[Scummvm-git-logs] scummvm master -> 037393a289bcb428dd687360198179668985ac4c

digitall noreply at scummvm.org
Tue Jun 28 21:54:44 UTC 2022


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

Summary:
037393a289 SAGA2: Remove Dead / Unused Debug Code from Tile Classes


Commit: 037393a289bcb428dd687360198179668985ac4c
    https://github.com/scummvm/scummvm/commit/037393a289bcb428dd687360198179668985ac4c
Author: D G Turner (digitall at scummvm.org)
Date: 2022-06-28T22:53:25+01:00

Commit Message:
SAGA2: Remove Dead / Unused Debug Code from Tile Classes

This code was causing various GCC compiler warnings including for
the DEBUG symbol value being implicitly 0 due to not being defined.

Changed paths:
    engines/saga2/tilemode.cpp
    engines/saga2/tilevect.h


diff --git a/engines/saga2/tilemode.cpp b/engines/saga2/tilemode.cpp
index cb64108c45c..95152a45706 100644
--- a/engines/saga2/tilemode.cpp
+++ b/engines/saga2/tilemode.cpp
@@ -49,10 +49,6 @@
 
 namespace Saga2 {
 
-#define TEST1           1           //  enable test code
-#define TEST2           1
-#define TEST3           1
-
 #define CHEATMOVE       1           // For moving with keypad in 8 directions
 
 /* ===================================================================== *
@@ -111,13 +107,6 @@ void moveActors(int32 deltaTime);
 
 void updateMainDisplay();
 
-#if DEBUG
-void soundTest1();
-void soundTest2();
-void voiceTest1();
-void voiceTest2();
-#endif
-
 void toggleMusic();
 
 #if CHEATMOVE
@@ -990,19 +979,10 @@ void TileModeHandleKey(int16 key, int16 qual) {
 		toggleMusic();
 		break;
 
-
-#if DEBUG
-	case 'q':
-	case 0x1b:
-		endGame();
-		break;
-
-#else
-	case 0x1b:
+	case 0x1b: // Escape key
 		if (uiKeysEnabled)
 			OptionsDialog();
 		break;
-#endif
 
 	default:
 		if (uiKeysEnabled)
@@ -1011,19 +991,6 @@ void TileModeHandleKey(int16 key, int16 qual) {
 	}
 }
 
-//  A debugging function to show the queue of recent mouse events.
-
-#if DEBUG
-static char mouseHistory[33];
-
-void showMouseEvent(char eventType) {
-	memmove(mouseHistory + 1, mouseHistory, 31);
-	mouseHistory[0] = eventType;
-	mouseHistory[32] = '\0';
-	WriteStatusF(5, mouseHistory);
-}
-#endif
-
 //-----------------------------------------------------------------------
 //	Handle mouse actions on the tile map "control".
 
@@ -1226,12 +1193,6 @@ static APPFUNC(cmdClickTileMap) {
 						((gGenericControl *)ev.panel)->disableDblClick();
 					}
 				}
-
-#if DEBUG && TEST1
-				if (isActor(pickedObject))
-					pickedActor = pickedObject;
-#endif
-
 			}
 			//  We're not pointing at an object and the mouse cursor
 			//  does not have an object
diff --git a/engines/saga2/tilevect.h b/engines/saga2/tilevect.h
index d4265a99995..7a12ee72dc1 100644
--- a/engines/saga2/tilevect.h
+++ b/engines/saga2/tilevect.h
@@ -49,18 +49,13 @@ inline TilePoint rightVector(TilePoint tp, bool which = 0) {
 // Routine to force the magnitude of a vector to a value
 
 inline void setMagnitude(TilePoint &tp, int32 newMag) {
-#if DEBUG
-	assert(tp.magnitude());
-#else
-	if (tp.magnitude() == 0)
+	if (tp.magnitude()) {
+		int32 nu = (tp.u * newMag) / tp.magnitude();
+		int32 nv = (tp.v * newMag) / tp.magnitude();
+		tp = TilePoint(nu, nv, tp.z);
+	} else {
 		tp = TilePoint(1, 1, 0);
-#endif
-	//if ( tp.magnitude() )
-	//{
-	int32 nu = (tp.u * newMag) / tp.magnitude();
-	int32 nv = (tp.v * newMag) / tp.magnitude();
-	tp = TilePoint(nu, nv, tp.z);
-	//}
+	}
 }
 
 // returns an arbitrary 'side' designation for a line and a point




More information about the Scummvm-git-logs mailing list