-
Notifications
You must be signed in to change notification settings - Fork 166
Add $fpscounter chat command to toggle debug info overlay #285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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.
Summary of ChangesHello @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
🧠 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
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this 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.
| 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; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| 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; | |
| } |
RenderDebugInfo (FPS, mouse position, camera angles) is now:
The $fpscounter command is checked before the $fps prefix to avoid a crash from trying to parse "ounter on" as a float.