Fix issues with desktop runtime

This commit is contained in:
lax1dude 2024-03-10 17:34:48 -07:00
parent 6366638193
commit 0821e23613
9 changed files with 38 additions and 23 deletions

View File

@ -13,17 +13,15 @@
> DELETE 2 @ 2 : 3 > DELETE 2 @ 2 : 3
> CHANGE 1 : 15 @ 1 : 11 > CHANGE 1 : 13 @ 1 : 11
~ import java.util.Set; ~ import java.util.Set;
~ ~
~ import net.lax1dude.eaglercraft.v1_8.internal.PlatformAudio; ~ import net.lax1dude.eaglercraft.v1_8.internal.PlatformAudio;
~ ~
~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
~ import net.lax1dude.eaglercraft.v1_8.EaglercraftSoundManager;
~
~ import com.google.common.collect.Lists; ~ import com.google.common.collect.Lists;
~ ~
~ import net.lax1dude.eaglercraft.v1_8.EaglercraftSoundManager;
~ import net.lax1dude.eaglercraft.v1_8.IOUtils; ~ import net.lax1dude.eaglercraft.v1_8.IOUtils;
~ import net.lax1dude.eaglercraft.v1_8.ThreadLocalRandom; ~ import net.lax1dude.eaglercraft.v1_8.ThreadLocalRandom;
~ import net.lax1dude.eaglercraft.v1_8.json.JSONTypeProvider; ~ import net.lax1dude.eaglercraft.v1_8.json.JSONTypeProvider;

View File

@ -154,8 +154,9 @@
> DELETE 3 @ 3 : 6 > DELETE 3 @ 3 : 6
> CHANGE 6 : 8 @ 6 : 7 > CHANGE 5 : 8 @ 5 : 7
~ } catch (Throwable var2) {
~ logger.error("Failed to load resource pack icon for \"{}\"!", reResourcePack.resourcePackFile); ~ logger.error("Failed to load resource pack icon for \"{}\"!", reResourcePack.resourcePackFile);
~ logger.error(var2); ~ logger.error(var2);

View File

@ -7,7 +7,7 @@
> CHANGE 3 : 5 @ 3 : 8 > CHANGE 3 : 5 @ 3 : 8
~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; ~
~ import net.lax1dude.eaglercraft.v1_8.ThreadLocalRandom; ~ import net.lax1dude.eaglercraft.v1_8.ThreadLocalRandom;
> INSERT 6 : 7 @ 6 > INSERT 6 : 7 @ 6

View File

@ -80,7 +80,8 @@ public class PlatformFilesystem {
} }
} }
}else { }else {
throw new EaglerFileSystemException("Not a file: " + f.getAbsolutePath()); logger.warn("Tried to read file that doesn't exist: \"{}\"", f.getAbsolutePath());
return null;
} }
} }

View File

@ -192,6 +192,10 @@ public class PlatformInput {
cursorHand = glfwCreateStandardCursor(GLFW_HAND_CURSOR); cursorHand = glfwCreateStandardCursor(GLFW_HAND_CURSOR);
cursorText = glfwCreateStandardCursor(GLFW_IBEAM_CURSOR); cursorText = glfwCreateStandardCursor(GLFW_IBEAM_CURSOR);
glfwSetCursor(glfwWindow, cursorDefault); glfwSetCursor(glfwWindow, cursorDefault);
if(!fullscreen && startupFullscreen) {
toggleFullscreen();
}
} }
public static int getWindowWidth() { public static int getWindowWidth() {
@ -386,6 +390,7 @@ public class PlatformInput {
} }
private static boolean fullscreen = false; private static boolean fullscreen = false;
private static boolean startupFullscreen = false;
private static int[] lastPos = new int[4]; private static int[] lastPos = new int[4];
public static void toggleFullscreen() { public static void toggleFullscreen() {
@ -407,6 +412,10 @@ public class PlatformInput {
fullscreen = !fullscreen; fullscreen = !fullscreen;
} }
public static void setStartupFullscreen(boolean bool) {
startupFullscreen = bool;
}
// https://stackoverflow.com/a/31526753 // https://stackoverflow.com/a/31526753
private static long getCurrentMonitor(long window) { private static long getCurrentMonitor(long window) {
int nmonitors, i; int nmonitors, i;

View File

@ -6,6 +6,7 @@ import javax.swing.UnsupportedLookAndFeelException;
import net.lax1dude.eaglercraft.v1_8.EagRuntime; import net.lax1dude.eaglercraft.v1_8.EagRuntime;
import net.lax1dude.eaglercraft.v1_8.EagUtils; import net.lax1dude.eaglercraft.v1_8.EagUtils;
import net.lax1dude.eaglercraft.v1_8.internal.EnumPlatformANGLE; import net.lax1dude.eaglercraft.v1_8.internal.EnumPlatformANGLE;
import net.lax1dude.eaglercraft.v1_8.internal.PlatformInput;
import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime; import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime;
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.program.ShaderSource; import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.program.ShaderSource;
import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayManager; import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayManager;
@ -40,6 +41,20 @@ public class LWJGLEntryPoint {
System.err.println("Could not set system look and feel: " + e.toString()); System.err.println("Could not set system look and feel: " + e.toString());
} }
boolean hideRenderDocDialog = false;
for(int i = 0; i < args.length; ++i) {
if(args[i].equalsIgnoreCase("highp")) {
ShaderSource.setHighP(true);
}
if(args[i].equalsIgnoreCase("hide-renderdoc")) {
hideRenderDocDialog = true;
}
if(args[i].equalsIgnoreCase("fullscreen")) {
PlatformInput.setStartupFullscreen(true);
}
}
if(!hideRenderDocDialog) {
LaunchRenderDocDialog lr = new LaunchRenderDocDialog(); LaunchRenderDocDialog lr = new LaunchRenderDocDialog();
lr.setLocationRelativeTo(null); lr.setLocationRelativeTo(null);
lr.setVisible(true); lr.setVisible(true);
@ -49,15 +64,10 @@ public class LWJGLEntryPoint {
} }
lr.dispose(); lr.dispose();
}
getANGLEPlatformFromArgs(args); getANGLEPlatformFromArgs(args);
for(int i = 0; i < args.length; ++i) {
if(args[i].equalsIgnoreCase("highp")) {
ShaderSource.setHighP(true);
}
}
RelayManager.relayManager.load(EagRuntime.getStorage("r")); RelayManager.relayManager.load(EagRuntime.getStorage("r"));
if (RelayManager.relayManager.count() <= 0) { if (RelayManager.relayManager.count() <= 0) {

View File

@ -2,7 +2,6 @@ package net.lax1dude.eaglercraft.v1_8.internal.lwjgl;
import javax.swing.JFrame; import javax.swing.JFrame;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
import javax.swing.JTextArea; import javax.swing.JTextArea;

View File

@ -10,7 +10,6 @@ import net.lax1dude.eaglercraft.v1_8.minecraft.GuiScreenGenericErrorMessage;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.resources.I18n; import net.minecraft.client.resources.I18n;
import net.minecraft.client.resources.ResourcePackRepository;
/** /**
* Copyright (c) 2024 lax1dude. All Rights Reserved. * Copyright (c) 2024 lax1dude. All Rights Reserved.

View File

@ -4,13 +4,11 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import net.lax1dude.eaglercraft.v1_8.EagRuntime; import net.lax1dude.eaglercraft.v1_8.EagRuntime;
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
import net.lax1dude.eaglercraft.v1_8.EaglercraftVersion; import net.lax1dude.eaglercraft.v1_8.EaglercraftVersion;
import net.lax1dude.eaglercraft.v1_8.ThreadLocalRandom; import net.lax1dude.eaglercraft.v1_8.ThreadLocalRandom;
import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayManager; import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayManager;
import org.json.JSONArray; import org.json.JSONArray;
import org.json.JSONObject; import org.json.JSONObject;
import org.teavm.jso.JSBody;
import org.teavm.jso.JSObject; import org.teavm.jso.JSObject;
import net.lax1dude.eaglercraft.v1_8.internal.IClientConfigAdapter; import net.lax1dude.eaglercraft.v1_8.internal.IClientConfigAdapter;