From: Kostya Shishkov Date: Sat, 11 Apr 2020 08:21:03 +0000 (+0200) Subject: vmd: correct u8 conversion X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=6eda31365cb2eb9dc4eb72a538c4527f52b85c2a;p=nihav.git vmd: correct u8 conversion --- 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 } }