Skip to content
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

Cleanup DebugManager #3060

Merged
merged 4 commits into from Jun 14, 2021
Merged

Cleanup DebugManager #3060

merged 4 commits into from Jun 14, 2021

Conversation

@sluicebox
Copy link
Member

@sluicebox sluicebox commented Jun 10, 2021

I had trouble reading DebugManager to figure out recent regressions so I cleaned it up.

  • Renamed methods and members to be consistent and clearer
  • Updated doxygen comments to be in sync with method behaviors
  • Global debug channels are now automatically added by DebugManager. The code was going to a lot of effort to try to achieve that but still not always succeeding. Now it's explicit and simpler. Callers don't have to always call two methods to add channels.
  • Removed unnecessary calls to remove debug channels from Engine destructors. As of PR #3012, Engines are no longer responsible for adding their channels, so this code should have been removed from the destructors. It's redundant; runGame() already handles this.
@sluicebox sluicebox force-pushed the sluicebox:debug-cleanup branch from 36392a1 to 3ccbbb5 Jun 10, 2021
@ysj1173886760
Copy link
Contributor

@ysj1173886760 ysj1173886760 commented Jun 14, 2021

Thank you, that reverting part is correct. I didn't managed to get the total sight of this, so i made some mistakes.
Thank you for amending and optimizing those codes. I've learnt a lot though that. Much Appreciated.

@sluicebox sluicebox merged commit f2f28c4 into scummvm:master Jun 14, 2021
1 check passed
1 check passed
@codacy-production
Codacy Static Code Analysis Codacy Static Code Analysis
Details
@sluicebox
Copy link
Member Author

@sluicebox sluicebox commented Jun 14, 2021

Thanks for reviewing this!

The confusion in this class predates your changes -- channels vs flags, adding vs registering vs setting, etc. Now that all that code is in one place, those existing inconsistencies became clearer. I also like that you've got the channels managed outside of the Engine constructors and destructors.

Now that the expert has taken a look, I'm comfortable merging. =)

@sluicebox sluicebox deleted the sluicebox:debug-cleanup branch Jun 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants