Table of Contents

Class TerrainBitmapReader

Namespace
Map.Rendering.Terrain
Assembly
MapAssembly.dll

ENGINE: Reads terrain.bmp and converts RGB pixels to terrain type indices Handles both direct BMP palette reading and Unity Texture2D RGB conversion

public class TerrainBitmapReader
Inheritance
object
TerrainBitmapReader

Constructors

TerrainBitmapReader(bool)

public TerrainBitmapReader(bool logProgress = true)

Parameters

logProgress bool

Methods

ConvertRGBToTerrainTypes(Texture2D, TerrainRGBLookup, int, int)

Convert RGB pixels from terrain texture to terrain type indices Uses TerrainRGBLookup to map RGB colors to terrain indices Returns array of terrain indices [y * width + x] = terrainTypeIndex

public uint[] ConvertRGBToTerrainTypes(Texture2D terrainTexture, TerrainRGBLookup rgbLookup, int width, int height)

Parameters

terrainTexture Texture2D
rgbLookup TerrainRGBLookup
width int
height int

Returns

uint[]

ReadBmpPaletteIndices(string, int, int)

Read raw palette indices from an 8-bit indexed BMP file Bypasses Unity's texture import which converts palette indices to RGB Returns array of palette indices [y * width + x] = paletteIndex

public uint[] ReadBmpPaletteIndices(string bmpPath, int expectedWidth, int expectedHeight)

Parameters

bmpPath string
expectedWidth int
expectedHeight int

Returns

uint[]