From d0f210aeec1dc8a3bd44c8ec053eabc56553c005 Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Mon, 13 May 2019 22:37:59 +0100 Subject: DRASCULA: Move sufrace allocation outside game loop I don't see the point and reallocating and freeing the same surfaces for each chaper, so now they are only allocated once and freed once at the end. --- engines/drascula/drascula.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp index 56b9efaeea..09962f161b 100644 --- a/engines/drascula/drascula.cpp +++ b/engines/drascula/drascula.cpp @@ -279,6 +279,8 @@ Common::Error DrasculaEngine::run() { checkCD(); + allocMemory(); + while (!shouldQuit()) { int i; takeObject = 0; @@ -319,8 +321,6 @@ Common::Error DrasculaEngine::run() { actorFrames[i] = 0; actorFrames[kFrameVonBraun] = 1; - allocMemory(); - _subtitlesDisabled = !ConfMan.getBool("subtitles"); if (currentChapter != 3) @@ -382,6 +382,8 @@ Common::Error DrasculaEngine::run() { currentChapter++; } + freeMemory(); + return Common::kNoError; } @@ -391,7 +393,6 @@ void DrasculaEngine::endChapter() { black(); MusicFadeout(); stopMusic(); - freeMemory(); } bool DrasculaEngine::runCurrentChapter() { -- cgit v1.2.3