Class BitmapTextureLoader
Abstract base class for loading and populating textures from bitmap files Provides common infrastructure for terrain, heightmap, and normal map loading Eliminates code duplication across specialized bitmap loaders
public abstract class BitmapTextureLoader
- Inheritance
-
objectBitmapTextureLoader
Fields
bmpLoader
protected JobifiedBMPLoader bmpLoader
Field Value
logProgress
protected bool logProgress
Field Value
- bool
textureManager
protected MapTextureManager textureManager
Field Value
Methods
ApplyTextureAndSync(Texture2D)
Apply texture changes and force GPU sync Common pattern used by all bitmap loaders
protected void ApplyTextureAndSync(Texture2D texture)
Parameters
textureTexture2D
GetBitmapFileName()
Get the bitmap filename (e.g., "terrain.bmp", "heightmap.bmp")
protected abstract string GetBitmapFileName()
Returns
- string
GetLoaderName()
Get the loader name for logging purposes
protected abstract string GetLoaderName()
Returns
- string
Initialize(MapTextureManager, bool)
Initialize the bitmap loader with required dependencies
public void Initialize(MapTextureManager textures, bool enableLogging = true)
Parameters
texturesMapTextureManagerenableLoggingbool
LoadAndPopulateAsync(string)
Load bitmap and populate corresponding texture
public Task LoadAndPopulateAsync(string provincesPath)
Parameters
provincesPathstringPath to provinces.bmp or provinces.png (used to derive bitmap path)
Returns
- Task
PopulateTexture(BMPLoadResult)
Populate texture with bitmap data (implemented by derived classes)
protected abstract void PopulateTexture(BMPLoadResult bitmapData)
Parameters
bitmapDataBMPLoadResult
RebindTexturesToMaterials()
Rebind textures to runtime materials after texture updates Ensures all material instances have the updated textures
protected void RebindTexturesToMaterials()