fn decode_texture_set_bytes(chr: char, texture_id: TextureId, param: String, bytes: DecodeBytes) -> Result<(DecoderState, Option<Draw>), DecoderError> {
        // 4 u32s and some data
        if param.len() < 24 {
            let mut param = param;
            param.push(chr);
            return Ok((DecoderState::TextureOpSetBytes(texture_id, param, bytes), None));
        }

        let bytes = bytes.decode(chr)?;

        if !bytes.ready() {
            return Ok((DecoderState::TextureOpSetBytes(texture_id, param, bytes), None));
        }

        // Decode the data
        let mut chars   = param.chars();
        let x           = Self::decode_u32(&mut chars)?;
        let y           = Self::decode_u32(&mut chars)?;
        let w           = Self::decode_u32(&mut chars)?;
        let h           = Self::decode_u32(&mut chars)?;

        Ok((DecoderState::None, Some(Draw::Texture(texture_id, TextureOp::SetBytes(x, y, w, h, Arc::new(bytes.to_bytes()?))))))
    }
///
/// Decodes a texture 'set bytes' operation
///
Decodes a texture 'set bytes' operation
Decodes a texture ' set bytes ' operation
fn decode_texture_set_bytes(chr: char, texture_id: TextureId, param: String, bytes: DecodeBytes) -> Result<(DecoderState, Option<Draw>), DecoderError> {
        // 4 u32s and some data
        if param.len() < 24 {
            let mut param = param;
            param.push(chr);
            return Ok((DecoderState::TextureOpSetBytes(texture_id, param, bytes), None));
        }
        let bytes = bytes.decode(chr)?;
        if !bytes.ready() {
            return Ok((DecoderState::TextureOpSetBytes(texture_id, param, bytes), None));
        }
        // Decode the data
        let mut chars   = param.chars();
        let x           = Self::decode_u32(&mut chars)?;
        let y           = Self::decode_u32(&mut chars)?;
        let w           = Self::decode_u32(&mut chars)?;
        let h           = Self::decode_u32(&mut chars)?;
        Ok((DecoderState::None, Some(Draw::Texture(texture_id, TextureOp::SetBytes(x, y, w, h, Arc::new(bytes.to_bytes()?))))))
    }
fn decode_texture_set_bytes ( chr : char , texture_id : TextureId , param : String , bytes : DecodeBytes ) -> Result < ( DecoderState , Option < Draw > ) , DecoderError > { // 4 u32s and some data if param . len ( ) < 24 { let mut param = param ; param . push ( chr ) ; return Ok ( ( DecoderState :: TextureOpSetBytes ( texture_id , param , bytes ) , None ) ) ; } let bytes = bytes . decode ( chr ) ? ; if ! bytes . ready ( ) { return Ok ( ( DecoderState :: TextureOpSetBytes ( texture_id , param , bytes ) , None ) ) ; } // Decode the data let mut chars = param . chars ( ) ; let x = Self :: decode_u32 ( & mut chars ) ? ; let y = Self :: decode_u32 ( & mut chars ) ? ; let w = Self :: decode_u32 ( & mut chars ) ? ; let h = Self :: decode_u32 ( & mut chars ) ? ; Ok ( ( DecoderState :: None , Some ( Draw :: Texture ( texture_id , TextureOp :: SetBytes ( x , y , w , h , Arc :: new ( bytes . to_bytes ( ) ? ) ) ) ) ) ) }
Decodes a texture 'set bytes' operation
Decodes a texture ' set bytes ' operation
chr
char
texture_id
TextureId
param
String
bytes
DecodeBytes