mirror of
https://github.com/Eaglercraft-Archive/Eaglercraftx-1.8.8-src.git
synced 2025-06-27 18:38:14 -05:00
Update #47 - Singleplayer lag fixes
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user