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

Core: Some code style improvements to AStarGrid2D #81900

Merged

Conversation

dalexeev
Copy link
Member

@dalexeev dalexeev commented Sep 19, 2023

  1. Remove unused, undefined and unexposed get_width() and get_height() declarations.
  2. Replace GET_POINT_UNCHECKED() macro with _get_point_unchecked() method, for consistency and better style.
  3. Replace int64_t with int32_t since components of Vector2i and Rect2i are int32_t.
  4. Make loops consistent.

Copy link
Member

@Chaosus Chaosus left a comment

Choose a reason for hiding this comment

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

I think these int's should also been changed to int32_t for consistency, other than that I have no claim to this PR.

core/math/a_star_grid_2d.cpp Outdated Show resolved Hide resolved
core/math/a_star_grid_2d.cpp Outdated Show resolved Hide resolved
core/math/a_star_grid_2d.cpp Outdated Show resolved Hide resolved
core/math/a_star_grid_2d.cpp Outdated Show resolved Hide resolved
@dalexeev
Copy link
Member Author

dalexeev commented Sep 19, 2023

I think these int's should also been changed to int32_t for consistency

Done. Although this is not related to coordinates and Vector/Array use int.

_FORCE_INLINE_ const T &operator[](int p_index) const { return _cowdata.get(p_index); }

@akien-mga akien-mga modified the milestones: 4.x, 4.2 Sep 19, 2023
@akien-mga akien-mga merged commit 0bd49b3 into godotengine:master Sep 20, 2023
16 checks passed
@akien-mga
Copy link
Member

Thanks!

@dalexeev dalexeev deleted the core-astar-grid-2d-code-style branch September 20, 2023 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants