mirror of
https://github.com/Eaglercraft-Archive/Eaglercraftx-1.8.8-src.git
synced 2025-06-27 18:38:14 -05:00
Update #24 - 1000s of optimizations, shared worlds on desktop
This commit is contained in:
@ -42,11 +42,13 @@ public interface IClientConfigAdapter {
|
||||
|
||||
String getWorldsDB();
|
||||
|
||||
String getResourcePacksDB();
|
||||
|
||||
JSONObject dumpConfig();
|
||||
|
||||
List<RelayEntry> getRelays();
|
||||
|
||||
boolean checkShaderGLErrors();
|
||||
boolean isCheckShaderGLErrors();
|
||||
|
||||
boolean isDemo();
|
||||
|
||||
|
@ -188,8 +188,12 @@ public class VFile2 {
|
||||
return null;
|
||||
}
|
||||
ByteBuffer readBuffer = PlatformFilesystem.eaglerRead(path);
|
||||
byte[] copyBuffer = PlatformRuntime.castNativeByteBuffer(readBuffer);
|
||||
if(copyBuffer != null) {
|
||||
return copyBuffer;
|
||||
}
|
||||
try {
|
||||
byte[] copyBuffer = new byte[readBuffer.remaining()];
|
||||
copyBuffer = new byte[readBuffer.remaining()];
|
||||
readBuffer.get(copyBuffer);
|
||||
return copyBuffer;
|
||||
}finally {
|
||||
@ -219,7 +223,12 @@ public class VFile2 {
|
||||
|
||||
public void setAllBytes(byte[] bytes) {
|
||||
assertNotRelative();
|
||||
ByteBuffer copyBuffer = PlatformRuntime.allocateByteBuffer(bytes.length);
|
||||
ByteBuffer copyBuffer = PlatformRuntime.castPrimitiveByteArray(bytes);
|
||||
if(copyBuffer != null) {
|
||||
PlatformFilesystem.eaglerWrite(path, copyBuffer);
|
||||
return;
|
||||
}
|
||||
copyBuffer = PlatformRuntime.allocateByteBuffer(bytes.length);
|
||||
try {
|
||||
copyBuffer.put(bytes);
|
||||
copyBuffer.flip();
|
||||
|
@ -54,7 +54,7 @@ class VFileInputStream extends InputStream {
|
||||
if(len > 0) {
|
||||
fileBuffer.get(b, off, len);
|
||||
}
|
||||
return len;
|
||||
return len <= 0 ? -1 : len;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,8 +1,8 @@
|
||||
package net.lax1dude.eaglercraft.v1_8.internal.vfs2;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglerOutputStream;
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.PlatformFilesystem;
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime;
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.buffer.ByteBuffer;
|
||||
@ -22,7 +22,7 @@ import net.lax1dude.eaglercraft.v1_8.internal.buffer.ByteBuffer;
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
class VFileOutputStream extends ByteArrayOutputStream {
|
||||
class VFileOutputStream extends EaglerOutputStream {
|
||||
|
||||
private final VFile2 vfsFile;
|
||||
private boolean closed = false;
|
||||
|
Reference in New Issue
Block a user