summaryrefslogtreecommitdiff
path: root/src/tileset.rs
diff options
context:
space:
mode:
authortom barrett <spalf0@gmail.com>2019-07-13 04:51:26 -0500
committertom barrett <spalf0@gmail.com>2019-07-13 04:51:26 -0500
commit9443ea856a706654916f0905d346c1e2c9d500c4 (patch)
tree027b69e10c482337cfc1109c58c50fdf32fa8c04 /src/tileset.rs
parentb4e83e63d46fdbc40f548bfa9bd95d7ed9912b8d (diff)
less code
Diffstat (limited to 'src/tileset.rs')
-rw-r--r--src/tileset.rs20
1 files changed, 1 insertions, 19 deletions
diff --git a/src/tileset.rs b/src/tileset.rs
index fe2f84b..5193d44 100644
--- a/src/tileset.rs
+++ b/src/tileset.rs
@@ -1,11 +1,10 @@
use ggez::filesystem::File;
use ggez::graphics::Rect;
use std::collections::HashMap;
-use std::f32::consts::PI;
use crate::animations::Animation;
use crate::constants::{self, FLIP_A, FLIP_D, FLIP_H, FLIP_V};
-use crate::tile::{Properties, Tile};
+use crate::tile::{Properties, Tile, flip, rotate};
use crate::xmlelements::XMLElements;
pub struct Tileset {
@@ -135,20 +134,3 @@ impl Tileset {
.clone()
}
}
-
-pub fn convert_angle_to_rad(angle: f32) -> f32 {
- angle * (PI / 180.0)
-}
-
-fn flip(tile: Tile) -> Tile {
- let mut t = tile.clone();
- t.source.x *= -1.0;
- t.source.x -= t.source.w;
- t
-}
-
-fn rotate(tile: Tile, angle: f32) -> Tile {
- let mut t = tile.clone();
- t.properties.rotation = convert_angle_to_rad(angle);
- t
-}