Class TextureUtils.TextureCopier
- All Implemented Interfaces:
AutoCloseable
- Enclosing class:
- TextureUtils
- Since:
- 2.6.0
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Commits the destination texture set to the destination Wad.boolean
Copies one flat from the source Wad to the destination Wad.boolean
Copies one flat from the source Wad to the destination Wad.boolean
copyTexture
(String textureName) Copies one texture from the source Wad to the destination Wad, and copies the associated patch entries from the source Wad to the destination Wad, if they exist in the source.boolean
copyTexture
(String textureName, boolean force) Copies one texture from the source Wad to the destination Wad, and copies the associated patch entries from the source Wad to the destination Wad, if they exist in the source.boolean
copyTexture
(String textureName, boolean force, boolean replace) Copies one texture from the source Wad to the destination Wad, and copies the associated patch entries from the source Wad to the destination Wad, if they exist in the source.void
ignoreFlat
(String flatName) Adds a flat to the list of "already copied" flats, as though it already exists in the destination.
-
Method Details
-
copyFlat
Copies one flat from the source Wad to the destination Wad. This will not re-copy flats that already exist (by name) in the destination Wad.If the flat start/end namespace markers do not exist in the destination Wad, they will be created:
F_START
andF_END
if IWAD,FF_START
andFF_END
if PWAD.An error will occur if either Wad is closed (mostly WadFiles) when this is called.
This does not pay attention to ANIMATED entries! Those will have to be moved separately!
This is completely equivalent to
copyFlat(flatName, false)
- Parameters:
flatName
- the name of the flat to copy over.- Returns:
- true if the flat was copied over, false if the flat name was not found in the source, or it already existed in the destination.
- Throws:
IOException
- if a read or write error occurs.IllegalArgumentException
- if flatName is not a valid entry name.
-
copyFlat
Copies one flat from the source Wad to the destination Wad. This will not re-copy flats that already exist (by name) in the destination Wad.If the flat start/end namespace markers do not exist in the destination Wad, they will be created:
F_START
andF_END
if IWAD,FF_START
andFF_END
if PWAD.An error will occur if either Wad is closed (mostly WadFiles) when this is called.
This does not pay attention to ANIMATED entries! Those will have to be moved separately!
- Parameters:
flatName
- the name of the flat to copy over.force
- if true, this will not check for flats that already exist (by name) in the destination Wad, and copy anyway.- Returns:
- true if the flat was copied over, false if the flat name was not found in the source, or it already existed in the destination.
- Throws:
IOException
- if a read or write error occurs.IllegalArgumentException
- if flatName is not a valid entry name.- Since:
- 2.6.0
-
ignoreFlat
Adds a flat to the list of "already copied" flats, as though it already exists in the destination.- Parameters:
flatName
- the name of the flat.- Throws:
IllegalArgumentException
- if flatName is not a valid entry name.- Since:
- 2.10.0
-
copyTexture
Copies one texture from the source Wad to the destination Wad, and copies the associated patch entries from the source Wad to the destination Wad, if they exist in the source. This will not re-copy patches that already exist (by name) in the destination Wad.If the TEXTUREx/PNAMES entries do not exist in the destination Wad, blank ones will be prepared (and written on close).
If the patch start/end namespace markers do not exist in the destination Wad, they will be created:
P_START
andP_END
if IWAD,PP_START
andPP_END
if PWAD.An error will occur if either Wad is closed (mostly WadFiles) when this is called.
This does not pay attention to ANIMATED or SWITCHES entries! Those will have to be moved separately!
This is completely equivalent to
copyTexture(textureName, false)
- Parameters:
textureName
- the name of the texture to copy over.- Returns:
- true if the texture was copied over, false if the texture name was not found in the source, or it already existed in the destination.
- Throws:
IOException
- if a read or write error occurs.
-
copyTexture
Copies one texture from the source Wad to the destination Wad, and copies the associated patch entries from the source Wad to the destination Wad, if they exist in the source.If the TEXTUREx/PNAMES entries do not exist in the destination Wad, blank ones will be prepared (and written on close).
If the patch start/end namespace markers do not exist in the destination Wad, they will be created:
P_START
andP_END
if IWAD,PP_START
andPP_END
if PWAD.An error will occur if either Wad is closed (mostly WadFiles) when this is called.
This does not pay attention to ANIMATED or SWITCHES entries! Those will have to be moved separately!
- Parameters:
textureName
- the name of the texture to copy over.force
- if true, this will not check for textures that already exist (by name) in the destination Wad, and copy it and its patches anyway.- Returns:
- true if the texture was copied over, false if the texture name was not found in the source, or it already existed in the destination.
- Throws:
IOException
- if a read or write error occurs.- Since:
- 2.6.0
-
copyTexture
Copies one texture from the source Wad to the destination Wad, and copies the associated patch entries from the source Wad to the destination Wad, if they exist in the source.If the TEXTUREx/PNAMES entries do not exist in the destination Wad, blank ones will be prepared (and written on close).
If the patch start/end namespace markers do not exist in the destination Wad, they will be created:
P_START
andP_END
if IWAD,PP_START
andPP_END
if PWAD.An error will occur if either Wad is closed (mostly WadFiles) when this is called.
This does not pay attention to ANIMATED or SWITCHES entries! Those will have to be moved separately!
- Parameters:
textureName
- the name of the texture to copy over.force
- if true, this will not check for textures that already exist (by name) in the destination Wad, and copy it and its patches anyway.replace
- if true, andforce
is true, then the texture of the same name in the destination is deleted first (BUT NOT PATCHES).- Returns:
- true if the texture was copied over, false if the texture name was not found in the source, or it already existed in the destination.
- Throws:
IOException
- if a read or write error occurs.- Since:
- 2.10.0
-
close
Commits the destination texture set to the destination Wad. This will replace TEXTURE1/2 and PNAMES in the destination.- Specified by:
close
in interfaceAutoCloseable
- Throws:
IOException
- if a write error occurs.
-