Add extra reveal chunk tracker unordered map to prevent minimap updates every single frame the player character walked. Release Build 10027.

mac-build
sigonasr2 4 months ago
parent 0131620b8b
commit f1b2aa59f9
  1. 6
      Adventures in Lestoria/Minimap.cpp
  2. 2
      Adventures in Lestoria/Minimap.h
  3. 2
      Adventures in Lestoria/Version.h
  4. BIN
      x64/Release/Adventures in Lestoria.exe

@ -175,6 +175,8 @@ void Minimap::Reset(){
UpdateChunk(game->GetCurrentMapName(),chunkPos,InitialLoad::YES);
}
#pragma endregion
revealedChunks.clear();
}
void Minimap::Update(){
@ -187,7 +189,9 @@ void Minimap::Update(){
void Minimap::UpdateChunk(const MapName map,const vi2d chunkPos,const InitialLoad initialLoad){
if(game->TestingModeEnabled())return;
loadedChunks[map].insert(std::format("{}_{}",chunkPos.x,chunkPos.y));
const bool minimapChunkLoadSucceeded{loadedChunks[map].insert(std::format("{}_{}",chunkPos.x,chunkPos.y)).second};
const bool minimapChunkRevealSucceeded{revealedChunks[map].insert(std::format("{}_{}",chunkPos.x,chunkPos.y)).second};
if(!minimapChunkLoadSucceeded&&!minimapChunkRevealSucceeded)return;
if(game->GetCurrentMapName()!=map)return; //Don't update the minimap when the map name doesn't match the current map.

@ -70,7 +70,7 @@ private:
Renderable minimap;
Renderable cover;
Renderable coverOutline;
std::unordered_map<MapName,std::unordered_set<std::string>>loadedChunks;
std::unordered_map<MapName,std::unordered_set<std::string>>loadedChunks,revealedChunks;
MinimapMode displayMode=MinimapMode::SMALL;
bool MinimapVisible();

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 1
#define VERSION_MINOR 2
#define VERSION_PATCH 3
#define VERSION_BUILD 10024
#define VERSION_BUILD 10027
#define stringify(a) stringify_(a)
#define stringify_(a) #a

Loading…
Cancel
Save