From 9966e3e2cbefc6b596fa5ad4262e56b88e461879 Mon Sep 17 00:00:00 2001 From: Adspartan Date: Mon, 10 Feb 2020 00:15:50 +0100 Subject: [PATCH] map_horizon: make adt not in the wdl more visible on the minimap --- src/noggit/World.cpp | 2 +- src/noggit/map_horizon.cpp | 15 +++++++++++++-- src/noggit/map_horizon.h | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/noggit/World.cpp b/src/noggit/World.cpp index 13ce71adf..9d446204e 100644 --- a/src/noggit/World.cpp +++ b/src/noggit/World.cpp @@ -91,7 +91,7 @@ World::World(const std::string& name, int map_id) : _model_instance_storage(this) , _tile_update_queue(this) , mapIndex (name, map_id, this) - , horizon(name) + , horizon(name, &mapIndex) , mWmoFilename("") , mWmoEntry(ENTRY_MODF()) , detailtexcoords(0) diff --git a/src/noggit/map_horizon.cpp b/src/noggit/map_horizon.cpp index 902f2fc03..5312631d9 100644 --- a/src/noggit/map_horizon.cpp +++ b/src/noggit/map_horizon.cpp @@ -89,7 +89,7 @@ static inline uint32_t color_for_height (int16_t height) namespace noggit { -map_horizon::map_horizon(const std::string& basename) +map_horizon::map_horizon(const std::string& basename, const MapIndex * const index) { std::stringstream filename; filename << "World\\Maps\\" << basename << "\\" << basename << ".wdl"; @@ -190,7 +190,18 @@ map_horizon::map_horizon(const std::string& basename) for (size_t i (0); i < 16; ++i) { //! \todo R and B are inverted here - _qt_minimap.setPixel (x * 16 + i, y * 16 + j, color_for_height (_tiles[y][x]->height_17[j][i])); + _qt_minimap.setPixel(x * 16 + i, y * 16 + j, color_for_height(_tiles[y][x]->height_17[j][i])); + } + } + } + // the adt exist but there's no data in the wdl + else if (index->hasTile(tile_index(x, y))) + { + for (size_t j(0); j < 16; ++j) + { + for (size_t i(0); i < 16; ++i) + { + _qt_minimap.setPixel(x * 16 + i, y * 16 + j, color(200, 100, 25)); } } } diff --git a/src/noggit/map_horizon.h b/src/noggit/map_horizon.h index 7d4e6abc2..d2f6fa485 100644 --- a/src/noggit/map_horizon.h +++ b/src/noggit/map_horizon.h @@ -74,7 +74,7 @@ class map_horizon minimap(const map_horizon& horizon); }; - map_horizon(const std::string& basename); + map_horizon(const std::string& basename, const MapIndex * const index); QImage _qt_minimap;