[Scummvm-git-logs] scummvm master -> 9eaba2bc7d1e4ff4b64d3f390bb03b461a64b13d

kelmer44 noreply at scummvm.org
Thu Oct 9 07:48:42 UTC 2025


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

Summary:
9eaba2bc7d TOT: Fixes game crashing when looking at object after animation


Commit: 9eaba2bc7d1e4ff4b64d3f390bb03b461a64b13d
    https://github.com/scummvm/scummvm/commit/9eaba2bc7d1e4ff4b64d3f390bb03b461a64b13d
Author: kelmer (kelmer at gmail.com)
Date: 2025-10-09T09:48:34+02:00

Commit Message:
TOT: Fixes game crashing when looking at object after animation

Changed paths:
    engines/tot/engine.cpp


diff --git a/engines/tot/engine.cpp b/engines/tot/engine.cpp
index f4d3ce37542..e88f7713585 100644
--- a/engines/tot/engine.cpp
+++ b/engines/tot/engine.cpp
@@ -586,16 +586,14 @@ void TotEngine::animatedSequence(uint numSequence) {
 		_graphics->restoreBackground();
 		animIndex = _mainCharAnimation.depth;
 		_mainCharAnimation.depth = 30;
-		if (g_engine->_screenLayers[13]) {
-			free(g_engine->_screenLayers[13]);
-		}
-		clearScreenLayer(13);
-		_screenLayers[13] = animptr;
-		_depthMap[13].posx = animX;
-		_depthMap[13].posy = animY;
+		clearScreenLayer(12);
+		_screenLayers[12] = animptr;
+		_depthMap[12].posx = animX;
+		_depthMap[12].posy = animY;
 		assembleScreen();
 		_graphics->drawScreen(_sceneBackground);
-		_screenLayers[13] = nullptr;
+		// do not clear layer yet, needed for next frames
+		_screenLayers[12] = nullptr;
 
 		_mainCharAnimation.depth = animIndex;
 		drawInventory();
@@ -634,9 +632,7 @@ void TotEngine::animatedSequence(uint numSequence) {
 		}
 		animIndex = _mainCharAnimation.depth;
 		_mainCharAnimation.depth = 30;
-		if (g_engine->_screenLayers[12]) {
-			free(g_engine->_screenLayers[12]);
-		}
+
 		clearScreenLayer(12);
 		_screenLayers[12] = animptr;
 		_depthMap[12].posx = animX;
@@ -644,7 +640,8 @@ void TotEngine::animatedSequence(uint numSequence) {
 		disableSecondAnimation();
 		_mainCharAnimation.depth = animIndex;
 		_graphics->drawScreen(_sceneBackground);
-		_screenLayers[13] = nullptr;
+		// do not clear layer yet, needed for next frames
+		_screenLayers[12] = nullptr;
 		for (animIndex = 9; animIndex <= secFrameCount; animIndex++) {
 			animationFile.read(animptr, animFrameSize);
 			emptyLoop();




More information about the Scummvm-git-logs mailing list