Package net.mtrop.doom.texture
Class CommonPatch
java.lang.Object
net.mtrop.doom.texture.CommonPatch
- All Implemented Interfaces:
BinaryObject
- Direct Known Subclasses:
DoomTextureList.Texture.Patch
,StrifeTextureList.Texture.Patch
Singular patch entry for a texture.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.mtrop.doom.object.BinaryObject
BinaryObject.InlineScanner<BO extends BinaryObject>, BinaryObject.Reflect, BinaryObject.Scanner<BO extends BinaryObject>, BinaryObject.Shared, BinaryObject.Transformer<BO extends BinaryObject>
-
Field Summary
Modifier and TypeFieldDescriptionprotected int
Horizontal offset of the patch.protected int
Vertical offset of the patch.protected int
Index of patch in patch names lump to use. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
int
int
void
setNameIndex
(int patchIndex) Sets the patch's index into the patch name lump.void
setOriginX
(int originX) Sets the horizontal offset of the patch in pixels.void
setOriginY
(int originY) Sets the vertical offset of the patch in pixels.toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.mtrop.doom.object.BinaryObject
fromBytes, readBytes, readFile, toBytes, writeBytes, writeFile, writeFile
-
Field Details
-
originX
protected int originXHorizontal offset of the patch. -
originY
protected int originYVertical offset of the patch. -
patchIndex
protected int patchIndexIndex of patch in patch names lump to use.
-
-
Constructor Details
-
CommonPatch
public CommonPatch()
-
-
Method Details
-
getOriginX
public int getOriginX()- Returns:
- the horizontal offset of the patch in pixels.
-
setOriginX
public void setOriginX(int originX) Sets the horizontal offset of the patch in pixels.- Parameters:
originX
- the patch origin, x-coordinate.- Throws:
IllegalArgumentException
- iforiginX
is less than -32768 or more than 32767.
-
getOriginY
public int getOriginY()- Returns:
- the vertical offset of the patch in pixels.
-
setOriginY
public void setOriginY(int originY) Sets the vertical offset of the patch in pixels.- Parameters:
originY
- the patch origin, y-coordinate.- Throws:
IllegalArgumentException
- iforiginY
is less than -32768 or more than 32767.
-
getNameIndex
public int getNameIndex()- Returns:
- the patch's index into the patch name lump.
-
setNameIndex
public void setNameIndex(int patchIndex) Sets the patch's index into the patch name lump.- Parameters:
patchIndex
- the patch index.- Throws:
IllegalArgumentException
- ifpatchIndex
is less than 0 or more than 65535.- See Also:
-
toString
-