pmd_wan 6.0.0

A library that can read wan file, a sprite format used in pokemon mystery dungeon games
Documentation
use super::ShirenAnimationFrame;
use crate::WanError;
use std::io::Read;

#[derive(Debug, Clone)]
pub struct ShirenAnimation {
    pub frames: Vec<ShirenAnimationFrame>,
}

impl ShirenAnimation {
    pub fn new<T: Read>(reader: &mut T) -> Result<Self, WanError> {
        let mut frames = Vec::new();
        loop {
            let frame = ShirenAnimationFrame::new(reader)?;
            if frame.is_end_marker() {
                break;
            }
            frames.push(frame);
        }

        Ok(Self { frames })
    }
}