X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=nihav-game%2Fsrc%2Fcodecs%2Fgremlinvideo.rs;h=4b53ae87a5784ea71bc51bc008a9c96a503ddd3c;hb=7450554d7dbd9ac5bb73bc48389bb9c08dc8d714;hp=c8059fa6995db416eaf23f86858ce1308ef6ccd9;hpb=8a790ba71b9b2af5804690e6aa8e099aaf26c2d9;p=nihav.git diff --git a/nihav-game/src/codecs/gremlinvideo.rs b/nihav-game/src/codecs/gremlinvideo.rs index c8059fa..4b53ae8 100644 --- a/nihav-game/src/codecs/gremlinvideo.rs +++ b/nihav-game/src/codecs/gremlinvideo.rs @@ -143,17 +143,17 @@ impl GremlinVideoDecoder { let mut sidx = PREAMBLE_SIZE; let mut didx = 0; - for i in 0..768 { dst[paloff + i] = self.pal[i]; } + dst[paloff..][..768].copy_from_slice(&self.pal); if !self.scale_v && !self.scale_h { for _ in 0..h { - for x in 0..w { dst[didx + x] = self.frame[sidx + x]; } + dst[didx..][..w].copy_from_slice(&self.frame[sidx..][..w]); sidx += w; didx += stride; } } else { for y in 0..h { if !self.scale_v { - for x in 0..w { dst[didx + x] = self.frame[sidx + x]; } + dst[didx..][..w].copy_from_slice(&self.frame[sidx..][..w]); } else { for x in 0..w { dst[didx + x] = self.frame[sidx + x/2]; } } @@ -247,6 +247,7 @@ impl GremlinVideoDecoder { Ok(()) } + #[allow(clippy::identity_op)] fn decode_method68(&mut self, br: &mut ByteReader, skip: usize, use8: bool) -> DecoderResult<()> { let mut bits = Bits32::new(); @@ -460,6 +461,12 @@ impl NADecoder for GremlinVideoDecoder { } } +impl NAOptionHandler for GremlinVideoDecoder { + fn get_supported_options(&self) -> &[NAOptionDefinition] { &[] } + fn set_options(&mut self, _options: &[NAOption]) { } + fn query_option_value(&self, _name: &str) -> Option { None } +} + pub fn get_decoder_video() -> Box { Box::new(GremlinVideoDecoder::new()) } @@ -554,6 +561,12 @@ impl NADecoder for GremlinAudioDecoder { } } +impl NAOptionHandler for GremlinAudioDecoder { + fn get_supported_options(&self) -> &[NAOptionDefinition] { &[] } + fn set_options(&mut self, _options: &[NAOption]) { } + fn query_option_value(&self, _name: &str) -> Option { None } +} + pub fn get_decoder_audio() -> Box { Box::new(GremlinAudioDecoder::new()) }