Fix issues with desktop runtime

This commit is contained in:
eaglercraft 2024-03-10 18:30:16 -07:00
parent aae277ed5d
commit d262f9c825
9 changed files with 36 additions and 22 deletions

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,24 +41,33 @@ 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());
} }
LaunchRenderDocDialog lr = new LaunchRenderDocDialog(); boolean hideRenderDocDialog = false;
lr.setLocationRelativeTo(null);
lr.setVisible(true);
while(lr.isVisible()) {
EagUtils.sleep(100l);
}
lr.dispose();
getANGLEPlatformFromArgs(args);
for(int i = 0; i < args.length; ++i) { for(int i = 0; i < args.length; ++i) {
if(args[i].equalsIgnoreCase("highp")) { if(args[i].equalsIgnoreCase("highp")) {
ShaderSource.setHighP(true); 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();
lr.setLocationRelativeTo(null);
lr.setVisible(true);
while(lr.isVisible()) {
EagUtils.sleep(100l);
}
lr.dispose();
}
getANGLEPlatformFromArgs(args);
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

@ -11,11 +11,9 @@ 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

@ -185,7 +185,7 @@ public class ResourcePackRepository {
try { try {
this.texturePackIcon = this.reResourcePack.getPackImage(); this.texturePackIcon = this.reResourcePack.getPackImage();
} catch (IOException var2) { } 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

@ -1,7 +1,7 @@
package net.minecraft.command; package net.minecraft.command;
import java.util.List; import java.util.List;
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
import net.lax1dude.eaglercraft.v1_8.ThreadLocalRandom; import net.lax1dude.eaglercraft.v1_8.ThreadLocalRandom;
import net.minecraft.server.MinecraftServer; import net.minecraft.server.MinecraftServer;
import net.minecraft.util.BlockPos; import net.minecraft.util.BlockPos;

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;