dedupe animation frames handling
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
use crate::{from_base36, optional_data_line, AnimationFrames, Image, Position, ToBase36};
|
||||
use crate::image::animation_frames_from_string;
|
||||
|
||||
#[derive(Debug, Eq, PartialEq)]
|
||||
pub struct Sprite {
|
||||
@@ -94,13 +95,9 @@ impl From<String> for Sprite {
|
||||
|
||||
items.reverse();
|
||||
|
||||
// todo dedupe
|
||||
let animation_frames = lines[1..].join("");
|
||||
let animation_frames: Vec<&str> = animation_frames.split(">").collect();
|
||||
let animation_frames: Vec<Image> = animation_frames
|
||||
.iter()
|
||||
.map(|&frame| Image::from(frame.to_string()))
|
||||
.collect();
|
||||
let animation_frames = animation_frames_from_string(
|
||||
lines[1..].join("\n")
|
||||
);
|
||||
|
||||
Sprite {
|
||||
id,
|
||||
|
||||
Reference in New Issue
Block a user