[Scummvm-git-logs] scummvm master -> 3b6bbd63a0637a4e4139b6b8a776ae5f4807d127

dreammaster noreply at scummvm.org
Sat May 16 22:48:17 UTC 2026


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:
3b6bbd63a0 MADS: PHANTOM: Fix anim_timer filling up image_list


Commit: 3b6bbd63a0637a4e4139b6b8a776ae5f4807d127
    https://github.com/scummvm/scummvm/commit/3b6bbd63a0637a4e4139b6b8a776ae5f4807d127
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-05-17T08:48:07+10:00

Commit Message:
MADS: PHANTOM: Fix anim_timer filling up image_list

Changed paths:
    engines/mads/madsv2/animview/anim_timer.cpp
    engines/mads/madsv2/animview/animview.cpp


diff --git a/engines/mads/madsv2/animview/anim_timer.cpp b/engines/mads/madsv2/animview/anim_timer.cpp
index 1dc0d070bd6..51ca90a2e89 100644
--- a/engines/mads/madsv2/animview/anim_timer.cpp
+++ b/engines/mads/madsv2/animview/anim_timer.cpp
@@ -36,7 +36,6 @@ namespace AnimView {
 static const byte FX_TIMES[16] = {
 	0, 110, 110, 64, 64, 64, 64, 64, 64, 64, 64, 0, 0, 0, 0, 0
 };
-constexpr int sound_var1 = 49;
 
 constexpr int MESSAGES_COUNT = 8;
 static int messageHandle[MESSAGES_COUNT];
@@ -60,7 +59,7 @@ void anim_timer_init() {
 
 void anim_timer() {
 	bool flag = false;
-	uint32 currTimer = timer_read();
+	long currTimer = timer_read();
 	Speech *speech;
 	Frame *frame;
 	int sound, count;
@@ -99,7 +98,7 @@ void anim_timer() {
 		if (currTimer < timer1)
 			goto done;
 	} else {
-		uint32 time = timer1 - FX_TIMES[runFx];
+		long time = timer1 - FX_TIMES[runFx];
 		if (time > currTimer)
 			goto done;
 	}
@@ -119,8 +118,9 @@ void anim_timer() {
 		speech->display_condition != 0x800 &&
 		speech->resource_id >= 0;
 
-	if (speech->sound /*&& (!flag || sound_var1 == 49)*/) {
+	if (speech->sound /*&& (!flag || sound_var1 == '1')*/) {
 		g_engine->_soundManager->command(speech->sound);
+		flag = false;
 	}
 
 	if (flag) {
@@ -153,7 +153,7 @@ block1:
 		for (count = 0; count < current_anim->num_speech; ++count) {
 			Speech *s = &current_anim->speech[count];
 			if (count != speechIndex && messageCount < MESSAGES_COUNT &&
-					s->first_frame <= currentFrame && s->last_frame > currentFrame) {
+					s->first_frame <= currentFrame && s->last_frame >= currentFrame) {
 				messageHandle[messageCount++] = matte_add_message(current_anim->font, s->text,
 					s->x, s->y, (palIndex2 << 8) | palIndex1,
 					current_anim->font_auto_spacing);
@@ -178,7 +178,7 @@ block2:
 		currentViewY = frameViewY;
 	} else {
 		for (count = 0; count < image_marker; ++count) {
-			if (image_list[count].flags == IMAGE_REFRESH)
+			if (image_list[count].flags != IMAGE_REFRESH)
 				image_list[count].flags = IMAGE_ERASE;
 		}
 	}
diff --git a/engines/mads/madsv2/animview/animview.cpp b/engines/mads/madsv2/animview/animview.cpp
index cd72d568818..b033182d935 100644
--- a/engines/mads/madsv2/animview/animview.cpp
+++ b/engines/mads/madsv2/animview/animview.cpp
@@ -263,6 +263,9 @@ static void run_animation(int animIndex) {
 			current_error_code = -1;
 			error_code = 3;
 		}
+
+		// Animation loop delay
+		g_system->delayMillis(10);
 	}
 
 	cycling_threshold = 3;




More information about the Scummvm-git-logs mailing list