#pragma once #include #pragma pack(push, 1) // stores the color aof the map at a specific height struct MapBlock { unsigned char height; int color; }; // stores the colors at all heights of a specific x and y position on the map. // there can by only 256 colors stored per position struct MapPixel { unsigned char len; MapBlock* blocks; }; #pragma pack(pop) class ChunkMap : public Framework::ReferenceCounter { private: MapPixel* pixels; unsigned char* heightMap; Framework::Punkt chunkCenter; Framework::Bild rendered; unsigned char maxHeight; public: ChunkMap(Framework::StreamReader* zReader); ChunkMap(Framework::Punkt center); ~ChunkMap(); void setMaxHeight(unsigned char maxHeight); const Framework::Bild &getRenderedImage() const; unsigned char* getHeightMap() const; Framework::Punkt getChunkCenter() const; };