[Scummvm-git-logs] scummvm master -> 8dad9a782a9bfcfb86ff13a69136147a90aad0aa

bluegr noreply at scummvm.org
Tue Jun 21 14:06:08 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:
49b03e480a CHEWY: More renaming for the dialog closeup code
c8e42edb6c CHEWY: Cleanup loadDialogCloseup()
8dad9a782a CHEWY: Clear pending events when starting a dialog closeup - bug #13593


Commit: 49b03e480ab744038185490de61f0a6ac57a9b90
    https://github.com/scummvm/scummvm/commit/49b03e480ab744038185490de61f0a6ac57a9b90
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-06-21T17:05:27+03:00

Commit Message:
CHEWY: More renaming for the dialog closeup code

Changed paths:
    engines/chewy/globals.h
    engines/chewy/main.cpp
    engines/chewy/menus.cpp
    engines/chewy/rooms/room41.cpp
    engines/chewy/t_event.cpp


diff --git a/engines/chewy/globals.h b/engines/chewy/globals.h
index 98a703125c8..b59250aec34 100644
--- a/engines/chewy/globals.h
+++ b/engines/chewy/globals.h
@@ -415,9 +415,9 @@ void remove_inventory(int16 nr);
 void getDisplayCoord(int16 *x, int16 *y, int16 nr);
 void calcTxtXy(int16 *x, int16 *y, char *txtAdr, int16 txtNr);
 void calcTxtXy(int16 *x, int16 *y, Common::StringArray &desc);
-void adsMenu();
+void handleDialogCloseupMenu();
 
-void stop_ads_dialog();
+void stopDialogCloseupDialog();
 
 void play_scene_ani(int16 nr, int16 mode);
 
@@ -447,7 +447,7 @@ int16 atsAction(int16 txtNr, int16 txtMode, int16 MODE);
 
 void selectDialogOption(int16 diaNr, int16 blkNr, int16 strEndNr);
 
-void ads_ende(int16 diaNr, int16 blkNr, int16 strEndNr);
+void endDialogCloseup(int16 diaNr, int16 blkNr, int16 strEndNr);
 
 void atdsStringStart(int16 diaNr, int16 strNr, int16 personNr,
                        int16 mode);
diff --git a/engines/chewy/main.cpp b/engines/chewy/main.cpp
index f5926167cd5..eec36498e90 100644
--- a/engines/chewy/main.cpp
+++ b/engines/chewy/main.cpp
@@ -487,7 +487,7 @@ void setupScreen(SetupScreenMode mode) {
 		}
 
 		if (_G(flags).DialogCloseup)
-			adsMenu();
+			handleDialogCloseupMenu();
 		if (_G(mouseLeftClick)) {
 			if (_G(menu_item) == CUR_WALK) {
 				if (_G(cur_ausgang_flag)) {
diff --git a/engines/chewy/menus.cpp b/engines/chewy/menus.cpp
index 74e011769b7..7c32d53c9ac 100644
--- a/engines/chewy/menus.cpp
+++ b/engines/chewy/menus.cpp
@@ -248,7 +248,7 @@ void autoMenu(int16 *x, int16 *y, int16 lineNr, int16 height, char *text, int16
 
 #define ADS_WIN 0,153,20,3,60,1
 
-void adsMenu() {
+void handleDialogCloseupMenu() {
 	int16 curYStart;
 	int16 col;
 
@@ -294,8 +294,8 @@ void adsMenu() {
 				DialogCloseupNextBlock *an_blk = _G(atds)->dialogCloseupItemChoice(_G(ads_dia_nr), _G(ads_blk_nr), curY);
 				if (an_blk->_blkNr == -1) {
 					selectDialogOption(_G(ads_dia_nr), _G(ads_blk_nr), an_blk->_endNr);
-					ads_ende(_G(ads_dia_nr), _G(ads_blk_nr), an_blk->_endNr);
-					stop_ads_dialog();
+					endDialogCloseup(_G(ads_dia_nr), _G(ads_blk_nr), an_blk->_endNr);
+					stopDialogCloseupDialog();
 				} else {
 					an_blk = _G(atds)->calcNextDialogCloseupBlock(_G(ads_dia_nr), _G(ads_blk_nr), curY);
 					selectDialogOption(_G(ads_dia_nr), _G(ads_blk_nr), an_blk->_endNr);
@@ -316,7 +316,7 @@ void adsMenu() {
 	}
 }
 
-void stop_ads_dialog() {
+void stopDialogCloseupDialog() {
 	aadWait(-1);
 	_G(gameState).DispFlag = _G(ads_tmp_dsp);
 	_G(cur_display) = true;
diff --git a/engines/chewy/rooms/room41.cpp b/engines/chewy/rooms/room41.cpp
index 5c3362175a1..bc742d4687f 100644
--- a/engines/chewy/rooms/room41.cpp
+++ b/engines/chewy/rooms/room41.cpp
@@ -245,7 +245,7 @@ void Room41::sub_dia() {
 	if (_G(gameState).R41LolaOk) {
 		startAadWait(163);
 		_G(atds)->hideDialogCloseupItem(11, 0, 2);
-		stop_ads_dialog();
+		stopDialogCloseupDialog();
 		autoMove(5, P_CHEWY);
 		new_invent_2_cur(PAPIER_INV);
 
diff --git a/engines/chewy/t_event.cpp b/engines/chewy/t_event.cpp
index be9082c5de5..c2e104d2056 100644
--- a/engines/chewy/t_event.cpp
+++ b/engines/chewy/t_event.cpp
@@ -1160,7 +1160,7 @@ void selectDialogOption(int16 diaNr, int16 blkNr, int16 strEndNr) {
 				Room41::sub_dia();
 			} else if (blkNr == 0 && strEndNr == 3) {
 				_G(gameState).R41RepairInfo = true;
-				stop_ads_dialog();
+				stopDialogCloseupDialog();
 			}
 			break;
 
@@ -1173,7 +1173,7 @@ void selectDialogOption(int16 diaNr, int16 blkNr, int16 strEndNr) {
 		case 15:
 			if (blkNr == 1 && strEndNr == 0) {
 				_G(gameState).R55Job = true;
-				stop_ads_dialog();
+				stopDialogCloseupDialog();
 			}
 			break;
 
@@ -1212,7 +1212,7 @@ void selectDialogOption(int16 diaNr, int16 blkNr, int16 strEndNr) {
 	}
 }
 
-void ads_ende(int16 diaNr, int16 blkNr, int16 strEndNr) {
+void endDialogCloseup(int16 diaNr, int16 blkNr, int16 strEndNr) {
 	switch (diaNr) {
 	case 0:
 		_G(flags).AutoAniPlay = false;


Commit: c8e42edb6c7d6124894b721f3a0d7f7961ebfd17
    https://github.com/scummvm/scummvm/commit/c8e42edb6c7d6124894b721f3a0d7f7961ebfd17
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-06-21T17:05:27+03:00

Commit Message:
CHEWY: Cleanup loadDialogCloseup()

Changed paths:
    engines/chewy/t_event.cpp


diff --git a/engines/chewy/t_event.cpp b/engines/chewy/t_event.cpp
index c2e104d2056..4b4d592d19e 100644
--- a/engines/chewy/t_event.cpp
+++ b/engines/chewy/t_event.cpp
@@ -30,12 +30,8 @@
 namespace Chewy {
 
 int16 loadDialogCloseup(int16 diaNr) {
-	int16 ret = false;
-
 	if (_G(flags).DialogCloseup == false) {
-		bool tmp = _G(atds)->startDialogCloseup(diaNr);
-		if (tmp == true) {
-			ret = true;
+		if (_G(atds)->startDialogCloseup(diaNr)) {
 			_G(ads_blk_nr) = 0;
 			_G(dialogCloseupItemPtr) = _G(atds)->dialogCloseupItemPtr(diaNr, _G(ads_blk_nr), &_G(ads_item_nr));
 			_G(flags).DialogCloseup = true;
@@ -47,9 +43,10 @@ int16 loadDialogCloseup(int16 diaNr) {
 			_G(ads_dia_nr) = diaNr;
 			_G(talk_start_ani) = -1;
 			_G(talk_hide_static) = -1;
+			return true;
 		}
 	}
-	return ret;
+	return false;
 }
 
 void setSsiPos() {


Commit: 8dad9a782a9bfcfb86ff13a69136147a90aad0aa
    https://github.com/scummvm/scummvm/commit/8dad9a782a9bfcfb86ff13a69136147a90aad0aa
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-06-21T17:05:27+03:00

Commit Message:
CHEWY: Clear pending events when starting a dialog closeup - bug #13593

Changed paths:
    engines/chewy/sprite.cpp


diff --git a/engines/chewy/sprite.cpp b/engines/chewy/sprite.cpp
index d119d99dfac..93c80bea60c 100644
--- a/engines/chewy/sprite.cpp
+++ b/engines/chewy/sprite.cpp
@@ -575,7 +575,12 @@ void startDialogCloseupWait(int16 diaNr) {
 	if (!_G(flags).DialogCloseup) {
 		_G(menu_item) = CUR_TALK;
 		cursorChoice(_G(menu_item));
+		_G(minfo).button = 0;
+		g_events->_kbInfo._keyCode = '\0';
+		g_events->_kbInfo._scanCode = Common::KEYCODE_INVALID;
+
 		loadDialogCloseup(diaNr);
+
 		while (_G(flags).DialogCloseup && !SHOULD_QUIT) {
 			setupScreen(DO_SETUP);
 		}




More information about the Scummvm-git-logs mailing list