mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-05-27 05:44:51 +00:00
framerate is float
This commit is contained in:
@@ -295,7 +295,6 @@ public class SWFOutputStream extends OutputStream {
|
||||
public void writeFIXED(double value) throws IOException {
|
||||
long valueLong = (long) (value * (1 << 16));
|
||||
int beforePoint = (int) valueLong >> 16;
|
||||
|
||||
int afterPoint = (int) valueLong % (1 << 16);
|
||||
writeUI16(afterPoint);
|
||||
writeUI16(beforePoint);
|
||||
@@ -308,10 +307,11 @@ public class SWFOutputStream extends OutputStream {
|
||||
* @throws IOException
|
||||
*/
|
||||
public void writeFIXED8(float value) throws IOException {
|
||||
int beforePoint = (int) getIntPart(value);
|
||||
int afterPoint = (int) getIntPart((value + (value < 0 ? beforePoint : -beforePoint)) * 256);
|
||||
final int divisor = 1 << 8;
|
||||
int beforePoint = (int) value;
|
||||
int afterPoint = Math.abs((int) (value * divisor)) % divisor;
|
||||
writeUI8(afterPoint);
|
||||
writeUI8(beforePoint);
|
||||
writeSI8(beforePoint);
|
||||
}
|
||||
|
||||
private void writeLong(long value) throws IOException {
|
||||
@@ -578,13 +578,6 @@ public class SWFOutputStream extends OutputStream {
|
||||
return nBits;
|
||||
}
|
||||
|
||||
private static long getIntPart(double value) {
|
||||
if (value < 0) {
|
||||
return (long) Math.ceil(value);
|
||||
}
|
||||
return (long) Math.floor(value);
|
||||
}
|
||||
|
||||
public static int unsignedSize(final int value) {
|
||||
|
||||
final int val = (value < 0) ? -value - 1 : value;
|
||||
|
||||
Reference in New Issue
Block a user