[Scummvm-git-logs] scummvm branch-2-9 -> 30c7fafa8fc4050bb7eeb029bdecd4e6d9fd316c

bluegr noreply at scummvm.org
Sat Nov 16 23:54:21 UTC 2024


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

Summary:
0a5596c347 GLK: AGT: Fix unintended comparison for digits in debugout()
0b371c54e1 IMGUI: Fix some GCC const-related warnings
b0c849f382 SCUMM: Simplify width and height initialization
283616dc3d BACKENDS: 3DS: Silence "casts away qualifiers" warning.
30c7fafa8f SCUMM: MACGUI: Don't initialize Mac GUI when it's not activated


Commit: 0a5596c34769f43839338ff0182cf5bcf8b735bb
    https://github.com/scummvm/scummvm/commit/0a5596c34769f43839338ff0182cf5bcf8b735bb
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2024-11-17T01:53:51+02:00

Commit Message:
GLK: AGT: Fix unintended comparison for digits in debugout()

Typo detected in -funsigned-char builds:

  comparison is always true due to limited range of data type [-Wtype-limits]
    } else if (*s >= 0 && *s <= 9) linebuff[lp++] = ' ';
                     ^

but it's a happy accident; it's not a signedness issue, rather the code was
looking for the first non-printable control characters in the ASCII table,
instead of the numeric digits '0' to '9'.

Changed paths:
    engines/glk/agt/interface.cpp


diff --git a/engines/glk/agt/interface.cpp b/engines/glk/agt/interface.cpp
index 2e45779f202..da190463d0e 100644
--- a/engines/glk/agt/interface.cpp
+++ b/engines/glk/agt/interface.cpp
@@ -173,7 +173,7 @@ void debugout(const char *s) {
 				lp = 0;
 			} else if (*s == '\t') {
 				for (i = 0; i < 3; i++) linebuff[lp++] = ' ';
-			} else if (*s >= 0 && *s <= 9) linebuff[lp++] = ' ';
+			} else if (*s >= '0' && *s <= '9') linebuff[lp++] = ' ';
 			else linebuff[lp++] = *s;
 		}
 		linebuff[lp] = 0;


Commit: 0b371c54e1d1d6e0cc316fb3b54b57aaf1771360
    https://github.com/scummvm/scummvm/commit/0b371c54e1d1d6e0cc316fb3b54b57aaf1771360
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2024-11-17T01:53:52+02:00

Commit Message:
IMGUI: Fix some GCC const-related warnings

imgui_draw.cpp:3730: warning: cast from type 'const ImFontGlyph*' to type 'void*' casts away qualifiers [-Wcast-qual]
imgui_draw.cpp: In member function 'void ImFont::SetGlyphVisible(ImWchar, bool)':
imgui_draw.cpp:3730:44: warning: cast from type 'const ImFontGlyph*' to type 'void*' casts away qualifiers [-Wcast-qual]
 3730 |     if (ImFontGlyph* glyph = (ImFontGlyph*)(void*)FindGlyph((ImWchar)c))
      |                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

Changed paths:
    backends/imgui/imgui.cpp
    backends/imgui/imgui_demo.cpp
    backends/imgui/imgui_draw.cpp


diff --git a/backends/imgui/imgui.cpp b/backends/imgui/imgui.cpp
index 50c8d362efe..5b139e306fc 100644
--- a/backends/imgui/imgui.cpp
+++ b/backends/imgui/imgui.cpp
@@ -15234,7 +15234,7 @@ void ImGui::LoadIniSettingsFromMemory(const char* ini_data, size_t ini_size)
             line_end[-1] = 0;
             const char* name_end = line_end - 1;
             const char* type_start = line + 1;
-            char* type_end = (char*)(void*)ImStrchrRange(type_start, name_end, ']');
+            char* type_end = const_cast<char *>(ImStrchrRange(type_start, name_end, ']'));
             const char* name_start = type_end ? ImStrchrRange(type_end + 1, name_end, '[') : NULL;
             if (!type_end || !name_start)
                 continue;
@@ -21345,7 +21345,7 @@ void ImGui::ShowMetricsWindow(bool* p_open)
 
         if (TreeNode("SettingsIniData", "Settings unpacked data (.ini): %d bytes", g.SettingsIniData.size()))
         {
-            InputTextMultiline("##Ini", (char*)(void*)g.SettingsIniData.c_str(), g.SettingsIniData.Buf.Size, ImVec2(-FLT_MIN, GetTextLineHeight() * 20), ImGuiInputTextFlags_ReadOnly);
+            InputTextMultiline("##Ini", const_cast<char *>(g.SettingsIniData.c_str()), g.SettingsIniData.Buf.Size, ImVec2(-FLT_MIN, GetTextLineHeight() * 20), ImGuiInputTextFlags_ReadOnly);
             TreePop();
         }
         TreePop();
diff --git a/backends/imgui/imgui_demo.cpp b/backends/imgui/imgui_demo.cpp
index 7ed778b5783..3048b69276c 100644
--- a/backends/imgui/imgui_demo.cpp
+++ b/backends/imgui/imgui_demo.cpp
@@ -3926,7 +3926,7 @@ static void ShowDemoWindowMultiSelect(ImGuiDemoWindowData* demo_data)
                             ImGui::TableNextColumn();
                             ImGui::SetNextItemWidth(-FLT_MIN);
                             ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0, 0));
-                            ImGui::InputText("###NoLabel", (char*)(void*)item_category, strlen(item_category), ImGuiInputTextFlags_ReadOnly);
+                            ImGui::InputText("###NoLabel", const_cast<char *>(item_category), strlen(item_category), ImGuiInputTextFlags_ReadOnly);
                             ImGui::PopStyleVar();
                         }
 
diff --git a/backends/imgui/imgui_draw.cpp b/backends/imgui/imgui_draw.cpp
index acd633ebfb2..e4aa544f31c 100644
--- a/backends/imgui/imgui_draw.cpp
+++ b/backends/imgui/imgui_draw.cpp
@@ -3727,7 +3727,7 @@ bool ImFont::IsGlyphRangeUnused(unsigned int c_begin, unsigned int c_last)
 
 void ImFont::SetGlyphVisible(ImWchar c, bool visible)
 {
-    if (ImFontGlyph* glyph = (ImFontGlyph*)(void*)FindGlyph((ImWchar)c))
+    if (ImFontGlyph* glyph = const_cast<ImFontGlyph *>(FindGlyph((ImWchar)c)))
         glyph->Visible = visible ? 1 : 0;
 }
 


Commit: b0c849f382ea9216a71f719fb09c0f56ed3023f7
    https://github.com/scummvm/scummvm/commit/b0c849f382ea9216a71f719fb09c0f56ed3023f7
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2024-11-17T01:53:52+02:00

Commit Message:
SCUMM: Simplify width and height initialization

Following 381fc1fc44 (SCUMM: Fix Duplicate Branches GCC Compiler Warning),
some of the conditions can be omitted.

Changed paths:
    engines/scumm/scumm.cpp


diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 6f883a02937..25238329261 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -366,18 +366,13 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
 		break;
 	}
 
-	// Steam Win and Mac versions share the same DOS data files.
-	bool isSteamVersion = Common::String(_game.preferredTag).equalsIgnoreCase("steam");
-
 	// defaults
 	_screenWidth = 320;
 	_screenHeight = 200;
 
-	if (_game.platform == Common::kPlatformFMTowns && _game.version == 3) {	// FM-TOWNS V3 games originally use 320x240, and we have an option to trim to 200
-		_screenWidth = 320;
-		if (ConfMan.getBool("trim_fmtowns_to_200_pixels"))
-			_screenHeight = 200;
-		else
+	if (_game.platform == Common::kPlatformFMTowns && _game.version == 3) {
+		// FM-TOWNS V3 games originally use 320x240, and we have an option to trim to 200
+		if (!ConfMan.getBool("trim_fmtowns_to_200_pixels"))
 			_screenHeight = 240;
 	} else if (_game.version == 8 || _game.heversion >= 71) {
 		// COMI uses 640x480. Likewise starting from version 7.1, HE games use
@@ -387,9 +382,6 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
 	} else if (_game.platform == Common::kPlatformNES) {
 		_screenWidth = 256;
 		_screenHeight = 240;
-	} else if (!isSteamVersion && _useMacScreenCorrectHeight && _game.platform == Common::kPlatformMacintosh && _game.version >= 3) {
-		_screenWidth = 320;
-		_screenHeight = 200;
 	}
 
 #ifndef DISABLE_TOWNS_DUAL_LAYER_MODE


Commit: 283616dc3d183cd097fc6fb4e3295ac7b85cee89
    https://github.com/scummvm/scummvm/commit/283616dc3d183cd097fc6fb4e3295ac7b85cee89
Author: Michael Ball (ballm4788 at gmail.com)
Date: 2024-11-17T01:53:53+02:00

Commit Message:
BACKENDS: 3DS: Silence "casts away qualifiers" warning.

Changed paths:
    backends/platform/3ds/osystem-graphics.cpp


diff --git a/backends/platform/3ds/osystem-graphics.cpp b/backends/platform/3ds/osystem-graphics.cpp
index ffdef26b826..649e5d41335 100644
--- a/backends/platform/3ds/osystem-graphics.cpp
+++ b/backends/platform/3ds/osystem-graphics.cpp
@@ -84,7 +84,7 @@ void OSystem_3DS::init3DSGraphics() {
 	                          DISPLAY_TRANSFER_FLAGS);
 
 	// Load and bind simple default shader (shader.v.pica)
-	_dvlb = DVLB_ParseFile((u32*)shader_shbin, shader_shbin_size);
+	_dvlb = DVLB_ParseFile((u32*)const_cast<u8 *>(shader_shbin), shader_shbin_size);
 	shaderProgramInit(&_program);
 	shaderProgramSetVsh(&_program, &_dvlb->DVLE[0]);
 	C3D_BindProgram(&_program);


Commit: 30c7fafa8fc4050bb7eeb029bdecd4e6d9fd316c
    https://github.com/scummvm/scummvm/commit/30c7fafa8fc4050bb7eeb029bdecd4e6d9fd316c
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2024-11-17T01:53:53+02:00

Commit Message:
SCUMM: MACGUI: Don't initialize Mac GUI when it's not activated

Authored by @AndywinXp as a better alternative to the changes done in
PR #6240.

This way, games without original gui active never even attempt to
communicate with _macGui. This also disables _macScreen.

Changed paths:
    engines/scumm/scumm.cpp


diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 25238329261..02ecd1f6979 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1181,8 +1181,11 @@ Common::Error ScummEngine::init() {
 	if (_game.platform == Common::kPlatformMacintosh && _game.heversion == 0) {
 		Common::MacResManager resource;
 
-		_macScreen = new Graphics::Surface();
-		_macScreen->create(640, _useMacScreenCorrectHeight ? 480 : 400, Graphics::PixelFormat::createFormatCLUT8());
+		// Indy3 and LOOM *must* use the _macScreen
+		if (isUsingOriginalGUI() || _game.version == 3) {
+			_macScreen = new Graphics::Surface();
+			_macScreen->create(640, _useMacScreenCorrectHeight ? 480 : 400, Graphics::PixelFormat::createFormatCLUT8());
+		}
 
 		// \xAA is a trademark glyph in Mac OS Roman. We try that, but
 		// also the Windows version, the UTF-8 version, and just plain
@@ -1202,7 +1205,8 @@ Common::Error ScummEngine::init() {
 					macResourceFile = indyFileNames[i];
 
 					_textSurfaceMultiplier = 2;
-					_macGui = new MacGui(this, macResourceFile);
+					if (isUsingOriginalGUI())
+						_macGui = new MacGui(this, macResourceFile);
 					break;
 				}
 			}
@@ -1224,7 +1228,8 @@ Common::Error ScummEngine::init() {
 					macResourceFile = loomFileNames[i];
 
 					_textSurfaceMultiplier = 2;
-					_macGui = new MacGui(this, macResourceFile);
+					if (isUsingOriginalGUI())
+						_macGui = new MacGui(this, macResourceFile);
 					break;
 				}
 			}
@@ -1253,7 +1258,7 @@ Common::Error ScummEngine::init() {
 				GUI::MessageDialog dialog(_("Could not find the 'Monkey Island' Macintosh executable to read resources\n"
 											"and instruments from. Music and Mac GUI will be disabled."), _("OK"));
 				dialog.runModal();
-			} else {
+			} else if (isUsingOriginalGUI()) {
 				_macGui = new MacGui(this, macResourceFile);
 			}
 		} else if (_game.id == GID_INDY4 && _language != Common::JA_JPN) {
@@ -1287,7 +1292,7 @@ Common::Error ScummEngine::init() {
 											"Mac GUI will not be shown."),
 										_("OK"));
 				dialog.runModal();
-			} else {
+			} else if (isUsingOriginalGUI()) {
 				_macGui = new MacGui(this, macResourceFile);
 			}
 		} else if (_game.id == GID_MONKEY2) {
@@ -1307,7 +1312,7 @@ Common::Error ScummEngine::init() {
 											"Mac GUI will not be shown."),
 										  _("OK"));
 				dialog.runModal();
-			} else {
+			} else if (isUsingOriginalGUI()) {
 				_macGui = new MacGui(this, macResourceFile);
 			}
 		}




More information about the Scummvm-git-logs mailing list