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 visibility module #9850

Merged
merged 3 commits into from
Sep 19, 2023
Merged

Cleanup visibility module #9850

merged 3 commits into from
Sep 19, 2023

Conversation

nicopap
Copy link
Contributor

@nicopap nicopap commented Sep 19, 2023

Objective

  • check_visibility system in bevy_render had an Option<&NoFrustumCulling> that could be replaced by Has, which is theoretically faster and semantically more correct.
  • It also had some awkward indenting due to very large closure argument lists.
  • Some of the tests could be written more concisely

Solution

Use Has, move the tuple destructuring in a let binding, create a function for the tests.

Note to reviewers

Enable the "no white space diff" in the diff viewer to have a more meaningful diff in the check_visibility system.
In the "Files changed" view, click on the little cog right of the "Jump to" text, on the row where the "Review changes" button is. then enable the "Hide whitespace" checkbox and click reload.


Migration Guide

  • The check_visibility system's Option<&NoFrustumCulling> parameter has been replaced by Has<NoFrustumCulling>, if you were calling it manually, you should change the type to match it

- Use `Has<Foo>` instead of `Option<&Foo>`
- Move tuple unstructuring outside of closure argument to remove one
  indentation level
@nicopap nicopap added A-Rendering Drawing game state to the screen C-Code-Quality A section of code that is hard to understand or change C-Breaking-Change A breaking change to Bevy's public API that needs to be noted in a migration guide labels Sep 19, 2023
Co-authored-by: Rob Parrett <robparrett@gmail.com>
@mockersf mockersf added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Sep 19, 2023
@mockersf mockersf added this pull request to the merge queue Sep 19, 2023
Merged via the queue into bevyengine:main with commit 692ef95 Sep 19, 2023
22 checks passed
@nicopap nicopap deleted the has-no-cull branch September 20, 2023 13:07
rdrpenguin04 pushed a commit to rdrpenguin04/bevy that referenced this pull request Jan 9, 2024
# Objective

- `check_visibility` system in `bevy_render` had an
`Option<&NoFrustumCulling>` that could be replaced by `Has`, which is
theoretically faster and semantically more correct.
- It also had some awkward indenting due to very large closure argument
lists.
- Some of the tests could be written more concisely

## Solution

Use `Has`, move the tuple destructuring in a `let` binding, create a
function for the tests.

## Note to reviewers

Enable the "no white space diff" in the diff viewer to have a more
meaningful diff in the `check_visibility` system.
In the "Files changed" view, click on the little cog right of the "Jump
to" text, on the row where the "Review changes" button is. then enable
the "Hide whitespace" checkbox and click reload.

---

## Migration Guide

- The `check_visibility` system's `Option<&NoFrustumCulling>` parameter
has been replaced by `Has<NoFrustumCulling>`, if you were calling it
manually, you should change the type to match it

---------

Co-authored-by: Rob Parrett <robparrett@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Breaking-Change A breaking change to Bevy's public API that needs to be noted in a migration guide C-Code-Quality A section of code that is hard to understand or change S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants