Class Texture

java.lang.Object
zombie.asset.Asset
zombie.core.textures.Texture
All Implemented Interfaces:
Serializable, IDestroyable, IMaskerable, ITexture
Direct Known Subclasses:
AngelCodeFont.CharDefTexture, SmartTexture, VideoTexture

public class Texture extends Asset implements IDestroyable, ITexture, Serializable
See Also:
  • Field Details

    • nullTextures

      public static final HashSet<String> nullTextures
    • ASSET_TYPE

      public static final AssetType ASSET_TYPE
    • bindCount

      public static int bindCount
    • doingQuad

      public static boolean doingQuad
    • lr

      public static float lr
    • lg

      public static float lg
    • lb

      public static float lb
    • la

      public static float la
    • lastlastTextureID

      public static int lastlastTextureID
    • totalTextureID

      public static int totalTextureID
    • lastTextureID

      public static int lastTextureID
    • warnFailFindTexture

      public static boolean warnFailFindTexture
    • flip

      public boolean flip
    • offsetX

      public float offsetX
    • offsetY

      public float offsetY
    • bindAlways

      public boolean bindAlways
    • xEnd

      public float xEnd
    • yEnd

      public float yEnd
    • xStart

      public float xStart
    • yStart

      public float yStart
    • assetParams

      public Texture.TextureAssetParams assetParams
  • Constructor Details

    • Texture

      public Texture(AssetPath path, AssetManager manager, Texture.TextureAssetParams params)
    • Texture

      public Texture(TextureID data, String name)
    • Texture

      public Texture(TextureID data, String name, int splitX, int splitY, int splitW, int splitH)
    • Texture

      public Texture(String file) throws Exception
      Throws:
      Exception
    • Texture

      public Texture(String name, BufferedInputStream b, boolean bDoMask) throws Exception
      Throws:
      Exception
    • Texture

      public Texture(String file, boolean bDelete, boolean bUseAlpha) throws Exception
      Throws:
      Exception
    • Texture

      public Texture(String file, boolean useAlphaChannel) throws Exception
      Throws:
      Exception
    • Texture

      public Texture(int width, int height, String name, int flags)
    • Texture

      public Texture(int width, int height, int flags)
    • Texture

      public Texture(int width, int height, int flags, int format, int internalFormat)
    • Texture

      public Texture(int width, int height, int flags, boolean deferCreation)
    • Texture

      public Texture(String file, int red, int green, int blue) throws Exception
      Throws:
      Exception
    • Texture

      public Texture(Texture t)
    • Texture

      public Texture()
  • Method Details

    • TexDeferedCreation

      public void TexDeferedCreation(int w, int h, int flags, int format, int internalFormat)
    • TexDeferedCreation

      public void TexDeferedCreation(int w, int h, int flags)
    • processFilePath

      public static String processFilePath(String filePath)
    • bindNone

      public static void bindNone()
    • getWhite

      public static Texture getWhite()
    • getErrorTexture

      public static Texture getErrorTexture()
    • getEngineMipmapTexture

      public static Texture getEngineMipmapTexture()
    • clearTextures

      public static void clearTextures()
    • getSharedTexture

      public static Texture getSharedTexture(String name)
    • getSharedTexture

      public static Texture getSharedTexture(String name, int flags)
    • trygetTexture

      public static Texture trygetTexture(String name)
    • onTexturePacksChanged

      public static void onTexturePacksChanged()
    • getTexture

      public static Texture getTexture(String name)
    • getSteamAvatar

      public static Texture getSteamAvatar(long steamID)
    • steamAvatarChanged

      public static void steamAvatarChanged(long steamID)
    • forgetTexture

      public static void forgetTexture(String name)
    • reload

      public static void reload(String name)
    • flipPixels

      public static int[] flipPixels(int[] imgPixels, int imgw, int imgh)
    • reloadFromFile

      public void reloadFromFile(String name)
    • bind

      public void bind()
      Specified by:
      bind in interface ITexture
    • bind

      public void bind(int unit)
      Specified by:
      bind in interface ITexture
    • copyMaskRegion

      public void copyMaskRegion(Texture from, int x, int y, int width, int height)
    • createMask

      public void createMask()
    • createMask

      public void createMask(boolean[] mask)
    • createMask

      public void createMask(BooleanGrid mask)
    • createMask

      public void createMask(WrappedBuffer buf)
    • destroy

      public void destroy()
      Specified by:
      destroy in interface IDestroyable
    • equals

      public boolean equals(Texture other)
    • getData

      public WrappedBuffer getData()
      Specified by:
      getData in interface ITexture
    • setData

      public void setData(ByteBuffer data)
      Specified by:
      setData in interface ITexture
    • getHeight

      public int getHeight()
      Specified by:
      getHeight in interface ITexture
    • setHeight

      public void setHeight(int height)
    • getHeightHW

      public int getHeightHW()
      Specified by:
      getHeightHW in interface ITexture
    • getHeightOrig

      public int getHeightOrig()
    • getID

      public int getID()
      Specified by:
      getID in interface ITexture
    • getMask

      public Mask getMask()
      Specified by:
      getMask in interface IMaskerable
    • setMask

      public void setMask(Mask mask)
      Specified by:
      setMask in interface ITexture
    • isMaskSet

      public boolean isMaskSet(int x, int y)
    • getName

      public String getName()
    • setName

      public void setName(String name)
    • getTextureId

      public TextureID getTextureId()
    • getUseAlphaChannel

      public boolean getUseAlphaChannel()
    • setUseAlphaChannel

      public void setUseAlphaChannel(boolean value)
    • getX

      public int getX()
    • getY

      public int getY()
    • getWidth

      public int getWidth()
      Specified by:
      getWidth in interface ITexture
    • setWidth

      public void setWidth(int width)
    • getWidthHW

      public int getWidthHW()
      Specified by:
      getWidthHW in interface ITexture
    • getWidthOrig

      public int getWidthOrig()
    • getXEnd

      public float getXEnd()
      Specified by:
      getXEnd in interface ITexture
    • getXStart

      public float getXStart()
      Specified by:
      getXStart in interface ITexture
    • getYEnd

      public float getYEnd()
      Specified by:
      getYEnd in interface ITexture
    • getYStart

      public float getYStart()
      Specified by:
      getYStart in interface ITexture
    • getOffsetX

      public float getOffsetX()
    • setOffsetX

      public void setOffsetX(int offset)
    • getOffsetY

      public float getOffsetY()
    • setOffsetY

      public void setOffsetY(int offset)
    • isCollisionable

      public boolean isCollisionable()
    • isDestroyed

      public boolean isDestroyed()
      Specified by:
      isDestroyed in interface IDestroyable
    • isSolid

      public boolean isSolid()
      Specified by:
      isSolid in interface ITexture
    • isValid

      public boolean isValid()
    • makeTransp

      public void makeTransp(int red, int green, int blue)
      Specified by:
      makeTransp in interface ITexture
    • render

      public void render(float x, float y, float width, float height)
    • render

      public void render(float x, float y)
    • render

      public void render(float x, float y, float width, float height, float r, float g, float b, float a, Consumer<TextureDraw> texdModifier)
    • render

      public void render(ObjectRenderEffects dr, float x, float y, float width, float height, float r, float g, float b, float a, Consumer<TextureDraw> texdModifier)
    • rendershader2

      public void rendershader2(float x, float y, float width, float height, int texx, int texy, int texWidth, int texHeight, float r, float g, float b, float a)
    • renderdiamond

      public void renderdiamond(float x, float y, float width, float height, int l, int u, int r, int d)
    • renderwallnw

      public void renderwallnw(float x, float y, float width, float height, int u, int d, int u2, int d2, int r, int r2)
    • renderwallw

      public void renderwallw(float x, float y, float width, float height, int u, int d, int u2, int d2)
    • renderwalln

      public void renderwalln(float x, float y, float width, float height, int u, int d, int u2, int d2)
    • renderstrip

      public void renderstrip(int x, int y, int width, int height, float r, float g, float b, float a, Consumer<TextureDraw> texdModifier)
    • setAlphaForeach

      public void setAlphaForeach(int red, int green, int blue, int alpha)
      Specified by:
      setAlphaForeach in interface ITexture
    • setCustomizedTexture

      public void setCustomizedTexture()
    • setNameOnly

      public void setNameOnly(String name)
    • setRegion

      public void setRegion(int x, int y, int width, int height)
      Specified by:
      setRegion in interface ITexture
    • splitIcon

      public Texture splitIcon()
    • split

      public Texture split(int xOffset, int yOffset, int width, int height)
    • split

      public Texture split(String name, int xOffset, int yOffset, int width, int height)
    • split

      public Texture[] split(int xOffset, int yOffset, int row, int coloumn, int width, int height, int spaceX, int spaceY)
    • split2D

      public Texture[][] split2D(int[] xstep, int[] ystep)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • saveMask

      public void saveMask(String name)
    • saveToZomboidDirectory

      public void saveToZomboidDirectory(String filename)
    • saveToCurrentSavefileDirectory

      public void saveToCurrentSavefileDirectory(String filename)
    • saveOnRenderThread

      public void saveOnRenderThread(String filename)
    • loadMaskRegion

      public void loadMaskRegion(ByteBuffer cache)
    • saveMaskRegion

      public void saveMaskRegion(ByteBuffer cache)
    • getRealWidth

      public int getRealWidth()
    • setRealWidth

      public void setRealWidth(int realWidth)
    • getRealHeight

      public int getRealHeight()
    • setRealHeight

      public void setRealHeight(int realHeight)
    • getUVScale

      public Vector2 getUVScale(Vector2 uvScale)
    • getType

      public AssetType getType()
      Specified by:
      getType in class Asset
    • onBeforeReady

      public void onBeforeReady()
    • collectAllIcons

      public static void collectAllIcons(HashMap<String,String> map, HashMap<String,String> mapFull)