Update #47 - Singleplayer lag fixes

This commit is contained in:
lax1dude
2025-01-19 13:26:27 -08:00
parent 3f5ee57068
commit 1f0d593a8c
2052 changed files with 133581 additions and 2339 deletions

View File

@ -42,9 +42,11 @@ import org.teavm.platform.PlatformRunnable;
import com.google.common.collect.Collections2;
import com.google.common.collect.Iterators;
import com.google.common.collect.Sets;
import com.jcraft.jzlib.Deflater;
import com.jcraft.jzlib.DeflaterOutputStream;
import com.jcraft.jzlib.GZIPInputStream;
import com.jcraft.jzlib.GZIPOutputStream;
import com.jcraft.jzlib.Inflater;
import com.jcraft.jzlib.InflaterInputStream;
import net.lax1dude.eaglercraft.v1_8.internal.buffer.ByteBuffer;
@ -539,11 +541,21 @@ public class PlatformRuntime {
}
public static String getGLVersion() {
return PlatformOpenGL._wglGetString(RealOpenGLEnums.GL_VERSION);
String ret = PlatformOpenGL._wglGetString(RealOpenGLEnums.GL_VERSION);
if(ret != null) {
return ret;
}else {
return "null";
}
}
public static String getGLRenderer() {
return PlatformOpenGL._wglGetString(RealOpenGLEnums.GL_RENDERER);
String ret = PlatformOpenGL._wglGetString(RealOpenGLEnums.GL_RENDERER);
if(ret != null) {
return ret;
}else {
return "null";
}
}
public static ByteBuffer allocateByteBuffer(int length) {
@ -1070,6 +1082,23 @@ public class PlatformRuntime {
return new DeflaterOutputStream(os);
}
@SuppressWarnings("deprecation")
public static int deflateFull(byte[] input, int inputOff, int inputLen, byte[] output, int outputOff,
int outputLen) throws IOException {
Deflater df = new Deflater();
df.setInput(input, inputOff, inputLen, false);
df.setOutput(output, outputOff, outputLen);
df.init(5);
int c;
do {
c = df.deflate(4);
if(c != 0 && c != 1) {
throw new IOException("Deflater failed! Code " + c);
}
}while(c != 1);
return (int)df.getTotalOut();
}
public static OutputStream newGZIPOutputStream(OutputStream os) throws IOException {
return new GZIPOutputStream(os);
}
@ -1078,6 +1107,22 @@ public class PlatformRuntime {
return new InflaterInputStream(is);
}
@SuppressWarnings("deprecation")
public static int inflateFull(byte[] input, int inputOff, int inputLen, byte[] output, int outputOff,
int outputLen) throws IOException {
Inflater df = new Inflater();
df.setInput(input, inputOff, inputLen, false);
df.setOutput(output, outputOff, outputLen);
int c;
do {
c = df.inflate(0);
if(c != 0 && c != 1) {
throw new IOException("Inflater failed! Code " + c);
}
}while(c != 1);
return (int)df.getTotalOut();
}
public static InputStream newGZIPInputStream(InputStream is) throws IOException {
return new GZIPInputStream(is);
}

View File

@ -9,7 +9,7 @@ import org.teavm.jso.typedarrays.Int8Array;
import net.lax1dude.eaglercraft.v1_8.internal.teavm.TeaVMUtils;
/**
* Copyright (c) 2022-2023 lax1dude. All Rights Reserved.
* Copyright (c) 2022-2025 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
@ -23,7 +23,7 @@ import net.lax1dude.eaglercraft.v1_8.internal.teavm.TeaVMUtils;
* POSSIBILITY OF SUCH DAMAGE.
*
*/
public class EaglerArrayByteBuffer implements ByteBuffer {
public class EaglerArrayByteBuffer extends ByteBuffer {
final DataView dataView;
final Int8Array typedArray;

View File

@ -5,7 +5,7 @@ import org.teavm.jso.typedarrays.Float32Array;
import net.lax1dude.eaglercraft.v1_8.internal.teavm.TeaVMUtils;
/**
* Copyright (c) 2022-2023 lax1dude. All Rights Reserved.
* Copyright (c) 2022-2025 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
@ -19,7 +19,7 @@ import net.lax1dude.eaglercraft.v1_8.internal.teavm.TeaVMUtils;
* POSSIBILITY OF SUCH DAMAGE.
*
*/
public class EaglerArrayFloatBuffer implements FloatBuffer {
public class EaglerArrayFloatBuffer extends FloatBuffer {
final Float32Array typedArray;

View File

@ -5,7 +5,7 @@ import org.teavm.jso.typedarrays.Int32Array;
import net.lax1dude.eaglercraft.v1_8.internal.teavm.TeaVMUtils;
/**
* Copyright (c) 2022-2023 lax1dude. All Rights Reserved.
* Copyright (c) 2022-2025 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
@ -19,7 +19,7 @@ import net.lax1dude.eaglercraft.v1_8.internal.teavm.TeaVMUtils;
* POSSIBILITY OF SUCH DAMAGE.
*
*/
public class EaglerArrayIntBuffer implements IntBuffer {
public class EaglerArrayIntBuffer extends IntBuffer {
final Int32Array typedArray;

View File

@ -5,7 +5,7 @@ import org.teavm.jso.typedarrays.Int16Array;
import net.lax1dude.eaglercraft.v1_8.internal.teavm.TeaVMUtils;
/**
* Copyright (c) 2022-2023 lax1dude. All Rights Reserved.
* Copyright (c) 2022-2025 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
@ -19,7 +19,7 @@ import net.lax1dude.eaglercraft.v1_8.internal.teavm.TeaVMUtils;
* POSSIBILITY OF SUCH DAMAGE.
*
*/
public class EaglerArrayShortBuffer implements ShortBuffer {
public class EaglerArrayShortBuffer extends ShortBuffer {
final Int16Array typedArray;