Skip to content

Commit

Permalink
Update to bevy 0.11
Browse files Browse the repository at this point in the history
  • Loading branch information
exjam committed Aug 23, 2023
1 parent adf32d4 commit 345c1a4
Show file tree
Hide file tree
Showing 98 changed files with 713 additions and 678 deletions.
66 changes: 34 additions & 32 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,30 @@ edition = "2021"
anyhow = "1.0.4"
arrayvec = "0.7"
async-trait = "0.1"
bevy = { version = "0.10", default-features = false, features = ["dds", "tga", "bevy_asset", "bevy_core_pipeline", "bevy_winit", "bevy_render", "bevy_pbr"] }
bevy_egui = "0.20.2"
bevy-inspector-egui = "0.18"
bevy_polyline = "0.6.0"
bevy_rapier3d = "0.21"
bitflags = "1.2"
bevy = { version = "0.11.2", default-features = false, features = ["dds", "tga", "bevy_asset", "bevy_core_pipeline", "bevy_winit", "bevy_render", "bevy_pbr"] }
bevy_egui = "0.21"
bevy-inspector-egui = "0.19"
bevy_polyline = "0.7"
bevy_rapier3d = "0.22"
bitflags = "2.3"
bytemuck = { version = "1.7.0", features = ["derive"] }
chrono = "0.4"
clap = "3.2"
cpal = "0.15"
crossbeam-channel = "0.5"
directories = "5.0"
dolly = "0.4.1"
egui = "0.21"
egui_extras = "0.21"
dolly = "0.4.2"
egui = "0.22"
egui_extras = "0.22"
enum-map = { version = "2.0", features = ["serde"] }
glam = "0.24.1"
hound = "3.4"
image = { version = "0.24", default-features = false, features = ["dds", "ico", "tga"] }
lazy_static = "1.4.0"
lewton = "0.10"
log = "0.4.14"
md5 = "0.7.0"
num-derive = "0.3"
num-derive = "0.4"
num-traits = "0.2"
oddio = "0.6"
pelite = "0.10.0"
Expand All @@ -40,34 +41,35 @@ tokio = { version = "1.17", features = ["rt", "net", "sync", "macros", "io-util"
toml = "0.7.2"
quick-xml = { version = "0.26.0", features = ["serialize"] }
regex = "1"
rose-data = { git = "https://github.com/exjam/rose-offline", rev = "4605e4584647ca40594af4e3108fe8fd69c23c45" }
rose-data-irose = { git = "https://github.com/exjam/rose-offline", rev = "4605e4584647ca40594af4e3108fe8fd69c23c45" }
rose-file-readers = { git = "https://github.com/exjam/rose-offline", rev = "4605e4584647ca40594af4e3108fe8fd69c23c45" }
rose-game-common = { git = "https://github.com/exjam/rose-offline", rev = "4605e4584647ca40594af4e3108fe8fd69c23c45" }
rose-game-irose = { git = "https://github.com/exjam/rose-offline", rev = "4605e4584647ca40594af4e3108fe8fd69c23c45" }
rose-network-common = { git = "https://github.com/exjam/rose-offline", rev = "4605e4584647ca40594af4e3108fe8fd69c23c45" }
rose-network-irose = { git = "https://github.com/exjam/rose-offline", rev = "4605e4584647ca40594af4e3108fe8fd69c23c45" }
rose-data = { git = "https://github.com/exjam/rose-offline", rev = "a499d3850446c22516c0d3f9336ff80088ed7cb1" }
rose-data-irose = { git = "https://github.com/exjam/rose-offline", rev = "a499d3850446c22516c0d3f9336ff80088ed7cb1" }
rose-file-readers = { git = "https://github.com/exjam/rose-offline", rev = "a499d3850446c22516c0d3f9336ff80088ed7cb1" }
rose-game-common = { git = "https://github.com/exjam/rose-offline", rev = "a499d3850446c22516c0d3f9336ff80088ed7cb1" }
rose-game-irose = { git = "https://github.com/exjam/rose-offline", rev = "a499d3850446c22516c0d3f9336ff80088ed7cb1" }
rose-network-common = { git = "https://github.com/exjam/rose-offline", rev = "a499d3850446c22516c0d3f9336ff80088ed7cb1" }
rose-network-irose = { git = "https://github.com/exjam/rose-offline", rev = "a499d3850446c22516c0d3f9336ff80088ed7cb1" }

[patch.crates-io]
bevy = { git = "https://github.com/exjam/bevy", rev = "4a309dafa9c912d36ecbcbd29253b9876b67c7e1" }
bevy_egui = { git = "https://github.com/exjam/bevy_egui", rev = "36988d9f5197c3a1f57ab56e89f8261269174fef" }
egui = { git = "https://github.com/exjam/egui", rev = "3ff66738341330d40e206269ce3540379b9ce1f5" }
bevy = { git = "https://github.com/exjam/bevy", rev = "04945fbacb297d3720049b7c89e3cb8eb19049c2" }
bevy_egui = { git = "https://github.com/exjam/bevy_egui", rev = "cc94933c647ed4e6cba48a559f70cc69cb2f1708" }
dolly = { git = "https://github.com/exjam/dolly", rev = "007862856f95c2b75b1e18ade4f4e35cfe6829a5" }
egui = { git = "https://github.com/exjam/egui", rev = "cc52964889bf41d3268a553836515f7e17fc6e48" }
oddio = { git = "https://github.com/exjam/oddio", rev = "3c20292903fe629d7eab08c1790db70b9fddac96" }
pelite = { git = "https://github.com/exjam/pelite", rev = "750b4aea126b1248b46e52cf2b9ad288d01e698c" }
winit = { git = "https://github.com/exjam/winit", rev = "5c5519c5c192e1eb6eda5f3420d467131d3273bb" }
# Thanks bevy-inspector-egui
bevy_app = { git = "https://github.com/exjam/bevy", rev = "4a309dafa9c912d36ecbcbd29253b9876b67c7e1" }
bevy_asset = { git = "https://github.com/exjam/bevy", rev = "4a309dafa9c912d36ecbcbd29253b9876b67c7e1" }
bevy_core = { git = "https://github.com/exjam/bevy", rev = "4a309dafa9c912d36ecbcbd29253b9876b67c7e1" }
bevy_ecs = { git = "https://github.com/exjam/bevy", rev = "4a309dafa9c912d36ecbcbd29253b9876b67c7e1" }
bevy_hierarchy = { git = "https://github.com/exjam/bevy", rev = "4a309dafa9c912d36ecbcbd29253b9876b67c7e1" }
bevy_log = { git = "https://github.com/exjam/bevy", rev = "4a309dafa9c912d36ecbcbd29253b9876b67c7e1" }
bevy_math = { git = "https://github.com/exjam/bevy", rev = "4a309dafa9c912d36ecbcbd29253b9876b67c7e1" }
bevy_reflect = { git = "https://github.com/exjam/bevy", rev = "4a309dafa9c912d36ecbcbd29253b9876b67c7e1" }
bevy_utils = { git = "https://github.com/exjam/bevy", rev = "4a309dafa9c912d36ecbcbd29253b9876b67c7e1" }
bevy_core_pipeline = { git = "https://github.com/exjam/bevy", rev = "4a309dafa9c912d36ecbcbd29253b9876b67c7e1" }
bevy_pbr = { git = "https://github.com/exjam/bevy", rev = "4a309dafa9c912d36ecbcbd29253b9876b67c7e1" }
bevy_render = { git = "https://github.com/exjam/bevy", rev = "4a309dafa9c912d36ecbcbd29253b9876b67c7e1" }
bevy_app = { git = "https://github.com/exjam/bevy", rev = "04945fbacb297d3720049b7c89e3cb8eb19049c2" }
bevy_asset = { git = "https://github.com/exjam/bevy", rev = "04945fbacb297d3720049b7c89e3cb8eb19049c2" }
bevy_core = { git = "https://github.com/exjam/bevy", rev = "04945fbacb297d3720049b7c89e3cb8eb19049c2" }
bevy_ecs = { git = "https://github.com/exjam/bevy", rev = "04945fbacb297d3720049b7c89e3cb8eb19049c2" }
bevy_hierarchy = { git = "https://github.com/exjam/bevy", rev = "04945fbacb297d3720049b7c89e3cb8eb19049c2" }
bevy_log = { git = "https://github.com/exjam/bevy", rev = "04945fbacb297d3720049b7c89e3cb8eb19049c2" }
bevy_math = { git = "https://github.com/exjam/bevy", rev = "04945fbacb297d3720049b7c89e3cb8eb19049c2" }
bevy_reflect = { git = "https://github.com/exjam/bevy", rev = "04945fbacb297d3720049b7c89e3cb8eb19049c2" }
bevy_utils = { git = "https://github.com/exjam/bevy", rev = "04945fbacb297d3720049b7c89e3cb8eb19049c2" }
bevy_core_pipeline = { git = "https://github.com/exjam/bevy", rev = "04945fbacb297d3720049b7c89e3cb8eb19049c2" }
bevy_pbr = { git = "https://github.com/exjam/bevy", rev = "04945fbacb297d3720049b7c89e3cb8eb19049c2" }
bevy_render = { git = "https://github.com/exjam/bevy", rev = "04945fbacb297d3720049b7c89e3cb8eb19049c2" }

[profile.dev.package."*"]
opt-level = 3
3 changes: 2 additions & 1 deletion src/animation/animation_state.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use bevy::{
prelude::{Component, Entity, Handle},
prelude::{Component, Entity, Event, Handle},
reflect::Reflect,
time::Time,
};
Expand All @@ -8,6 +8,7 @@ use rose_data::AnimationEventFlags;

use crate::animation::ZmoAsset;

#[derive(Event)]
pub struct AnimationFrameEvent {
pub entity: Entity,
pub flags: AnimationEventFlags,
Expand Down
10 changes: 6 additions & 4 deletions src/animation/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use bevy::{
prelude::{AddAsset, App, CoreSet, IntoSystemConfigs, IntoSystemSetConfig, Plugin, SystemSet},
prelude::{
AddAsset, App, IntoSystemConfigs, IntoSystemSetConfig, Plugin, PostUpdate, SystemSet,
},
transform::TransformSystem,
};

Expand Down Expand Up @@ -49,11 +51,11 @@ impl Plugin for RoseAnimationPlugin {
.register_type::<TransformAnimation>();

app.configure_set(
RoseAnimationSystem
.in_base_set(CoreSet::PostUpdate)
.before(TransformSystem::TransformPropagate),
PostUpdate,
RoseAnimationSystem.before(TransformSystem::TransformPropagate),
)
.add_systems(
PostUpdate,
(
camera_animation_system,
mesh_animation_system,
Expand Down
8 changes: 4 additions & 4 deletions src/animation/zmo_asset_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use bevy::{
asset::{AssetLoader, BoxedFuture, LoadContext, LoadedAsset},
math::{Quat, Vec3},
prelude::{Handle, Image},
reflect::{FromReflect, Reflect, TypeUuid},
reflect::{Reflect, TypeUuid},
render::render_resource::{Extent3d, TextureDimension, TextureFormat},
};
use rose_file_readers::{RoseFile, ZmoChannel, ZmoFile};
Expand All @@ -15,14 +15,14 @@ pub struct ZmoAssetLoader;
#[derive(Default)]
pub struct ZmoTextureAssetLoader;

#[derive(Reflect, FromReflect, Clone, Default)]
#[derive(Reflect, Clone, Default)]
pub struct ZmoAssetBone {
pub translation: Vec<Vec3>,
pub rotation: Vec<Quat>,
pub scale: Vec<f32>,
}

#[derive(Reflect, FromReflect, Clone, Default)]
#[derive(Reflect, Clone, Default)]
pub struct ZmoAssetAnimationTexture {
pub texture: Handle<Image>,
pub alphas: Vec<f32>,
Expand All @@ -32,7 +32,7 @@ pub struct ZmoAssetAnimationTexture {
pub has_uv1_channel: bool,
}

#[derive(Reflect, FromReflect, TypeUuid)]
#[derive(Reflect, TypeUuid)]
#[uuid = "120cb5ff-e72d-4730-9756-648d0001fdfa"]
pub struct ZmoAsset {
pub num_frames: usize,
Expand Down
4 changes: 2 additions & 2 deletions src/audio/audio_source.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::sync::Arc;

use bevy::reflect::TypeUuid;
use bevy::reflect::{TypePath, TypeUuid};

pub trait StreamingAudioSource {
fn channel_count(&self) -> u32;
Expand All @@ -15,7 +15,7 @@ pub struct AudioSourceDecoded {
pub sample_rate: u32,
}

#[derive(Clone, TypeUuid)]
#[derive(Clone, TypeUuid, TypePath)]
#[uuid = "f40c2d6a-d2ad-42cc-8f86-0147d3ddd68c"]
pub struct AudioSource {
pub bytes: Arc<[u8]>,
Expand Down
8 changes: 3 additions & 5 deletions src/audio/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
use bevy::prelude::{
AddAsset, App, Component, CoreSet, IntoSystemConfig, IntoSystemConfigs, Plugin, Resource,
};
use bevy::prelude::{AddAsset, App, Component, IntoSystemConfigs, Last, Plugin, Resource};

mod audio_source;
mod global_sound;
Expand Down Expand Up @@ -98,13 +96,13 @@ impl Plugin for OddioPlugin {
.init_asset_loader::<OggLoader>()
.init_asset_loader::<WavLoader>()
.add_systems(
Last,
(
spatial_sound_gain_changed_system.before(spatial_sound_system),
spatial_sound_system,
global_sound_gain_changed_system.before(global_sound_system),
global_sound_system,
)
.in_base_set(CoreSet::Last),
),
);
}
}
7 changes: 2 additions & 5 deletions src/components/character_model_blink_timer.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
use std::ops::Range;

use bevy::{
prelude::Component,
reflect::{FromReflect, Reflect},
};
use bevy::{prelude::Component, reflect::Reflect};
use rand::Rng;

#[derive(Component, Reflect, FromReflect)]
#[derive(Component, Reflect)]
pub struct CharacterBlinkTimer {
pub timer: f32,
pub is_open: bool,
Expand Down
9 changes: 3 additions & 6 deletions src/components/client_entity.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
use bevy::{
prelude::Component,
reflect::{FromReflect, Reflect},
};
use bevy::{prelude::Component, reflect::Reflect};

pub use rose_game_common::messages::ClientEntityId;

#[derive(Copy, Clone, Debug, PartialEq, Eq, Reflect, FromReflect)]
#[derive(Copy, Clone, Debug, PartialEq, Eq, Reflect)]
pub enum ClientEntityType {
Character,
Monster,
Npc,
ItemDrop,
}

#[derive(Copy, Clone, Component, Reflect, FromReflect)]
#[derive(Copy, Clone, Component, Reflect)]
pub struct ClientEntity {
pub id: ClientEntityId,
pub entity_type: ClientEntityType,
Expand Down
4 changes: 2 additions & 2 deletions src/components/client_entity_name.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use bevy::{
prelude::{Component, Deref, DerefMut},
reflect::{FromReflect, Reflect},
reflect::Reflect,
};

#[derive(Component, Deref, DerefMut, Reflect, FromReflect)]
#[derive(Component, Deref, DerefMut, Reflect)]
pub struct ClientEntityName {
pub name: String,
}
Expand Down
20 changes: 10 additions & 10 deletions src/components/command.rs
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
use bevy::{
math::{Vec2, Vec3},
prelude::{Component, Entity},
reflect::{FromReflect, Reflect},
reflect::Reflect,
};
use rose_data::{MotionId, SkillId};
use std::ops::{Deref, DerefMut};

use rose_game_common::components::MoveMode;

#[derive(Clone, Debug, PartialEq, Reflect, FromReflect)]
#[derive(Clone, Debug, PartialEq, Reflect)]
pub struct CommandMove {
pub destination: Vec3,
pub target: Option<Entity>,
pub move_mode: Option<MoveMode>,
}

#[derive(Clone, Debug, PartialEq, Eq, Reflect, FromReflect)]
#[derive(Clone, Debug, PartialEq, Eq, Reflect)]
pub struct CommandAttack {
pub target: Entity,
}

#[derive(Clone, Debug, PartialEq, Eq, Reflect, FromReflect)]
#[derive(Clone, Debug, PartialEq, Eq, Reflect)]
pub struct CommandEmote {
pub motion_id: MotionId,
pub is_stop: bool,
}

#[derive(Clone, Debug, PartialEq, Eq, Reflect, FromReflect)]
#[derive(Clone, Debug, PartialEq, Eq, Reflect)]
pub enum CommandSit {
Sitting,
Sit,
Standing,
}

#[derive(Copy, Clone, Debug, PartialEq, Reflect, FromReflect)]
#[derive(Copy, Clone, Debug, PartialEq, Reflect)]
pub enum CommandCastSkillTarget {
Entity(Entity),
Position(Vec2),
}

#[derive(Copy, Clone, Debug, PartialEq, Eq, Reflect, FromReflect)]
#[derive(Copy, Clone, Debug, PartialEq, Eq, Reflect)]
pub enum CommandCastSkillState {
Starting,
Casting,
CastingRepeat,
Action,
}

#[derive(Clone, Debug, PartialEq, Reflect, FromReflect)]
#[derive(Clone, Debug, PartialEq, Reflect)]
pub struct CommandCastSkill {
pub skill_id: SkillId,
pub skill_target: Option<CommandCastSkillTarget>,
Expand All @@ -58,7 +58,7 @@ pub struct CommandCastSkill {
pub ready_action: bool,
}

#[derive(Component, Clone, Debug, PartialEq, Reflect, FromReflect)]
#[derive(Component, Clone, Debug, PartialEq, Reflect)]
pub enum Command {
Stop,
Move(CommandMove),
Expand Down Expand Up @@ -213,7 +213,7 @@ impl Command {
}
}

#[derive(Component, Debug, Default, Reflect, FromReflect)]
#[derive(Component, Debug, Default, Reflect)]
pub struct NextCommand(Option<Command>);

impl NextCommand {
Expand Down
7 changes: 2 additions & 5 deletions src/components/dead.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
use bevy::{
prelude::Component,
reflect::{FromReflect, Reflect},
};
use bevy::{prelude::Component, reflect::Reflect};

#[derive(Component, Reflect, FromReflect)]
#[derive(Component, Reflect)]
pub struct Dead;
7 changes: 2 additions & 5 deletions src/components/dummy_bone_offset.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
use bevy::{
prelude::Component,
reflect::{FromReflect, Reflect},
};
use bevy::{prelude::Component, reflect::Reflect};

#[derive(Component, Reflect, FromReflect)]
#[derive(Component, Reflect)]
pub struct DummyBoneOffset {
pub index: usize,
}
Expand Down
11 changes: 4 additions & 7 deletions src/components/effect.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
use bevy::{
prelude::Component,
reflect::{FromReflect, Reflect},
};
use bevy::{prelude::Component, reflect::Reflect};

#[derive(Component, Reflect, FromReflect)]
#[derive(Component, Reflect)]
pub struct Effect {
pub manual_despawn: bool,
}
Expand All @@ -14,8 +11,8 @@ impl Effect {
}
}

#[derive(Component, Default, Reflect, FromReflect)]
#[derive(Component, Default, Reflect)]
pub struct EffectMesh {}

#[derive(Component, Default, Reflect, FromReflect)]
#[derive(Component, Default, Reflect)]
pub struct EffectParticle {}
Loading

0 comments on commit 345c1a4

Please sign in to comment.