Skip to content

Conversation

@Mosch0512
Copy link
Contributor

RenderDebugInfo (FPS, mouse position, camera angles) is now:

  • Always on in Debug builds
  • Off by default in Release builds, toggle with $fpscounter on/off

The $fpscounter command is checked before the $fps prefix to avoid a crash from trying to parse "ounter on" as a float.

RenderDebugInfo (FPS, mouse position, camera angles) is now:
- Always on in Debug builds
- Off by default in Release builds, toggle with $fpscounter on/off

The $fpscounter command is checked before the $fps prefix to avoid
a crash from trying to parse "ounter on" as a float.
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Mosch0512, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a new mechanism to control the visibility of the debug information overlay (showing FPS, mouse position, and camera angles) at runtime. Previously, this overlay was controlled by compile-time preprocessor directives. Now, it is always enabled in Debug builds and off by default in Release builds, with the added ability to toggle its state using new console commands. This enhances flexibility for testing and debugging in various build configurations and prevents parsing errors with related commands.

Highlights

  • Runtime Debug Info Control: Introduced a new static boolean g_bShowDebugInfo in SceneManager.cpp to control the visibility of the debug information overlay (FPS, mouse position, camera angles) at runtime.
  • Conditional Default Visibility: The g_bShowDebugInfo flag is initialized to true for Debug builds and false for Release builds, ensuring the debug overlay is visible by default only in debug environments.
  • New Toggle Function: Added a SetShowDebugInfo function in SceneManager.cpp to allow programmatic control over the g_bShowDebugInfo flag.
  • Dynamic Debug Rendering: Modified the RenderDebugInfo function in SceneManager.cpp to conditionally render the debug overlay based on the g_bShowDebugInfo flag, replacing previous compile-time preprocessor checks with a runtime check.
  • Console Command Integration: Implemented new console commands $fpscounter on and $fpscounter off in muConsoleDebug.cpp to allow users to toggle the debug information overlay at runtime.
  • Command Priority Fix: Prioritized the $fpscounter command checks over the existing $fps command in muConsoleDebug.cpp to prevent potential parsing crashes.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • src/source/Scenes/SceneManager.cpp
    • Added a static boolean g_bShowDebugInfo to manage the debug overlay's visibility, defaulting to true in Debug builds and false in Release builds.
    • Introduced void SetShowDebugInfo(bool enabled) to allow external modification of g_bShowDebugInfo.
    • Updated RenderDebugInfo() to check g_bShowDebugInfo before rendering, effectively moving the debug overlay's control from compile-time to runtime.
    • Removed the #if defined(_DEBUG) || ... preprocessor block around the RenderDebugInfo body.
  • src/source/Utilities/Log/muConsoleDebug.cpp
    • Implemented handling for new console commands: $fpscounter on and $fpscounter off, which call SetShowDebugInfo to toggle the debug overlay.
    • Reordered command checks to ensure $fpscounter commands are processed before the $fps command to avoid parsing conflicts.
Activity
  • No human activity (comments, reviews, etc.) has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a useful chat command $fpscounter to toggle the debug information overlay, which is a great addition for debugging in release builds. The implementation is clear and correctly uses a runtime flag controlled by the new command.

My main feedback is on the command handling logic in muConsoleDebug.cpp, where there's an opportunity to reduce code duplication. I've left a specific suggestion for that.

Additionally, for better code organization and type safety, consider declaring SetShowDebugInfo in a header file (like SceneManager.h) and including it where needed, instead of using extern in the .cpp file. This would make dependencies between modules more explicit.

Overall, a good and useful change.

Comment on lines +82 to +94
if (strCommand.compare(L"$fpscounter on") == 0)
{
extern void SetShowDebugInfo(bool);
SetShowDebugInfo(true);
return true;
}

if (strCommand.compare(L"$fpscounter off") == 0)
{
extern void SetShowDebugInfo(bool);
SetShowDebugInfo(false);
return true;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The two if statements for handling $fpscounter on and $fpscounter off can be combined into a single, more concise block. This reduces code duplication and improves readability by handling both cases together and using a boolean expression to set the value.

Suggested change
if (strCommand.compare(L"$fpscounter on") == 0)
{
extern void SetShowDebugInfo(bool);
SetShowDebugInfo(true);
return true;
}
if (strCommand.compare(L"$fpscounter off") == 0)
{
extern void SetShowDebugInfo(bool);
SetShowDebugInfo(false);
return true;
}
if (strCommand == L"$fpscounter on" || strCommand == L"$fpscounter off")
{
extern void SetShowDebugInfo(bool);
SetShowDebugInfo(strCommand == L"$fpscounter on");
return true;
}

@Mosch0512 Mosch0512 closed this Feb 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant