[Scummvm-git-logs] scummvm master -> 85f4c354a6bf2b6eac55c511581ffd854ec4a6a5

dreammaster noreply at scummvm.org
Tue May 5 11:38:06 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:
85f4c354a6 MADS: PHANTOM: Fix loading animation resource headers


Commit: 85f4c354a6bf2b6eac55c511581ffd854ec4a6a5
    https://github.com/scummvm/scummvm/commit/85f4c354a6bf2b6eac55c511581ffd854ec4a6a5
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-05-05T21:37:55+10:00

Commit Message:
MADS: PHANTOM: Fix loading animation resource headers

Changed paths:
    engines/mads/madsv2/animview/animview.cpp
    engines/mads/madsv2/core/anim.cpp


diff --git a/engines/mads/madsv2/animview/animview.cpp b/engines/mads/madsv2/animview/animview.cpp
index 02ea3e2120d..77486f96ed9 100644
--- a/engines/mads/madsv2/animview/animview.cpp
+++ b/engines/mads/madsv2/animview/animview.cpp
@@ -31,6 +31,7 @@
 #include "mads/madsv2/core/tile.h"
 #include "mads/madsv2/core/timer.h"
 #include "mads/madsv2/animview/animview.h"
+#include "mads/madsv2/engine.h"
 
 namespace MADS {
 namespace MADSV2 {
@@ -178,10 +179,39 @@ static void read_resource(Common::SeekableReadStream *src) {
 	}
 }
 
-static void perform() {
+/**
+ * Animate a single entry in the anim_list
+ */
+static void animate_entry(AnimEntry &entry) {
 	char buf[80];// , speech_name[80];
 	AnimFile anim_in;
 
+	*buf = '\0';
+	if (in_mads_mode)
+		Common::strcpy_s(buf, "*");
+	Common::strcat_s(buf, entry.name);
+
+	himem_preload_series(buf, 0);
+
+	if (anim_get_header_info(buf, &anim_in))
+		return;
+
+	if (anim_in.load_flags & AA_LOAD_FONT) {
+		*buf = '\0';
+		if (in_mads_mode)
+			Common::strcpy_s(buf, "*");
+		Common::strcat_s(buf, anim_in.font_file);
+		himem_preload_series(buf, 0);
+	}
+
+	// TODO: More stuff
+}
+
+/**
+ * Iterate over the entries in the anim_list, animating each
+ * in sequence
+ */
+static void animate() {
 	himem_startup();
 	(void)tile_setup();
 
@@ -193,19 +223,8 @@ static void perform() {
 	timer_install();
 	matte_init(-1);
 
-	for (int count = 0; count < anim_count; ++count) {
-		*buf = '\0';
-		if (in_mads_mode)
-			Common::strcpy_s(buf, "*");
-		Common::strcat_s(buf, anim_list[count].name);
-
-		himem_preload_series(buf, 0);
-
-		if (anim_get_header_info(buf, &anim_in))
-			continue;
-		
-		// TODO: More stuff
-	}
+	for (int count = 0; count < anim_count && !g_engine->shouldQuit(); ++count)
+		animate_entry(anim_list[count]);
 }
 
 void animview_main(const char *resName) {
@@ -235,7 +254,7 @@ void animview_main(const char *resName) {
 	read_resource(file);
 	delete file;
 
-	perform();
+	animate();
 }
 
 } // namespace AnimView
diff --git a/engines/mads/madsv2/core/anim.cpp b/engines/mads/madsv2/core/anim.cpp
index 5d21d50f301..88c9ec25ed5 100644
--- a/engines/mads/madsv2/core/anim.cpp
+++ b/engines/mads/madsv2/core/anim.cpp
@@ -56,6 +56,7 @@ void AnimFile::load(Common::SeekableReadStream *src) {
 	src->read(background_depth, 13);
 	src->read(speech_file, 13);
 	src->read(font_file, 13);
+	src->skip(1);
 }
 
 void Speech::load(Common::SeekableReadStream *src) {
@@ -533,15 +534,15 @@ int anim_get_header_info(char *file_name,
 
 	load_handle.open = false;
 
-	if (loader_open(&load_handle, file_name, "rb", true))
-		goto done;
-
-	if (!loader_read(anim_in, sizeof(AnimFile), 1, &load_handle))
-		goto done;
-
-	error_flag = false;
+	if (!loader_open(&load_handle, file_name, "rb", true)) {
+		byte buffer[AnimFile::SIZE];
+		if (loader_read(buffer, AnimFile::SIZE, 1, &load_handle)) {
+			Common::MemoryReadStream src(buffer, AnimFile::SIZE);
+			anim_in->load(&src);
+			error_flag = false;
+		}
+	}
 
-done:
 	if (load_handle.open)
 		loader_close(&load_handle);
 




More information about the Scummvm-git-logs mailing list