Skip to content

Commit fee715d

Browse files
committed
Remove the '3d' feature flag
1 parent eb9b752 commit fee715d

7 files changed

Lines changed: 18 additions & 32 deletions

File tree

Cargo.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ edition = "2024"
1111
resolver = "3"
1212
exclude = ["assets/example.gif", "assets/example3d.gif"]
1313

14-
[features]
15-
default = ["3d"]
16-
3d = ["bevy/bevy_pbr"]
17-
custom_cursor = ["bevy/custom_cursor"]
18-
1914
[dependencies]
2015
bevy = { version = "0.17.0", default-features = false, features = [
2116
"bevy_log",

src/animator.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@ use bevy::{
1515
window::{CursorIcon, CustomCursor, CustomCursorImage},
1616
};
1717

18-
#[cfg(feature = "3d")]
19-
use crate::components::sprite3d::Sprite3d;
2018
use crate::{
2119
animation::AnimationId,
2220
animator::iterator::{AnimationIterator, IteratorFrame},
23-
components::spritesheet_animation::{AnimationProgress, SpritesheetAnimation},
21+
components::{
22+
sprite3d::Sprite3d,
23+
spritesheet_animation::{AnimationProgress, SpritesheetAnimation},
24+
},
2425
events::AnimationEvent,
2526
library::AnimationLibrary,
2627
};
@@ -56,7 +57,6 @@ pub struct SpritesheetAnimationQuery {
5657
entity: Entity,
5758
spritesheet_animation: &'static mut SpritesheetAnimation,
5859
sprite: Option<&'static mut Sprite>,
59-
#[cfg(feature = "3d")]
6060
sprite3d: Option<&'static mut Sprite3d>,
6161
image_node: Option<&'static mut ImageNode>,
6262
cursor_icon: Option<&'static mut CursorIcon>,
@@ -233,7 +233,8 @@ impl Animator {
233233
atlas.index = frame.atlas_index;
234234
}
235235

236-
#[cfg(feature = "3d")]
236+
// 3D sprites
237+
237238
if let Some(atlas) = item
238239
.sprite3d
239240
.as_deref_mut()
@@ -243,6 +244,8 @@ impl Animator {
243244
atlas.index = frame.atlas_index;
244245
}
245246

247+
// Images
248+
246249
if let Some(atlas) = item
247250
.image_node
248251
.as_deref_mut()
@@ -252,7 +255,7 @@ impl Animator {
252255
atlas.index = frame.atlas_index;
253256
}
254257

255-
// Custom cursor
258+
// Cursors
256259

257260
if let Some(atlas) = item
258261
.cursor_icon

src/components.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
#[cfg(feature = "3d")]
21
pub mod sprite3d;
3-
42
pub mod spritesheet_animation;

src/lib.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,13 @@ pub mod prelude {
9191
Animation, AnimationDirection, AnimationDuration, AnimationId, AnimationRepeat,
9292
},
9393
clip::{Clip, ClipId},
94-
components::spritesheet_animation::SpritesheetAnimation,
94+
components::{sprite3d::Sprite3d, spritesheet_animation::SpritesheetAnimation},
9595
easing::{Easing, EasingVariety},
9696
events::{AnimationEvent, AnimationMarkerId},
9797
library::{AnimationLibrary, LibraryError},
9898
plugin::SpritesheetAnimationPlugin,
9999
spritesheet::Spritesheet,
100100
};
101-
102-
#[cfg(feature = "3d")]
103-
pub use super::components::sprite3d::Sprite3d;
104101
}
105102

106103
const CRATE_NAME: &str = "bevy_spritesheet_animation";

src/plugin.rs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ use bevy::{
55
};
66

77
use crate::{
8-
animator::Animator, components::spritesheet_animation::SpritesheetAnimation,
9-
events::AnimationEvent, library::AnimationLibrary, systems::spritesheet_animation,
8+
animator::Animator,
9+
components::{sprite3d::Sprite3d, spritesheet_animation::SpritesheetAnimation},
10+
events::AnimationEvent,
11+
library::AnimationLibrary,
12+
systems::{sprite3d, spritesheet_animation},
1013
};
11-
#[cfg(feature = "3d")]
12-
use crate::{components::sprite3d::Sprite3d, systems::sprite3d};
1314

1415
/// Set for systems that update the animation state.
1516
#[derive(Debug, PartialEq, Eq, Clone, Hash, SystemSet)]
@@ -66,20 +67,15 @@ impl Plugin for SpritesheetAnimationPlugin {
6667
.register_type::<SpritesheetAnimation>()
6768
// Animations events
6869
.add_message::<AnimationEvent>()
69-
// Systems
70+
// Animation system
7071
.add_systems(
7172
PostUpdate,
72-
// Main animation system
7373
spritesheet_animation::play_animations.in_set(AnimationSystemSet),
74-
);
75-
76-
#[cfg(feature = "3d")]
77-
app
78-
// Cache for 3D sprites
74+
)
75+
// 3D sprites
7976
.init_resource::<sprite3d::Cache>()
8077
.register_type::<sprite3d::Cache>()
8178
.register_type::<Sprite3d>()
82-
// 3D sprite systems
8379
.add_systems(
8480
PostUpdate,
8581
(

src/systems.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
#[cfg(feature = "3d")]
21
pub mod sprite3d;
3-
42
pub mod spritesheet_animation;

src/systems/sprite3d.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ use bevy::{
1313
render::{alpha::AlphaMode, render_resource::Face},
1414
};
1515

16-
#[cfg(feature = "3d")]
1716
use crate::prelude::Sprite3d;
1817

1918
/// Cached data for the 3D sprites

0 commit comments

Comments
 (0)