Skip to content

Commit 57e37a7

Browse files
author
eaglercraft
committed
u38
1 parent b302c97 commit 57e37a7

File tree

14 files changed

+95
-103
lines changed

14 files changed

+95
-103
lines changed
771 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"pluginName":"EaglercraftXBungee","pluginVersion":"1.3.0","pluginButton":"Download \"EaglerXBungee-1.3.0.jar\"","pluginFilename":"EaglerXBungee.zip"}
1+
{"pluginName":"EaglercraftXBungee","pluginVersion":"1.3.1","pluginButton":"Download \"EaglerXBungee-1.3.1.jar\"","pluginFilename":"EaglerXBungee.zip"}

src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformRuntime.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public static void create() {
8686
endiannessTestBytes.asIntBuffer().put(0x6969420);
8787
if (((endiannessTestBytes.get(0) & 0xFF) | ((endiannessTestBytes.get(1) & 0xFF) << 8)
8888
| ((endiannessTestBytes.get(2) & 0xFF) << 16) | ((endiannessTestBytes.get(3) & 0xFF) << 24)) != 0x6969420) {
89-
throw new UnsupportedOperationException("Big endian CPU detected! (somehow)");
89+
throw new PlatformIncompatibleException("Big endian CPU detected! (somehow)");
9090
}else {
9191
logger.info("Endianness: this CPU is little endian");
9292
}
@@ -158,7 +158,7 @@ public static void create() {
158158
}
159159
}
160160
if(myGLVersion == -1) {
161-
throw new RuntimeException("Could not create a supported OpenGL ES context!");
161+
throw new PlatformIncompatibleException("Could not create a supported OpenGL ES context!");
162162
}
163163

164164
glfwSetWindowPos(windowHandle, winX, winY);
@@ -218,7 +218,7 @@ public static void create() {
218218
int[] major = new int[] { 1 };
219219
int[] minor = new int[] { 4 };
220220
if(!eglInitialize(glfw_eglHandle, major, minor)) {
221-
throw new RuntimeException("Could not initialize EGL");
221+
throw new RuntimeInitializationFailureException("Could not initialize EGL");
222222
}
223223

224224
EGL.createDisplayCapabilities(glfw_eglHandle, major[0], minor[0]);
@@ -239,7 +239,7 @@ public static void create() {
239239
logger.warn("Note: try adding the \"d3d9\" option if you are on windows trying to get GLES 2.0");
240240
}
241241
if(realGLVersion != 320 && realGLVersion != 310 && realGLVersion != 300 && realGLVersion != 200) {
242-
throw new RuntimeException("Unsupported OpenGL ES version detected: " + realGLVersion);
242+
throw new PlatformIncompatibleException("Unsupported OpenGL ES version detected: " + realGLVersion);
243243
}
244244
myGLVersion = realGLVersion;
245245
PlatformOpenGL.setCurrentContext(myGLVersion, caps);

src/main/java/net/lax1dude/eaglercraft/v1_8/EaglercraftVersion.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public class EaglercraftVersion {
1010
/// Customize these to fit your fork:
1111

1212
public static final String projectForkName = "EaglercraftX";
13-
public static final String projectForkVersion = "u37";
13+
public static final String projectForkVersion = "u38";
1414
public static final String projectForkVendor = "lax1dude";
1515

1616
public static final String projectForkURL = "https://gitlab.com/lax1dude/eaglercraftx-1.8";
@@ -20,7 +20,7 @@ public class EaglercraftVersion {
2020
public static final String projectOriginName = "EaglercraftX";
2121
public static final String projectOriginAuthor = "lax1dude";
2222
public static final String projectOriginRevision = "1.8";
23-
public static final String projectOriginVersion = "u37";
23+
public static final String projectOriginVersion = "u38";
2424

2525
public static final String projectOriginURL = "https://gitlab.com/lax1dude/eaglercraftx-1.8"; // rest in peace
2626

@@ -31,7 +31,7 @@ public class EaglercraftVersion {
3131
public static final boolean enableUpdateService = true;
3232

3333
public static final String updateBundlePackageName = "net.lax1dude.eaglercraft.v1_8.client";
34-
public static final int updateBundlePackageVersionInt = 37;
34+
public static final int updateBundlePackageVersionInt = 38;
3535

3636
public static final String updateLatestLocalStorageKey = "latestUpdate_" + updateBundlePackageName;
3737

src/main/java/net/lax1dude/eaglercraft/v1_8/internal/EnumPlatformType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
*/
1818
public enum EnumPlatformType {
19-
DESKTOP("Desktop"), JAVASCRIPT("HTML5");
19+
DESKTOP("Desktop"), JAVASCRIPT("JavaScript"), ASM("ASM");
2020

2121
private final String name;
2222

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package net.lax1dude.eaglercraft.v1_8.internal;
2+
3+
/**
4+
* Copyright (c) 2022-2024 lax1dude. All Rights Reserved.
5+
*
6+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
7+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
8+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
9+
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
10+
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
11+
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
12+
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
13+
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
14+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
15+
* POSSIBILITY OF SUCH DAMAGE.
16+
*
17+
*/
18+
public class PlatformIncompatibleException extends RuntimeException {
19+
20+
public PlatformIncompatibleException(String s) {
21+
super(s);
22+
}
23+
24+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package net.lax1dude.eaglercraft.v1_8.internal;
2+
3+
/**
4+
* Copyright (c) 2022-2024 lax1dude. All Rights Reserved.
5+
*
6+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
7+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
8+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
9+
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
10+
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
11+
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
12+
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
13+
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
14+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
15+
* POSSIBILITY OF SUCH DAMAGE.
16+
*
17+
*/
18+
public class RuntimeInitializationFailureException extends RuntimeException {
19+
20+
public RuntimeInitializationFailureException(String message, Throwable cause) {
21+
super(message, cause);
22+
}
23+
24+
public RuntimeInitializationFailureException(String s) {
25+
super(s);
26+
}
27+
28+
}

src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/EaglercraftGPU.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -923,10 +923,13 @@ public static final void warmUpCache() {
923923
}
924924

925925
public static final void destroyCache() {
926-
stringCache.clear();
927-
mapTexturesGL.clear();
928-
mapQueriesGL.clear();
929-
mapDisplayListsGL.clear();
926+
GLSLHeader.destroy();
927+
DrawUtils.destroy();
928+
SpriteLevelMixer.destroy();
929+
InstancedFontRenderer.destroy();
930+
InstancedParticleRenderer.destroy();
931+
EffectPipelineFXAA.destroy();
932+
TextureCopyUtil.destroy();
930933
emulatedVAOs = false;
931934
emulatedVAOState = null;
932935
glesVers = -1;
@@ -936,13 +939,10 @@ public static final void destroyCache() {
936939
hasFramebufferHDR16FSupport = false;
937940
hasFramebufferHDR32FSupport = false;
938941
hasLinearHDR32FSupport = false;
939-
GLSLHeader.destroy();
940-
DrawUtils.destroy();
941-
SpriteLevelMixer.destroy();
942-
InstancedFontRenderer.destroy();
943-
InstancedParticleRenderer.destroy();
944-
EffectPipelineFXAA.destroy();
945-
TextureCopyUtil.destroy();
942+
stringCache.clear();
943+
mapTexturesGL.clear();
944+
mapQueriesGL.clear();
945+
mapDisplayListsGL.clear();
946946
}
947947

948948
public static final int checkOpenGLESVersion() {

src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/EffectPipelineFXAA.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ public static void destroy() {
169169
}
170170
if(framebufferColor != -1) {
171171
GlStateManager.deleteTexture(framebufferColor);
172-
framebufferColor = -2;
172+
framebufferColor = -1;
173173
}
174174
if(framebufferDepth != null) {
175175
_wglDeleteRenderbuffer(framebufferDepth);

src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformInput.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,8 @@ public void handleEvent(MouseEvent evt) {
330330
int b = evt.getButton();
331331
b = b == 1 ? 2 : (b == 2 ? 1 : b);
332332
buttonStates[b] = true;
333-
int eventX = (int)(getOffsetX(evt) * windowDPI);
334-
int eventY = windowHeight - (int)(getOffsetY(evt) * windowDPI) - 1;
333+
int eventX = (int)(getOffsetX(evt, touchOffsetXTeaVM) * windowDPI);
334+
int eventY = windowHeight - (int)(getOffsetY(evt, touchOffsetYTeaVM) * windowDPI) - 1;
335335
synchronized(mouseEvents) {
336336
mouseEvents.add(new VMouseEvent(eventX, eventY, b, 0.0f, EVENT_MOUSE_DOWN));
337337
if(mouseEvents.size() > 64) {
@@ -348,8 +348,8 @@ public void handleEvent(MouseEvent evt) {
348348
int b = evt.getButton();
349349
b = b == 1 ? 2 : (b == 2 ? 1 : b);
350350
buttonStates[b] = false;
351-
int eventX = (int)(getOffsetX(evt) * windowDPI);
352-
int eventY = windowHeight - (int)(getOffsetY(evt) * windowDPI) - 1;
351+
int eventX = (int)(getOffsetX(evt, touchOffsetXTeaVM) * windowDPI);
352+
int eventY = windowHeight - (int)(getOffsetY(evt, touchOffsetYTeaVM) * windowDPI) - 1;
353353
synchronized(mouseEvents) {
354354
mouseEvents.add(new VMouseEvent(eventX, eventY, b, 0.0f, EVENT_MOUSE_UP));
355355
if(mouseEvents.size() > 64) {
@@ -363,13 +363,13 @@ public void handleEvent(MouseEvent evt) {
363363
public void handleEvent(MouseEvent evt) {
364364
evt.preventDefault();
365365
evt.stopPropagation();
366-
mouseX = (int)(getOffsetX(evt) * windowDPI);
367-
mouseY = windowHeight - (int)(getOffsetY(evt) * windowDPI) - 1;
366+
mouseX = (int)(getOffsetX(evt, touchOffsetXTeaVM) * windowDPI);
367+
mouseY = windowHeight - (int)(getOffsetY(evt, touchOffsetYTeaVM) * windowDPI) - 1;
368368
mouseDX += evt.getMovementX();
369369
mouseDY += -evt.getMovementY();
370370
if(hasShownPressAnyKey) {
371-
int eventX = (int)(getOffsetX(evt) * windowDPI);
372-
int eventY = windowHeight - (int)(getOffsetY(evt) * windowDPI) - 1;
371+
int eventX = (int)(getOffsetX(evt, touchOffsetXTeaVM) * windowDPI);
372+
int eventY = windowHeight - (int)(getOffsetY(evt, touchOffsetYTeaVM) * windowDPI) - 1;
373373
synchronized(mouseEvents) {
374374
mouseEvents.add(new VMouseEvent(eventX, eventY, -1, 0.0f, EVENT_MOUSE_MOVE));
375375
if(mouseEvents.size() > 64) {
@@ -600,8 +600,8 @@ public void handleEvent(WheelEvent evt) {
600600
double delta = evt.getDeltaY();
601601
mouseDWheel += delta;
602602
if(hasShownPressAnyKey) {
603-
int eventX = (int)(getOffsetX(evt) * windowDPI);
604-
int eventY = windowHeight - (int)(getOffsetY(evt) * windowDPI) - 1;
603+
int eventX = (int)(getOffsetX(evt, touchOffsetXTeaVM) * windowDPI);
604+
int eventY = windowHeight - (int)(getOffsetY(evt, touchOffsetYTeaVM) * windowDPI) - 1;
605605
synchronized(mouseEvents) {
606606
mouseEvents.add(new VMouseEvent(eventX, eventY, -1, (float)delta, EVENT_MOUSE_WHEEL));
607607
if(mouseEvents.size() > 64) {
@@ -825,11 +825,11 @@ private static void iterateKeyboardLayout(KeyboardLayoutIterator cb, final Async
825825
@JSBody(params = { "fallback" }, script = "if(window.navigator.userActivation){return window.navigator.userActivation.hasBeenActive;}else{return fallback;}")
826826
public static native boolean hasBeenActiveTeaVM(boolean fallback);
827827

828-
@JSBody(params = { "m" }, script = "return m.offsetX;")
829-
private static native int getOffsetX(MouseEvent m);
828+
@JSBody(params = { "m", "off" }, script = "return (typeof m.offsetX === \"number\") ? m.offsetX : (m.pageX - off);")
829+
private static native int getOffsetX(MouseEvent m, int offX);
830830

831-
@JSBody(params = { "m" }, script = "return m.offsetY;")
832-
private static native int getOffsetY(MouseEvent m);
831+
@JSBody(params = { "m", "off" }, script = "return (typeof m.offsetY === \"number\") ? m.offsetY : (m.pageY - off);")
832+
private static native int getOffsetY(MouseEvent m, int offY);
833833

834834
@JSBody(params = { "e" }, script = "return (typeof e.which === \"number\") ? e.which : ((typeof e.keyCode === \"number\") ? e.keyCode : 0);")
835835
private static native int getWhich(KeyboardEvent e);

0 commit comments

Comments
 (0)