Skip to content

Commit

Permalink
map_horizon: make adt not in the wdl more visible on the minimap
Browse files Browse the repository at this point in the history
  • Loading branch information
Adspartan committed Feb 9, 2020
1 parent db5daab commit 9966e3e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/noggit/World.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
15 changes: 13 additions & 2 deletions src/noggit/map_horizon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/noggit/map_horizon.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 9966e3e

Please sign in to comment.