[Scummvm-git-logs] scummvm master -> 0f362ab975990ab470fa37b003cb93ec6f0e4f37

dreammaster dreammaster at scummvm.org
Sat Apr 17 23:37:52 UTC 2021


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

Summary:
bc8c92c2f9 AGS: Replace QFG2 workarounds with generic upstream fix
0f362ab975 AGS: Apply upstream rename of vis constants


Commit: bc8c92c2f9d946254575e17096c2c65b795900fb
    https://github.com/scummvm/scummvm/commit/bc8c92c2f9d946254575e17096c2c65b795900fb
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2021-04-17T16:37:13-07:00

Commit Message:
AGS: Replace QFG2 workarounds with generic upstream fix

This applies commit b07ddea6d2a16cd4e77e687675853dbc914b15ca

Changed paths:
    engines/ags/engine/ac/gui.cpp
    engines/ags/engine/script/cc_instance.cpp


diff --git a/engines/ags/engine/ac/gui.cpp b/engines/ags/engine/ac/gui.cpp
index a8fcc58034..e336da5464 100644
--- a/engines/ags/engine/ac/gui.cpp
+++ b/engines/ags/engine/ac/gui.cpp
@@ -80,10 +80,12 @@ void GUI_SetVisible(ScriptGUI *tehgui, int isvisible) {
 }
 
 int GUI_GetVisible(ScriptGUI *tehgui) {
-	// GUI_GetVisible is slightly different from IsGUIOn, because
-	// with a mouse ypos gui it returns 1 if the GUI is enabled,
-	// whereas IsGUIOn actually checks if it is displayed
-	return _GP(guis)[tehgui->id].IsVisible() ? 1 : 0;
+	// Since 3.5.0 this always returns honest state of the Visible property as set by the game
+	if (_G(loaded_game_file_version) >= kGameVersion_350)
+		return (_GP(guis)[tehgui->id].IsVisible()) ? 1 : 0;
+	// Prior to 3.5.0 PopupY guis overrided Visible property and set it to 0 when auto-hidden;
+	// in order to simulate same behavior we only return positive if such gui is popped up:
+	return (_GP(guis)[tehgui->id].IsDisplayed()) ? 1 : 0;
 }
 
 int GUI_GetX(ScriptGUI *tehgui) {
diff --git a/engines/ags/engine/script/cc_instance.cpp b/engines/ags/engine/script/cc_instance.cpp
index f4d36da6a3..00d2f1b50f 100644
--- a/engines/ags/engine/script/cc_instance.cpp
+++ b/engines/ags/engine/script/cc_instance.cpp
@@ -1217,14 +1217,6 @@ int ccInstance::Run(int32_t curpc) {
 }
 
 ccInstance::WorkaroundResult ccInstance::checkForWorkaround(ScriptOperation &codeOp) {
-	if ((pc == 0x72bab || pc == 0x7365c) && codeOp.Instruction.Code == SCMD_CALLEXT
-			&& ::AGS::g_vm->getGameId() == "qfg2agdi") {
-		GUIMain &gui = _GP(guis)[2];
-		registers[SREG_AX] = gui.IsVisibleAndNotConcealed() ? 1 : 0;
-
-		return WorkaroundResult::WR_SKIP_FUNCTION;
-	}
-
 	return WorkaroundResult::WR_NONE;
 }
 


Commit: 0f362ab975990ab470fa37b003cb93ec6f0e4f37
    https://github.com/scummvm/scummvm/commit/0f362ab975990ab470fa37b003cb93ec6f0e4f37
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2021-04-17T16:37:14-07:00

Commit Message:
AGS: Apply upstream rename of vis constants

This applies commit b31631d749e8a8ce7dd06d47e87e0193d8fb8871

Changed paths:
    engines/ags/shared/gui/guimain.cpp
    engines/ags/shared/gui/guimain.h


diff --git a/engines/ags/shared/gui/guimain.cpp b/engines/ags/shared/gui/guimain.cpp
index 59b3344d24..472cf0b3b3 100644
--- a/engines/ags/shared/gui/guimain.cpp
+++ b/engines/ags/shared/gui/guimain.cpp
@@ -806,8 +806,8 @@ void WriteGUI(const std::vector<GUIMain> &theGuis, Stream *out) {
 void ApplyLegacyVisibility(GUIMain &gui, LegacyGUIVisState vis) {
 	// kGUIPopupMouseY had its own rules, which we practically reverted now
 	if (gui.PopupStyle == kGUIPopupMouseY) {
-		// it was only !Visible if the legacy Visibility was Concealed
-		gui.SetVisible(vis != kGUIVisibility_Concealed);
+		// it was only !Visible if the legacy Visibility was LockedOff
+		gui.SetVisible(vis != kGUIVisibility_LockedOff);
 		// and you could tell it's overridden by behavior when legacy Visibility is Off
 		gui.SetConceal(vis == kGUIVisibility_Off);
 	}
diff --git a/engines/ags/shared/gui/guimain.h b/engines/ags/shared/gui/guimain.h
index e6936a8129..3a3039ea49 100644
--- a/engines/ags/shared/gui/guimain.h
+++ b/engines/ags/shared/gui/guimain.h
@@ -58,9 +58,9 @@ namespace Shared {
 
 // Legacy GUIMain visibility state, which combined Visible property and override factor
 enum LegacyGUIVisState {
-	kGUIVisibility_Concealed = -1, // gui is hidden by command
-	kGUIVisibility_Off = 0, // gui is disabled (won't show up by command)
-	kGUIVisibility_On = 1  // gui is shown by command
+	kGUIVisibility_LockedOff = -1, // locked hidden (used by PopupMouseY guis)
+	kGUIVisibility_Off = 0,        // hidden
+	kGUIVisibility_On = 1          // shown
 };
 
 class Bitmap;




More information about the Scummvm-git-logs mailing list