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
FieldsModifier and TypeFieldDescriptionprotected intHorizontal offset of the patch.protected intVertical offset of the patch.protected intIndex of patch in patch names lump to use. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintintintvoidsetNameIndex(int patchIndex) Sets the patch's index into the patch name lump.voidsetOriginX(int originX) Sets the horizontal offset of the patch in pixels.voidsetOriginY(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, waitMethods 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- iforiginXis 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- iforiginYis 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- ifpatchIndexis less than 0 or more than 65535.- See Also:
-
toString
-