Add extra reveal chunk tracker unordered map to prevent minimap updates every single frame the player character walked. Release Build 10027.
This commit is contained in:
parent
210dd3b9de
commit
38710151c4
@ -175,6 +175,8 @@ void Minimap::Reset(){
|
|||||||
UpdateChunk(game->GetCurrentMapName(),chunkPos,InitialLoad::YES);
|
UpdateChunk(game->GetCurrentMapName(),chunkPos,InitialLoad::YES);
|
||||||
}
|
}
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
|
revealedChunks.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Minimap::Update(){
|
void Minimap::Update(){
|
||||||
@ -187,7 +189,9 @@ void Minimap::Update(){
|
|||||||
|
|
||||||
void Minimap::UpdateChunk(const MapName map,const vi2d chunkPos,const InitialLoad initialLoad){
|
void Minimap::UpdateChunk(const MapName map,const vi2d chunkPos,const InitialLoad initialLoad){
|
||||||
if(game->TestingModeEnabled())return;
|
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.
|
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 minimap;
|
||||||
Renderable cover;
|
Renderable cover;
|
||||||
Renderable coverOutline;
|
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;
|
MinimapMode displayMode=MinimapMode::SMALL;
|
||||||
|
|
||||||
bool MinimapVisible();
|
bool MinimapVisible();
|
||||||
|
@ -39,7 +39,7 @@ All rights reserved.
|
|||||||
#define VERSION_MAJOR 1
|
#define VERSION_MAJOR 1
|
||||||
#define VERSION_MINOR 2
|
#define VERSION_MINOR 2
|
||||||
#define VERSION_PATCH 3
|
#define VERSION_PATCH 3
|
||||||
#define VERSION_BUILD 10024
|
#define VERSION_BUILD 10027
|
||||||
|
|
||||||
#define stringify(a) stringify_(a)
|
#define stringify(a) stringify_(a)
|
||||||
#define stringify_(a) #a
|
#define stringify_(a) #a
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user