Class TexturePool
java.lang.Object
dev.prozilla.pine.common.asset.pool.AssetPool<TextureBase>
dev.prozilla.pine.common.asset.pool.TexturePool
- All Implemented Interfaces:
Destructible
-
Field Summary
Fields inherited from class dev.prozilla.pine.common.asset.pool.AssetPool
eventDispatcher -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClears the pool of texture arrays.protected TextureBasecreateAsset(String path) Creates a new asset from a normalized path.createTextureArray(int width, int height) Creates a texture array that can be used to load multiple textures with the same resolution into.createTextureArray(int width, int height, int layers) Creates a texture array that can be used to load multiple textures with the same resolution into.Loads an asset from a path or retrieves it from the pool if it has already been loaded once.loadInTextureArray(String path) protected voidPrepares this pool for the next asset.voidvoidprintTextureArraysInfo(Logger logger) Logs the dimensions and layer usage of every texture array in the resource pool.protected booleanRemoves an asset from this pool.booleanremoveTextureArray(TextureArray textureArray) Removes a texture array and all its textures from the resource pool.intReturns the amount of texture arrays in this pool.
-
Constructor Details
-
TexturePool
-
-
Method Details
-
load
Description copied from class:AssetPoolLoads an asset from a path or retrieves it from the pool if it has already been loaded once.This method is protected because some subclasses may require additional parameters to load an asset.
- Overrides:
loadin classAssetPool<TextureBase>- Parameters:
path- The path of the asset- Returns:
- The asset, or
nullif it failed to load.
-
loadInTextureArray
-
createAsset
Description copied from class:AssetPoolCreates a new asset from a normalized path.- Specified by:
createAssetin classAssetPool<TextureBase>- Parameters:
path- The normalized path- Returns:
- The new asset, or
nullif the asset creation failed.
-
prepareNext
protected void prepareNext()Description copied from class:AssetPoolPrepares this pool for the next asset.- Overrides:
prepareNextin classAssetPool<TextureBase>
-
remove
Description copied from class:AssetPoolRemoves an asset from this pool.- Overrides:
removein classAssetPool<TextureBase>- Parameters:
path- The path of the asset to remove- Returns:
falseifpathdoes not match any asset in this pool.
-
removeTextureArray
Removes a texture array and all its textures from the resource pool.- Parameters:
textureArray- Texture array to remove
-
createTextureArray
Creates a texture array that can be used to load multiple textures with the same resolution into.- Parameters:
width- The width of the texturesheight- The height of the textures
-
createTextureArray
Creates a texture array that can be used to load multiple textures with the same resolution into.- Parameters:
width- The width of the texturesheight- The height of the textureslayers- The amount of textures to fit into the texture array
-
clearTextureArrays
public void clearTextureArrays()Clears the pool of texture arrays. -
textureArrayCount
public int textureArrayCount()Returns the amount of texture arrays in this pool.- Returns:
- The amount of texture arrays in this pool.
-
printInfo
- Overrides:
printInfoin classAssetPool<TextureBase>
-
printTextureArraysInfo
Logs the dimensions and layer usage of every texture array in the resource pool.
-