Class CommonPatch

java.lang.Object
net.mtrop.doom.texture.CommonPatch
All Implemented Interfaces:
BinaryObject
Direct Known Subclasses:
DoomTextureList.Texture.Patch, StrifeTextureList.Texture.Patch

public abstract class CommonPatch extends Object implements BinaryObject
Singular patch entry for a texture.
  • Field Details

    • originX

      protected int originX
      Horizontal offset of the patch.
    • originY

      protected int originY
      Vertical offset of the patch.
    • patchIndex

      protected int patchIndex
      Index 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 - if originX 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 - if originY 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 - if patchIndex is less than 0 or more than 65535.
      See Also:
    • toString

      public String toString()
      Overrides:
      toString in class Object