diff --git a/src/device/video_sdl2.rs b/src/device/video_sdl2.rs index d9c6360..c659213 100644 --- a/src/device/video_sdl2.rs +++ b/src/device/video_sdl2.rs @@ -80,13 +80,13 @@ impl Sdl2VideoDevice { twobpp: bool, ) { let v = BLENDING[4][color as usize]; - let h = v; + let _h = v; let opaque = v; for v in 0..8 { let mut c: u8 = sprite[v] | (if twobpp { sprite[v + 8] } else { 0 }) << 8; for h in 7..0 { - c = c >> 1; + c >>= 1; let ch = ((c & 1) | ((c >> 7) & 2)) as usize; if opaque != 0 || ch != 0 { self.write_pixel( @@ -110,7 +110,7 @@ impl Sdl2VideoDevice { // Works in C's *u8 land, not clear it works in Rust. let mut shift = 4; for i in 0..4 { - let r = (colors[0 + i / 2] >> shift) & 0x0f; + let r = (colors[i / 2] >> shift) & 0x0f; let g = (colors[2 + i / 2] >> shift) & 0x0f; let b = (colors[4 + i / 2] >> shift) & 0x0f; @@ -152,7 +152,7 @@ impl Sdl2VideoDevice { } impl Device for Sdl2VideoDevice { - fn dei1(&mut self, vm: &mut Uxn, port: u8) -> Result { + fn dei1(&mut self, _vm: &mut Uxn, port: u8) -> Result { let slot = port & 0xF; // FIXME: this is sorta copypasta, but LOTS of source byte order assumptions here. match slot { @@ -169,7 +169,7 @@ impl Device for Sdl2VideoDevice { /** * Callback used by UXN to do output through a "device". */ - fn deo1(&mut self, vm: &mut Uxn, port: u8, val: u8) -> Result<(), DeviceError> { + fn deo1(&mut self, _vm: &mut Uxn, port: u8, val: u8) -> Result<(), DeviceError> { let slot = port & 0xF; match slot { // Writing to the device vector