Skip to content

Commit

Permalink
Chain camera-related systems
Browse files Browse the repository at this point in the history
Fixes random Changed<Viewport> misses after d5a7330
  • Loading branch information
rmsc committed Feb 16, 2021
1 parent 77ccdad commit 31d387e
Showing 1 changed file with 8 additions and 19 deletions.
27 changes: 8 additions & 19 deletions crates/bevy_render/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub mod shader;
pub mod surface;
pub mod texture;

use bevy_ecs::{IntoExclusiveSystem, IntoSystem, SystemStage};
use bevy_ecs::{IntoChainSystem, IntoExclusiveSystem, IntoSystem, SystemStage};
use bevy_reflect::RegisterTypeBuilder;
use draw::Visible;
pub use once_cell;
Expand Down Expand Up @@ -141,24 +141,13 @@ impl Plugin for RenderPlugin {
)
.add_system_to_stage(
bevy_app::stage::POST_UPDATE,
surface::viewport_system.system(),
)
.add_system_to_stage(
bevy_app::stage::POST_UPDATE,
camera::active_cameras_system.system(),
)
.add_system_to_stage(
bevy_app::stage::POST_UPDATE,
camera::camera_system::<OrthographicProjection>.system(),
)
.add_system_to_stage(
bevy_app::stage::POST_UPDATE,
camera::camera_system::<PerspectiveProjection>.system(),
)
// registration order matters here. this must come after all camera_system::<T> systems
.add_system_to_stage(
bevy_app::stage::POST_UPDATE,
camera::visible_entities_system.system(),
surface::viewport_system
.system()
.chain(camera::active_cameras_system.system())
.chain(camera::camera_system::<OrthographicProjection>.system())
.chain(camera::camera_system::<PerspectiveProjection>.system())
// registration order matters here. this must come after all camera_system::<T> systems
.chain(camera::visible_entities_system.system()),
)
.add_system_to_stage(
stage::RENDER_RESOURCE,
Expand Down

0 comments on commit 31d387e

Please sign in to comment.