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

[Merged by Bors] - register missing reflect types #5747

Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions crates/bevy_core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub mod prelude {

use bevy_app::prelude::*;
use bevy_ecs::entity::Entity;
use bevy_utils::HashSet;
use bevy_utils::{Duration, HashSet, Instant};
use std::borrow::Cow;
use std::ops::Range;

Expand Down Expand Up @@ -45,7 +45,9 @@ fn register_rust_types(app: &mut App) {
.register_type::<String>()
.register_type::<HashSet<String>>()
.register_type::<Option<String>>()
.register_type::<Cow<'static, str>>();
.register_type::<Cow<'static, str>>()
.register_type::<Duration>()
.register_type::<Instant>();
}

fn register_math_types(app: &mut App) {
Expand Down
1 change: 1 addition & 0 deletions crates/bevy_core_pipeline/src/core_3d/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ pub struct Core3dPlugin;
impl Plugin for Core3dPlugin {
fn build(&self, app: &mut App) {
app.register_type::<Camera3d>()
.register_type::<Camera3dDepthLoadOp>()
.add_plugin(ExtractComponentPlugin::<Camera3d>::default());

let render_app = match app.get_sub_app_mut(RenderApp) {
Expand Down
2 changes: 2 additions & 0 deletions crates/bevy_core_pipeline/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ pub mod prelude {
use crate::{clear_color::ClearColor, core_2d::Core2dPlugin, core_3d::Core3dPlugin};
use bevy_app::{App, Plugin};
use bevy_render::extract_resource::ExtractResourcePlugin;
use clear_color::ClearColorConfig;
jakobhellermann marked this conversation as resolved.
Show resolved Hide resolved

#[derive(Default)]
pub struct CorePipelinePlugin;

impl Plugin for CorePipelinePlugin {
fn build(&self, app: &mut App) {
app.register_type::<ClearColor>()
.register_type::<ClearColorConfig>()
.init_resource::<ClearColor>()
.add_plugin(ExtractResourcePlugin::<ClearColor>::default())
.add_plugin(Core2dPlugin)
Expand Down
1 change: 1 addition & 0 deletions crates/bevy_input/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ bevy_app = { path = "../bevy_app", version = "0.9.0-dev" }
bevy_ecs = { path = "../bevy_ecs", version = "0.9.0-dev" }
bevy_math = { path = "../bevy_math", version = "0.9.0-dev" }
bevy_utils = { path = "../bevy_utils", version = "0.9.0-dev" }
bevy_reflect = { path = "../bevy_reflect", version = "0.9.0-dev" }

# other
serde = { version = "1", features = ["derive"], optional = true }
6 changes: 2 additions & 4 deletions crates/bevy_render/src/camera/camera.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ use bevy_reflect::FromReflect;
use bevy_transform::components::GlobalTransform;
use bevy_utils::HashSet;
use bevy_window::{WindowCreated, WindowId, WindowResized, Windows};
use serde::{Deserialize, Serialize};
use std::{borrow::Cow, ops::Range};
use wgpu::Extent3d;

Expand All @@ -32,9 +31,8 @@ use wgpu::Extent3d;
/// The viewport defines the area on the render target to which the camera renders its image.
/// You can overlay multiple cameras in a single window using viewports to create effects like
/// split screen, minimaps, and character viewers.
// TODO: remove reflect_value when possible
#[derive(Reflect, FromReflect, Debug, Clone, Serialize, Deserialize)]
#[reflect_value(Default, Serialize, Deserialize)]
#[derive(Reflect, FromReflect, Debug, Clone)]
#[reflect(Default)]
jakobhellermann marked this conversation as resolved.
Show resolved Hide resolved
pub struct Viewport {
/// The physical position to render this viewport to within the [`RenderTarget`] of this [`Camera`].
/// (0,0) corresponds to the top-left corner
Expand Down
1 change: 1 addition & 0 deletions crates/bevy_render/src/camera/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pub struct CameraPlugin;
impl Plugin for CameraPlugin {
fn build(&self, app: &mut App) {
app.register_type::<Camera>()
.register_type::<Viewport>()
.register_type::<Visibility>()
.register_type::<ComputedVisibility>()
.register_type::<VisibleEntities>()
Expand Down
1 change: 1 addition & 0 deletions crates/bevy_sprite/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ impl Plugin for SpritePlugin {
shaders.set_untracked(SPRITE_SHADER_HANDLE, sprite_shader);
app.add_asset::<TextureAtlas>()
.register_type::<Sprite>()
.register_type::<Anchor>()
.register_type::<Mesh2dHandle>()
.add_plugin(Mesh2dRenderPlugin)
.add_plugin(ColorMaterialPlugin);
Expand Down
2 changes: 2 additions & 0 deletions crates/bevy_text/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ impl Plugin for TextPlugin {
app.add_asset::<Font>()
.add_asset::<FontAtlasSet>()
.register_type::<Text>()
.register_type::<TextSection>()
.register_type::<TextAlignment>()
.register_type::<VerticalAlign>()
.register_type::<HorizontalAlign>()
.init_asset_loader::<FontLoader>()
Expand Down
2 changes: 2 additions & 0 deletions crates/bevy_time/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ impl Plugin for TimePlugin {
app.init_resource::<Time>()
.init_resource::<FixedTimesteps>()
.register_type::<Timer>()
.register_type::<Time>()
.register_type::<Stopwatch>()
// time system is added as an "exclusive system" to ensure it runs before other systems
// in CoreStage::First
.add_system_to_stage(
Expand Down