X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=nihav-game%2Fsrc%2Fcodecs%2Fgremlinvideo.rs;h=4b53ae87a5784ea71bc51bc008a9c96a503ddd3c;hb=7450554d7dbd9ac5bb73bc48389bb9c08dc8d714;hp=73f42255d549ef612f38cfb739aa96dbe3bb995a;hpb=47933c6d7ef4dc3ca6d549199081c67cea324c36;p=nihav.git diff --git a/nihav-game/src/codecs/gremlinvideo.rs b/nihav-game/src/codecs/gremlinvideo.rs index 73f4225..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();