From 518a4e21b14feb7e4a170be151c999a8a7727b65 Mon Sep 17 00:00:00 2001 From: nickgkg Date: Thu, 16 Jul 2020 13:43:49 -0400 Subject: [PATCH] also fix serialization --- .../src/com/jpexs/decompiler/flash/SWFOutputStream.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFOutputStream.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFOutputStream.java index df8dbbec6..73e2eba6e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFOutputStream.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFOutputStream.java @@ -312,9 +312,9 @@ public class SWFOutputStream extends OutputStream { * @throws IOException */ public void writeFIXED8(float value) throws IOException { - final int divisor = 1 << 8; - int beforePoint = (int) value; - int afterPoint = Math.abs((int) (value * divisor)) % divisor; + int valueInt = (int) (value * (1 << 8)); + int beforePoint = (int) valueInt >> 8; + int afterPoint = (int) valueInt % (1 << 8); writeUI8(afterPoint); writeSI8(beforePoint); }