[Scummvm-git-logs] scummvm master -> b8204a783a1ad27a61f7a76b922c173089e84bc9

dreammaster noreply at scummvm.org
Sun May 17 01:11:47 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:
b8204a783a MADS: PHANTOM: Fixed incorrectly named buffer usage.


Commit: b8204a783a1ad27a61f7a76b922c173089e84bc9
    https://github.com/scummvm/scummvm/commit/b8204a783a1ad27a61f7a76b922c173089e84bc9
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-05-17T11:11:22+10:00

Commit Message:
MADS: PHANTOM: Fixed incorrectly named buffer usage.

animview intro is now starting to show something.

Changed paths:
    engines/mads/madsv2/animview/anim_timer.cpp
    engines/mads/madsv2/animview/animview.cpp
    engines/mads/madsv2/animview/functions.cpp
    engines/mads/madsv2/animview/functions.h
    engines/mads/madsv2/core/matte.cpp


diff --git a/engines/mads/madsv2/animview/anim_timer.cpp b/engines/mads/madsv2/animview/anim_timer.cpp
index 51ca90a2e89..9bdd74c3e23 100644
--- a/engines/mads/madsv2/animview/anim_timer.cpp
+++ b/engines/mads/madsv2/animview/anim_timer.cpp
@@ -221,11 +221,11 @@ block2:
 
 	frame = &current_anim->frame[currentFrame];
 	if (frame->yank_x) {
-		buffer_peel_horiz(&scr_work, frame->yank_x);
+		buffer_peel_horiz(&scr_orig, frame->yank_x);
 		matte_refresh_work();
 	}
 	if (frame->yank_y) {
-		buffer_peel_vert(&scr_work, frame->yank_y, scr_inter_orig.data, 320 * 200);
+		buffer_peel_vert(&scr_orig, frame->yank_y, scr_orig.data, 320 * 200);
 		matte_refresh_work();
 	}
 
diff --git a/engines/mads/madsv2/animview/animview.cpp b/engines/mads/madsv2/animview/animview.cpp
index b033182d935..c4adaaf2e2e 100644
--- a/engines/mads/madsv2/animview/animview.cpp
+++ b/engines/mads/madsv2/animview/animview.cpp
@@ -172,21 +172,21 @@ static void run_animation(int animIndex) {
 
 	if (hasAnimInited) {
 		hasAnimInited = true;
-		mouse_set_work_buffer(scr_inter_orig.data, scr_inter_orig.x);
-		mouse_set_view_port_loc(0, viewing_at_y, scr_inter_orig.x, scr_inter_orig.y + viewing_at_y - 1);
+		mouse_set_work_buffer(scr_work.data, scr_work.x);
+		mouse_set_view_port_loc(0, viewing_at_y, scr_work.x, scr_work.y + viewing_at_y - 1);
 		mouse_set_view_port(0, 0);
 	}
 
 	auto &screen = *g_engine->getScreen();
 	if (viewing_at_y && anim_list[animIndex].show_bars) {
 		screen.hLine(0, viewing_at_y, 319, 253);
-		screen.hLine(0, viewing_at_y + scr_inter_orig.y, 319, 253);
+		screen.hLine(0, viewing_at_y + scr_work.y, 319, 253);
 	} else if (viewing_at_y) {
 		screen.hLine(0, viewing_at_y, 319, 0);
-		screen.hLine(0, viewing_at_y + scr_inter_orig.y, 319, 0);
+		screen.hLine(0, viewing_at_y + scr_work.y, 319, 0);
 	}
 
-	buffer_fill(scr_inter_orig, 0);
+	buffer_fill(scr_work, 0);
 
 	currentViewX = currentViewY = -1;
 	current_error_code = error_code;
@@ -418,7 +418,7 @@ static void animate() {
 
 		if (anim_list[count].bg_load_status) {
 			buffer_free(&scr_depth);
-			buffer_free(&scr_inter);
+			buffer_free(&scr_orig);
 			tile_map_free(&picture_map);
 			tile_map_free(&depth_map);
 
@@ -432,10 +432,10 @@ static void animate() {
 		}
 
 		int loadFlags = anim_list[count].bg_load_status ? ANIM_LOAD_BACKGROUND : 0;
-		current_anim = anim_load(buf, &scr_work, &scr_depth,
+		current_anim = anim_load(buf, &scr_orig, &scr_depth,
 			&picture_map, &depth_map, &picture_res, &depth_res, &room,
 			&anim_cycle_list, loadFlags);
-		scr_work_orig = scr_work;
+		scr_inter_orig = scr_orig;
 
 		if (!current_anim)
 			error("Could not load anim for - %s", buf);
@@ -455,14 +455,14 @@ static void animate() {
 		has_cycles = anim_cycle_list.num_cycles > 0;
 		current_anim_inter = (AnimInterPtr)current_anim;
 
-		int height = (scr_work.y == 200) ? 200 : 156;
-		buffer_init(&scr_inter_orig, 320, height);
-		scr_inter = scr_inter_orig;
+		int height = (scr_orig.y == 200) ? 200 : 156;
+		buffer_init(&scr_work, 320, height);
+		scr_inter = scr_work;
 
 		viewing_at_y = (height == 200) ? 0 : 200 - (height / 2);
 		viewing_at_y2 = viewing_at_y;
 
-		buffer_fill(scr_inter_orig, 0);
+		buffer_fill(scr_work, 0);
 
 		// Speech handling
 		speech_lines_count = 0;
@@ -522,7 +522,7 @@ static void animate() {
 		has_sound_file = false;
 
 		// Free surface
-		buffer_free(&scr_inter_orig);
+		buffer_free(&scr_work);
 		anim_unload(current_anim);
 		current_anim = nullptr;
 	}
@@ -531,7 +531,7 @@ done:
 	buffer_free(&scr_work);
 	anim_unload(current_anim);
 	buffer_free(&scr_depth);
-	buffer_free(&scr_inter);
+	buffer_free(&scr_orig);
 	tile_map_free(&picture_map);
 	tile_map_free(&depth_map);
 
diff --git a/engines/mads/madsv2/animview/functions.cpp b/engines/mads/madsv2/animview/functions.cpp
index 9037270c841..6aa3b658d96 100644
--- a/engines/mads/madsv2/animview/functions.cpp
+++ b/engines/mads/madsv2/animview/functions.cpp
@@ -33,7 +33,7 @@ namespace AnimView {
 
 int anim_count;
 AnimEntry anim_list[MAX_ANIM];
-uint8 background_load_status;
+bool background_load_status;
 int16 sound_interrupts_mode;
 bool show_white_bars;
 bool resync_timer1, resync_timer2;
@@ -45,7 +45,7 @@ bool do_not_clear_screen;
  */
 void functions_init() {
 	anim_count = 0;
-	background_load_status = 0;
+	background_load_status = true;
 	sound_interrupts_mode = 0;
 	show_white_bars = false;
 	resync_timer1 = true;
diff --git a/engines/mads/madsv2/animview/functions.h b/engines/mads/madsv2/animview/functions.h
index fcfa9ba7c3c..300ef176147 100644
--- a/engines/mads/madsv2/animview/functions.h
+++ b/engines/mads/madsv2/animview/functions.h
@@ -30,7 +30,7 @@ namespace AnimView {
 
 struct AnimEntry {
 	char name[16];
-	uint8 bg_load_status;
+	bool bg_load_status;
 	uint8 sound_mode;
 	uint8 show_bars;
 	uint8 fx;
@@ -39,7 +39,7 @@ constexpr int MAX_ANIM = 40;
 
 extern int anim_count;
 extern AnimEntry anim_list[MAX_ANIM];
-extern uint8 background_load_status;
+extern bool background_load_status;
 extern int16 sound_interrupts_mode;
 extern bool show_white_bars;
 extern bool resync_timer1, resync_timer2;
diff --git a/engines/mads/madsv2/core/matte.cpp b/engines/mads/madsv2/core/matte.cpp
index 6b86ec01d19..fd393051150 100644
--- a/engines/mads/madsv2/core/matte.cpp
+++ b/engines/mads/madsv2/core/matte.cpp
@@ -628,8 +628,8 @@ static void matte_special_effect(int special_effect, int full_screen) {
 
 		if (special_effect == MATTE_FX_FADE_THRU_BLACK) {
 			mcga_getpal(&special_pal);
-			matte_quick_to_black(&special_pal[0].r, 1);
-			// magic_fade_to_grey (special_pal, NULL, 0, 256, 0, 1, 1, 16);
+			//matte_quick_to_black(&special_pal[0].r, 1);
+			magic_fade_to_grey(special_pal, NULL, 0, 256, 0, 1, 1, 16);
 			buffer_fill(scr_live, 0);
 		}
 
@@ -641,7 +641,7 @@ static void matte_special_effect(int special_effect, int full_screen) {
 			work_screen->x, work_screen->y);
 
 		matte_quick_from_black(&special_pal[0].r, 1);
-		// magic_fade_from_grey (special_pal, master_palette, 0, 256, 0, 1, 1, 16);
+		//magic_fade_from_grey(special_pal, master_palette, 0, 256, 0, 1, 1, 16);
 		break;
 
 	case MATTE_FX_CORNER_LOWER_LEFT:




More information about the Scummvm-git-logs mailing list