]> git.nihav.org Git - nihav.git/commitdiff
vmd: correct u8 conversion
authorKostya Shishkov <kostya.shishkov@gmail.com>
Sat, 11 Apr 2020 08:21:03 +0000 (10:21 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Sat, 11 Apr 2020 08:21:44 +0000 (10:21 +0200)
nihav-game/src/codecs/vmd.rs

index ef1e60a88545f1c86aca58deb0f0232f32177572..32041cebe3bf4a9b77adf4dd338181ad625c7d79 100644 (file)
@@ -374,11 +374,7 @@ impl VMDAudioDecoder {
         }
     }
     fn cvt_u8(val: u8) -> u8 {
-        if val < 128 {
-            127 - val
-        } else {
-            val
-        }
+        val ^ 0x80
     }
 }