[Scummvm-git-logs] scummvm master -> 34007cb7c24da765d946452e2cf9f0f5dd642f6e

bluegr noreply at scummvm.org
Sun May 22 16:38:16 UTC 2022


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

Summary:
ef181e8fed CHEWY: Simplify and rename some screen related functions
b612498015 CHEWY: Remove more screen related dead code
34007cb7c2 SCI: Clean up script patches for Hoyle Bridge and Children's Collection


Commit: ef181e8fed601de927f64cb05afb81f74d19bb14
    https://github.com/scummvm/scummvm/commit/ef181e8fed601de927f64cb05afb81f74d19bb14
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-05-22T19:37:50+03:00

Commit Message:
CHEWY: Simplify and rename some screen related functions

Changed paths:
    engines/chewy/dialogs/cinema.cpp
    engines/chewy/dialogs/credits.cpp
    engines/chewy/dialogs/files.cpp
    engines/chewy/dialogs/inventory.cpp
    engines/chewy/dialogs/main_menu.cpp
    engines/chewy/dialogs/options.cpp
    engines/chewy/effect.cpp
    engines/chewy/inits.cpp
    engines/chewy/main.cpp
    engines/chewy/mcga_graphics.cpp
    engines/chewy/mcga_graphics.h
    engines/chewy/r_event.cpp
    engines/chewy/rooms/room00.cpp
    engines/chewy/rooms/room28.cpp
    engines/chewy/rooms/room40.cpp
    engines/chewy/rooms/room51.cpp
    engines/chewy/rooms/room56.cpp
    engines/chewy/rooms/room76.cpp
    engines/chewy/rooms/room82.cpp
    engines/chewy/rooms/room86.cpp
    engines/chewy/rooms/room89.cpp
    engines/chewy/t_event.cpp


diff --git a/engines/chewy/dialogs/cinema.cpp b/engines/chewy/dialogs/cinema.cpp
index cbc409467fd..61e18e076c7 100644
--- a/engines/chewy/dialogs/cinema.cpp
+++ b/engines/chewy/dialogs/cinema.cpp
@@ -191,7 +191,7 @@ void Cinema::execute() {
 				_G(room)->set_ak_pal(&_G(room_blk));
 				_G(fx)->blende1(_G(workptr), _G(screen0), _G(pal), 150, 0, 0);
 			} else {
-				_G(out)->back2screen(_G(workpage));
+				_G(out)->copyToScreen();
 			}
 		}
 
diff --git a/engines/chewy/dialogs/credits.cpp b/engines/chewy/dialogs/credits.cpp
index 46bf073d4cd..90646a20f70 100644
--- a/engines/chewy/dialogs/credits.cpp
+++ b/engines/chewy/dialogs/credits.cpp
@@ -258,7 +258,7 @@ void Credits::execute() {
 			break;
 
 		_G(out)->setPointer(nullptr);
-		_G(out)->back2screen(_G(workpage));
+		_G(out)->copyToScreen();
 	}
 
 	_G(fontMgr)->setFont(_G(font8));
diff --git a/engines/chewy/dialogs/files.cpp b/engines/chewy/dialogs/files.cpp
index 446185bd9cb..6894fbc3d17 100644
--- a/engines/chewy/dialogs/files.cpp
+++ b/engines/chewy/dialogs/files.cpp
@@ -152,7 +152,7 @@ bool Files::execute(bool isInGame) {
 			--mode[QUIT];
 		if (mode[QUIT] == 1) {
 			_G(out)->printxy(120, 138, 255, 300, 0, g_engine->getLanguage() == Common::Language::DE_DEU ? QUIT_MSG_DE : QUIT_MSG_EN);
-			_G(out)->back2screen(_G(workpage));
+			_G(out)->copyToScreen();
 
 			key = getch();
 			if (key == 'j' || key == 'J' || key == 'y' || key == 'Y' || key == 'z' || key == 'Z') {
@@ -279,7 +279,7 @@ enter:
 					}
 				}
 			} else if (mode[SAVE]) {
-				_G(out)->back2screen(_G(workpage));
+				_G(out)->copyToScreen();
 				_G(out)->setPointer(_G(screen0));
 				char slotName[81];
 				slotName[0] = '\0';
@@ -300,7 +300,7 @@ enter:
 		}
 
 		_G(cur)->plot_cur();
-		_G(out)->back2screen(_G(workpage));
+		_G(out)->copyToScreen();
 
 		EVENTS_UPDATE;
 	}
diff --git a/engines/chewy/dialogs/inventory.cpp b/engines/chewy/dialogs/inventory.cpp
index 31b52316d29..07e8242d0f0 100644
--- a/engines/chewy/dialogs/inventory.cpp
+++ b/engines/chewy/dialogs/inventory.cpp
@@ -296,7 +296,7 @@ void Inventory::menu() {
 						inv_rand_y = -1;
 						plot_menu();
 						_G(cur)->plot_cur();
-						_G(out)->back2screen(_G(workpage));
+						_G(out)->copyToScreen();
 					}
 				} else {
 					if (menu_flag1 != MENU_DISPLAY) {
@@ -360,7 +360,7 @@ void Inventory::menu() {
 				_G(fx)->blende1(_G(workptr), _G(screen0), nullptr, 200, 1, 300);
 			menu_flag1 = false;
 			_G(out)->setClip(0, 0, 320, 200);
-			_G(out)->back2screen(_G(workpage));
+			_G(out)->copyToScreen();
 		} else {
 			showCur();
 		}
@@ -374,7 +374,7 @@ void Inventory::menu() {
 	while (_G(in)->getSwitchCode() == Common::KEYCODE_ESCAPE && !SHOULD_QUIT) {
 		setupScreen(NO_SETUP);
 		_G(cur)->plot_cur();
-		_G(out)->back2screen(_G(workpage));
+		_G(out)->copyToScreen();
 	}
 
 	_G(flags).InventMenu = false;
@@ -534,7 +534,7 @@ int16 Inventory::look(int16 invent_nr, int16 mode, int16 ats_nr) {
 		}
 
 		_G(cur)->plot_cur();
-		_G(out)->back2screen(_G(workpage));
+		_G(out)->copyToScreen();
 		SHOULD_QUIT_RETURN0;
 	}
 
@@ -542,7 +542,7 @@ int16 Inventory::look(int16 invent_nr, int16 mode, int16 ats_nr) {
 		setupScreen(NO_SETUP);
 		plot_menu();
 		_G(cur)->plot_cur();
-		_G(out)->back2screen(_G(workpage));
+		_G(out)->copyToScreen();
 		SHOULD_QUIT_RETURN0;
 	}
 
@@ -654,7 +654,7 @@ void Inventory::showDiary() {
 	_G(room)->load_tgp(DIARY_START, &_G(room_blk), GBOOK_TGP, 0, GBOOK);
 	_G(out)->setPointer(_G(workptr));
 	_G(out)->map_spr2screen(_G(ablage)[_G(room_blk).AkAblage], _G(gameState).scrollx, _G(gameState).scrolly);
-	_G(out)->back2screen(_G(workpage));
+	_G(out)->copyToScreen();
 	_G(room)->set_ak_pal(&_G(room_blk));
 	_G(out)->setPointer(nullptr);
 	_G(fx)->blende1(_G(workptr), _G(screen0), _G(pal), 150, 0, 0);
diff --git a/engines/chewy/dialogs/main_menu.cpp b/engines/chewy/dialogs/main_menu.cpp
index 23fe8919e0b..8dd26270a17 100644
--- a/engines/chewy/dialogs/main_menu.cpp
+++ b/engines/chewy/dialogs/main_menu.cpp
@@ -164,7 +164,7 @@ void MainMenu::animate() {
 	_G(mouseLeftClick) = false;
 	_G(menu_flag) = 0;
 	_G(out)->setPointer(nullptr);
-	_G(out)->back2screen(_G(workpage));
+	_G(out)->copyToScreen();
 
 	g_screen->update();
 	g_events->update();
diff --git a/engines/chewy/dialogs/options.cpp b/engines/chewy/dialogs/options.cpp
index 81062273cb9..9c89aa87280 100644
--- a/engines/chewy/dialogs/options.cpp
+++ b/engines/chewy/dialogs/options.cpp
@@ -231,7 +231,7 @@ void Options::execute(TafInfo *ti) {
 		}
 
 		_G(cur)->plot_cur();
-		_G(out)->back2screen(_G(workpage));
+		_G(out)->copyToScreen();
 		EVENTS_UPDATE;
 		SHOULD_QUIT_RETURN;
 
diff --git a/engines/chewy/effect.cpp b/engines/chewy/effect.cpp
index 10974bbbe8e..a9000098d78 100644
--- a/engines/chewy/effect.cpp
+++ b/engines/chewy/effect.cpp
@@ -149,14 +149,14 @@ void Effect::border(byte *workpage_, int16 lines, uint8 mode, int16 color) {
 			_G(out)->setPointer(workpage_ + 4);
 			_G(out)->boxFill(152 - x, 0, 152 - x + 8, 200, color);
 			_G(out)->boxFill(x + 160, 0, x + 168, 200, color);
-			_G(out)->back2screen(workpage_);
+			_G(out)->copyToScreen();
 		}
 	} else {
 		for (int i = 0, x = 0; i < 20; ++i, x += 8) {
 			_G(out)->setPointer(workpage_ + 4);
 			_G(out)->boxFill(x, 0, x + 8, 200, color);
 			_G(out)->boxFill(312 - x, 0, 31 - x + 8, 200, color);
-			_G(out)->back2screen(workpage_);
+			_G(out)->copyToScreen();
 		}
 	}
 }
diff --git a/engines/chewy/inits.cpp b/engines/chewy/inits.cpp
index e2bff35d1c5..d2c48d3b75c 100644
--- a/engines/chewy/inits.cpp
+++ b/engines/chewy/inits.cpp
@@ -65,7 +65,7 @@ void standard_init() {
 	_G(pal)[765] = 63;
 	_G(pal)[766] = 63;
 	_G(pal)[767] = 63;
-	_G(out)->einblenden(_G(pal), 0);
+	_G(out)->fadeIn(_G(pal), 0);
 	_G(room)->set_timer_start(1);
 
 	_G(out)->cls();
@@ -77,7 +77,7 @@ void standard_init() {
 	_G(pal)[765] = 63;
 	_G(pal)[766] = 63;
 	_G(pal)[767] = 63;
-	_G(out)->einblenden(_G(pal), 0);
+	_G(out)->fadeIn(_G(pal), 0);
 	_G(out)->cls();
 	_G(uhr)->setNewTimer(0, 5, SEC_10_MODE);
 
diff --git a/engines/chewy/main.cpp b/engines/chewy/main.cpp
index bfb21355d2c..22d759253ba 100644
--- a/engines/chewy/main.cpp
+++ b/engines/chewy/main.cpp
@@ -596,7 +596,7 @@ void setupScreen(SetupScreenMode mode) {
 			break;
 
 		default:
-			_G(out)->back2screen(_G(workpage));
+			_G(out)->copyToScreen();
 			break;
 		}
 
diff --git a/engines/chewy/mcga_graphics.cpp b/engines/chewy/mcga_graphics.cpp
index 0c87b224a98..32470e8628f 100644
--- a/engines/chewy/mcga_graphics.cpp
+++ b/engines/chewy/mcga_graphics.cpp
@@ -81,7 +81,7 @@ void McgaGraphics::raster_col(int16 c, int16 r, int16 g, int16 b) {
 	setScummVMPalette(&_palTable[c * 3], c, 1);
 }
 
-void McgaGraphics::einblenden(byte *palette, int16 frames) {
+void McgaGraphics::fadeIn(byte *palette, int16 frames) {
 	for (int16 j = 63; j >= 0; j--) {
 		int16 k = 0;
 		for (int16 i = 0; i < 256; i++) {
@@ -103,7 +103,7 @@ void McgaGraphics::einblenden(byte *palette, int16 frames) {
 	}
 }
 
-void McgaGraphics::ausblenden(int16 frames) {
+void McgaGraphics::fadeOut() {
 	for (int16 j = 0; j < 64; j++) {
 		int16 k = 0;
 		for (int16 i = 0; i < 256; i++) {
@@ -165,8 +165,9 @@ void McgaGraphics::pop_box(int16 x, int16 y, int16 x1, int16 y1, int16 col1, int
 	drawLine(x, y, x, y1 + 1, col1);
 }
 
-void McgaGraphics::back2screen(byte *ptr) {
+void McgaGraphics::copyToScreen() {
 	byte *destP = (byte *)g_screen->getPixels();
+	const byte *ptr = _G(workpage);
 	Common::copy(ptr + 4, ptr + 4 + (SCREEN_WIDTH * SCREEN_HEIGHT), destP);
 	g_screen->markAllDirty();
 }
diff --git a/engines/chewy/mcga_graphics.h b/engines/chewy/mcga_graphics.h
index 10c1c1c32ec..b994d4ae3d4 100644
--- a/engines/chewy/mcga_graphics.h
+++ b/engines/chewy/mcga_graphics.h
@@ -38,8 +38,8 @@ public:
 
 	void setPalette(byte *palette);
 	void raster_col(int16 c, int16 r, int16 g, int16 b);
-	void einblenden(byte *palette, int16 frames);
-	void ausblenden(int16 frames);
+	void fadeIn(byte *palette, int16 frames);
+	void fadeOut();
 	void set_partialpalette(const byte *palette, int16 startCol, int16 nr);
 
 	void cls();
@@ -49,7 +49,7 @@ public:
 	void pop_box(int16 x, int16 y, int16 x1, int16 y1,
 	             int16 col1, int16 col2, int16 back_col);
 
-	void back2screen(byte *ptr);
+	void copyToScreen();
 
 	void spriteSave(byte *spritePtr, int16 x, int16 y, int16 width,
 	                int16 height);
diff --git a/engines/chewy/r_event.cpp b/engines/chewy/r_event.cpp
index 09692698524..d92f77ec5ea 100644
--- a/engines/chewy/r_event.cpp
+++ b/engines/chewy/r_event.cpp
@@ -723,7 +723,7 @@ void flic_cut(int16 nr) {
 
 		// TODO: Reimplement
 		//_G(sndPlayer)->fadeOut(0);
-		_G(out)->ausblenden(1);
+		_G(out)->fadeOut();
 		_G(out)->cls();
 		//while (_G(sndPlayer)->musicPlaying()) {}
 		break;
@@ -743,7 +743,7 @@ void flic_cut(int16 nr) {
 
 		// TODO: Reimplement
 		//_G(sndPlayer)->fadeOut(0);
-		_G(out)->ausblenden(1);
+		_G(out)->fadeOut();
 		_G(out)->cls();
 		//while (_G(sndPlayer)->musicPlaying() && !SHOULD_QUIT) {}
 		break;
diff --git a/engines/chewy/rooms/room00.cpp b/engines/chewy/rooms/room00.cpp
index b1c4aa8d6d4..b38be10cfb2 100644
--- a/engines/chewy/rooms/room00.cpp
+++ b/engines/chewy/rooms/room00.cpp
@@ -236,7 +236,7 @@ void Room0::eyeStart(EyeMode mode) {
 
 		_G(cur)->plot_cur();
 		calcEyeClick(3);
-		_G(out)->back2screen(_G(workpage));
+		_G(out)->copyToScreen();
 
 		if (adi->delay_count > 0)
 			--adi->delay_count;
@@ -281,7 +281,7 @@ void Room0::eyeWait() {
 		setupScreen(NO_SETUP);
 		_G(cur)->plot_cur();
 		calcEyeClick(2);
-		_G(out)->back2screen(_G(workpage));
+		_G(out)->copyToScreen();
 
 		if (adi->delay_count > 0) {
 			--adi->delay_count;
@@ -491,7 +491,7 @@ void Room0::feederStart(int16 mode) {
 		if (!mode)
 			calcPillowClick(1);
 
-		_G(out)->back2screen(_G(workpage));
+		_G(out)->copyToScreen();
 		if (adi->delay_count > 0)
 			--adi->delay_count;
 		else {
@@ -530,7 +530,7 @@ void Room0::feederExtend() {
 		setupScreen(NO_SETUP);
 		_G(cur)->plot_cur();
 		calcPillowClick(1);
-		_G(out)->back2screen(_G(workpage));
+		_G(out)->copyToScreen();
 	}
 
 	clear_prog_ani();
diff --git a/engines/chewy/rooms/room28.cpp b/engines/chewy/rooms/room28.cpp
index 33a3e06681f..10b601c4288 100644
--- a/engines/chewy/rooms/room28.cpp
+++ b/engines/chewy/rooms/room28.cpp
@@ -81,7 +81,7 @@ void Room28::entry(int16 eib_nr) {
 					_G(det)->showStaticSpr(6);
 
 					if (!_G(gameState).R40TeilKarte) {
-						_G(out)->ausblenden(0);
+						_G(out)->fadeOut();
 						_G(out)->set_partialpalette(_G(pal), 255, 1);
 						startAadWait(607);
 						_G(fx_blend) = BLEND3;
diff --git a/engines/chewy/rooms/room40.cpp b/engines/chewy/rooms/room40.cpp
index dc3a9ad552c..00d6343a262 100644
--- a/engines/chewy/rooms/room40.cpp
+++ b/engines/chewy/rooms/room40.cpp
@@ -115,10 +115,10 @@ void Room40::xit(int16 eib_nr) {
 				_G(obj)->hide_sib(SIB_MUENZE_R40);
 
 				_G(uhr)->disableTimer();
-				_G(out)->ausblenden(0);
+				_G(out)->fadeOut();
 				hide_person();
 				setupScreen(DO_SETUP);
-				_G(out)->einblenden(_G(pal), 0);
+				_G(out)->fadeIn(_G(pal), 0);
 				_G(uhr)->enableTimer();
 
 				_G(mouseLeftClick) = false;
@@ -341,7 +341,7 @@ int16 Room40::use_mr_pumpkin() {
 						autoMove(8, P_CHEWY);
 						start_spz_wait(CH_PUMP_GET1, 1, false, P_CHEWY);
 						delInventory(_G(gameState).AkInvent);
-						_G(out)->ausblenden(1);
+						_G(out)->fadeOut();
 						Room43::catch_pg();
 						remove_inventory(LIKOER_INV);
 						_G(obj)->addInventory(LIKOER2_INV, &_G(room_blk));
@@ -474,10 +474,10 @@ int16 Room40::use_haendler() {
 				_G(det)->del_static_ani(5);
 				_G(det)->set_static_ani(3, -1);
 				startAadWait(211);
-				_G(out)->ausblenden(0);
+				_G(out)->fadeOut();
 				_G(out)->set_partialpalette(_G(pal), 255, 1);
 				startAadWait(212);
-				_G(out)->ausblenden(0);
+				_G(out)->fadeOut();
 				_G(gameState).R40Wettbewerb = true;
 				_G(gameState)._personRoomNr[P_HOWARD] = 28;
 				_G(flags).NoScroll = false;
diff --git a/engines/chewy/rooms/room51.cpp b/engines/chewy/rooms/room51.cpp
index bcfa18116ee..36725d37c9e 100644
--- a/engines/chewy/rooms/room51.cpp
+++ b/engines/chewy/rooms/room51.cpp
@@ -255,10 +255,10 @@ int16 Room51::use_door(int16 txt_nr) {
 					_G(gameState).R51KillerWeg = true;
 					startAadWait(290);
 					g_engine->_sound->stopSound(0);
-					_G(out)->ausblenden(1);
+					_G(out)->fadeOut();
 					_G(out)->setPointer(nullptr);
 					_G(out)->cls();
-					_G(out)->einblenden(_G(pal), 0);
+					_G(out)->fadeIn(_G(pal), 0);
 					_G(flags).NoPalAfterFlc = true;
 					_G(det)->showStaticSpr(16);
 					flic_cut(FCUT_068);
diff --git a/engines/chewy/rooms/room56.cpp b/engines/chewy/rooms/room56.cpp
index a8e795ef320..21492aa0868 100644
--- a/engines/chewy/rooms/room56.cpp
+++ b/engines/chewy/rooms/room56.cpp
@@ -308,7 +308,7 @@ int16 Room56::use_kneipe() {
 				startAadWait(307);
 				_G(det)->stop_detail(10);
 				g_engine->_sound->playSound(10, 0);
-				_G(out)->ausblenden(0);
+				_G(out)->fadeOut();
 				setupScreen(DO_SETUP);
 				_G(gameState)._personHide[P_CHEWY] = false;
 				_G(gameState)._personHide[P_HOWARD] = false;
diff --git a/engines/chewy/rooms/room76.cpp b/engines/chewy/rooms/room76.cpp
index d902699eb13..6a57c1e8abd 100644
--- a/engines/chewy/rooms/room76.cpp
+++ b/engines/chewy/rooms/room76.cpp
@@ -191,7 +191,7 @@ int Room76::proc7() {
 		invent_2_slot(106);
 		invent_2_slot(105);
 		startAadWait(444);
-		_G(out)->ausblenden(0);
+		_G(out)->fadeOut();
 		_G(out)->set_partialpalette(_G(pal), 255, 1);
 		startAadWait(443);
 		_G(gameState).scrollx = 0;
diff --git a/engines/chewy/rooms/room82.cpp b/engines/chewy/rooms/room82.cpp
index c5dd902a55a..78c9e2f31e5 100644
--- a/engines/chewy/rooms/room82.cpp
+++ b/engines/chewy/rooms/room82.cpp
@@ -196,7 +196,7 @@ int Room82::proc6() {
 
 	if (_G(gameState).flags30_10) {
 		startAadWait(450);
-		_G(out)->ausblenden(0);
+		_G(out)->fadeOut();
 		_G(out)->set_partialpalette(_G(pal), 255, 1);
 		_G(atds)->enableEvents(false);
 		startAadWait(598);
diff --git a/engines/chewy/rooms/room86.cpp b/engines/chewy/rooms/room86.cpp
index 96b99359a4c..69d2a10a620 100644
--- a/engines/chewy/rooms/room86.cpp
+++ b/engines/chewy/rooms/room86.cpp
@@ -193,7 +193,7 @@ void Room86::proc3(bool cond) {
 		_G(det)->setStaticPos(0, 352, destY, false, false);
 		destY += deltaY;
 		_G(out)->setPointer(nullptr);
-		_G(out)->back2screen(_G(workpage));
+		_G(out)->copyToScreen();
 	}
 
 	g_engine->_sound->stopSound(1);
diff --git a/engines/chewy/rooms/room89.cpp b/engines/chewy/rooms/room89.cpp
index 77f5cfbea47..f7317d15bde 100644
--- a/engines/chewy/rooms/room89.cpp
+++ b/engines/chewy/rooms/room89.cpp
@@ -102,7 +102,7 @@ void Room89::entry() {
 			_G(out)->cls();
 			_G(out)->scale_set(_G(Ci).tempArea, ABS(edi) / 2, ABS(var24) / 2, edi, var24, _G(scr_width));
 			_G(out)->setPointer(nullptr);
-			_G(out)->back2screen(_G(workpage));
+			_G(out)->copyToScreen();
 			g_events->delay(30);
 			SHOULD_QUIT_RETURN;
 		}
@@ -124,13 +124,13 @@ void Room89::entry() {
 			_G(out)->cls();
 			_G(out)->scale_set(_G(Ci).tempArea, ABS(edi) / 2, ABS(var30) / 2, edi, var30, _G(scr_width));
 			_G(out)->setPointer(nullptr);
-			_G(out)->back2screen(_G(workpage));
+			_G(out)->copyToScreen();
 			g_events->delay(30);
 			SHOULD_QUIT_RETURN;
 		}
 
 		g_events->delay(3000);
-		_G(out)->ausblenden(2);
+		_G(out)->fadeOut();
 		_G(out)->setPointer(_G(workptr));
 		_G(out)->cls();
 		_G(out)->setPointer(nullptr);
@@ -139,7 +139,7 @@ void Room89::entry() {
 		Dialogs::Credits::execute();
 		
 		_G(gameState).SVal4 = 1;
-		_G(out)->ausblenden(2);
+		_G(out)->fadeOut();
 		_G(out)->setPointer(nullptr);
 		_G(out)->cls();
 	}
diff --git a/engines/chewy/t_event.cpp b/engines/chewy/t_event.cpp
index b7d51e4a19f..ffdd9cea7bb 100644
--- a/engines/chewy/t_event.cpp
+++ b/engines/chewy/t_event.cpp
@@ -2171,7 +2171,7 @@ void calc_inv_use_txt(int16 test_nr) {
 		_G(room)->load_tgp(NOTEBOOK_START, &_G(room_blk), GBOOK_TGP, 0, GBOOK);
 		_G(out)->setPointer(_G(workptr));
 		_G(out)->map_spr2screen(_G(ablage)[_G(room_blk).AkAblage], _G(gameState).scrollx, _G(gameState).scrolly);
-		_G(out)->back2screen(_G(workpage));
+		_G(out)->copyToScreen();
 
 		while (_G(in)->getSwitchCode() != Common::KEYCODE_ESCAPE) {
 			g_events->update();


Commit: b612498015fa3e98339bd107109a3d9a6081d7d5
    https://github.com/scummvm/scummvm/commit/b612498015fa3e98339bd107109a3d9a6081d7d5
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-05-22T19:37:51+03:00

Commit Message:
CHEWY: Remove more screen related dead code

The custom clip rect and the screen fading frame code aren't used

Changed paths:
    engines/chewy/dialogs/inventory.cpp
    engines/chewy/globals.h
    engines/chewy/inits.cpp
    engines/chewy/mcga_graphics.cpp
    engines/chewy/mcga_graphics.h
    engines/chewy/rooms/room40.cpp
    engines/chewy/rooms/room51.cpp


diff --git a/engines/chewy/dialogs/inventory.cpp b/engines/chewy/dialogs/inventory.cpp
index 07e8242d0f0..bd4f80c93b8 100644
--- a/engines/chewy/dialogs/inventory.cpp
+++ b/engines/chewy/dialogs/inventory.cpp
@@ -359,7 +359,6 @@ void Inventory::menu() {
 			} else if (menu_flag1 == MENU_HIDE)
 				_G(fx)->blende1(_G(workptr), _G(screen0), nullptr, 200, 1, 300);
 			menu_flag1 = false;
-			_G(out)->setClip(0, 0, 320, 200);
 			_G(out)->copyToScreen();
 		} else {
 			showCur();
diff --git a/engines/chewy/globals.h b/engines/chewy/globals.h
index 320d2ce4068..d4d259adf00 100644
--- a/engines/chewy/globals.h
+++ b/engines/chewy/globals.h
@@ -247,7 +247,6 @@ public:
 	int _spriteWidth = 0;
 
 	// mcga_graphics.cpp
-	int16 _clipx1 = 0, _clipx2 = 0, _clipy1 = 0, _clipy2 = 0;
 	int16 _gcurx = 0, _gcury = 0;
 
 	// menus.cpp
diff --git a/engines/chewy/inits.cpp b/engines/chewy/inits.cpp
index d2c48d3b75c..4cef3f5a517 100644
--- a/engines/chewy/inits.cpp
+++ b/engines/chewy/inits.cpp
@@ -48,7 +48,6 @@ void standard_init() {
 
 	_G(out)->init();
 	_G(out)->cls();
-	_G(out)->setClip(0, 0, 320, 200);
 	_G(scr_width) = 0;
 	_G(screen0) = (byte *)g_screen->getPixels();
 
@@ -65,7 +64,7 @@ void standard_init() {
 	_G(pal)[765] = 63;
 	_G(pal)[766] = 63;
 	_G(pal)[767] = 63;
-	_G(out)->fadeIn(_G(pal), 0);
+	_G(out)->fadeIn(_G(pal));
 	_G(room)->set_timer_start(1);
 
 	_G(out)->cls();
@@ -77,7 +76,7 @@ void standard_init() {
 	_G(pal)[765] = 63;
 	_G(pal)[766] = 63;
 	_G(pal)[767] = 63;
-	_G(out)->fadeIn(_G(pal), 0);
+	_G(out)->fadeIn(_G(pal));
 	_G(out)->cls();
 	_G(uhr)->setNewTimer(0, 5, SEC_10_MODE);
 
diff --git a/engines/chewy/mcga_graphics.cpp b/engines/chewy/mcga_graphics.cpp
index 32470e8628f..b9d3dfde1f6 100644
--- a/engines/chewy/mcga_graphics.cpp
+++ b/engines/chewy/mcga_graphics.cpp
@@ -53,13 +53,6 @@ void setScummVMPalette(const byte *palette, uint start, uint count) {
 	g_system->getPaletteManager()->setPalette(tempPal, start, count);
 }
 
-void McgaGraphics::setClip(int16 x1, int16 y1, int16 x2, int16 y2) {
-	_G(clipx1) = x1;
-	_G(clipx2) = x2;
-	_G(clipy1) = y1;
-	_G(clipy2) = y2;
-}
-
 void McgaGraphics::setPointer(byte *ptr) {
 	if (ptr) {
 		_G(currentScreen) = ptr;
@@ -81,7 +74,7 @@ void McgaGraphics::raster_col(int16 c, int16 r, int16 g, int16 b) {
 	setScummVMPalette(&_palTable[c * 3], c, 1);
 }
 
-void McgaGraphics::fadeIn(byte *palette, int16 frames) {
+void McgaGraphics::fadeIn(byte *palette) {
 	for (int16 j = 63; j >= 0; j--) {
 		int16 k = 0;
 		for (int16 i = 0; i < 256; i++) {
@@ -177,18 +170,18 @@ void McgaGraphics::spriteSave(byte *spritePtr, int16 x, int16 y, int16 width, in
 		width = 4;
 	if (height <= 0)
 		height = 1;
-	if (x < _G(clipx1)) {
-		x = _G(clipx1);
-		width -= (_G(clipx1) - x);
+	if (x < 0) {
+		x = 0;
+		width -= (0 - x);
 	}
-	if ((x + width) > _G(clipx2) + 1)
-		width = _G(clipx2) - x;
-	if (y < _G(clipy1)) {
-		y = _G(clipy1);
-		height -= (_G(clipy1) - y);
+	if ((x + width) > 320 + 1)
+		width = 320 - x;
+	if (y < 0) {
+		y = 0;
+		height -= (0 - y);
 	}
-	if ((y + height) > _G(clipy2) + 1)
-		height = _G(clipy2) - y;
+	if ((y + height) > 200 + 1)
+		height = 200 - y;
 	if (width < 1)
 		width = 0;
 	if (height <= 0)
@@ -212,35 +205,35 @@ void McgaGraphics::spriteSave(byte *spritePtr, int16 x, int16 y, int16 width, in
 }
 
 static bool mspr_set_mcga_clip(int x, int y, int pitch, int &width, int &height, const byte *&srcP, byte *&destP) {
-	if (y < _G(clipy1)) {
-		int yDiff = ABS(_G(clipy1) - y);
+	if (y < 0) {
+		int yDiff = ABS(0 - y);
 		height -= yDiff;
 		srcP += yDiff * width;
-		y = _G(clipy1);
+		y = 0;
 	}
 	if (height < 1)
 		return false;
 
-	if (x < _G(clipx1)) {
-		int xDiff = ABS(_G(clipx1) - x);
+	if (x < 0) {
+		int xDiff = ABS(0 - x);
 		width -= xDiff;
 		srcP += xDiff;
-		x = _G(clipx1);
+		x = 0;
 	}
 	if (width < 1)
 		return false;
 
 	int x2 = x + width;
-	if (x2 > _G(clipx2)) {
-		int xDiff = x2 - _G(clipx2);
+	if (x2 > 320) {
+		int xDiff = x2 - 320;
 		width -= xDiff;
 	}
 	if (width <= 1)
 		return false;
 
 	int y2 = y + height;
-	if (y2 > _G(clipy2)) {
-		int yDiff = y2 - _G(clipy2);
+	if (y2 > 200) {
+		int yDiff = y2 - 200;
 		height -= yDiff;
 	}
 	if (height < 1)
@@ -818,8 +811,8 @@ void McgaGraphics::setYVals(int spriteHeight) {
 }
 
 void McgaGraphics::clip(byte *&source, byte *&dest, int16 &x, int16 &y) {
-	if (y < _G(clipy1)) {
-		int yCount = _G(clipy1) - y;
+	if (y < 0) {
+		int yCount = 0 - y;
 		_zoomSpriteDeltaY2 -= yCount;
 
 		--yCount;
@@ -841,8 +834,8 @@ void McgaGraphics::clip(byte *&source, byte *&dest, int16 &x, int16 &y) {
 		return;
 	}
 
-	if (x < _G(clipx1)) {
-		int xCount = _G(clipx1) - x;
+	if (x < 0) {
+		int xCount = 0 - x;
 		_zoomSpriteDeltaX2 -= xCount;
 		dest += xCount;
 
@@ -860,14 +853,14 @@ void McgaGraphics::clip(byte *&source, byte *&dest, int16 &x, int16 &y) {
 
 	if (_zoomSpriteDeltaX2 > 0) {
 		int x2 = x + _zoomSpriteDeltaX2;
-		if (x2 >= _G(clipx2)) {
-			_zoomSpriteDeltaX2 -= x2 - _G(clipx2);
+		if (x2 >= 320) {
+			_zoomSpriteDeltaX2 -= x2 - 320;
 		}
 
 		if (_zoomSpriteDeltaY2 > 0) {
 			int y2 = y + _zoomSpriteDeltaY2;
-			if (y2 >= _G(clipy2)) {
-				_zoomSpriteDeltaY2 -= y2 - _G(clipy2);
+			if (y2 >= 200) {
+				_zoomSpriteDeltaY2 -= y2 - 200;
 			}
 			if (_zoomSpriteDeltaY2 <= 0)
 				source = nullptr;
diff --git a/engines/chewy/mcga_graphics.h b/engines/chewy/mcga_graphics.h
index b994d4ae3d4..6ea11788870 100644
--- a/engines/chewy/mcga_graphics.h
+++ b/engines/chewy/mcga_graphics.h
@@ -33,12 +33,11 @@ public:
 
 	void init();
 
-	void setClip(int16 x1, int16 y1, int16 x2, int16 y2);
 	void setPointer(byte *ptr);
 
 	void setPalette(byte *palette);
 	void raster_col(int16 c, int16 r, int16 g, int16 b);
-	void fadeIn(byte *palette, int16 frames);
+	void fadeIn(byte *palette);
 	void fadeOut();
 	void set_partialpalette(const byte *palette, int16 startCol, int16 nr);
 
diff --git a/engines/chewy/rooms/room40.cpp b/engines/chewy/rooms/room40.cpp
index 00d6343a262..6e7f50570c1 100644
--- a/engines/chewy/rooms/room40.cpp
+++ b/engines/chewy/rooms/room40.cpp
@@ -118,7 +118,7 @@ void Room40::xit(int16 eib_nr) {
 				_G(out)->fadeOut();
 				hide_person();
 				setupScreen(DO_SETUP);
-				_G(out)->fadeIn(_G(pal), 0);
+				_G(out)->fadeIn(_G(pal));
 				_G(uhr)->enableTimer();
 
 				_G(mouseLeftClick) = false;
diff --git a/engines/chewy/rooms/room51.cpp b/engines/chewy/rooms/room51.cpp
index 36725d37c9e..7faf09efd4e 100644
--- a/engines/chewy/rooms/room51.cpp
+++ b/engines/chewy/rooms/room51.cpp
@@ -258,7 +258,7 @@ int16 Room51::use_door(int16 txt_nr) {
 					_G(out)->fadeOut();
 					_G(out)->setPointer(nullptr);
 					_G(out)->cls();
-					_G(out)->fadeIn(_G(pal), 0);
+					_G(out)->fadeIn(_G(pal));
 					_G(flags).NoPalAfterFlc = true;
 					_G(det)->showStaticSpr(16);
 					flic_cut(FCUT_068);


Commit: 34007cb7c24da765d946452e2cf9f0f5dd642f6e
    https://github.com/scummvm/scummvm/commit/34007cb7c24da765d946452e2cf9f0f5dd642f6e
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-05-22T19:37:51+03:00

Commit Message:
SCI: Clean up script patches for Hoyle Bridge and Children's Collection

For Hoyle Bridge, we jump directly to the Bridge screen, and it's not
possible to go back to the game selection screen, so we don't need
patches for that version.
For Children's Collection, we now use enablePatch(), which results in
cleaner code.

Changed paths:
    engines/sci/engine/script_patches.cpp


diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index a507d2c09a3..c85e768393c 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -2323,40 +2323,15 @@ static const uint16 hoyle5PatchSetScale[] = {
 // Choosing any other game than the above results in a "No script found" error.
 // The original game did not show the game selection screen, as there were
 // direct shortucts to each game.
-// Since we do show the game selection screen, we remove all the games
-// which from the ones below, which are not included in each version:
-// - Crazy Eights (script 100)
-// - Old Maid (script 200)
+// We do show the game selection screen for Children's Collection, thus we
+// disable all the games which are not included in this version:
 // - Hearts (script 300)
 // - Gin Rummy (script 400)
 // - Cribbage (script 500)
 // - Klondike / Solitaire (script 600)
 // - Bridge (script 700)
 // - Poker (script 1100)
-// - Checkers (script 1200)
 // - Backgammon (script 1300)
-static const uint16 hoyle5SignatureCrazyEights[] = {
-	SIG_MAGICDWORD,
-	0x38, 0x8e, 0x00,      // pushi 008e
-	0x76,                  // push0
-	0x38, 0xf0, 0x02,      // pushi 02f0
-	0x76,                  // push0
-	0x72, 0x9c, 0x01,      // lofsa chooseCrazy8s
-	0x4a, 0x08, 0x00,      // send  0008
-	SIG_END
-};
-
-static const uint16 hoyle5SignatureOldMaid[] = {
-	SIG_MAGICDWORD,
-	0x38, 0x8e, 0x00,      // pushi 008e
-	0x76,                  // push0
-	0x38, 0xf0, 0x02,      // pushi 02f0
-	0x76,                  // push0
-	0x72, 0x2c, 0x02,      // lofsa chooseOldMaid
-	0x4a, 0x08, 0x00,      // send  0008
-	SIG_END
-};
-
 static const uint16 hoyle5SignatureHearts[] = {
 	SIG_MAGICDWORD,
 	0x38, 0x8e, 0x00,      // pushi 008e
@@ -2423,17 +2398,6 @@ static const uint16 hoyle5SignaturePoker[] = {
 	SIG_END
 };
 
-static const uint16 hoyle5SignatureCheckers[] = {
-	SIG_MAGICDWORD,
-	0x38, 0x8e, 0x00,      // pushi 008e
-	0x76,                  // push0
-	0x38, 0xf0, 0x02,      // pushi 02f0
-	0x76,                  // push0
-	0x72, 0x1c, 0x06,      // lofsa chooseCheckers
-	0x4a, 0x08, 0x00,      // send  0008
-	SIG_END
-};
-
 static const uint16 hoyle5SignatureBackgammon[] = {
 	SIG_MAGICDWORD,
 	0x38, 0x8e, 0x00,      // pushi 008e
@@ -2506,45 +2470,13 @@ static const SciScriptPatcherEntry hoyle5Signatures[] = {
 	{  true, 64990, "increase number of save games (1/2)",         1, sci2NumSavesSignature1,           sci2NumSavesPatch1 },
 	{  true, 64990, "increase number of save games (2/2)",         1, sci2NumSavesSignature2,           sci2NumSavesPatch2 },
 	{  true, 64990, "disable change directory button",             1, sci2ChangeDirSignature,           sci2ChangeDirPatch },
-	SCI_SIGNATUREENTRY_TERMINATOR
-};
-
-//          script, description,                                      signature                         patch
-static const SciScriptPatcherEntry hoyle5ChildrensCollectionSignatures[] = {
-	{  true,     3, "remove kGetTime spin",                        1, hoyle5SignatureSpinLoop,          hoyle5PatchSpinLoop },
-	{  true,    23, "remove kGetTime spin",                        1, hoyle5SignatureSpinLoop,          hoyle5PatchSpinLoop },
-	{  true,   200, "fix setScale calls",                         11, hoyle5SetScaleSignature,          hoyle5PatchSetScale },
-	{  true,   500, "remove kGetTime spin",                        1, hoyle5SignatureSpinLoop,          hoyle5PatchSpinLoop },
-	{  true, 64937, "remove kGetTime spin",                        1, hoyle5SignatureSpinLoop,          hoyle5PatchSpinLoop },
-	{  true,   975, "disable Gin Rummy",                           1, hoyle5SignatureGinRummy,          hoyle5PatchDisableGame },
-	{  true,   975, "disable Cribbage",                            1, hoyle5SignatureCribbage,          hoyle5PatchDisableGame },
-	{  true,   975, "disable Klondike",                            1, hoyle5SignatureKlondike,          hoyle5PatchDisableGame },
-	{  true,   975, "disable Bridge",                              1, hoyle5SignatureBridge,            hoyle5PatchDisableGame },
-	{  true,   975, "disable Poker",                               1, hoyle5SignaturePoker,             hoyle5PatchDisableGame },
-	{  true,   975, "disable Hearts",                              1, hoyle5SignatureHearts,            hoyle5PatchDisableGame },
-	{  true,   975, "disable Backgammon",                          1, hoyle5SignatureBackgammon,        hoyle5PatchDisableGame },
-	SCI_SIGNATUREENTRY_TERMINATOR
-};
-
-//          script, description,                                      signature                         patch
-static const SciScriptPatcherEntry hoyle5BridgeSignatures[] = {
-	{  true,     3, "remove kGetTime spin",                        1, hoyle5SignatureSpinLoop,          hoyle5PatchSpinLoop },
-	{  true,    23, "remove kGetTime spin",                        1, hoyle5SignatureSpinLoop,          hoyle5PatchSpinLoop },
-	{  true,   500, "remove kGetTime spin",                        1, hoyle5SignatureSpinLoop,          hoyle5PatchSpinLoop },
-	{  true, 64937, "remove kGetTime spin",                        1, hoyle5SignatureSpinLoop,          hoyle5PatchSpinLoop },
-	{  true,   733, "bridge arithmetic against object ",           1, hoyle5SignatureBridgeArithmetic,  hoyle5PatchBridgeArithmetic },
-	{  true,   975, "disable Gin Rummy",                           1, hoyle5SignatureGinRummy,          hoyle5PatchDisableGame },
-	{  true,   975, "disable Cribbage",                            1, hoyle5SignatureCribbage,          hoyle5PatchDisableGame },
-	{  true,   975, "disable Klondike",                            1, hoyle5SignatureKlondike,          hoyle5PatchDisableGame },
-	{  true,   975, "disable Poker",                               1, hoyle5SignaturePoker,             hoyle5PatchDisableGame },
-	{  true,   975, "disable Hearts",                              1, hoyle5SignatureHearts,            hoyle5PatchDisableGame },
-	{  true,   975, "disable Backgammon",                          1, hoyle5SignatureBackgammon,        hoyle5PatchDisableGame },
-	{  true,   975, "disable Crazy Eights",                        1, hoyle5SignatureCrazyEights,       hoyle5PatchDisableGame },
-	{  true,   975, "disable Old Maid",                            1, hoyle5SignatureOldMaid,           hoyle5PatchDisableGame },
-	{  true,   975, "disable Checkers",                            1, hoyle5SignatureCheckers,          hoyle5PatchDisableGame },
-	{  true, 64990, "increase number of save games (1/2)",         1, sci2NumSavesSignature1,           sci2NumSavesPatch1 },
-	{  true, 64990, "increase number of save games (2/2)",         1, sci2NumSavesSignature2,           sci2NumSavesPatch2 },
-	{  true, 64990, "disable change directory button",             1, sci2ChangeDirSignature,           sci2ChangeDirPatch },
+	{ false,   975, "disable Gin Rummy",                           1, hoyle5SignatureGinRummy,          hoyle5PatchDisableGame },
+	{ false,   975, "disable Cribbage",                            1, hoyle5SignatureCribbage,          hoyle5PatchDisableGame },
+	{ false,   975, "disable Klondike",                            1, hoyle5SignatureKlondike,          hoyle5PatchDisableGame },
+	{ false,   975, "disable Bridge",                              1, hoyle5SignatureBridge,            hoyle5PatchDisableGame },
+	{ false,   975, "disable Poker",                               1, hoyle5SignaturePoker,             hoyle5PatchDisableGame },
+	{ false,   975, "disable Hearts",                              1, hoyle5SignatureHearts,            hoyle5PatchDisableGame },
+	{ false,   975, "disable Backgammon",                          1, hoyle5SignatureBackgammon,        hoyle5PatchDisableGame },
 	SCI_SIGNATUREENTRY_TERMINATOR
 };
 
@@ -22993,15 +22925,7 @@ void ScriptPatcher::processScript(uint16 scriptNr, SciSpan<byte> scriptData) {
 		break;
 #ifdef ENABLE_SCI32
 	case GID_HOYLE5:
-		if (g_sci->getResMan()->testResource(ResourceId(kResourceTypeScript, 100)) &&
-			g_sci->getResMan()->testResource(ResourceId(kResourceTypeScript, 700)))
-			signatureTable = hoyle5Signatures;
-		else if (g_sci->getResMan()->testResource(ResourceId(kResourceTypeScript, 100)) &&
-			    !g_sci->getResMan()->testResource(ResourceId(kResourceTypeScript, 700)))
-			signatureTable = hoyle5ChildrensCollectionSignatures;
-		else if (!g_sci->getResMan()->testResource(ResourceId(kResourceTypeScript, 100)) &&
-			      g_sci->getResMan()->testResource(ResourceId(kResourceTypeScript, 700)))
-			signatureTable = hoyle5BridgeSignatures;
+		signatureTable = hoyle5Signatures;
 		break;
 	case GID_GK1:
 		signatureTable = gk1Signatures;
@@ -23195,6 +23119,18 @@ void ScriptPatcher::processScript(uint16 scriptNr, SciSpan<byte> scriptData) {
 					enablePatch(signatureTable, "subtitle patch compatibility");
 				}
 				break;
+			case GID_HOYLE5:
+				if (!g_sci->getResMan()->testResource(ResourceId(kResourceTypeScript, 700))) {
+					// Hoyle 5 children's collection
+					enablePatch(signatureTable, "disable Gin Rummy");
+					enablePatch(signatureTable, "disable Cribbage");
+					enablePatch(signatureTable, "disable Klondike");
+					enablePatch(signatureTable, "disable Bridge");
+					enablePatch(signatureTable, "disable Poker");
+					enablePatch(signatureTable, "disable Hearts");
+					enablePatch(signatureTable, "disable Backgammon");
+				}
+				break;
 			case GID_KQ4:
 				if (!g_sci->getResMan()->testResource(ResourceId(kResourceTypeView, 653))) {
 					enablePatch(signatureTable, "missing waterfall view");




More information about the Scummvm-git-logs mailing list