Skip to content

Commit

Permalink
remove animator system and related code
Browse files Browse the repository at this point in the history
  • Loading branch information
B-Reif committed Jul 23, 2021
1 parent 9c07a79 commit cd9fd5f
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 334 deletions.
4 changes: 1 addition & 3 deletions examples/simple/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ use std::path::Path;
use bevy::{input::system::exit_on_esc_system, prelude::*};
use bevy_ase::{
self,
animate::{self, AnimationInfo},
animation_index::{AnimationId, AnimationIndex},
loader::{self, AseAsset, Loader},
timer, Animation,
Animation,
};

mod ids;
Expand Down
3 changes: 1 addition & 2 deletions examples/tilemap/main.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
use std::path::Path;

use bevy::{input::system::exit_on_esc_system, prelude::*};
use bevy_ase::{self, loader, loader::Loader, timer, Tileset};
use bevy_ase::{self, loader, loader::Loader, Tileset};
use bevy_ecs_tilemap::prelude::*;

fn main() {
App::build()
.add_plugins(DefaultPlugins)
.add_plugin(TilemapPlugin)
.add_plugin(timer::GameTimePlugin)
.add_plugin(loader::AseLoaderPlugin)
.add_system(exit_on_esc_system.system())
.add_state(AppState::Loading)
Expand Down
136 changes: 0 additions & 136 deletions src/animate.rs

This file was deleted.

115 changes: 0 additions & 115 deletions src/animation_index.rs

This file was deleted.

3 changes: 0 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
//! [`Bevy`]: https://bevyengine.org/
//! [`Aseprite`]: https://www.aseprite.org/
//! [`Resources`]: https://bevyengine.org/learn/book/getting-started/resources/
pub mod animate;
mod animation;
pub mod animation_index;
mod ase;
pub mod loader;
mod processing;
Expand All @@ -25,7 +23,6 @@ mod sprite;
#[cfg(test)]
mod tests;
mod tileset;
pub mod timer;

pub use animation::{Animation, Frame};
pub use ase::AseId;
Expand Down
5 changes: 0 additions & 5 deletions src/loader.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use crate::animate::AnimationInfo;
use crate::animation::Animation;
use crate::processing::{self, ResourceData};
use crate::slice::Slice;
Expand Down Expand Up @@ -229,7 +228,6 @@ impl Loader {

pub(crate) struct AseAssetResources<'a> {
pub animations: Option<&'a mut Assets<Animation>>,
pub anim_info: Option<&'a mut AnimationInfo>,
pub textures: Option<&'a mut Assets<Texture>>,
pub atlases: Option<&'a mut Assets<TextureAtlas>>,
pub tilesets: Option<&'a mut Assets<Tileset>>,
Expand Down Expand Up @@ -258,7 +256,6 @@ pub fn ase_importer(
mut textures: Option<ResMut<Assets<Texture>>>,
mut atlases: Option<ResMut<Assets<TextureAtlas>>>,
mut animations: Option<ResMut<Assets<Animation>>>,
mut anim_info: Option<ResMut<AnimationInfo>>,
mut tilesets: Option<ResMut<Assets<Tileset>>>,
mut slices: Option<ResMut<Assets<Slice>>>,
) {
Expand All @@ -272,12 +269,10 @@ pub fn ase_importer(
let textures = textures.as_mut().map(DerefMut::deref_mut);
let atlases = atlases.as_mut().map(DerefMut::deref_mut);
let animations = animations.as_mut().map(DerefMut::deref_mut);
let anim_info = anim_info.as_mut().map(DerefMut::deref_mut);
let tilesets = tilesets.as_mut().map(DerefMut::deref_mut);
let slices = slices.as_mut().map(DerefMut::deref_mut);
let resources = AseAssetResources {
animations,
anim_info,
textures,
atlases,
tilesets,
Expand Down
4 changes: 0 additions & 4 deletions src/processing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ impl ResourceData {
pub(crate) fn move_into_resources(self, resources: &mut AseAssetResources) {
let AseAssetResources {
animations,
anim_info,
textures,
atlases,
tilesets,
Expand Down Expand Up @@ -180,9 +179,6 @@ impl ResourceData {
});
}
let handle = animations.add(Animation::new(frames));
if let Some(anim_info) = anim_info {
anim_info.add_anim(tmp_anim.file, tmp_anim.tag, handle);
}
}
}
}
Expand Down
Loading

0 comments on commit cd9fd5f

Please sign in to comment.