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

Game loop cleanup #245

Closed
wants to merge 4 commits into from
Closed

Conversation

adam4813
Copy link
Member

@adam4813 adam4813 commented Aug 1, 2023

Clang suggested code quality cleanups and general code quality cleanups from experience

Description

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@adam4813 adam4813 requested a review from Meisaka August 1, 2023 00:51
@adam4813
Copy link
Member Author

adam4813 commented Aug 1, 2023

This branch has been stale for a bit, so I want to review the changes before asking for review

@adam4813 adam4813 marked this pull request as draft August 1, 2023 00:52
@@ -203,7 +193,7 @@ eid PhysicsSystem::RayCastMousePick(
this->last_rayvalid = false;
this->last_entity_hit = 0;

CollisionBody* body = static_cast<CollisionBody*>(body_iter->second->getUserPointer());
auto* body = static_cast<CollisionBody*>(body_iter->second->getUserPointer());
Copy link
Member Author

Choose a reason for hiding this comment

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

Suggestion from code quality tools to use auto since the name of the type is already on the initialization side.

@@ -71,6 +71,8 @@ template <typename ID_T, typename T> class Multiton {
*/
static void Remove(const ID_T id) { instances.erase(id); }

static const std::map<ID_T, T>& Instances() { return instances; }
Copy link
Member Author

Choose a reason for hiding this comment

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

Allows better iteration with range-based for loops

@adam4813 adam4813 marked this pull request as ready for review August 8, 2023 17:12
@adam4813
Copy link
Member Author

adam4813 commented Aug 8, 2023

The last commit is just whitespace changes, so CI was skipped. I will bypass to merge, unless other changes are requested

@adam4813 adam4813 closed this Nov 12, 2023
@adam4813 adam4813 deleted the game-loop-cleanup branch November 12, 2023 03:33
@adam4813
Copy link
Member Author

Moved to branch in this repo

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