[Scummvm-git-logs] scummvm master -> 37992636e712370b62b85128ee331dc9d809e202

alxpnv noreply at scummvm.org
Thu Nov 18 10:05:43 UTC 2021


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

Summary:
37992636e7 ASYLUM: potential fix for palette fade related crashes


Commit: 37992636e712370b62b85128ee331dc9d809e202
    https://github.com/scummvm/scummvm/commit/37992636e712370b62b85128ee331dc9d809e202
Author: alxpnv (alxpnv22 at yahoo.com)
Date: 2021-11-18T13:09:26+03:00

Commit Message:
ASYLUM: potential fix for palette fade related crashes

Changed paths:
    engines/asylum/asylum.cpp
    engines/asylum/system/screen.h
    engines/asylum/views/scene.cpp


diff --git a/engines/asylum/asylum.cpp b/engines/asylum/asylum.cpp
index f56d96135f..04e062d38c 100644
--- a/engines/asylum/asylum.cpp
+++ b/engines/asylum/asylum.cpp
@@ -177,7 +177,8 @@ Common::Error AsylumEngine::run() {
 
 		_system->delayMillis(10);
 
-		_system->updateScreen();
+		if (!screen()->isFading())
+			_system->updateScreen();
 
 		if (_scene)
 			checkAchievements();
@@ -367,7 +368,8 @@ void AsylumEngine::playIntro() {
 					}
 				}
 
-				_system->updateScreen();
+				if (!screen()->isFading())
+					_system->updateScreen();
 				_system->delayMillis(100);
 
 			} while (_sound->isPlaying(introSpeech) && !skip);
diff --git a/engines/asylum/system/screen.h b/engines/asylum/system/screen.h
index a623d2b4f9..73b5fc8d66 100644
--- a/engines/asylum/system/screen.h
+++ b/engines/asylum/system/screen.h
@@ -102,6 +102,7 @@ public:
 	void updatePalette(int32 param);
 	void setupPalette(byte *buffer, int start, int count);
 
+	bool isFading() { return _isFading; }
 	void startPaletteFade(ResourceId resourceId, int32 ticksWait, int32 delta);
 	void paletteFade(uint32 start, int32 ticksWait, int32 delta);
 	void stopPaletteFade(char red, char green, char blue);
diff --git a/engines/asylum/views/scene.cpp b/engines/asylum/views/scene.cpp
index b8bad08a16..2a8b39a5c2 100644
--- a/engines/asylum/views/scene.cpp
+++ b/engines/asylum/views/scene.cpp
@@ -1834,7 +1834,8 @@ void Scene::playIntroSpeech() {
 		Common::Event ev;
 		_vm->getEventManager()->pollEvent(ev);
 
-		g_system->updateScreen();
+		if (!getScreen()->isFading())
+			g_system->updateScreen();
 		g_system->delayMillis(100);
 
 	} while (getSound()->isPlaying(resourceId));
@@ -2395,7 +2396,8 @@ void Scene::preload() {
 	do {
 		title->update(_vm->getTick());
 
-		g_system->updateScreen();
+		if (!getScreen()->isFading())
+			g_system->updateScreen();
 		g_system->delayMillis(10);
 
 		// Poll events (this ensure we don't freeze the screen)
@@ -2826,7 +2828,8 @@ void Scene::debugShowPolygon(uint32 index, uint32 color) {
 void Scene::debugHighlightPolygon(uint32 index) {
 	debugShowPolygon(index, 0x12);
 	getScreen()->copyBackBufferToScreen();
-	g_system->updateScreen();
+	if (!getScreen()->isFading())
+		g_system->updateScreen();
 }
 
 // SCENE RECTS DEBUG




More information about the Scummvm-git-logs mailing list