TODO: need to auto detect ANGLE bug

This commit is contained in:
LAX1DUDE 2022-08-10 19:21:54 -07:00
parent d01c6fb300
commit 10a63f7038
7 changed files with 27 additions and 30 deletions

View File

@ -322,9 +322,7 @@ public class Minecraft implements Runnable {
int var4 = var2.getScaledHeight();
this.voiceOverlay.setResolution(var3, var4);
//if (this.serverName != null) {
// this.displayGuiScreen(new GuiConnecting(new GuiMainMenu(), this, this.serverName, this.serverPort));
//} else {
EaglerAdapter.anisotropicPatch(EaglerAdapter.glNeedsAnisotropicFix());
EaglerProfile.loadFromStorage();
@ -1154,8 +1152,6 @@ public class Minecraft implements Runnable {
--this.rightClickDelayTimer;
}
EaglerAdapter.anisotropicPatch(this.gameSettings.patchAnisotropic);
this.mcProfiler.startSection("stats");
this.mcProfiler.endStartSection("gui");

View File

@ -7,7 +7,7 @@ public enum EnumOptions {
AMBIENT_OCCLUSION("options.ao", false, false), GUI_SCALE("options.guiScale", false, false), RENDER_CLOUDS("options.renderClouds", false, true), PARTICLES("options.particles", false, false),
CHAT_VISIBILITY("options.chat.visibility", false, false), CHAT_COLOR("options.chat.color", false, true), CHAT_LINKS("options.chat.links", false, true), CHAT_OPACITY("options.chat.opacity", true, false),
CHAT_LINKS_PROMPT("options.chat.links.prompt", false, true), USE_SERVER_TEXTURES("options.serverTextures", false, true), SNOOPER_ENABLED("options.snooper", false, true), USE_FULLSCREEN("options.fullscreen", false, true),
PATCH_ANGLE("options.patchAnisotropic", false, true), ENABLE_FOG("options.fog", false, true), SHOW_CAPE("options.showCape", false, true), ANTIALIASING("options.framebufferAntialias", false, false), CHAT_SCALE("options.chat.scale", true, false), CHAT_WIDTH("options.chat.width", true, false),
ENABLE_FOG("options.fog", false, true), SHOW_CAPE("options.showCape", false, true), ANTIALIASING("options.framebufferAntialias", false, false), CHAT_SCALE("options.chat.scale", true, false), CHAT_WIDTH("options.chat.width", true, false),
CHAT_HEIGHT_FOCUSED("options.chat.height.focused", true, false), CHAT_HEIGHT_UNFOCUSED("options.chat.height.unfocused", true, false), CHUNK_UPDATES("options.chunkUpdates", false, false);
private final boolean enumFloat;

View File

@ -64,12 +64,6 @@ class EnumOptionsHelper {
;
}
try {
enumOptionsMappingHelperArray[EnumOptions.PATCH_ANGLE.ordinal()] = 12;
} catch (NoSuchFieldError var3) {
;
}
try {
enumOptionsMappingHelperArray[EnumOptions.SHOW_CAPE.ordinal()] = 13;
} catch (NoSuchFieldError var2) {

View File

@ -62,7 +62,6 @@ public class GameSettings {
public boolean showCape = true;
public boolean touchscreen = false;
public int antialiasMode = 1;
public boolean patchAnisotropic = false;
public int overrideWidth = 0;
public int overrideHeight = 0;
public boolean heldItemTooltips = true;
@ -163,7 +162,6 @@ public class GameSettings {
this.particleSetting = 0;
this.language = "en_US";
this.mc = par1Minecraft;
this.patchAnisotropic = EaglerAdapter.isWindows();
this.loadOptions();
}
@ -358,11 +356,6 @@ public class GameSettings {
}
}
if (par1EnumOptions == EnumOptions.PATCH_ANGLE) {
this.patchAnisotropic = !this.patchAnisotropic;
this.mc.renderGlobal.loadRenderers();
}
this.saveOptions();
}
@ -413,9 +406,6 @@ public class GameSettings {
case 11:
return this.fullScreen;
case 12:
return this.patchAnisotropic;
case 13:
return this.showCape;
@ -523,7 +513,6 @@ public class GameSettings {
if(yee.hasKey("chatHeightUnfocused")) this.chatHeightUnfocused = yee.getFloat("chatHeightUnfocused");
if(yee.hasKey("chatScale")) this.chatScale = yee.getFloat("chatScale");
if(yee.hasKey("chatWidth")) this.chatWidth = yee.getFloat("chatWidth");
if(yee.hasKey("patchAnisotropic")) this.patchAnisotropic = yee.getBoolean("patchAnisotropic");
if(yee.hasKey("showCoordinates")) this.showCoordinates = yee.getBoolean("showCoordinates");
if(yee.hasKey("showSkinJacket")) showSkinJacket = yee.getBoolean("showSkinJacket");
if(yee.hasKey("showSkinHat")) showSkinHat = yee.getBoolean("showSkinHat");
@ -598,7 +587,6 @@ public class GameSettings {
yee.setFloat("chatHeightUnfocused", this.chatHeightUnfocused);
yee.setFloat("chatScale", this.chatScale);
yee.setFloat("chatWidth", this.chatWidth);
yee.setBoolean("patchAnisotropic", this.patchAnisotropic);
yee.setBoolean("showCoordinates", this.showCoordinates);
yee.setBoolean("showSkinJacket", showSkinJacket);
yee.setBoolean("showSkinHat", showSkinHat);

View File

@ -17,7 +17,7 @@ public class GuiVideoSettings extends GuiScreen {
/** An array of all of EnumOption's video options. */
private static EnumOptions[] videoOptions = new EnumOptions[] { EnumOptions.GRAPHICS, EnumOptions.RENDER_DISTANCE, EnumOptions.AMBIENT_OCCLUSION, EnumOptions.FRAMERATE_LIMIT, EnumOptions.ANAGLYPH, EnumOptions.VIEW_BOBBING,
EnumOptions.GUI_SCALE, EnumOptions.GAMMA, EnumOptions.RENDER_CLOUDS, EnumOptions.ENABLE_FOG, EnumOptions.PARTICLES, EnumOptions.PATCH_ANGLE, EnumOptions.CHUNK_UPDATES };
EnumOptions.GUI_SCALE, EnumOptions.GAMMA, EnumOptions.RENDER_CLOUDS, EnumOptions.ENABLE_FOG, EnumOptions.PARTICLES, EnumOptions.CHUNK_UPDATES };
public GuiVideoSettings(GuiScreen par1GuiScreen, GameSettings par2GameSettings) {
this.parentGuiScreen = par1GuiScreen;

View File

@ -0,0 +1,21 @@
package net.lax1dude.eaglercraft.adapter;
import static net.lax1dude.eaglercraft.adapter.teavm.WebGL2RenderingContext.*;
import org.teavm.jso.browser.Window;
import org.teavm.jso.dom.html.HTMLCanvasElement;
import net.lax1dude.eaglercraft.adapter.teavm.WebGL2RenderingContext;
public class DetectAnisotropicGlitch {
public static boolean detectGlitch() {
//HTMLCanvasElement cvs = (HTMLCanvasElement) Window.current().getDocument().createElement("canvas");
//WebGL2RenderingContext ctx = (WebGL2RenderingContext) cvs.getContext("webgl2");
return EaglerAdapterImpl2.isWindows(); //TODO
}
}

View File

@ -1,7 +1,6 @@
package net.lax1dude.eaglercraft.adapter;
import static net.lax1dude.eaglercraft.adapter.teavm.WebGL2RenderingContext.*;
import static org.teavm.jso.webgl.WebGLRenderingContext.*;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@ -108,10 +107,6 @@ public class EaglerAdapterImpl2 {
public static final boolean _wisWebGL() {
return true;
}
private static boolean isAnisotropicPatched = false;
public static final boolean _wisAnisotropicPatched() {
return isAnisotropicPatched;
}
public static final String _wgetShaderHeader() {
return "#version 300 es";
}
@ -966,6 +961,9 @@ public class EaglerAdapterImpl2 {
public static final boolean isWindows() {
return getNavString("platform").toLowerCase().contains("win");
}
public static final boolean glNeedsAnisotropicFix() {
return DetectAnisotropicGlitch.detectGlitch();
}
private static HTMLCanvasElement imageLoadCanvas = null;
private static CanvasRenderingContext2D imageLoadContext = null;