[Scummvm-git-logs] scummvm master -> 064684fd16c752be1bdd901f11bb272510d1d038

digitall noreply at scummvm.org
Wed Mar 2 10:02:22 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:
649ad6f9a6 AGS: Remove Duplicate Definition from Allegro System Header
f0c0ad80dd AGS: Remove Redundant Code Branch in Legacy Route Finder
064684fd16 AGS: Fix GCC Duplicate Branch Warning in Allegro Fixed Point Code


Commit: 649ad6f9a6e977a7a347380aab1aa17ed4eb1ac4
    https://github.com/scummvm/scummvm/commit/649ad6f9a6e977a7a347380aab1aa17ed4eb1ac4
Author: D G Turner (digitall at scummvm.org)
Date: 2022-03-02T09:57:27Z

Commit Message:
AGS: Remove Duplicate Definition from Allegro System Header

This was causing GCC warnings when -Wduplicated-branches was defined.

Changed paths:
    engines/ags/engine/gfx/ali_3d_scummvm.cpp
    engines/ags/engine/platform/scummvm/scummvm_platform_driver.cpp
    engines/ags/lib/allegro/system.h


diff --git a/engines/ags/engine/gfx/ali_3d_scummvm.cpp b/engines/ags/engine/gfx/ali_3d_scummvm.cpp
index beae50ce4d6..90bf5ceee7a 100644
--- a/engines/ags/engine/gfx/ali_3d_scummvm.cpp
+++ b/engines/ags/engine/gfx/ali_3d_scummvm.cpp
@@ -114,7 +114,7 @@ bool ScummVMRendererGraphicsDriver::SetDisplayMode(const DisplayMode &mode) {
 	if (!IsModeSupported(mode))
 		return false;
 
-	const int driver = mode.Windowed ? GFX_SCUMMVM : GFX_SCUMMVM_FULLSCREEN;
+	const int driver = GFX_SCUMMVM;
 	if (set_gfx_mode(driver, mode.Width, mode.Height, mode.ColorDepth) != 0)
 		return false;
 
diff --git a/engines/ags/engine/platform/scummvm/scummvm_platform_driver.cpp b/engines/ags/engine/platform/scummvm/scummvm_platform_driver.cpp
index 3d627f08a35..e083bfd2963 100644
--- a/engines/ags/engine/platform/scummvm/scummvm_platform_driver.cpp
+++ b/engines/ags/engine/platform/scummvm/scummvm_platform_driver.cpp
@@ -146,7 +146,7 @@ void ScummVMPlatformDriver::UnlockMouse() {
 
 void ScummVMPlatformDriver::GetSystemDisplayModes(std::vector<Engine::DisplayMode> &dms) {
 	dms.clear();
-	GFX_MODE_LIST *gmlist = get_gfx_mode_list(GFX_SCUMMVM_FULLSCREEN);
+	GFX_MODE_LIST *gmlist = get_gfx_mode_list(GFX_SCUMMVM);
 	for (int i = 0; i < gmlist->num_modes; ++i) {
 		const GFX_MODE &m = gmlist->mode[i];
 		dms.push_back(Engine::DisplayMode(Engine::GraphicResolution(m.width, m.height, m.bpp)));
diff --git a/engines/ags/lib/allegro/system.h b/engines/ags/lib/allegro/system.h
index b091bcee2b7..de985ad56fb 100644
--- a/engines/ags/lib/allegro/system.h
+++ b/engines/ags/lib/allegro/system.h
@@ -38,7 +38,6 @@ namespace AGS3 {
 #define SYSTEM_NONE        AL_ID('N','O','N','E')
 
 #define GFX_SCUMMVM             AL_ID('S', 'C', 'V', 'M')
-#define GFX_SCUMMVM_FULLSCREEN  AL_ID('S', 'C', 'V', 'M')
 
 #define SWITCH_NONE           0
 #define SWITCH_PAUSE          1


Commit: f0c0ad80dd76f684e1b6dd65b95405e1a23ae624
    https://github.com/scummvm/scummvm/commit/f0c0ad80dd76f684e1b6dd65b95405e1a23ae624
Author: D G Turner (digitall at scummvm.org)
Date: 2022-03-02T09:58:51Z

Commit Message:
AGS: Remove Redundant Code Branch in Legacy Route Finder

This causes GCC warnings when -Wduplicated-branches is defined.

Changed paths:
    engines/ags/engine/ac/route_finder_impl_legacy.cpp


diff --git a/engines/ags/engine/ac/route_finder_impl_legacy.cpp b/engines/ags/engine/ac/route_finder_impl_legacy.cpp
index 34291ac0237..3d74db313fc 100644
--- a/engines/ags/engine/ac/route_finder_impl_legacy.cpp
+++ b/engines/ags/engine/ac/route_finder_impl_legacy.cpp
@@ -214,8 +214,11 @@ static int is_route_possible(int fromx, int fromy, int tox, int toy, Bitmap *wss
 		walk_area_granularity[dd] /= walk_area_times[dd];
 		if (walk_area_granularity[dd] <= 4)
 			walk_area_granularity[dd] = 2;
+		// NB: Since MAX_GRANULARITY is 3, the following code is redundant causing compiler warnings
+#if 0
 		else if (walk_area_granularity[dd] <= 15)
 			walk_area_granularity[dd] = 3;
+#endif
 		else
 			walk_area_granularity[dd] = MAX_GRANULARITY;
 


Commit: 064684fd16c752be1bdd901f11bb272510d1d038
    https://github.com/scummvm/scummvm/commit/064684fd16c752be1bdd901f11bb272510d1d038
Author: D G Turner (digitall at scummvm.org)
Date: 2022-03-02T10:01:09Z

Commit Message:
AGS: Fix GCC Duplicate Branch Warning in Allegro Fixed Point Code

Changed paths:
    engines/ags/lib/allegro/fixed.cpp


diff --git a/engines/ags/lib/allegro/fixed.cpp b/engines/ags/lib/allegro/fixed.cpp
index e1797b2e7b5..317cdee8b58 100644
--- a/engines/ags/lib/allegro/fixed.cpp
+++ b/engines/ags/lib/allegro/fixed.cpp
@@ -105,11 +105,16 @@ fixed fixdiv(fixed x, fixed y) {
 }
 
 int fixfloor(fixed x) {
+	// FIXME: GCC warning "this condition has identical branches [-Wduplicated-branches]" on this code i.e. both branches are functionally identical. Remove?
+#if 0
 	/* (x >> 16) is not portable */
 	if (x >= 0)
 		return (x >> 16);
 	else
 		return ~((~x) >> 16);
+#else
+	return (x >> 16);
+#endif
 }
 
 




More information about the Scummvm-git-logs mailing list