[Scummvm-git-logs] scummvm master -> 92300268765dd5faf921c033b87f76c475539341

criezy criezy at scummvm.org
Mon May 13 23:57:15 CEST 2019


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
d0f210aeec DRASCULA: Move sufrace allocation outside game loop
9230026876 DRASCULA: Fix loading game from launcher


Commit: d0f210aeec1dc8a3bd44c8ec053eabc56553c005
    https://github.com/scummvm/scummvm/commit/d0f210aeec1dc8a3bd44c8ec053eabc56553c005
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2019-05-13T22:56:57+01:00

Commit Message:
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.

Changed paths:
    engines/drascula/drascula.cpp


diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp
index 56b9efa..09962f1 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() {


Commit: 92300268765dd5faf921c033b87f76c475539341
    https://github.com/scummvm/scummvm/commit/92300268765dd5faf921c033b87f76c475539341
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2019-05-13T22:56:57+01:00

Commit Message:
DRASCULA: Fix loading game from launcher

This was particularly an issue when the game had been saved in
chapter 1 as in this case the load would happen too early and
the game would crash. In other cases it was working but was
not optimal (the gane loop was run once before it succeeded
to load the game).

This fixes bug #10959.

Changed paths:
    engines/drascula/drascula.cpp


diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp
index 09962f1..02fe211 100644
--- a/engines/drascula/drascula.cpp
+++ b/engines/drascula/drascula.cpp
@@ -274,7 +274,11 @@ Common::Error DrasculaEngine::run() {
 	// Check if a save is loaded from the launcher
 	int directSaveSlotLoading = ConfMan.getInt("save_slot");
 	if (directSaveSlotLoading >= 0) {
+		// Set the current chapter to -1. This forces the load to happen
+		// later during the game loop, and not now.
+		currentChapter = -1;
 		loadGame(directSaveSlotLoading);
+		currentChapter++;
 	}
 
 	checkCD();





More information about the Scummvm-git-logs mailing list