Force all old decal instances to be cleared from the engine when the game is reset. This addresses a very random Linux crash that was occurring enough to be a problem when quitting the game. Release Build 11570.

master
sigonasr2 2 months ago
parent ca46f0b92e
commit 57cc852033
  1. 1
      Adventures in Lestoria/AdventuresInLestoria.cpp
  2. 2
      Adventures in Lestoria/Version.h
  3. 8
      Adventures in Lestoria/olcPixelGameEngine.h
  4. BIN
      x64/Release/Adventures in Lestoria.exe

@ -4187,6 +4187,7 @@ void AiL::ResetGame(bool changeToMainMenu){
Tutorial::Initialize();
minimap.SetMinimapMode(MinimapMode::SMALL);
minimap.EraseChunkData();
ClearDecalInstances();
}
void AiL::OnRequestCompleted(const std::string_view receivedData)const{

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 1
#define VERSION_MINOR 3
#define VERSION_PATCH 0
#define VERSION_BUILD 11566
#define VERSION_BUILD 11570
#define stringify(a) stringify_(a)
#define stringify_(a) #a

@ -1210,6 +1210,8 @@ namespace olc
const uint8_t GetMosaicEffect()const;
void SetMosaicEffect(uint8_t effectLevel);
void ClearDecalInstances();
HWButton*const GetKeyboardState(uint8_t key);
public:
static std::map<char,Pixel> charToColor;
@ -2141,6 +2143,12 @@ namespace olc
if(originalText.length()>0&&originalText[0]=='#')return std::string(originalText.substr(7));
return std::string(originalText);
}
void PixelGameEngine::ClearDecalInstances(){
for(LayerDesc&layer:GetLayers()){
layer.vecDecalInstance.clear();
}
}
std::u32string PixelGameEngine::stripLeadingCol(std::u32string_view originalText){
if(originalText.length()>0&&originalText[0]=='#')return std::u32string(originalText.substr(7));

Loading…
Cancel
Save