diff --git a/engines/sludge/builtin.cpp b/engines/sludge/builtin.cpp index 4d4726a165f..d6cfbb53fe3 100644 --- a/engines/sludge/builtin.cpp +++ b/engines/sludge/builtin.cpp @@ -1428,7 +1428,7 @@ builtIn(showBoxes) { builtIn(removeAllScreenRegions) { UNUSEDALL - g_sludge->_regionMan->killAll(); + g_sludge->_regionMan->kill(); return BR_CONTINUE; } diff --git a/engines/sludge/freeze.cpp b/engines/sludge/freeze.cpp index 2df8f553eae..15125dbf4ee 100644 --- a/engines/sludge/freeze.cpp +++ b/engines/sludge/freeze.cpp @@ -136,7 +136,7 @@ void GraphicsManager::unfreeze(bool killImage) { killAllPeople(); allPeople = _frozenStuff->allPeople; - g_sludge->_regionMan->killAll(); + g_sludge->_regionMan->kill(); g_sludge->_regionMan->resotre(_frozenStuff); killLightMap(); diff --git a/engines/sludge/loadsave.cpp b/engines/sludge/loadsave.cpp index bd4b38343a9..2a69d022801 100644 --- a/engines/sludge/loadsave.cpp +++ b/engines/sludge/loadsave.cpp @@ -504,7 +504,7 @@ bool loadGame(const Common::String &fname) { g_sludge->_txtMan->loadFont(ssgVersion, fp); killAllPeople(); - g_sludge->_regionMan->killAll(); + g_sludge->_regionMan->kill(); int camerX = fp->readUint16BE(); int camerY = fp->readUint16BE(); diff --git a/engines/sludge/region.cpp b/engines/sludge/region.cpp index 3ce4d92c74f..409c4fc939e 100644 --- a/engines/sludge/region.cpp +++ b/engines/sludge/region.cpp @@ -41,9 +41,8 @@ RegionManager::RegionManager(SludgeEngine *vm) _overRegion = nullptr; } -RegionManager::~RegionManager() -{ - +RegionManager::~RegionManager() { + kill(); } void RegionManager::showBoxes() { @@ -123,7 +122,7 @@ void RegionManager::loadRegions(Common::SeekableReadStream *stream) { *pointy = NULL; } -void RegionManager::killAll() { +void RegionManager::kill() { ScreenRegion *killRegion; while (_allScreenRegions) { killRegion = _allScreenRegions; diff --git a/engines/sludge/region.h b/engines/sludge/region.h index 3a7414979e4..06b7a627d71 100644 --- a/engines/sludge/region.h +++ b/engines/sludge/region.h @@ -39,7 +39,7 @@ public: ~RegionManager(); // Kill - void killAll(); + void kill(); // Add & remove region bool addScreenRegion(int x1, int y1, int x2, int y2, int, int, int, int objectNum); diff --git a/engines/sludge/sludger.cpp b/engines/sludge/sludger.cpp index 9eb0eb82db9..0da7f394275 100644 --- a/engines/sludge/sludger.cpp +++ b/engines/sludge/sludger.cpp @@ -183,7 +183,7 @@ void initSludge() { void killSludge() { killAllFunctions(); killAllPeople(); - g_sludge->_regionMan->killAll(); + g_sludge->_regionMan->kill(); setFloorNull(); g_sludge->_speechMan->kill(); g_sludge->_languageMan->kill();