[Scummvm-git-logs] scummvm master -> ed2d89fedde0555937adb0056f416194b1cfffbb

digitall noreply at scummvm.org
Mon Jul 18 21:19:14 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:
ed2d89fedd SAGA2: Remove Undefined DEBUG Macro Symbol Usage from Automap


Commit: ed2d89fedde0555937adb0056f416194b1cfffbb
    https://github.com/scummvm/scummvm/commit/ed2d89fedde0555937adb0056f416194b1cfffbb
Author: D G Turner (digitall at scummvm.org)
Date: 2022-07-18T22:17:28+01:00

Commit Message:
SAGA2: Remove Undefined DEBUG Macro Symbol Usage from Automap

This generates a warning if GCC is passed -Wundef.

This will now allow the Automap cheat functionality to be enabled
at runtime via the debug console when code for this is added.

Changed paths:
    engines/saga2/automap.cpp
    engines/saga2/automap.h


diff --git a/engines/saga2/automap.cpp b/engines/saga2/automap.cpp
index f3dfaf00897..e9f6376cfb2 100644
--- a/engines/saga2/automap.cpp
+++ b/engines/saga2/automap.cpp
@@ -49,10 +49,6 @@ extern GameWorld            *currentWorld;
 
 requestInfo     rInfo;
 
-#if DEBUG
-bool autoMapCheat = false;
-#endif
-
 static AutoMap     *pAutoMap = nullptr;
 
 /* ===================================================================== *
@@ -178,6 +174,7 @@ AutoMap::AutoMap(const Rect16 box,
 
 	_trackPos = getCenterActor()->getLocation();
 
+	_autoMapCheat = false; // FIXME: Allow setting from debug console
 }
 
 // ------------------------------------------------------------------------
@@ -495,11 +492,7 @@ void AutoMap::createSmallMap() {
 			uint16  mtile = mapRow[v];
 
 			if (mtile & metaTileVisited)
-				if (
-#if DEBUG
-				    autoMapCheat ||
-#endif
-				    (mtile & metaTileVisited)) {
+				if (_autoMapCheat || (mtile & metaTileVisited)) {
 					// get the tile data
 					map.data = &_summaryData[(mtile & ~metaTileVisited) << 6];
 
diff --git a/engines/saga2/automap.h b/engines/saga2/automap.h
index 92e3b27e460..7738e7b73ba 100644
--- a/engines/saga2/automap.h
+++ b/engines/saga2/automap.h
@@ -57,6 +57,8 @@ private:
 	uint8   *_summaryData;
 	Rect16  _sumMapArea;
 
+	bool _autoMapCheat;
+
 public:
 	AutoMap(const Rect16 box,
 	         uint8 *summary,




More information about the Scummvm-git-logs mailing list