Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
This upgrades Bevy to 0.14.
Changes
Most changes relate to color APIs,
app.world()
andapp.world_mut()
. Other changes include:AppExit
from examplemain
functionsEventUpdateSignal
, which no longer existsShouldUpdateEvents::Always
onEventRegistry
for playback tests andupdated test assertions inconfigureFrameCount
-related tests not to expect double buffering.InputPlaybackPlugin
systems inFirst
to occur after events flush to fix tests and guarantee correct system ordering.Questions / TODOsSolved! Skip this :)This last bit is potentially controversial but I didn't want to submit a PR with an incomplete solution even if I wasn't entirely confident in the more complete one.
Without this last change (feel free to try the commit, it's
432c5a7
), there are issues with theinput-playback.rs
tests usingPlaybackStrategy::FrameCount
. Specifically, theEvent
buffers in these tests are not flushing each update unlessShouldUpdateEvents::Always
is set on theEventRegistry
resource. Then, ifShouldUpdateEvents::Always
is set, the buffer flushes at the end of theupdate
call, so the test code that followsapp.update()
sees an empty "front" buffer (to accept input in the next update call) and the events of the last update in the "back" buffer. This makes sense (that is the "last frame" now), but does imply that something needs to change.To provide some concrete example behaviors, this creates issues in the
frame_range_once
andframe_range_loop
tests, which specifically check for double-buffering behavior. WithoutShouldUpdateEvents::Always
, event counts simply accumulate, but with it included, the tests still fail because they expect double-buffered event counts. Additionally, the comment attests/input_playback.rs#87
is now misleading: thatinput_events
variable originally has both events in theevents_a
buffer, and if we setShouldUpdateEvents::Always
, it is the same but for theevents_b
buffer. This is not representative of double-buffering.This is also true if we read the input events during
playback_strategy_frame
and other tests. The one test that does not have this behavior isrepeated_playback
which sets aTimeUpdateStrategy::ManualDuration
and probably triggersFixedUpdate
, which would setShouldUpdateEvents::Ready
and execute a flush.It didn't seem as appropriate to wrangle
FixedUpdate
or manually trigger event flushes, nor to make assertions insideUpdate
orPostUpdate
somehow so that we could observe the double-buffering, which is why I took the approach of not expecting double-buffered events in these tests.Seems like
Event
s have gone through a few changes in the past few versions and I'm not an expert on all them, so please let me know if there is a preferable approach!