Package mindustry.mod
Class DataImagePacker
java.lang.Object
mindustry.mod.DataImagePacker
Manages data patch images.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final StringPrefix for images pushed dynamically by the server viaaddTexture(String, byte[]), as opposed to map/mod data patches. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTexture(String name, byte[] pngData) Decodes PNG bytes and registers them into the atlas under "netRegionPrefix + name", replacing any existing image with the same name.voidpack(arc.struct.Seq<ImageAsset> images) Packs a new set of images.voidprintStats(arc.graphics.g2d.PixmapPacker mainPacker, arc.graphics.g2d.PixmapPacker envPacker) voidremoveTextureQueued(String name) Queues a texture for removal.voidunload()
-
Field Details
-
regionPrefix
- See Also:
-
serverRegionPrefix
Prefix for images pushed dynamically by the server viaaddTexture(String, byte[]), as opposed to map/mod data patches.- See Also:
-
-
Constructor Details
-
DataImagePacker
public DataImagePacker()
-
-
Method Details
-
pack
Packs a new set of images. If images are already packed, disposes of the old ones. -
unload
public void unload() -
addTexture
Decodes PNG bytes and registers them into the atlas under "netRegionPrefix + name", replacing any existing image with the same name. Safe to call from any thread. -
removeTextureQueued
Queues a texture for removal. Will run after any pendingaddTexture(java.lang.String, byte[])calls so that races do not occur. -
printStats
public void printStats(arc.graphics.g2d.PixmapPacker mainPacker, arc.graphics.g2d.PixmapPacker envPacker)
-