22w14c Made some (maybe) performance changes

This commit is contained in:
LAX1DUDE 2022-04-09 22:43:20 -07:00
parent 6946edc396
commit 767864ad1a
9 changed files with 77201 additions and 77198 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@ public class ConfigConstants {
public static boolean profanity = false;
public static final String version = "22w14b";
public static final String version = "22w14c";
public static final String mainMenuString = "eaglercraft " + version;
public static final String forkMe = "https://github.com/LAX1DUDE/eaglercraft";

View File

@ -377,7 +377,7 @@ public class EaglerAdapterImpl2 {
private static boolean enableRepeatEvents = false;
private static boolean isWindowFocused = true;
@JSBody(params = { }, script = "return {antialias: false, depth: true, powerPreference: \"high-performance\", desynchronized: false, preserveDrawingBuffer: false, premultipliedAlpha: false, alpha: false};")
@JSBody(params = { }, script = "return {antialias: false, depth: true, powerPreference: \"high-performance\", desynchronized: true, preserveDrawingBuffer: false, premultipliedAlpha: false, alpha: false};")
public static native JSObject youEagler();
public static final int _wGL_TEXTURE_2D = TEXTURE_2D;
@ -985,13 +985,29 @@ public class EaglerAdapterImpl2 {
@JSBody(params = { "obj" }, script = "if(obj.commit) obj.commit();")
private static native int commitContext(JSObject obj);
public static final void updateDisplay() {
commitContext(webgl);
try {
Thread.sleep(1l);
} catch (InterruptedException e) {
;
@JSBody(params = { "obj", "def" }, script = "return window.eagler && (typeof window.eagler[obj] === 'boolean' ? window.eagler[obj] : def);")
private static native boolean getJavascriptFlag(String obj, boolean def);
@JSBody(params = { "obj" }, script = "return typeof obj === 'boolean';")
private static native boolean hasJavascriptFlag(String obj);
@Async
private static native Object delayFor0Millis();
private static void delayFor0Millis(AsyncCallback<Object> cb) {
Window.setTimeout(new TimerHandler() {
@Override
public void onTimer() {
cb.complete(null);
}
}, 0);
}
public static final void updateDisplay() {
//if(getJavascriptFlag("displayUpdateCommitContext", true)) {
commitContext(webgl);
//}
delayFor0Millis();
}
public static final void setVSyncEnabled(boolean p1) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long