Go to the documentation of this file.
42 #pragma pack(push,1) // disable memory alignment
65 std::array<MinimapTile, MMBLOCK_SIZE *MMBLOCK_SIZE>&
getTiles() {
return m_tiles; }
71 std::array<MinimapTile, MMBLOCK_SIZE *MMBLOCK_SIZE> m_tiles;
95 bool loadImage(
const std::string& fileName,
const Position& topLeft,
float colorFactor);
96 void saveImage(
const std::string& fileName,
const Rect& mapRect);
97 bool loadOtmm(
const std::string& fileName);
98 void saveOtmm(
const std::string& fileName);
101 Rect calcMapRect(
const Rect& screenRect,
const Position& mapCenter,
float scale);
102 bool hasBlock(
const Position& pos) {
return m_tileBlocks[pos.
z].find(getBlockIndex(pos)) != m_tileBlocks[pos.
z].end(); }
109 std::unordered_map<uint, MinimapBlock> m_tileBlocks[
Otc::MAX_Z+1];
MinimapTile & getTile(int x, int y)
void resetTile(int x, int y)
bool loadOtmm(const std::string &fileName)
void saveImage(const std::string &fileName, const Rect &mapRect)
bool operator==(const MinimapTile &other) const
void updateTile(const Position &pos, const TilePtr &tile)
const MinimapTile & getTile(const Position &pos)
uint getTileIndex(int x, int y)
bool hasFlag(MinimapTileFlags flag) const
Rect getTileRect(const Position &pos, const Rect &screenRect, const Position &mapCenter, float scale)
Position getTilePosition(const Point &point, const Rect &screenRect, const Position &mapCenter, float scale)
Point getTilePoint(const Position &pos, const Rect &screenRect, const Position &mapCenter, float scale)
bool operator!=(const MinimapTile &other) const
void updateTile(int x, int y, const MinimapTile &tile)
const TexturePtr & getTexture()
void saveOtmm(const std::string &fileName)
std::array< MinimapTile, MMBLOCK_SIZE *MMBLOCK_SIZE > & getTiles()
void draw(const Rect &screenRect, const Position &mapCenter, float scale, const Color &color)
bool loadImage(const std::string &fileName, const Position &topLeft, float colorFactor)