From 6eda31365cb2eb9dc4eb72a538c4527f52b85c2a Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Sat, 11 Apr 2020 10:21:03 +0200 Subject: [PATCH] vmd: correct u8 conversion --- nihav-game/src/codecs/vmd.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/nihav-game/src/codecs/vmd.rs b/nihav-game/src/codecs/vmd.rs index ef1e60a..32041ce 100644 --- a/nihav-game/src/codecs/vmd.rs +++ b/nihav-game/src/codecs/vmd.rs @@ -374,11 +374,7 @@ impl VMDAudioDecoder { } } fn cvt_u8(val: u8) -> u8 { - if val < 128 { - 127 - val - } else { - val - } + val ^ 0x80 } } -- 2.39.5