[Scummvm-git-logs] scummvm master -> 9fe230017d4ae2df52f18000b4344561a1801535

hax0kartik noreply at scummvm.org
Tue Nov 14 16:00:37 UTC 2023


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:
9fe230017d CRAB: Fix FPS being shown unnecessarily.


Commit: 9fe230017d4ae2df52f18000b4344561a1801535
    https://github.com/scummvm/scummvm/commit/9fe230017d4ae2df52f18000b4344561a1801535
Author: Aditya (adityamurali003 at gmail.com)
Date: 2023-11-14T21:30:32+05:30

Commit Message:
CRAB: Fix FPS being shown unnecessarily.

Now fps is only shown if the user types "draw fps" in debugger console.

Changed paths:
    engines/crab/app.cpp
    engines/crab/console.cpp
    engines/crab/crab.h


diff --git a/engines/crab/app.cpp b/engines/crab/app.cpp
index 2a3e83ae5f2..c8d5e166199 100644
--- a/engines/crab/app.cpp
+++ b/engines/crab/app.cpp
@@ -150,8 +150,8 @@ void App::run() {
 			} else
 				++fpscount;
 
-			if (currentStateId >= 0)
-				g_engine->_textManager->draw(0, 0, numberToString(fpsval).c_str(), 0);
+		if ((g_engine->_debugDraw & DRAW_FPS) && currentStateId >= 0)
+			g_engine->_textManager->draw(0, 0, numberToString(fpsval).c_str(), 0);
 
 		g_engine->_screen->update();
 
diff --git a/engines/crab/console.cpp b/engines/crab/console.cpp
index c1abb26dee5..2e1b9851fc0 100644
--- a/engines/crab/console.cpp
+++ b/engines/crab/console.cpp
@@ -48,10 +48,12 @@ bool Console::cmdDraw(int argc, const char **argv) {
 				g_engine->_debugDraw |= DRAW_SPRITE_BOUNDS;
 			else if (!scumm_stricmp(argv[i], "PATHING"))
 				g_engine->_debugDraw |= DRAW_PATHING;
+			else if (!scumm_stricmp(argv[i], "FPS"))
+				g_engine->_debugDraw |= DRAW_FPS;
 			else if (!scumm_stricmp(argv[i], "ALL"))
-				g_engine->_debugDraw = DRAW_TMX | DRAW_PROP_BOUNDS | DRAW_SPRITE_BOUNDS | DRAW_PATHING;
+				g_engine->_debugDraw = DRAW_TMX | DRAW_PROP_BOUNDS | DRAW_SPRITE_BOUNDS | DRAW_PATHING | DRAW_FPS;
 			else
-				debugPrintf("Valid parameters are 'TMX', 'PROPS', 'SPRITE', 'PATHING', 'ALL' or 'OFF'\n");
+				debugPrintf("Valid parameters are 'TMX', 'PROPS', 'SPRITE', 'PATHING', 'FPS', 'ALL' or 'OFF'\n");
 		}
 	}
 	return true;
diff --git a/engines/crab/crab.h b/engines/crab/crab.h
index 4fe57b0274e..da7d6560255 100644
--- a/engines/crab/crab.h
+++ b/engines/crab/crab.h
@@ -83,7 +83,8 @@ enum DebugDraw {
 	DRAW_TMX = 1 << 0,
 	DRAW_PROP_BOUNDS = 1 << 1,
 	DRAW_SPRITE_BOUNDS = 1 << 2,
-	DRAW_PATHING = 1 << 3
+	DRAW_PATHING = 1 << 3,
+	DRAW_FPS = 1 << 4
 };
 
 class CrabEngine : public Engine {




More information about the Scummvm-git-logs mailing list