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

Use warn_once where relevant instead of manually implementing a single warn check #11693

Merged
merged 1 commit into from
Feb 5, 2024

Conversation

Kanabenki
Copy link
Contributor

Objective

  • Some places manually use a bool /AtomicBool to warn once.

Solution

  • Use the warn_once macro which internally creates an AtomicBool.

Downside: in some case the warning state would have been reset after recreating the struct carrying the warn state, whereas now it will always warn only once per program run (For example, if all MeshPipelines are dropped or the World is recreated for Local<bool>/ a bool resource, which shouldn't happen over the course of a standard App run).


Changelog

Removed

  • FontAtlasWarning has been removed, but the corresponding warning is still emitted.

@Kanabenki Kanabenki added C-Code-Quality A section of code that is hard to understand or change A-Diagnostics Logging, crash handling, error reporting and performance analysis labels Feb 4, 2024
@alice-i-cecile alice-i-cecile added the A-Rendering Drawing game state to the screen label Feb 4, 2024
@james7132 james7132 added this pull request to the merge queue Feb 5, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 5, 2024
@mockersf mockersf added this pull request to the merge queue Feb 5, 2024
Merged via the queue into bevyengine:main with commit 312df3c Feb 5, 2024
27 checks passed
tjamaan pushed a commit to tjamaan/bevy that referenced this pull request Feb 6, 2024
…gle warn check (bevyengine#11693)

# Objective

- Some places manually use a `bool` /`AtomicBool` to warn once.

## Solution

- Use the `warn_once` macro which internally creates an `AtomicBool`.

Downside: in some case the warning state would have been reset after
recreating the struct carrying the warn state, whereas now it will
always warn only once per program run (For example, if all
`MeshPipeline`s are dropped or the `World` is recreated for
`Local<bool>`/ a `bool` resource, which shouldn't happen over the course
of a standard `App` run).


---

## Changelog

### Removed

- `FontAtlasWarning` has been removed, but the corresponding warning is
still emitted.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Diagnostics Logging, crash handling, error reporting and performance analysis A-Rendering Drawing game state to the screen C-Code-Quality A section of code that is hard to understand or change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants