aboutsummaryrefslogtreecommitdiff
path: root/engines/drascula
diff options
context:
space:
mode:
authorThierry Crozat2019-05-13 22:37:59 +0100
committerThierry Crozat2019-05-13 22:56:57 +0100
commitd0f210aeec1dc8a3bd44c8ec053eabc56553c005 (patch)
tree0d8a15cea9c7fb59284b534f6db80df8049f3140 /engines/drascula
parentc92d20d28a4eb95fea0e61086d47a58a2ca3b283 (diff)
downloadscummvm-rg350-d0f210aeec1dc8a3bd44c8ec053eabc56553c005.tar.gz
scummvm-rg350-d0f210aeec1dc8a3bd44c8ec053eabc56553c005.tar.bz2
scummvm-rg350-d0f210aeec1dc8a3bd44c8ec053eabc56553c005.zip
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.
Diffstat (limited to 'engines/drascula')
-rw-r--r--engines/drascula/drascula.cpp7
1 files 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() {