fixed lighting and poor ANGLE issue #4994 patch performance

This commit is contained in:
LAX1DUDE 2022-01-08 23:35:35 -08:00
parent 1da594e102
commit f0aca67bb0
56 changed files with 64407 additions and 63553 deletions

View File

@ -28,6 +28,7 @@ sourceSets {
repositories { repositories {
jcenter() jcenter()
} }
dependencies { dependencies {
implementation 'org.teavm:teavm-platform:0.6.1' implementation 'org.teavm:teavm-platform:0.6.1'
implementation 'org.teavm:teavm-classlib:0.6.1' implementation 'org.teavm:teavm-classlib:0.6.1'
@ -36,11 +37,11 @@ dependencies {
teavm { teavm {
compileScopes = null; compileScopes = null;
minifying = false; minifying = true;
maxTopLevelNames = 10000; maxTopLevelNames = 10000;
properties = null; properties = null;
debugInformationGenerated = false; debugInformationGenerated = false;
sourceMapsGenerated = false; sourceMapsGenerated = true;
sourceFilesCopied = false; sourceFilesCopied = false;
incremental = false; incremental = false;
transformers = null; transformers = null;

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

View File

@ -84,6 +84,8 @@ uniform vec2 texCoordV1;
#ifdef CC_lighting #ifdef CC_lighting
uniform vec3 light0Pos; uniform vec3 light0Pos;
uniform vec3 light1Pos; uniform vec3 light1Pos;
uniform vec3 invertNormals;
uniform vec3 normalUniform;
#endif #endif
#ifdef CC_fog #ifdef CC_fog
uniform vec4 fogColor; uniform vec4 fogColor;
@ -94,7 +96,6 @@ uniform float fogDensity;
uniform float fogPremultiply; uniform float fogPremultiply;
#endif #endif
uniform vec4 colorUniform; uniform vec4 colorUniform;
uniform vec3 normalUniform;
#ifdef CC_alphatest #ifdef CC_alphatest
uniform float alphaTestF; uniform float alphaTestF;
#endif #endif
@ -109,6 +110,9 @@ uniform vec4 textureGenR_V;
uniform vec4 textureGenQ_V; uniform vec4 textureGenQ_V;
uniform mat4 matrix_inverse_m; uniform mat4 matrix_inverse_m;
#endif #endif
#ifdef CC_patch_anisotropic
uniform vec2 anisotropic_fix;
#endif
#ifdef CC_TEX_GEN_STRQ #ifdef CC_TEX_GEN_STRQ
in vec4 v_object_pos; in vec4 v_object_pos;
@ -173,12 +177,11 @@ void main(){
#ifdef CC_unit0 #ifdef CC_unit0
#ifdef CC_a_texture0 #ifdef CC_a_texture0
#if (defined(CC_patch_anisotropic) && defined(CC_a_texture1) && defined(CC_a_color)) #ifdef CC_patch_anisotropic
vec2 uv = (matrix_t * vec4(v_texture0, 0.0, 1.0)).xy ; vec2 uv = (matrix_t * vec4(v_texture0, 0.0, 1.0)).xy;
/* https://bugs.chromium.org/p/angleproject/issues/detail?id=4994 */ /* https://bugs.chromium.org/p/angleproject/issues/detail?id=4994 */
float x = 1024.0 * 63.0 / 64.0; uv = ((uv * anisotropic_fix) - fract(uv * anisotropic_fix) + 0.5) / anisotropic_fix;
uv = ((uv * x) - fract(uv * x) + 0.5) / x;
color *= texture(tex0, uv).bgra; color *= texture(tex0, uv).bgra;
#else #else
@ -207,16 +210,17 @@ void main(){
#ifdef CC_lighting #ifdef CC_lighting
#ifdef CC_a_normal #ifdef CC_a_normal
vec3 normal = normalize(matrix_mn * ((v_normal.xyz - 0.5) * 2.0)); vec3 normal = ((v_normal.xyz - 0.5) * 2.0);
#else #else
vec3 normal = normalize(matrix_mn * normalUniform); vec3 normal = normalUniform;
#endif #endif
float ins = abs(dot(normal, light0Pos) + dot(normal, light1Pos)); normal = normalize(matrix_mn * normal);
color.rgb *= sqrt(0.4 + ins * 0.6); float ins = max(dot(normal, -light0Pos), 0.0) + max(dot(normal, -light1Pos), 0.0);
color.rgb *= min((0.4 + ins * 0.6), 1.0);
#endif #endif
#ifdef CC_fog #ifdef CC_fog
float dist = sqrt(v_position.x * v_position.x + v_position.y * v_position.y + v_position.z * v_position.z); float dist = sqrt(dot(v_position, v_position));
float i = (fogMode == 1) ? clamp((dist - fogStart) / (fogEnd - fogStart), 0.0, 1.0) : clamp(1.0 - pow(2.718, -(fogDensity * dist)), 0.0, 1.0); float i = (fogMode == 1) ? clamp((dist - fogStart) / (fogEnd - fogStart), 0.0, 1.0) : clamp(1.0 - pow(2.718, -(fogDensity * dist)), 0.0, 1.0);
color.rgb = mix(color.rgb, fogColor.xyz, i * fogColor.a); color.rgb = mix(color.rgb, fogColor.xyz, i * fogColor.a);
#endif #endif

View File

@ -38,6 +38,8 @@ profile.playerSkin=Player Skin
profile.addSkin=Add Skin profile.addSkin=Add Skin
profile.clearSkin=Clear List profile.clearSkin=Clear List
fancyGraphicsNote=go to -> Options -> Video Settings on the pause menu to enable fancy graphics and smooth lighting
voice.title=Voice Channel voice.title=Voice Channel
voice.addr=Channel Address voice.addr=Channel Address
voice.connect=Connect voice.connect=Connect
@ -143,6 +145,8 @@ lanServer.scanning=Scanning for games on your local network
lanServer.start=Start LAN World lanServer.start=Start LAN World
lanServer.otherPlayers=Settings for Other Players lanServer.otherPlayers=Settings for Other Players
mcoServer.title=Minecraft Online World mcoServer.title=Minecraft Online World
addServer.SSLWarn1=you are on an https: page!
addServer.SSLWarn2=html5 will only allow wss://
multiplayer.title=Play Multiplayer multiplayer.title=Play Multiplayer
multiplayer.connect=Connect multiplayer.connect=Connect
@ -289,6 +293,8 @@ options.framebufferAntialias.auto=Auto
options.framebufferAntialias.fxaa=FXAA options.framebufferAntialias.fxaa=FXAA
options.framebufferAntialias.msaa4=MSAA4 options.framebufferAntialias.msaa4=MSAA4
options.framebufferAntialias.msaa8=MSAA8 options.framebufferAntialias.msaa8=MSAA8
options.patchAnisotropic=Fix ANGLE bug #4994
performance.max=Max FPS performance.max=Max FPS
performance.balanced=Balanced performance.balanced=Balanced
performance.powersaver=Power saver performance.powersaver=Power saver

View File

@ -2,6 +2,8 @@ package net.lax1dude.eaglercraft;
import java.util.Arrays; import java.util.Arrays;
import javax.swing.JOptionPane;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
import net.lax1dude.eaglercraft.EaglerAdapter; import net.lax1dude.eaglercraft.EaglerAdapter;
@ -13,6 +15,8 @@ public class MinecraftMain {
public static void main(String[] par0ArrayOfStr) { public static void main(String[] par0ArrayOfStr) {
JOptionPane.showMessageDialog(null, "launch renderdoc (optionally) and press ok to continue", "eaglercraft", JOptionPane.PLAIN_MESSAGE);
EaglerAdapter.initializeContext(); EaglerAdapter.initializeContext();
LocalStorageManager.loadStorage(); LocalStorageManager.loadStorage();
ServerList.loadDefaultServers(Base64.encodeBase64String(EaglerAdapter.loadLocalStorage("forced"))); ServerList.loadDefaultServers(Base64.encodeBase64String(EaglerAdapter.loadLocalStorage("forced")));

View File

@ -83,6 +83,14 @@ public class EaglerAdapterImpl2 {
return null; return null;
} }
} }
public static final boolean isSSLPage() {
return true;
}
public static final String[] getIdentifier() {
return new String[0];
}
private static final boolean useEPKTest = false; private static final boolean useEPKTest = false;
@ -224,6 +232,10 @@ public class EaglerAdapterImpl2 {
public static final class TextureGL { public static final class TextureGL {
protected final int obj; protected final int obj;
public int w = -1;
public int h = -1;
public boolean nearest = true;
public boolean anisotropic = false;
protected TextureGL(int obj) { protected TextureGL(int obj) {
this.obj = obj; this.obj = obj;
} }
@ -572,6 +584,12 @@ public class EaglerAdapterImpl2 {
public static final void _wglLineWidth(float p1) { public static final void _wglLineWidth(float p1) {
GL11.glLineWidth(p1); GL11.glLineWidth(p1);
} }
public static final int _wglGetTexParameteri(int p1) {
return GL11.glGetTexParameteri(GL11.GL_TEXTURE_2D, p1);
}
public static final float _wglGetTexParameterf(int p1) {
return GL11.glGetTexParameterf(GL11.GL_TEXTURE_2D, p1);
}
// ======================================================================================= // =======================================================================================
@ -711,6 +729,9 @@ public class EaglerAdapterImpl2 {
ss.cleanup(); ss.cleanup();
} }
} }
public static final boolean isWindows() {
return System.getProperty("os.name").toLowerCase().contains("windows");
}
public static final boolean mouseNext() { public static final boolean mouseNext() {
return Mouse.next(); return Mouse.next();
} }

View File

@ -358,9 +358,9 @@ public class Tessellator {
public void setNormal(float par1, float par2, float par3) { public void setNormal(float par1, float par2, float par3) {
this.hasNormals = true; this.hasNormals = true;
float len = (float) Math.sqrt(par1 * par1 + par2 * par2 + par3 * par3); float len = (float) Math.sqrt(par1 * par1 + par2 * par2 + par3 * par3);
int var4 = (int)((par1 / len) * 128.0F) + 127; int var4 = (int)((par1 / len) * 127.0F) + 127;
int var5 = (int)((par2 / len) * 128.0F) + 127; int var5 = (int)((par2 / len) * 127.0F) + 127;
int var6 = (int)((par3 / len) * 128.0F) + 127; int var6 = (int)((par3 / len) * 127.0F) + 127;
this.normal = var4 & 255 | (var5 & 255) << 8 | (var6 & 255) << 16; this.normal = var4 & 255 | (var5 & 255) << 8 | (var6 & 255) << 16;
} }

View File

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

View File

@ -247,7 +247,6 @@ public class DefaultSkinRenderer {
int id = id2 - EaglerProfile.skinNames.size(); int id = id2 - EaglerProfile.skinNames.size();
EaglerAdapter.glEnable(EaglerAdapter.GL_TEXTURE_2D); EaglerAdapter.glEnable(EaglerAdapter.GL_TEXTURE_2D);
RenderHelper.enableStandardItemLighting();
EaglerAdapter.glDisable(EaglerAdapter.GL_BLEND); EaglerAdapter.glDisable(EaglerAdapter.GL_BLEND);
EaglerAdapter.glDisable(EaglerAdapter.GL_CULL_FACE); EaglerAdapter.glDisable(EaglerAdapter.GL_CULL_FACE);
EaglerAdapter.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); EaglerAdapter.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
@ -257,6 +256,7 @@ public class DefaultSkinRenderer {
EaglerAdapter.glRotatef(180.0f, 1.0f, 0.0f, 0.0f); EaglerAdapter.glRotatef(180.0f, 1.0f, 0.0f, 0.0f);
EaglerAdapter.glEnable(EaglerAdapter.GL_RESCALE_NORMAL); EaglerAdapter.glEnable(EaglerAdapter.GL_RESCALE_NORMAL);
EaglerAdapter.glScalef(1.0F, -1.0F, 1.0F); EaglerAdapter.glScalef(1.0F, -1.0F, 1.0F);
RenderHelper.enableGUIStandardItemLighting();
EaglerAdapter.glTranslatef(0.0F, 1.0F, 0.0F); EaglerAdapter.glTranslatef(0.0F, 1.0F, 0.0F);
EaglerAdapter.glRotatef(((y - my) * -0.06f), 1.0f, 0.0f, 0.0f); EaglerAdapter.glRotatef(((y - my) * -0.06f), 1.0f, 0.0f, 0.0f);
EaglerAdapter.glRotatef(((x - mx) * 0.06f), 0.0f, 1.0f, 0.0f); EaglerAdapter.glRotatef(((x - mx) * 0.06f), 0.0f, 1.0f, 0.0f);

View File

@ -181,7 +181,7 @@ public class GuiScreenEditProfile extends GuiScreen {
protected void actionPerformed(GuiButton par1GuiButton) { protected void actionPerformed(GuiButton par1GuiButton) {
if(!dropDownOpen) { if(!dropDownOpen) {
if(par1GuiButton.id == 200) { if(par1GuiButton.id == 200) {
EaglerProfile.username = this.username.getText(); EaglerProfile.username = this.username.getText().length() == 0 ? "null" : this.username.getText();
EaglerProfile.presetSkinId = selectedSlot - EaglerProfile.skinNames.size(); EaglerProfile.presetSkinId = selectedSlot - EaglerProfile.skinNames.size();
if(EaglerProfile.presetSkinId < 0) { if(EaglerProfile.presetSkinId < 0) {
EaglerProfile.presetSkinId = -1; EaglerProfile.presetSkinId = -1;

View File

@ -144,6 +144,10 @@ public class EaglerAdapterGL30 extends EaglerAdapterImpl2 {
private static boolean enableNormalArray = false; private static boolean enableNormalArray = false;
private static boolean enableTex0Array = false; private static boolean enableTex0Array = false;
private static boolean enableTex1Array = false; private static boolean enableTex1Array = false;
private static boolean enableAnisotropicFix = false;
private static float anisotropicFixX = 1024.0f;
private static float anisotropicFixY = 1024.0f;
private static float colorR = 1.0f; private static float colorR = 1.0f;
private static float colorG = 1.0f; private static float colorG = 1.0f;
@ -160,6 +164,13 @@ public class EaglerAdapterGL30 extends EaglerAdapterImpl2 {
private static float tex0Y = 0; private static float tex0Y = 0;
private static float tex1X = 0; private static float tex1X = 0;
private static float tex1Y = 0; private static float tex1Y = 0;
private static TextureGL boundTexture0 = null;
private static boolean enableAnisotropicPatch = false;
private static boolean hintAnisotropicPatch = false;
public static final void anisotropicPatch(boolean e) {
enableAnisotropicPatch = e;
}
private static boolean enableTexGen = false; private static boolean enableTexGen = false;
private static boolean enableColorMaterial = false; private static boolean enableColorMaterial = false;
@ -271,9 +282,6 @@ public class EaglerAdapterGL30 extends EaglerAdapterImpl2 {
_wglEnable(_wGL_BLEND); _wglEnable(_wGL_BLEND);
break; break;
case GL_RESCALE_NORMAL: case GL_RESCALE_NORMAL:
//enableRescaleNormal = true;
//matNormalScalePointer = matModelPointer;
//matNormScaleV[0].setIdentity();
break; break;
case GL_TEXTURE_2D: case GL_TEXTURE_2D:
if(selectedTex == 0) { if(selectedTex == 0) {
@ -463,6 +471,10 @@ public class EaglerAdapterGL30 extends EaglerAdapterImpl2 {
} }
public static final void glTexImage2D(int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8, ByteBuffer p9) { public static final void glTexImage2D(int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8, ByteBuffer p9) {
if(p2 == 0 && selectedTex == 0 && boundTexture0 != null) {
boundTexture0.w = p4;
boundTexture0.h = p5;
}
_wglTexImage2D(_wGL_TEXTURE_2D, p2, _wGL_RGBA8, p4, p5, p6, _wGL_RGBA, _wGL_UNSIGNED_BYTE, p9); _wglTexImage2D(_wGL_TEXTURE_2D, p2, _wGL_RGBA8, p4, p5, p6, _wGL_RGBA, _wGL_UNSIGNED_BYTE, p9);
} }
public static final void glLight(int p1, int p2, FloatBuffer p3) { public static final void glLight(int p1, int p2, FloatBuffer p3) {
@ -471,15 +483,29 @@ public class EaglerAdapterGL30 extends EaglerAdapterImpl2 {
public static final void glLightModel(int p1, FloatBuffer p2) { public static final void glLightModel(int p1, FloatBuffer p2) {
} }
private static Vector4f lightPos0vec0 = new Vector4f();
private static Vector4f lightPos1vec0 = new Vector4f();
private static Vector4f lightPos0vec = new Vector4f(); private static Vector4f lightPos0vec = new Vector4f();
private static Vector4f lightPos1vec = new Vector4f(); private static Vector4f lightPos1vec = new Vector4f();
public static final void copyModelToLightMatrix() { public static final void copyModelToLightMatrix() {
lightPos0vec0.set(lightPos0vec);
lightPos1vec0.set(lightPos1vec);
lightPos0vec.set(0.2f, 1.0f, -0.7f, 0.0f); lightPos0vec.normalise(); lightPos0vec.set(0.2f, 1.0f, -0.7f, 0.0f); lightPos0vec.normalise();
lightPos1vec.set(-0.2f, 1.0f, 0.7f, 0.0f); lightPos1vec.normalise(); lightPos1vec.set(-0.2f, 1.0f, 0.7f, 0.0f); lightPos1vec.normalise();
Matrix4f.transform(matModelV[matModelPointer], lightPos0vec, lightPos0vec).normalise(); Matrix4f.transform(matModelV[matModelPointer], lightPos0vec, lightPos0vec).normalise();
Matrix4f.transform(matModelV[matModelPointer], lightPos1vec, lightPos1vec).normalise(); Matrix4f.transform(matModelV[matModelPointer], lightPos1vec, lightPos1vec).normalise();
} }
public static final void flipLightMatrix() {
lightPos0vec0.set(lightPos0vec);
lightPos1vec0.set(lightPos1vec);
lightPos0vec.y = -lightPos0vec.y;
lightPos1vec.y = -lightPos1vec.y;
}
public static final void revertLightMatrix() {
lightPos0vec.set(lightPos0vec0);
lightPos1vec.set(lightPos1vec0);
}
public static final void glPushMatrix() { public static final void glPushMatrix() {
switch(matrixMode) { switch(matrixMode) {
case GL_MODELVIEW: case GL_MODELVIEW:
@ -603,8 +629,23 @@ public class EaglerAdapterGL30 extends EaglerAdapterImpl2 {
public static final void glColorMask(boolean p1, boolean p2, boolean p3, boolean p4) { public static final void glColorMask(boolean p1, boolean p2, boolean p3, boolean p4) {
_wglColorMask(p1, p2, p3, p4); _wglColorMask(p1, p2, p3, p4);
} }
private static final void updateAnisotropicPatch() {
if(selectedTex == 0) {
enableAnisotropicFix = false;
if(enableAnisotropicPatch && boundTexture0 != null && boundTexture0.anisotropic && boundTexture0.nearest) {
enableAnisotropicFix = true;
anisotropicFixX = boundTexture0.w;
anisotropicFixY = boundTexture0.h;
}
}
}
public static final void glBindTexture(int p1, int p2) { public static final void glBindTexture(int p1, int p2) {
_wglBindTexture(_wGL_TEXTURE_2D, texObjects.get(p2)); TextureGL t = texObjects.get(p2);
_wglBindTexture(_wGL_TEXTURE_2D, t);
if(selectedTex == 0) {
boundTexture0 = t;
updateAnisotropicPatch();
}
} }
public static final void glCopyTexSubImage2D(int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8) { public static final void glCopyTexSubImage2D(int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8) {
_wglCopyTexSubImage2D(_wGL_TEXTURE_2D, p2, p3, p4, p5, p6, p7, p8); _wglCopyTexSubImage2D(_wGL_TEXTURE_2D, p2, p3, p4, p5, p6, p7, p8);
@ -638,7 +679,12 @@ public class EaglerAdapterGL30 extends EaglerAdapterImpl2 {
case GL_REPEAT: pp3 = _wGL_REPEAT; break; case GL_REPEAT: pp3 = _wGL_REPEAT; break;
case GL_CLAMP: pp3 = _wGL_CLAMP; break; case GL_CLAMP: pp3 = _wGL_CLAMP; break;
} }
if(selectedTex == 0 && boundTexture0 != null && pp2 == _wGL_TEXTURE_MAG_FILTER) {
boundTexture0.nearest = pp3 == _wGL_NEAREST;
}
_wglTexParameteri(pp1, pp2, pp3); _wglTexParameteri(pp1, pp2, pp3);
updateAnisotropicPatch();
} }
public static final void glTexParameterf(int p1, int p2, float p3) { public static final void glTexParameterf(int p1, int p2, float p3) {
int pp1 = 0; int pp1 = 0;
@ -652,7 +698,11 @@ public class EaglerAdapterGL30 extends EaglerAdapterImpl2 {
default: default:
case GL_TEXTURE_MAX_ANISOTROPY: pp2 = _wGL_TEXTURE_MAX_ANISOTROPY; break; case GL_TEXTURE_MAX_ANISOTROPY: pp2 = _wGL_TEXTURE_MAX_ANISOTROPY; break;
} }
if(selectedTex == 0 && boundTexture0 != null && pp2 == _wGL_TEXTURE_MAX_ANISOTROPY) {
boundTexture0.anisotropic = p3 > 1.0f;
}
_wglTexParameterf(pp1, pp2, p3); _wglTexParameterf(pp1, pp2, p3);
updateAnisotropicPatch();
} }
public static final void glLogicOp(int p1) { public static final void glLogicOp(int p1) {
@ -693,6 +743,7 @@ public class EaglerAdapterGL30 extends EaglerAdapterImpl2 {
if(!isCompilingDisplayList) { if(!isCompilingDisplayList) {
compilingDisplayList = displayLists.get(p1); compilingDisplayList = displayLists.get(p1);
if(compilingDisplayList != null) { if(compilingDisplayList != null) {
compilingDisplayList.shaderMode = -1;
compilingDisplayList.listLength = 0; compilingDisplayList.listLength = 0;
isCompilingDisplayList = true; isCompilingDisplayList = true;
} }
@ -775,12 +826,22 @@ public class EaglerAdapterGL30 extends EaglerAdapterImpl2 {
case GL_BGRA: pp3 = _wGL_BGRA; break; case GL_BGRA: pp3 = _wGL_BGRA; break;
} }
*/ */
if(p2 == 0 && selectedTex == 0 && boundTexture0 != null) {
boundTexture0.w = p4;
boundTexture0.h = p5;
}
bytesUploaded += p9.remaining()*4; bytesUploaded += p9.remaining()*4;
_wglTexImage2D(_wGL_TEXTURE_2D, p2, _wGL_RGBA8, p4, p5, p6, _wGL_RGBA, _wGL_UNSIGNED_BYTE, p9); _wglTexImage2D(_wGL_TEXTURE_2D, p2, _wGL_RGBA8, p4, p5, p6, _wGL_RGBA, _wGL_UNSIGNED_BYTE, p9);
updateAnisotropicPatch();
} }
public static final void glTexImage2D_2(int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8, IntBuffer p9) { public static final void glTexImage2D_2(int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8, IntBuffer p9) {
if(p2 == 0 && selectedTex == 0 && boundTexture0 != null) {
boundTexture0.w = p4;
boundTexture0.h = p5;
}
bytesUploaded += p9.remaining()*4; bytesUploaded += p9.remaining()*4;
_wglTexImage2D(_wGL_TEXTURE_2D, p2, _wGL_RGB8, p4, p5, p6, _wGL_RGB, _wGL_UNSIGNED_BYTE, p9); _wglTexImage2D(_wGL_TEXTURE_2D, p2, _wGL_RGB8, p4, p5, p6, _wGL_RGB, _wGL_UNSIGNED_BYTE, p9);
updateAnisotropicPatch();
} }
public static final void glTexSubImage2D(int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8, IntBuffer p9) { public static final void glTexSubImage2D(int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8, IntBuffer p9) {
int pp1 = 0; int pp1 = 0;
@ -859,6 +920,9 @@ public class EaglerAdapterGL30 extends EaglerAdapterImpl2 {
break; break;
} }
} }
public static final void hintAnisotropicFix(boolean hint) {
hintAnisotropicPatch = hint;
}
private static final int getShaderModeFlag0() { private static final int getShaderModeFlag0() {
int mode = 0; int mode = 0;
mode = (mode | (enableColorArray ? FixedFunctionShader.COLOR : 0)); mode = (mode | (enableColorArray ? FixedFunctionShader.COLOR : 0));
@ -875,6 +939,7 @@ public class EaglerAdapterGL30 extends EaglerAdapterImpl2 {
mode = (mode | (enableAlphaTest ? FixedFunctionShader.ALPHATEST : 0)); mode = (mode | (enableAlphaTest ? FixedFunctionShader.ALPHATEST : 0));
mode = (mode | (enableTexture2D ? FixedFunctionShader.UNIT0 : 0)); mode = (mode | (enableTexture2D ? FixedFunctionShader.UNIT0 : 0));
mode = (mode | (enableTexture2D_1 ? FixedFunctionShader.UNIT1 : 0)); mode = (mode | (enableTexture2D_1 ? FixedFunctionShader.UNIT1 : 0));
mode = (mode | ((enableTexture2D && (enableAnisotropicFix || (hintAnisotropicPatch && enableAnisotropicPatch))) ? FixedFunctionShader.FIX_ANISOTROPIC : 0));
return mode; return mode;
} }
private static final int getShaderModeFlag() { private static final int getShaderModeFlag() {
@ -889,6 +954,7 @@ public class EaglerAdapterGL30 extends EaglerAdapterImpl2 {
mode = (mode | (enableAlphaTest ? FixedFunctionShader.ALPHATEST : 0)); mode = (mode | (enableAlphaTest ? FixedFunctionShader.ALPHATEST : 0));
mode = (mode | (enableTexture2D ? FixedFunctionShader.UNIT0 : 0)); mode = (mode | (enableTexture2D ? FixedFunctionShader.UNIT0 : 0));
mode = (mode | (enableTexture2D_1 ? FixedFunctionShader.UNIT1 : 0)); mode = (mode | (enableTexture2D_1 ? FixedFunctionShader.UNIT1 : 0));
mode = (mode | ((enableTexture2D && (enableAnisotropicFix || (hintAnisotropicPatch && enableAnisotropicPatch))) ? FixedFunctionShader.FIX_ANISOTROPIC : 0));
return mode; return mode;
} }
private static FixedFunctionShader shader = null; private static FixedFunctionShader shader = null;
@ -930,6 +996,9 @@ public class EaglerAdapterGL30 extends EaglerAdapterImpl2 {
s.setTexGenR(texR_plane, texR_X, texR_Y, texR_Z, texR_W); s.setTexGenR(texR_plane, texR_X, texR_Y, texR_Z, texR_W);
s.setTexGenQ(texQ_plane, texQ_X, texQ_Y, texQ_Z, texQ_W); s.setTexGenQ(texQ_plane, texQ_X, texQ_Y, texQ_Z, texQ_W);
} }
if(enableAnisotropicFix) {
s.setAnisotropicFix(anisotropicFixX, anisotropicFixY);
}
} }
private static Object blankUploadArray = _wCreateLowLevelIntBuffer(525000); private static Object blankUploadArray = _wCreateLowLevelIntBuffer(525000);
public static final void glDrawArrays(int p1, int p2, int p3, Object buffer) { public static final void glDrawArrays(int p1, int p2, int p3, Object buffer) {

View File

@ -3,13 +3,15 @@ package net.lax1dude.eaglercraft.glemu;
import net.lax1dude.eaglercraft.EaglerAdapter; import net.lax1dude.eaglercraft.EaglerAdapter;
import net.lax1dude.eaglercraft.glemu.vector.Matrix3f; import net.lax1dude.eaglercraft.glemu.vector.Matrix3f;
import net.lax1dude.eaglercraft.glemu.vector.Matrix4f; import net.lax1dude.eaglercraft.glemu.vector.Matrix4f;
import net.lax1dude.eaglercraft.glemu.vector.Vector2f;
import net.lax1dude.eaglercraft.glemu.vector.Vector3f;
import net.lax1dude.eaglercraft.glemu.vector.Vector4f; import net.lax1dude.eaglercraft.glemu.vector.Vector4f;
import static net.lax1dude.eaglercraft.glemu.EaglerAdapterGL30.*; import static net.lax1dude.eaglercraft.glemu.EaglerAdapterGL30.*;
public class FixedFunctionShader { public class FixedFunctionShader {
private static final FixedFunctionShader[] instances = new FixedFunctionShader[1024]; //lol private static final FixedFunctionShader[] instances = new FixedFunctionShader[2048]; //lol
public static void refreshCoreGL() { public static void refreshCoreGL() {
for(int i = 0; i < instances.length; ++i) { for(int i = 0; i < instances.length; ++i) {
@ -31,6 +33,7 @@ public class FixedFunctionShader {
public static final int ALPHATEST = 128; public static final int ALPHATEST = 128;
public static final int UNIT0 = 256; public static final int UNIT0 = 256;
public static final int UNIT1 = 512; public static final int UNIT1 = 512;
public static final int FIX_ANISOTROPIC = 1024;
public static FixedFunctionShader instance(int i) { public static FixedFunctionShader instance(int i) {
FixedFunctionShader s = instances[i]; FixedFunctionShader s = instances[i];
@ -45,6 +48,7 @@ public class FixedFunctionShader {
boolean CC_alphatest = false; boolean CC_alphatest = false;
boolean CC_unit0 = false; boolean CC_unit0 = false;
boolean CC_unit1 = false; boolean CC_unit1 = false;
boolean CC_anisotropic = false;
if((i & COLOR) == COLOR) { if((i & COLOR) == COLOR) {
CC_a_color = true; CC_a_color = true;
} }
@ -75,7 +79,10 @@ public class FixedFunctionShader {
if((i & UNIT1) == UNIT1) { if((i & UNIT1) == UNIT1) {
CC_unit1 = true; CC_unit1 = true;
} }
s = new FixedFunctionShader(i, CC_a_color, CC_a_normal, CC_a_texture0, CC_a_texture1, CC_TEX_GEN_STRQ, CC_lighting, CC_fog, CC_alphatest, CC_unit0, CC_unit1); if((i & FIX_ANISOTROPIC) == FIX_ANISOTROPIC) {
CC_anisotropic = true;
}
s = new FixedFunctionShader(i, CC_a_color, CC_a_normal, CC_a_texture0, CC_a_texture1, CC_TEX_GEN_STRQ, CC_lighting, CC_fog, CC_alphatest, CC_unit0, CC_unit1, CC_anisotropic);
instances[i] = s; instances[i] = s;
} }
return s; return s;
@ -93,6 +100,7 @@ public class FixedFunctionShader {
private final boolean enable_alphatest; private final boolean enable_alphatest;
private final boolean enable_unit0; private final boolean enable_unit0;
private final boolean enable_unit1; private final boolean enable_unit1;
private final boolean enable_anisotropic_fix;
private final ProgramGL globject; private final ProgramGL globject;
private UniformGL u_matrix_m = null; private UniformGL u_matrix_m = null;
@ -127,6 +135,9 @@ public class FixedFunctionShader {
private UniformGL u_light0Pos = null; private UniformGL u_light0Pos = null;
private UniformGL u_light1Pos = null; private UniformGL u_light1Pos = null;
//private UniformGL u_invertNormals = null;
private UniformGL u_anisotropic_fix = null;
private final int a_position; private final int a_position;
private final int a_texture0; private final int a_texture0;
@ -140,7 +151,7 @@ public class FixedFunctionShader {
public final BufferGL genericBuffer; public final BufferGL genericBuffer;
public boolean bufferIsInitialized = false; public boolean bufferIsInitialized = false;
private FixedFunctionShader(int j, boolean CC_a_color, boolean CC_a_normal, boolean CC_a_texture0, boolean CC_a_texture1, boolean CC_TEX_GEN_STRQ, boolean CC_lighting, boolean CC_fog, boolean CC_alphatest, boolean CC_unit0, boolean CC_unit1) { private FixedFunctionShader(int j, boolean CC_a_color, boolean CC_a_normal, boolean CC_a_texture0, boolean CC_a_texture1, boolean CC_TEX_GEN_STRQ, boolean CC_lighting, boolean CC_fog, boolean CC_alphatest, boolean CC_unit0, boolean CC_unit1, boolean CC_anisotropic_fix) {
enable_color = CC_a_color; enable_color = CC_a_color;
enable_normal = CC_a_normal; enable_normal = CC_a_normal;
enable_texture0 = CC_a_texture0; enable_texture0 = CC_a_texture0;
@ -151,6 +162,7 @@ public class FixedFunctionShader {
enable_alphatest = CC_alphatest; enable_alphatest = CC_alphatest;
enable_unit0 = CC_unit0; enable_unit0 = CC_unit0;
enable_unit1 = CC_unit1; enable_unit1 = CC_unit1;
enable_anisotropic_fix = CC_anisotropic_fix;
if(shaderSource == null) { if(shaderSource == null) {
shaderSource = fileContents("/glsl/core.glsl"); shaderSource = fileContents("/glsl/core.glsl");
@ -167,8 +179,7 @@ public class FixedFunctionShader {
if(enable_alphatest) source += "#define CC_alphatest\n"; if(enable_alphatest) source += "#define CC_alphatest\n";
if(enable_unit0) source += "#define CC_unit0\n"; if(enable_unit0) source += "#define CC_unit0\n";
if(enable_unit1) source += "#define CC_unit1\n"; if(enable_unit1) source += "#define CC_unit1\n";
//if(!EaglerAdapter._wisAnisotropicPatched()) source += "#define CC_patch_anisotropic\n"; if(enable_anisotropic_fix) source += "#define CC_patch_anisotropic\n";
source += "#define CC_patch_anisotropic\n";
source += shaderSource; source += shaderSource;
ShaderGL v = _wglCreateShader(_wGL_VERTEX_SHADER); ShaderGL v = _wglCreateShader(_wGL_VERTEX_SHADER);
@ -215,6 +226,7 @@ public class FixedFunctionShader {
if(enable_lighting) { if(enable_lighting) {
u_normalUniform = _wglGetUniformLocation(globject, "normalUniform"); u_normalUniform = _wglGetUniformLocation(globject, "normalUniform");
//u_invertNormals = _wglGetUniformLocation(globject, "invertNormals");
u_light0Pos = _wglGetUniformLocation(globject, "light0Pos"); u_light0Pos = _wglGetUniformLocation(globject, "light0Pos");
u_light1Pos = _wglGetUniformLocation(globject, "light1Pos"); u_light1Pos = _wglGetUniformLocation(globject, "light1Pos");
} }
@ -244,6 +256,11 @@ public class FixedFunctionShader {
u_matrix_inverse_m = _wglGetUniformLocation(globject, "matrix_inverse_m"); u_matrix_inverse_m = _wglGetUniformLocation(globject, "matrix_inverse_m");
} }
if(enable_anisotropic_fix) {
u_anisotropic_fix = _wglGetUniformLocation(globject, "anisotropic_fix");
_wglUniform2f(u_anisotropic_fix, 1024.0f * 63.0f / 64.0f, 1024.0f * 63.0f / 64.0f);
}
_wglUniform1i(_wglGetUniformLocation(globject, "tex0"), 0); _wglUniform1i(_wglGetUniformLocation(globject, "tex0"), 0);
_wglUniform1i(_wglGetUniformLocation(globject, "tex1"), 1); _wglUniform1i(_wglGetUniformLocation(globject, "tex1"), 1);
@ -330,9 +347,33 @@ public class FixedFunctionShader {
private Matrix4f inverseModelMatrix = (Matrix4f) new Matrix4f().setZero(); private Matrix4f inverseModelMatrix = (Matrix4f) new Matrix4f().setZero();
private Vector4f light0Pos = new Vector4f(); private Vector4f light0Pos = new Vector4f();
private Vector4f light1Pos = new Vector4f(); private Vector4f light1Pos = new Vector4f();
private Vector2f anisotropicFix = new Vector2f(0.0f, 0.0f);
private boolean bound = false; private boolean bound = false;
private float invertNormalsX = 0.0f;
private float invertNormalsY = 0.0f;
private float invertNormalsZ = 0.0f;
public void setInvertNormals(float x, float y, float z) {
/*
if(invertNormalsX != x || invertNormalsY != y || invertNormalsZ != z) {
invertNormalsX = x;
invertNormalsY = y;
invertNormalsZ = z;
_wglUniform3f(u_invertNormals, x, y, z);
}
*/
}
public void setAnisotropicFix(float x, float y) {
if(anisotropicFix.x != x || anisotropicFix.y != y) {
anisotropicFix.x = x;
anisotropicFix.y = y;
_wglUniform2f(u_anisotropic_fix, x, y);
}
}
public void setModelMatrix(Matrix4f mat) { public void setModelMatrix(Matrix4f mat) {
if(!mat.equals(modelMatrix)) { if(!mat.equals(modelMatrix)) {
modelMatrix.load(mat).store(modelBuffer); modelMatrix.load(mat).store(modelBuffer);

View File

@ -1081,6 +1081,8 @@ public class Minecraft implements Runnable {
if (this.rightClickDelayTimer > 0) { if (this.rightClickDelayTimer > 0) {
--this.rightClickDelayTimer; --this.rightClickDelayTimer;
} }
EaglerAdapter.anisotropicPatch(this.gameSettings.patchAnisotropic);
this.mcProfiler.startSection("stats"); this.mcProfiler.startSection("stats");
this.mcProfiler.endStartSection("gui"); this.mcProfiler.endStartSection("gui");
@ -1497,8 +1499,12 @@ public class Minecraft implements Runnable {
//if(!EaglerAdapter._wisAnisotropicPatched()) { //if(!EaglerAdapter._wisAnisotropicPatched()) {
// displayEaglercraftText("ANGLE Issue #4994 is unpatched on this browser, using fake aliased sampling on linear magnified terrain texture for anisotropic filtering. Chrome patch progress and information available at https://crbug.com/angleproject/4994"); // displayEaglercraftText("ANGLE Issue #4994 is unpatched on this browser, using fake aliased sampling on linear magnified terrain texture for anisotropic filtering. Chrome patch progress and information available at https://crbug.com/angleproject/4994");
//} //}
StringTranslate var4 = StringTranslate.getInstance();
displayEaglercraftText("go to -> Options -> Video Settings on the pause menu to enable fancy graphics"); if(!this.gameSettings.fancyGraphics || this.gameSettings.ambientOcclusion == 0) {
displayEaglercraftText(var4.translateKey("fancyGraphicsNote"));
}
this.thePlayer.preparePlayerToSpawn(); this.thePlayer.preparePlayerToSpawn();
par1WorldClient.spawnEntityInWorld(this.thePlayer); par1WorldClient.spawnEntityInWorld(this.thePlayer);

View File

@ -78,6 +78,8 @@ public class EffectRenderer {
break; break;
case 1: case 1:
terrain.bindTexture(); terrain.bindTexture();
EaglerAdapter.glTexParameteri(EaglerAdapter.GL_TEXTURE_2D, EaglerAdapter.GL_TEXTURE_MIN_FILTER, EaglerAdapter.GL_NEAREST);
EaglerAdapter.glTexParameteri(EaglerAdapter.GL_TEXTURE_2D, EaglerAdapter.GL_TEXTURE_MAG_FILTER, EaglerAdapter.GL_NEAREST);
break; break;
case 2: case 2:
items.bindTexture(); items.bindTexture();

View File

@ -973,7 +973,7 @@ public class EntityRenderer {
RenderHelper.disableStandardItemLighting(); RenderHelper.disableStandardItemLighting();
terrain.bindTexture(); terrain.bindTexture();
EaglerAdapter.glTexParameterf(EaglerAdapter.GL_TEXTURE_2D, EaglerAdapter.GL_TEXTURE_MAX_ANISOTROPY, 16.0f); EaglerAdapter.glTexParameterf(EaglerAdapter.GL_TEXTURE_2D, EaglerAdapter.GL_TEXTURE_MAX_ANISOTROPY, 16.0f);
//EaglerAdapter.glTexParameteri(EaglerAdapter.GL_TEXTURE_2D, EaglerAdapter.GL_TEXTURE_MIN_FILTER, mc.gameSettings.fancyGraphics ? EaglerAdapter.GL_LINEAR_MIPMAP_LINEAR : EaglerAdapter.GL_NEAREST_MIPMAP_LINEAR); EaglerAdapter.glTexParameteri(EaglerAdapter.GL_TEXTURE_2D, EaglerAdapter.GL_TEXTURE_MIN_FILTER, EaglerAdapter.GL_NEAREST_MIPMAP_LINEAR);
EaglerAdapter.glAlphaFunc(EaglerAdapter.GL_GREATER, 0.6f); EaglerAdapter.glAlphaFunc(EaglerAdapter.GL_GREATER, 0.6f);
this.mc.mcProfiler.endStartSection("terrain"); this.mc.mcProfiler.endStartSection("terrain");
var5.sortAndRender(var4, 0, (double) par1); var5.sortAndRender(var4, 0, (double) par1);
@ -1041,7 +1041,7 @@ public class EntityRenderer {
//} //}
EaglerAdapter.glTexParameterf(EaglerAdapter.GL_TEXTURE_2D, EaglerAdapter.GL_TEXTURE_MAX_ANISOTROPY, 1.0f); EaglerAdapter.glTexParameterf(EaglerAdapter.GL_TEXTURE_2D, EaglerAdapter.GL_TEXTURE_MAX_ANISOTROPY, 1.0f);
//EaglerAdapter.glTexParameteri(EaglerAdapter.GL_TEXTURE_2D, EaglerAdapter.GL_TEXTURE_MIN_FILTER, EaglerAdapter.GL_NEAREST_MIPMAP_LINEAR); EaglerAdapter.glTexParameteri(EaglerAdapter.GL_TEXTURE_2D, EaglerAdapter.GL_TEXTURE_MIN_FILTER, EaglerAdapter.GL_NEAREST_MIPMAP_LINEAR);
var6.renderTransparentParticles(var4, par1); var6.renderTransparentParticles(var4, par1);
@ -1282,8 +1282,7 @@ public class EntityRenderer {
var8.startDrawingQuads(); var8.startDrawingQuads();
} }
var32 = ((float) (ticks + var21 * var21 * 3121 + var21 * 45238971 + var20 * var20 * 418711 + var20 * 13761 & 31) + par1) / 32.0F * (3.0F + this.random.nextFloat()); var32 = ((float) ((ticks + var21 * var21 * 3121 + var21 * 45238971 + var20 * var20 * 418711 + var20 * 13761 & 31) % 100000) + par1) / 32.0F * (3.0F + this.random.nextFloat());
var32 = var32 % 100000.0f;
double var33 = (double) ((float) var21 + 0.5F) - var41.posX; double var33 = (double) ((float) var21 + 0.5F) - var41.posX;
var35 = (double) ((float) var20 + 0.5F) - var41.posZ; var35 = (double) ((float) var20 + 0.5F) - var41.posZ;
float var37 = MathHelper.sqrt_double(var33 * var33 + var35 * var35) / (float) var16; float var37 = MathHelper.sqrt_double(var33 * var33 + var35 * var35) / (float) var16;
@ -1307,7 +1306,7 @@ public class EntityRenderer {
var8.startDrawingQuads(); var8.startDrawingQuads();
} }
var32 = (((float) (ticks & 511) + par1) / 512.0F); var32 = (((float) (ticks % 512) + par1) / 512.0F);
float var46 = this.random.nextFloat() + var19 * 0.01F * (float) this.random.nextGaussian(); float var46 = this.random.nextFloat() + var19 * 0.01F * (float) this.random.nextGaussian();
float var34 = this.random.nextFloat() + var19 * (float) this.random.nextGaussian() * 0.001F; float var34 = this.random.nextFloat() + var19 * (float) this.random.nextGaussian() * 0.001F;
var35 = (double) ((float) var21 + 0.5F) - var41.posX; var35 = (double) ((float) var21 + 0.5F) - var41.posX;

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), 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_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), 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),
ENABLE_VSYNC("options.vsync", 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), 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),
CHAT_HEIGHT_FOCUSED("options.chat.height.focused", true, false), CHAT_HEIGHT_UNFOCUSED("options.chat.height.unfocused", true, false); CHAT_HEIGHT_FOCUSED("options.chat.height.focused", true, false), CHAT_HEIGHT_UNFOCUSED("options.chat.height.unfocused", true, false);
private final boolean enumFloat; private final boolean enumFloat;

View File

@ -65,7 +65,7 @@ class EnumOptionsHelper {
} }
try { try {
enumOptionsMappingHelperArray[EnumOptions.ENABLE_VSYNC.ordinal()] = 12; enumOptionsMappingHelperArray[EnumOptions.PATCH_ANGLE.ordinal()] = 12;
} catch (NoSuchFieldError var3) { } catch (NoSuchFieldError var3) {
; ;
} }

View File

@ -62,6 +62,7 @@ public class GameSettings {
public boolean showCape = true; public boolean showCape = true;
public boolean touchscreen = false; public boolean touchscreen = false;
public int antialiasMode = 1; public int antialiasMode = 1;
public boolean patchAnisotropic = false;
public int overrideWidth = 0; public int overrideWidth = 0;
public int overrideHeight = 0; public int overrideHeight = 0;
public boolean heldItemTooltips = true; public boolean heldItemTooltips = true;
@ -142,6 +143,7 @@ public class GameSettings {
this.particleSetting = 0; this.particleSetting = 0;
this.language = "en_US"; this.language = "en_US";
this.mc = par1Minecraft; this.mc = par1Minecraft;
this.patchAnisotropic = EaglerAdapter.isWindows();
this.loadOptions(); this.loadOptions();
} }
@ -329,9 +331,9 @@ public class GameSettings {
} }
} }
if (par1EnumOptions == EnumOptions.ENABLE_VSYNC) { if (par1EnumOptions == EnumOptions.PATCH_ANGLE) {
this.enableVsync = !this.enableVsync; this.patchAnisotropic = !this.patchAnisotropic;
EaglerAdapter.setVSyncEnabled(this.enableVsync); this.mc.renderGlobal.loadRenderers();
} }
this.saveOptions(); this.saveOptions();
@ -385,7 +387,7 @@ public class GameSettings {
return this.fullScreen; return this.fullScreen;
case 12: case 12:
return this.enableVsync; return this.patchAnisotropic;
case 13: case 13:
return this.showCape; return this.showCape;
@ -493,6 +495,7 @@ public class GameSettings {
if(yee.hasKey("chatHeightUnfocused")) this.chatHeightUnfocused = yee.getFloat("chatHeightUnfocused"); if(yee.hasKey("chatHeightUnfocused")) this.chatHeightUnfocused = yee.getFloat("chatHeightUnfocused");
if(yee.hasKey("chatScale")) this.chatScale = yee.getFloat("chatScale"); if(yee.hasKey("chatScale")) this.chatScale = yee.getFloat("chatScale");
if(yee.hasKey("chatWidth")) this.chatWidth = yee.getFloat("chatWidth"); if(yee.hasKey("chatWidth")) this.chatWidth = yee.getFloat("chatWidth");
if(yee.hasKey("patchAnisotropic")) this.patchAnisotropic = yee.getBoolean("patchAnisotropic");
for (int var4 = 0; var4 < this.keyBindings.length; ++var4) { for (int var4 = 0; var4 < this.keyBindings.length; ++var4) {
if(yee.hasKey(keyBindings[var4].keyDescription)) this.keyBindings[var4].keyCode = yee.getInteger(keyBindings[var4].keyDescription); if(yee.hasKey(keyBindings[var4].keyDescription)) this.keyBindings[var4].keyCode = yee.getInteger(keyBindings[var4].keyDescription);
@ -545,6 +548,7 @@ public class GameSettings {
yee.setFloat("chatHeightUnfocused", this.chatHeightUnfocused); yee.setFloat("chatHeightUnfocused", this.chatHeightUnfocused);
yee.setFloat("chatScale", this.chatScale); yee.setFloat("chatScale", this.chatScale);
yee.setFloat("chatWidth", this.chatWidth); yee.setFloat("chatWidth", this.chatWidth);
yee.setBoolean("patchAnisotropic", this.patchAnisotropic);
for (int var4 = 0; var4 < this.keyBindings.length; ++var4) { for (int var4 = 0; var4 < this.keyBindings.length; ++var4) {
yee.setInteger(keyBindings[var4].keyDescription, keyBindings[var4].keyCode); yee.setInteger(keyBindings[var4].keyDescription, keyBindings[var4].keyCode);

View File

@ -123,7 +123,7 @@ public class GuiAchievement extends Gui {
this.theGame.fontRenderer.drawString(this.achievementStatName, var5 + 30, var6 + 18, -1); this.theGame.fontRenderer.drawString(this.achievementStatName, var5 + 30, var6 + 18, -1);
} }
RenderHelper.enableGUIStandardItemLighting(); RenderHelper.enableGUIStandardItemLighting2();
EaglerAdapter.glDisable(EaglerAdapter.GL_LIGHTING); EaglerAdapter.glDisable(EaglerAdapter.GL_LIGHTING);
EaglerAdapter.glEnable(EaglerAdapter.GL_RESCALE_NORMAL); EaglerAdapter.glEnable(EaglerAdapter.GL_RESCALE_NORMAL);
EaglerAdapter.glEnable(EaglerAdapter.GL_COLOR_MATERIAL); EaglerAdapter.glEnable(EaglerAdapter.GL_COLOR_MATERIAL);

View File

@ -153,7 +153,7 @@ public class GuiBeacon extends GuiContainer {
} }
} }
RenderHelper.enableGUIStandardItemLighting(); RenderHelper.enableGUIStandardItemLighting2();
} }
private static final TextureLocation tex = new TextureLocation("/gui/beacon.png"); private static final TextureLocation tex = new TextureLocation("/gui/beacon.png");

View File

@ -91,7 +91,7 @@ public abstract class GuiContainer extends GuiScreen {
EaglerAdapter.glDisable(EaglerAdapter.GL_LIGHTING); EaglerAdapter.glDisable(EaglerAdapter.GL_LIGHTING);
EaglerAdapter.glDisable(EaglerAdapter.GL_DEPTH_TEST); EaglerAdapter.glDisable(EaglerAdapter.GL_DEPTH_TEST);
super.drawScreen(par1, par2, par3); super.drawScreen(par1, par2, par3);
RenderHelper.enableGUIStandardItemLighting(); RenderHelper.enableGUIStandardItemLighting2();
EaglerAdapter.glPushMatrix(); EaglerAdapter.glPushMatrix();
EaglerAdapter.glTranslatef((float) var4, (float) var5, 0.0F); EaglerAdapter.glTranslatef((float) var4, (float) var5, 0.0F);
EaglerAdapter.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); EaglerAdapter.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
@ -268,7 +268,7 @@ public abstract class GuiContainer extends GuiScreen {
itemRenderer.zLevel = 0.0F; itemRenderer.zLevel = 0.0F;
EaglerAdapter.glEnable(EaglerAdapter.GL_LIGHTING); EaglerAdapter.glEnable(EaglerAdapter.GL_LIGHTING);
EaglerAdapter.glEnable(EaglerAdapter.GL_DEPTH_TEST); EaglerAdapter.glEnable(EaglerAdapter.GL_DEPTH_TEST);
RenderHelper.enableGUIStandardItemLighting(); RenderHelper.enableGUIStandardItemLighting2();
EaglerAdapter.glEnable(EaglerAdapter.GL_RESCALE_NORMAL); EaglerAdapter.glEnable(EaglerAdapter.GL_RESCALE_NORMAL);
} }
} }

View File

@ -534,7 +534,7 @@ public class GuiContainerCreative extends InventoryEffectRenderer {
*/ */
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
EaglerAdapter.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); EaglerAdapter.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
RenderHelper.enableGUIStandardItemLighting(); RenderHelper.enableGUIStandardItemLighting2();
CreativeTabs var4 = CreativeTabs.creativeTabArray[selectedTabIndex]; CreativeTabs var4 = CreativeTabs.creativeTabArray[selectedTabIndex];
CreativeTabs[] var5 = CreativeTabs.creativeTabArray; CreativeTabs[] var5 = CreativeTabs.creativeTabArray;
int var6 = var5.length; int var6 = var5.length;

View File

@ -288,7 +288,7 @@ public class GuiIngame extends Gui {
EaglerAdapter.glDisable(EaglerAdapter.GL_BLEND); EaglerAdapter.glDisable(EaglerAdapter.GL_BLEND);
this.mc.mcProfiler.startSection("actionBar"); this.mc.mcProfiler.startSection("actionBar");
EaglerAdapter.glEnable(EaglerAdapter.GL_RESCALE_NORMAL); EaglerAdapter.glEnable(EaglerAdapter.GL_RESCALE_NORMAL);
RenderHelper.enableGUIStandardItemLighting(); RenderHelper.enableGUIStandardItemLighting2();
for (var18 = 0; var18 < 9; ++var18) { for (var18 = 0; var18 < 9; ++var18) {
var19 = var6 / 2 - 90 + var18 * 20 + 2; var19 = var6 / 2 - 90 + var18 * 20 + 2;
@ -425,7 +425,7 @@ public class GuiIngame extends Gui {
this.drawString(var8, var45, var6 - var8.getStringWidth(var45) - 2, 46, 14737632); this.drawString(var8, var45, var6 - var8.getStringWidth(var45) - 2, 46, 14737632);
var45 = "verts: "+(EaglerAdapter.getVertexesPerSecond() / 1000)+"k, triangles: "+(EaglerAdapter.getTrianglesPerSecond() / 1000)+"k"; var45 = "verts: "+(EaglerAdapter.getVertexesPerSecond() / 1000)+"k, triangles: "+(EaglerAdapter.getTrianglesPerSecond() / 1000)+"k";
this.drawString(var8, var45, var6 - var8.getStringWidth(var45) - 2, 56, 14737632); this.drawString(var8, var45, var6 - var8.getStringWidth(var45) - 2, 56, 14737632);
var45 = "rendering backend: "+(EaglerAdapter.isWebGL ? "webgl10" : "opengl30"); var45 = "rendering backend: "+(EaglerAdapter.isWebGL ? "webgl20" : "opengl30");
this.drawString(var8, var45, var6 - var8.getStringWidth(var45) - 2, 66, 14737632); this.drawString(var8, var45, var6 - var8.getStringWidth(var45) - 2, 66, 14737632);
var45 = "glsl "+(EaglerAdapter._wgetShaderHeader() +", 32 bytes/vert"); var45 = "glsl "+(EaglerAdapter._wgetShaderHeader() +", 32 bytes/vert");
this.drawString(var8, var45, var6 - var8.getStringWidth(var45) - 2, 76, 14737632); this.drawString(var8, var45, var6 - var8.getStringWidth(var45) - 2, 76, 14737632);
@ -718,6 +718,8 @@ public class GuiIngame extends Gui {
EaglerAdapter.glBlendFunc(EaglerAdapter.GL_SRC_ALPHA, EaglerAdapter.GL_ONE_MINUS_SRC_ALPHA); EaglerAdapter.glBlendFunc(EaglerAdapter.GL_SRC_ALPHA, EaglerAdapter.GL_ONE_MINUS_SRC_ALPHA);
EaglerAdapter.glColor4f(1.0F, 1.0F, 1.0F, par1); EaglerAdapter.glColor4f(1.0F, 1.0F, 1.0F, par1);
terrain.bindTexture(); terrain.bindTexture();
EaglerAdapter.glTexParameteri(EaglerAdapter.GL_TEXTURE_2D, EaglerAdapter.GL_TEXTURE_MIN_FILTER, EaglerAdapter.GL_NEAREST);
EaglerAdapter.glTexParameteri(EaglerAdapter.GL_TEXTURE_2D, EaglerAdapter.GL_TEXTURE_MAG_FILTER, EaglerAdapter.GL_NEAREST);
Icon var4 = Block.portal.getBlockTextureFromSide(1); Icon var4 = Block.portal.getBlockTextureFromSide(1);
float var5 = var4.getMinU(); float var5 = var4.getMinU();
float var6 = var4.getMinV(); float var6 = var4.getMinV();

View File

@ -437,7 +437,7 @@ public class GuiMainMenu extends GuiScreen {
this.drawString(this.fontRenderer, "minecraft 1.5.2", 2, this.height - 20, 16777215); this.drawString(this.fontRenderer, "minecraft 1.5.2", 2, this.height - 20, 16777215);
this.drawString(this.fontRenderer, ConfigConstants.mainMenuString, 2, this.height - 10, 16777215); this.drawString(this.fontRenderer, ConfigConstants.mainMenuString, 2, this.height - 10, 16777215);
String var10 = "copyright 2020 calder young"; String var10 = "copyright " + Calendar.getInstance().get(Calendar.YEAR) + " calder young";
this.drawString(this.fontRenderer, var10, this.width - this.fontRenderer.getStringWidth(var10) - 2, this.height - 10, 16777215); this.drawString(this.fontRenderer, var10, this.width - this.fontRenderer.getStringWidth(var10) - 2, this.height - 10, 16777215);
var10 = "all rights reserved"; var10 = "all rights reserved";

View File

@ -127,7 +127,7 @@ public class GuiMerchant extends GuiContainer {
ItemStack var9 = var8.getItemToBuy(); ItemStack var9 = var8.getItemToBuy();
ItemStack var10 = var8.getSecondItemToBuy(); ItemStack var10 = var8.getSecondItemToBuy();
ItemStack var11 = var8.getItemToSell(); ItemStack var11 = var8.getItemToSell();
RenderHelper.enableGUIStandardItemLighting(); RenderHelper.enableGUIStandardItemLighting2();
EaglerAdapter.glDisable(EaglerAdapter.GL_LIGHTING); EaglerAdapter.glDisable(EaglerAdapter.GL_LIGHTING);
EaglerAdapter.glEnable(EaglerAdapter.GL_RESCALE_NORMAL); EaglerAdapter.glEnable(EaglerAdapter.GL_RESCALE_NORMAL);
EaglerAdapter.glEnable(EaglerAdapter.GL_COLOR_MATERIAL); EaglerAdapter.glEnable(EaglerAdapter.GL_COLOR_MATERIAL);

View File

@ -31,8 +31,9 @@ public class GuiScreenAddServer extends GuiScreen {
StringTranslate var1 = StringTranslate.getInstance(); StringTranslate var1 = StringTranslate.getInstance();
EaglerAdapter.enableRepeatEvents(true); EaglerAdapter.enableRepeatEvents(true);
this.buttonList.clear(); this.buttonList.clear();
this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, var1.translateKey("addServer.add"))); int sslOff = EaglerAdapter.isSSLPage() ? 36 : 0;
this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, var1.translateKey("gui.cancel"))); this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12 + sslOff, var1.translateKey("addServer.add")));
this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12 + sslOff, var1.translateKey("gui.cancel")));
this.buttonList.add(new GuiButton(2, this.width / 2 - 100, 142, var1.translateKey("addServer.hideAddress") + ": " + (this.newServerData.isHidingAddress() ? var1.translateKey("gui.yes") : var1.translateKey("gui.no")))); this.buttonList.add(new GuiButton(2, this.width / 2 - 100, 142, var1.translateKey("addServer.hideAddress") + ": " + (this.newServerData.isHidingAddress() ? var1.translateKey("gui.yes") : var1.translateKey("gui.no"))));
this.serverName = new GuiTextField(this.fontRenderer, this.width / 2 - 100, 66, 200, 20); this.serverName = new GuiTextField(this.fontRenderer, this.width / 2 - 100, 66, 200, 20);
this.serverName.setFocused(true); this.serverName.setFocused(true);
@ -113,6 +114,10 @@ public class GuiScreenAddServer extends GuiScreen {
this.drawCenteredString(this.fontRenderer, var4.translateKey("addServer.title"), this.width / 2, 17, 16777215); this.drawCenteredString(this.fontRenderer, var4.translateKey("addServer.title"), this.width / 2, 17, 16777215);
this.drawString(this.fontRenderer, var4.translateKey("addServer.enterName"), this.width / 2 - 100, 53, 10526880); this.drawString(this.fontRenderer, var4.translateKey("addServer.enterName"), this.width / 2 - 100, 53, 10526880);
this.drawString(this.fontRenderer, var4.translateKey("addServer.enterIp"), this.width / 2 - 100, 94, 10526880); this.drawString(this.fontRenderer, var4.translateKey("addServer.enterIp"), this.width / 2 - 100, 94, 10526880);
if(EaglerAdapter.isSSLPage()) {
this.drawCenteredString(this.fontRenderer, var4.translateKey("addServer.SSLWarn1"), this.width / 2, 169, 0xccccff);
this.drawCenteredString(this.fontRenderer, var4.translateKey("addServer.SSLWarn2"), this.width / 2, 181, 0xccccff);
}
this.serverName.drawTextBox(); this.serverName.drawTextBox();
this.serverAddress.drawTextBox(); this.serverAddress.drawTextBox();
super.drawScreen(par1, par2, par3); super.drawScreen(par1, par2, par3);

View File

@ -90,6 +90,10 @@ public class GuiScreenServerList extends GuiScreen {
this.drawDefaultBackground(); this.drawDefaultBackground();
this.drawCenteredString(this.fontRenderer, var4.translateKey("selectServer.direct"), this.width / 2, this.height / 4 - 60 + 20, 16777215); this.drawCenteredString(this.fontRenderer, var4.translateKey("selectServer.direct"), this.width / 2, this.height / 4 - 60 + 20, 16777215);
this.drawString(this.fontRenderer, var4.translateKey("addServer.enterIp"), this.width / 2 - 100, 100, 10526880); this.drawString(this.fontRenderer, var4.translateKey("addServer.enterIp"), this.width / 2 - 100, 100, 10526880);
if(EaglerAdapter.isSSLPage()) {
this.drawCenteredString(this.fontRenderer, var4.translateKey("addServer.SSLWarn1"), this.width / 2, 116 + 28, 0xccccff);
this.drawCenteredString(this.fontRenderer, var4.translateKey("addServer.SSLWarn2"), this.width / 2, 116 + 40, 0xccccff);
}
this.serverTextField.drawTextBox(); this.serverTextField.drawTextBox();
super.drawScreen(par1, par2, par3); super.drawScreen(par1, par2, par3);
} }

View File

@ -17,7 +17,7 @@ public class GuiVideoSettings extends GuiScreen {
/** An array of all of EnumOption's video options. */ /** 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, 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.ENABLE_VSYNC }; EnumOptions.GUI_SCALE, EnumOptions.GAMMA, EnumOptions.RENDER_CLOUDS, EnumOptions.ENABLE_FOG, EnumOptions.PARTICLES, EnumOptions.PATCH_ANGLE };
public GuiVideoSettings(GuiScreen par1GuiScreen, GameSettings par2GameSettings) { public GuiVideoSettings(GuiScreen par1GuiScreen, GameSettings par2GameSettings) {
this.parentGuiScreen = par1GuiScreen; this.parentGuiScreen = par1GuiScreen;

View File

@ -41,7 +41,9 @@ public class ItemRenderer {
if (par2ItemStack.getItemSpriteNumber() == 0 && Block.blocksList[par2ItemStack.itemID] != null && RenderBlocks.renderItemIn3d(Block.blocksList[par2ItemStack.itemID].getRenderType())) { if (par2ItemStack.getItemSpriteNumber() == 0 && Block.blocksList[par2ItemStack.itemID] != null && RenderBlocks.renderItemIn3d(Block.blocksList[par2ItemStack.itemID].getRenderType())) {
terrain.bindTexture(); terrain.bindTexture();
EaglerAdapter.flipLightMatrix();
this.renderBlocksInstance.renderBlockAsItem(Block.blocksList[par2ItemStack.itemID], par2ItemStack.getItemDamage(), 1.0F); this.renderBlocksInstance.renderBlockAsItem(Block.blocksList[par2ItemStack.itemID], par2ItemStack.getItemDamage(), 1.0F);
EaglerAdapter.flipLightMatrix();
} else { } else {
Icon var4 = par1EntityLiving.getItemIcon(par2ItemStack, par3); Icon var4 = par1EntityLiving.getItemIcon(par2ItemStack, par3);
@ -52,6 +54,8 @@ public class ItemRenderer {
if (par2ItemStack.getItemSpriteNumber() == 0) { if (par2ItemStack.getItemSpriteNumber() == 0) {
terrain.bindTexture(); terrain.bindTexture();
EaglerAdapter.glTexParameteri(EaglerAdapter.GL_TEXTURE_2D, EaglerAdapter.GL_TEXTURE_MIN_FILTER, EaglerAdapter.GL_NEAREST);
EaglerAdapter.glTexParameteri(EaglerAdapter.GL_TEXTURE_2D, EaglerAdapter.GL_TEXTURE_MAG_FILTER, EaglerAdapter.GL_NEAREST);
} else { } else {
items.bindTexture(); items.bindTexture();
} }
@ -63,6 +67,7 @@ public class ItemRenderer {
float var9 = var4.getMaxV(); float var9 = var4.getMaxV();
float var10 = 0.0F; float var10 = 0.0F;
float var11 = 0.3F; float var11 = 0.3F;
RenderHelper.enableStandardItemLighting2();
EaglerAdapter.glEnable(EaglerAdapter.GL_RESCALE_NORMAL); EaglerAdapter.glEnable(EaglerAdapter.GL_RESCALE_NORMAL);
EaglerAdapter.glTranslatef(-var10, -var11, 0.0F); EaglerAdapter.glTranslatef(-var10, -var11, 0.0F);
float var12 = 1.5F; float var12 = 1.5F;
@ -103,6 +108,7 @@ public class ItemRenderer {
} }
EaglerAdapter.glDisable(EaglerAdapter.GL_RESCALE_NORMAL); EaglerAdapter.glDisable(EaglerAdapter.GL_RESCALE_NORMAL);
EaglerAdapter.revertLightMatrix();
} }
EaglerAdapter.glPopMatrix(); EaglerAdapter.glPopMatrix();
@ -451,6 +457,8 @@ public class ItemRenderer {
if (this.mc.thePlayer.isBurning()) { if (this.mc.thePlayer.isBurning()) {
terrain.bindTexture(); terrain.bindTexture();
EaglerAdapter.glTexParameteri(EaglerAdapter.GL_TEXTURE_2D, EaglerAdapter.GL_TEXTURE_MIN_FILTER, EaglerAdapter.GL_NEAREST);
EaglerAdapter.glTexParameteri(EaglerAdapter.GL_TEXTURE_2D, EaglerAdapter.GL_TEXTURE_MAG_FILTER, EaglerAdapter.GL_NEAREST);
this.renderFireInFirstPerson(par1); this.renderFireInFirstPerson(par1);
} }
@ -459,6 +467,8 @@ public class ItemRenderer {
int var3 = MathHelper.floor_double(this.mc.thePlayer.posY); int var3 = MathHelper.floor_double(this.mc.thePlayer.posY);
int var4 = MathHelper.floor_double(this.mc.thePlayer.posZ); int var4 = MathHelper.floor_double(this.mc.thePlayer.posZ);
terrain.bindTexture(); terrain.bindTexture();
EaglerAdapter.glTexParameteri(EaglerAdapter.GL_TEXTURE_2D, EaglerAdapter.GL_TEXTURE_MIN_FILTER, EaglerAdapter.GL_NEAREST);
EaglerAdapter.glTexParameteri(EaglerAdapter.GL_TEXTURE_2D, EaglerAdapter.GL_TEXTURE_MAG_FILTER, EaglerAdapter.GL_NEAREST);
int var5 = this.mc.theWorld.getBlockId(var2, var3, var4); int var5 = this.mc.theWorld.getBlockId(var2, var3, var4);
if (this.mc.theWorld.isBlockNormalCube(var2, var3, var4)) { if (this.mc.theWorld.isBlockNormalCube(var2, var3, var4)) {

View File

@ -72,14 +72,12 @@ public class ModelBox {
this.vertexPositions[5] = var19; this.vertexPositions[5] = var19;
this.vertexPositions[6] = var20; this.vertexPositions[6] = var20;
this.vertexPositions[7] = var21; this.vertexPositions[7] = var21;
this.quadList[0] = new TexturedQuad(new PositionTextureVertex[] { var19, var15, var16, var20 }, par2 + par9 + par7, par3 + par9, par2 + par9 + par7 + par9, par3 + par9 + par8, par1ModelRenderer.textureWidth, this.quadList[0] = new TexturedQuad(new PositionTextureVertex[] { var19, var15, var16, var20 }, Vec3.createVectorHelper(1.0, 0.0, 0.0), par2 + par9 + par7, par3 + par9, par2 + par9 + par7 + par9, par3 + par9 + par8, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight);
par1ModelRenderer.textureHeight); this.quadList[1] = new TexturedQuad(new PositionTextureVertex[] { var23, var18, var21, var17 }, Vec3.createVectorHelper(-1.0, 0.0, 0.0), par2, par3 + par9, par2 + par9, par3 + par9 + par8, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight);
this.quadList[1] = new TexturedQuad(new PositionTextureVertex[] { var23, var18, var21, var17 }, par2, par3 + par9, par2 + par9, par3 + par9 + par8, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); this.quadList[2] = new TexturedQuad(new PositionTextureVertex[] { var19, var18, var23, var15 }, Vec3.createVectorHelper(0.0, 1.0, 0.0), par2 + par9, par3, par2 + par9 + par7, par3 + par9, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight);
this.quadList[2] = new TexturedQuad(new PositionTextureVertex[] { var19, var18, var23, var15 }, par2 + par9, par3, par2 + par9 + par7, par3 + par9, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); this.quadList[3] = new TexturedQuad(new PositionTextureVertex[] { var16, var17, var21, var20 }, Vec3.createVectorHelper(0.0, -1.0, 0.0), par2 + par9 + par7, par3 + par9, par2 + par9 + par7 + par7, par3, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight);
this.quadList[3] = new TexturedQuad(new PositionTextureVertex[] { var16, var17, var21, var20 }, par2 + par9 + par7, par3 + par9, par2 + par9 + par7 + par7, par3, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); this.quadList[4] = new TexturedQuad(new PositionTextureVertex[] { var15, var23, var17, var16 }, Vec3.createVectorHelper(0.0, 0.0, 1.0), par2 + par9, par3 + par9, par2 + par9 + par7, par3 + par9 + par8, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight);
this.quadList[4] = new TexturedQuad(new PositionTextureVertex[] { var15, var23, var17, var16 }, par2 + par9, par3 + par9, par2 + par9 + par7, par3 + par9 + par8, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); this.quadList[5] = new TexturedQuad(new PositionTextureVertex[] { var18, var19, var20, var21 }, Vec3.createVectorHelper(0.0, 0.0, -1.0), par2 + par9 + par7 + par9, par3 + par9, par2 + par9 + par7 + par9 + par7, par3 + par9 + par8, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight);
this.quadList[5] = new TexturedQuad(new PositionTextureVertex[] { var18, var19, var20, var21 }, par2 + par9 + par7 + par9, par3 + par9, par2 + par9 + par7 + par9 + par7, par3 + par9 + par8, par1ModelRenderer.textureWidth,
par1ModelRenderer.textureHeight);
if (par1ModelRenderer.mirror) { if (par1ModelRenderer.mirror) {
for (int var22 = 0; var22 < this.quadList.length; ++var22) { for (int var22 = 0; var22 < this.quadList.length; ++var22) {

View File

@ -47,6 +47,8 @@ public abstract class Render {
float var11 = par1Entity.width * 1.4F; float var11 = par1Entity.width * 1.4F;
EaglerAdapter.glScalef(var11, var11, var11); EaglerAdapter.glScalef(var11, var11, var11);
terrain.bindTexture(); terrain.bindTexture();
EaglerAdapter.glTexParameteri(EaglerAdapter.GL_TEXTURE_2D, EaglerAdapter.GL_TEXTURE_MIN_FILTER, EaglerAdapter.GL_NEAREST);
EaglerAdapter.glTexParameteri(EaglerAdapter.GL_TEXTURE_2D, EaglerAdapter.GL_TEXTURE_MAG_FILTER, EaglerAdapter.GL_NEAREST);
Tessellator var12 = Tessellator.instance; Tessellator var12 = Tessellator.instance;
float var13 = 0.5F; float var13 = 0.5F;
float var14 = 0.0F; float var14 = 0.0F;

View File

@ -6911,6 +6911,9 @@ public class RenderBlocks {
public void renderBlockAsItem(Block par1Block, int par2, float par3) { public void renderBlockAsItem(Block par1Block, int par2, float par3) {
Tessellator var4 = Tessellator.instance; Tessellator var4 = Tessellator.instance;
boolean var5 = par1Block.blockID == Block.grass.blockID; boolean var5 = par1Block.blockID == Block.grass.blockID;
EaglerAdapter.glTexParameteri(EaglerAdapter.GL_TEXTURE_2D, EaglerAdapter.GL_TEXTURE_MIN_FILTER, EaglerAdapter.GL_NEAREST);
EaglerAdapter.glTexParameteri(EaglerAdapter.GL_TEXTURE_2D, EaglerAdapter.GL_TEXTURE_MAG_FILTER, EaglerAdapter.GL_NEAREST);
if (par1Block == Block.dispenser || par1Block == Block.dropper || par1Block == Block.furnaceIdle) { if (par1Block == Block.dispenser || par1Block == Block.dropper || par1Block == Block.furnaceIdle) {
par2 = 3; par2 = 3;
@ -6993,10 +6996,12 @@ public class RenderBlocks {
var4.draw(); var4.draw();
EaglerAdapter.glTranslatef(0.5F, 0.5F, 0.5F); EaglerAdapter.glTranslatef(0.5F, 0.5F, 0.5F);
} else if (var6 == 22) { } else if (var6 == 22) {
RenderHelper.enableStandardItemLighting();
EaglerAdapter.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); EaglerAdapter.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
EaglerAdapter.glTranslatef(-0.5F, -0.5F, -0.5F); EaglerAdapter.glTranslatef(-0.5F, -0.5F, -0.5F);
ChestItemRenderHelper.instance.renderChest(par1Block, par2, par3); ChestItemRenderHelper.instance.renderChest(par1Block, par2, par3);
EaglerAdapter.glDisable(EaglerAdapter.GL_RESCALE_NORMAL); EaglerAdapter.glDisable(EaglerAdapter.GL_RESCALE_NORMAL);
EaglerAdapter.revertLightMatrix();
} else if (var6 == 6) { } else if (var6 == 6) {
var4.startDrawingQuads(); var4.startDrawingQuads();
var4.setNormal(0.0F, -1.0F, 0.0F); var4.setNormal(0.0F, -1.0F, 0.0F);

View File

@ -24,6 +24,8 @@ public class RenderFallingSand extends Render {
EaglerAdapter.glPushMatrix(); EaglerAdapter.glPushMatrix();
EaglerAdapter.glTranslatef((float) par2, (float) par4, (float) par6); EaglerAdapter.glTranslatef((float) par2, (float) par4, (float) par6);
tex.bindTexture(); tex.bindTexture();
EaglerAdapter.glTexParameteri(EaglerAdapter.GL_TEXTURE_2D, EaglerAdapter.GL_TEXTURE_MIN_FILTER, EaglerAdapter.GL_NEAREST);
EaglerAdapter.glTexParameteri(EaglerAdapter.GL_TEXTURE_2D, EaglerAdapter.GL_TEXTURE_MAG_FILTER, EaglerAdapter.GL_NEAREST);
EaglerAdapter.glDisable(EaglerAdapter.GL_LIGHTING); EaglerAdapter.glDisable(EaglerAdapter.GL_LIGHTING);
Tessellator var12; Tessellator var12;

View File

@ -421,7 +421,7 @@ public class RenderGlobal implements IWorldAccess {
* Gets the render info for use on the Debug screen * Gets the render info for use on the Debug screen
*/ */
public String getDebugInfoRenders() { public String getDebugInfoRenders() {
return "C: " + this.renderersBeingRendered + "/" + this.renderersLoaded + "F: " + this.renderersBeingClipped + ", O: " + this.renderersBeingOccluded + ", E: " + this.renderersSkippingRenderPass; return "C: " + this.renderersBeingRendered + "/" + this.renderersLoaded + ", F: " + this.renderersBeingClipped + ", O: " + this.renderersBeingOccluded + ", E: " + this.renderersSkippingRenderPass;
} }
public String getDebugInfoShort() { public String getDebugInfoShort() {
@ -1334,6 +1334,8 @@ public class RenderGlobal implements IWorldAccess {
float var7 = MathHelper.sin((float) Minecraft.getSystemTime() / 100.0F) * 0.2F + 0.8F; float var7 = MathHelper.sin((float) Minecraft.getSystemTime() / 100.0F) * 0.2F + 0.8F;
EaglerAdapter.glColor4f(var7, var7, var7, MathHelper.sin((float) Minecraft.getSystemTime() / 200.0F) * 0.2F + 0.5F); EaglerAdapter.glColor4f(var7, var7, var7, MathHelper.sin((float) Minecraft.getSystemTime() / 200.0F) * 0.2F + 0.5F);
tex_terrain.bindTexture(); tex_terrain.bindTexture();
EaglerAdapter.glTexParameteri(EaglerAdapter.GL_TEXTURE_2D, EaglerAdapter.GL_TEXTURE_MIN_FILTER, EaglerAdapter.GL_NEAREST);
EaglerAdapter.glTexParameteri(EaglerAdapter.GL_TEXTURE_2D, EaglerAdapter.GL_TEXTURE_MAG_FILTER, EaglerAdapter.GL_NEAREST);
} }
EaglerAdapter.glDisable(EaglerAdapter.GL_BLEND); EaglerAdapter.glDisable(EaglerAdapter.GL_BLEND);
@ -1348,6 +1350,8 @@ public class RenderGlobal implements IWorldAccess {
if (!this.damagedBlocks.isEmpty()) { if (!this.damagedBlocks.isEmpty()) {
EaglerAdapter.glBlendFunc(EaglerAdapter.GL_DST_COLOR, EaglerAdapter.GL_SRC_COLOR); EaglerAdapter.glBlendFunc(EaglerAdapter.GL_DST_COLOR, EaglerAdapter.GL_SRC_COLOR);
tex_terrain.bindTexture(); tex_terrain.bindTexture();
EaglerAdapter.glTexParameteri(EaglerAdapter.GL_TEXTURE_2D, EaglerAdapter.GL_TEXTURE_MIN_FILTER, EaglerAdapter.GL_NEAREST);
EaglerAdapter.glTexParameteri(EaglerAdapter.GL_TEXTURE_2D, EaglerAdapter.GL_TEXTURE_MAG_FILTER, EaglerAdapter.GL_NEAREST);
EaglerAdapter.glColor4f(1.0F, 1.0F, 1.0F, 0.5F); EaglerAdapter.glColor4f(1.0F, 1.0F, 1.0F, 0.5F);
EaglerAdapter.glPushMatrix(); EaglerAdapter.glPushMatrix();
EaglerAdapter.glDisable(EaglerAdapter.GL_ALPHA_TEST); EaglerAdapter.glDisable(EaglerAdapter.GL_ALPHA_TEST);

View File

@ -41,6 +41,12 @@ public class RenderHelper {
EaglerAdapter.glLightModel(EaglerAdapter.GL_LIGHT_MODEL_AMBIENT, setColorBuffer(var0, var0, var0, 1.0F)); EaglerAdapter.glLightModel(EaglerAdapter.GL_LIGHT_MODEL_AMBIENT, setColorBuffer(var0, var0, var0, 1.0F));
*/ */
} }
public static void enableStandardItemLighting2() {
EaglerAdapter.glPushMatrix();
EaglerAdapter.glScalef(1.0F, -1.0F, 1.0F);
enableStandardItemLighting();
EaglerAdapter.glPopMatrix();
}
/** /**
* Sets OpenGL lighting for rendering blocks as items inside GUI screens (such * Sets OpenGL lighting for rendering blocks as items inside GUI screens (such
@ -50,6 +56,16 @@ public class RenderHelper {
EaglerAdapter.glPushMatrix(); EaglerAdapter.glPushMatrix();
EaglerAdapter.glRotatef(-30.0F, 0.0F, 1.0F, 0.0F); EaglerAdapter.glRotatef(-30.0F, 0.0F, 1.0F, 0.0F);
EaglerAdapter.glRotatef(165.0F, 1.0F, 0.0F, 0.0F); EaglerAdapter.glRotatef(165.0F, 1.0F, 0.0F, 0.0F);
//EaglerAdapter.glScalef(1.0F, -1.0F, 1.0F);
enableStandardItemLighting();
EaglerAdapter.glPopMatrix();
}
public static void enableGUIStandardItemLighting2() {
EaglerAdapter.glPushMatrix();
EaglerAdapter.glRotatef(-30.0F, 0.0F, 1.0F, 0.0F);
EaglerAdapter.glRotatef(165.0F, 1.0F, 0.0F, 0.0F);
EaglerAdapter.glScalef(1.0F, -1.0F, 1.0F);
enableStandardItemLighting(); enableStandardItemLighting();
EaglerAdapter.glPopMatrix(); EaglerAdapter.glPopMatrix();
} }

View File

@ -57,7 +57,9 @@ public class RenderIronGolem extends RenderLiving {
EaglerAdapter.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); EaglerAdapter.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
EaglerAdapter.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); EaglerAdapter.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
terrain.bindTexture(); terrain.bindTexture();
EaglerAdapter.flipLightMatrix();
this.renderBlocks.renderBlockAsItem(Block.plantRed, 0, 1.0F); this.renderBlocks.renderBlockAsItem(Block.plantRed, 0, 1.0F);
EaglerAdapter.flipLightMatrix();
EaglerAdapter.glPopMatrix(); EaglerAdapter.glPopMatrix();
EaglerAdapter.glDisable(EaglerAdapter.GL_RESCALE_NORMAL); EaglerAdapter.glDisable(EaglerAdapter.GL_RESCALE_NORMAL);
} }

View File

@ -94,7 +94,9 @@ public class RenderItem extends Render {
} }
var18 = 1.0F; var18 = 1.0F;
EaglerAdapter.flipLightMatrix();
this.itemRenderBlocks.renderBlockAsItem(var22, var10.getItemDamage(), var18); this.itemRenderBlocks.renderBlockAsItem(var22, var10.getItemDamage(), var18);
EaglerAdapter.flipLightMatrix();
EaglerAdapter.glPopMatrix(); EaglerAdapter.glPopMatrix();
} }
} else { } else {

View File

@ -42,7 +42,9 @@ public class RenderItemFrame extends Render {
EaglerAdapter.glPushMatrix(); EaglerAdapter.glPushMatrix();
this.renderBlocksInstance.overrideBlockBounds(0.0D, (double) (0.5F - var5 + 0.0625F), (double) (0.5F - var5 + 0.0625F), (double) (var3 * 0.5F), (double) (0.5F + var5 - 0.0625F), (double) (0.5F + var5 - 0.0625F)); this.renderBlocksInstance.overrideBlockBounds(0.0D, (double) (0.5F - var5 + 0.0625F), (double) (0.5F - var5 + 0.0625F), (double) (var3 * 0.5F), (double) (0.5F + var5 - 0.0625F), (double) (0.5F + var5 - 0.0625F));
this.renderBlocksInstance.setOverrideBlockTexture(this.field_94147_f); this.renderBlocksInstance.setOverrideBlockTexture(this.field_94147_f);
//RenderHelper.enableStandardItemLighting2();
this.renderBlocksInstance.renderBlockAsItem(var2, 0, 1.0F); this.renderBlocksInstance.renderBlockAsItem(var2, 0, 1.0F);
//EaglerAdapter.revertLightMatrix();
this.renderBlocksInstance.clearOverrideBlockTexture(); this.renderBlocksInstance.clearOverrideBlockTexture();
this.renderBlocksInstance.unlockBlockBounds(); this.renderBlocksInstance.unlockBlockBounds();
EaglerAdapter.glPopMatrix(); EaglerAdapter.glPopMatrix();
@ -131,7 +133,9 @@ public class RenderItemFrame extends Render {
} }
RenderItem.renderInFrame = true; RenderItem.renderInFrame = true;
EaglerAdapter.flipLightMatrix();
RenderManager.instance.renderEntityWithPosYaw(var3, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); RenderManager.instance.renderEntityWithPosYaw(var3, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
EaglerAdapter.flipLightMatrix();
RenderItem.renderInFrame = false; RenderItem.renderInFrame = false;
if (var3.getEntityItem().getItem() == Item.compass) { if (var3.getEntityItem().getItem() == Item.compass) {

View File

@ -101,7 +101,9 @@ public class RenderMinecart extends Render {
protected void renderBlockInMinecart(EntityMinecart par1EntityMinecart, float par2, Block par3Block, int par4) { protected void renderBlockInMinecart(EntityMinecart par1EntityMinecart, float par2, Block par3Block, int par4) {
float var5 = par1EntityMinecart.getBrightness(par2); float var5 = par1EntityMinecart.getBrightness(par2);
EaglerAdapter.glPushMatrix(); EaglerAdapter.glPushMatrix();
EaglerAdapter.flipLightMatrix();
this.field_94145_f.renderBlockAsItem(par3Block, par4, var5); this.field_94145_f.renderBlockAsItem(par3Block, par4, var5);
EaglerAdapter.flipLightMatrix();
EaglerAdapter.glPopMatrix(); EaglerAdapter.glPopMatrix();
} }

View File

@ -19,6 +19,7 @@ public class RenderMooshroom extends RenderLiving {
if (!par1EntityMooshroom.isChild()) { if (!par1EntityMooshroom.isChild()) {
terrain.bindTexture(); terrain.bindTexture();
EaglerAdapter.flipLightMatrix();
EaglerAdapter.glEnable(EaglerAdapter.GL_CULL_FACE); EaglerAdapter.glEnable(EaglerAdapter.GL_CULL_FACE);
EaglerAdapter.glPushMatrix(); EaglerAdapter.glPushMatrix();
EaglerAdapter.glScalef(1.0F, -1.0F, 1.0F); EaglerAdapter.glScalef(1.0F, -1.0F, 1.0F);
@ -37,6 +38,7 @@ public class RenderMooshroom extends RenderLiving {
this.renderBlocks.renderBlockAsItem(Block.mushroomRed, 0, 1.0F); this.renderBlocks.renderBlockAsItem(Block.mushroomRed, 0, 1.0F);
EaglerAdapter.glPopMatrix(); EaglerAdapter.glPopMatrix();
EaglerAdapter.glDisable(EaglerAdapter.GL_CULL_FACE); EaglerAdapter.glDisable(EaglerAdapter.GL_CULL_FACE);
EaglerAdapter.flipLightMatrix();
} }
} }

View File

@ -538,7 +538,9 @@ public class RenderPlayer extends RenderLiving {
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) var5 / 1.0F, (float) var6 / 1.0F); OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) var5 / 1.0F, (float) var6 / 1.0F);
EaglerAdapter.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); EaglerAdapter.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
terrain.bindTexture(); terrain.bindTexture();
EaglerAdapter.flipLightMatrix();
this.renderBlocks.renderBlockAsItem(Block.blocksList[s.itemID], s.getItemDamage(), 1.0F); this.renderBlocks.renderBlockAsItem(Block.blocksList[s.itemID], s.getItemDamage(), 1.0F);
EaglerAdapter.flipLightMatrix();
EaglerAdapter.glPopMatrix(); EaglerAdapter.glPopMatrix();
EaglerAdapter.glDisable(EaglerAdapter.GL_RESCALE_NORMAL); EaglerAdapter.glDisable(EaglerAdapter.GL_RESCALE_NORMAL);
} }

View File

@ -36,6 +36,7 @@ public class RenderTNTPrimed extends Render {
var10 = (1.0F - ((float) par1EntityTNTPrimed.fuse - par9 + 1.0F) / 100.0F) * 0.8F; var10 = (1.0F - ((float) par1EntityTNTPrimed.fuse - par9 + 1.0F) / 100.0F) * 0.8F;
terrain.bindTexture(); terrain.bindTexture();
EaglerAdapter.flipLightMatrix();
this.blockRenderer.renderBlockAsItem(Block.tnt, 0, par1EntityTNTPrimed.getBrightness(par9)); this.blockRenderer.renderBlockAsItem(Block.tnt, 0, par1EntityTNTPrimed.getBrightness(par9));
if (par1EntityTNTPrimed.fuse / 5 % 2 == 0) { if (par1EntityTNTPrimed.fuse / 5 % 2 == 0) {
@ -50,6 +51,7 @@ public class RenderTNTPrimed extends Render {
EaglerAdapter.glEnable(EaglerAdapter.GL_LIGHTING); EaglerAdapter.glEnable(EaglerAdapter.GL_LIGHTING);
EaglerAdapter.glEnable(EaglerAdapter.GL_TEXTURE_2D); EaglerAdapter.glEnable(EaglerAdapter.GL_TEXTURE_2D);
} }
EaglerAdapter.flipLightMatrix();
EaglerAdapter.glPopMatrix(); EaglerAdapter.glPopMatrix();
} }

View File

@ -32,7 +32,9 @@ public class RenderTntMinecart extends RenderMinecart {
EaglerAdapter.glBlendFunc(EaglerAdapter.GL_SRC_ALPHA, EaglerAdapter.GL_DST_ALPHA); EaglerAdapter.glBlendFunc(EaglerAdapter.GL_SRC_ALPHA, EaglerAdapter.GL_DST_ALPHA);
EaglerAdapter.glColor4f(1.0F, 1.0F, 1.0F, (1.0F - ((float) var5 - par2 + 1.0F) / 100.0F) * 0.8F); EaglerAdapter.glColor4f(1.0F, 1.0F, 1.0F, (1.0F - ((float) var5 - par2 + 1.0F) / 100.0F) * 0.8F);
EaglerAdapter.glPushMatrix(); EaglerAdapter.glPushMatrix();
EaglerAdapter.flipLightMatrix();
this.field_94145_f.renderBlockAsItem(Block.tnt, 0, 1.0F); this.field_94145_f.renderBlockAsItem(Block.tnt, 0, 1.0F);
EaglerAdapter.flipLightMatrix();
EaglerAdapter.glPopMatrix(); EaglerAdapter.glPopMatrix();
EaglerAdapter.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); EaglerAdapter.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
EaglerAdapter.glDisable(EaglerAdapter.GL_BLEND); EaglerAdapter.glDisable(EaglerAdapter.GL_BLEND);

View File

@ -5,16 +5,16 @@ import net.lax1dude.eaglercraft.adapter.Tessellator;
public class TexturedQuad { public class TexturedQuad {
public PositionTextureVertex[] vertexPositions; public PositionTextureVertex[] vertexPositions;
public int nVertices; public int nVertices;
private boolean invertNormal; private Vec3 normal;
public TexturedQuad(PositionTextureVertex[] par1ArrayOfPositionTextureVertex) { public TexturedQuad(PositionTextureVertex[] par1ArrayOfPositionTextureVertex) {
this.nVertices = 0; this.nVertices = 0;
this.invertNormal = false; this.normal = null;
this.vertexPositions = par1ArrayOfPositionTextureVertex; this.vertexPositions = par1ArrayOfPositionTextureVertex;
this.nVertices = par1ArrayOfPositionTextureVertex.length; this.nVertices = par1ArrayOfPositionTextureVertex.length;
} }
public TexturedQuad(PositionTextureVertex[] par1ArrayOfPositionTextureVertex, int par2, int par3, int par4, int par5, float par6, float par7) { public TexturedQuad(PositionTextureVertex[] par1ArrayOfPositionTextureVertex, Vec3 normal, int par2, int par3, int par4, int par5, float par6, float par7) {
this(par1ArrayOfPositionTextureVertex); this(par1ArrayOfPositionTextureVertex);
float var8 = 0.0F / par6; float var8 = 0.0F / par6;
float var9 = 0.0F / par7; float var9 = 0.0F / par7;
@ -22,6 +22,7 @@ public class TexturedQuad {
par1ArrayOfPositionTextureVertex[1] = par1ArrayOfPositionTextureVertex[1].setTexturePosition((float) par2 / par6 + var8, (float) par3 / par7 + var9); par1ArrayOfPositionTextureVertex[1] = par1ArrayOfPositionTextureVertex[1].setTexturePosition((float) par2 / par6 + var8, (float) par3 / par7 + var9);
par1ArrayOfPositionTextureVertex[2] = par1ArrayOfPositionTextureVertex[2].setTexturePosition((float) par2 / par6 + var8, (float) par5 / par7 - var9); par1ArrayOfPositionTextureVertex[2] = par1ArrayOfPositionTextureVertex[2].setTexturePosition((float) par2 / par6 + var8, (float) par5 / par7 - var9);
par1ArrayOfPositionTextureVertex[3] = par1ArrayOfPositionTextureVertex[3].setTexturePosition((float) par4 / par6 - var8, (float) par5 / par7 - var9); par1ArrayOfPositionTextureVertex[3] = par1ArrayOfPositionTextureVertex[3].setTexturePosition((float) par4 / par6 - var8, (float) par5 / par7 - var9);
this.normal = normal;
} }
public void flipFace() { public void flipFace() {
@ -30,20 +31,25 @@ public class TexturedQuad {
for (int var2 = 0; var2 < this.vertexPositions.length; ++var2) { for (int var2 = 0; var2 < this.vertexPositions.length; ++var2) {
var1[var2] = this.vertexPositions[this.vertexPositions.length - var2 - 1]; var1[var2] = this.vertexPositions[this.vertexPositions.length - var2 - 1];
} }
this.normal.xCoord = -this.normal.xCoord;
this.normal.yCoord = -this.normal.yCoord;
this.normal.zCoord = -this.normal.zCoord;
this.vertexPositions = var1; this.vertexPositions = var1;
} }
public void draw(Tessellator par1Tessellator, float par2) { public void draw(Tessellator par1Tessellator, float par2) {
Vec3 var3 = this.vertexPositions[1].vector3D.subtract(this.vertexPositions[0].vector3D); //Vec3 var3 = this.vertexPositions[1].vector3D.subtract(this.vertexPositions[0].vector3D);
Vec3 var4 = this.vertexPositions[1].vector3D.subtract(this.vertexPositions[2].vector3D); //Vec3 var4 = this.vertexPositions[1].vector3D.subtract(this.vertexPositions[2].vector3D);
Vec3 var5 = var4.crossProduct(var3).normalize(); //Vec3 var5 = var4.crossProduct(var3).normalize();
par1Tessellator.startDrawingQuads(); par1Tessellator.startDrawingQuads();
if (this.invertNormal) { //if (this.invertNormal) {
par1Tessellator.setNormal(-((float) var5.xCoord), -((float) var5.yCoord), -((float) var5.zCoord)); // par1Tessellator.setNormal(-((float) var5.xCoord), -((float) var5.yCoord), -((float) var5.zCoord));
} else { //} else {
par1Tessellator.setNormal((float) var5.xCoord, (float) var5.yCoord, (float) var5.zCoord); if(this.normal != null) {
par1Tessellator.setNormal((float) this.normal.xCoord, (float) this.normal.yCoord, (float) this.normal.zCoord);
} }
for (int var6 = 0; var6 < 4; ++var6) { for (int var6 = 0; var6 < 4; ++var6) {

View File

@ -17,6 +17,8 @@ public class TileEntityRendererPiston extends TileEntitySpecialRenderer {
if (var9 != null && par1TileEntityPiston.getProgress(par8) < 1.0F) { if (var9 != null && par1TileEntityPiston.getProgress(par8) < 1.0F) {
Tessellator var10 = Tessellator.instance; Tessellator var10 = Tessellator.instance;
tex_terrain.bindTexture(); tex_terrain.bindTexture();
EaglerAdapter.glTexParameteri(EaglerAdapter.GL_TEXTURE_2D, EaglerAdapter.GL_TEXTURE_MIN_FILTER, EaglerAdapter.GL_NEAREST);
EaglerAdapter.glTexParameteri(EaglerAdapter.GL_TEXTURE_2D, EaglerAdapter.GL_TEXTURE_MAG_FILTER, EaglerAdapter.GL_NEAREST);
RenderHelper.disableStandardItemLighting(); RenderHelper.disableStandardItemLighting();
EaglerAdapter.glBlendFunc(EaglerAdapter.GL_SRC_ALPHA, EaglerAdapter.GL_ONE_MINUS_SRC_ALPHA); EaglerAdapter.glBlendFunc(EaglerAdapter.GL_SRC_ALPHA, EaglerAdapter.GL_ONE_MINUS_SRC_ALPHA);
EaglerAdapter.glEnable(EaglerAdapter.GL_BLEND); EaglerAdapter.glEnable(EaglerAdapter.GL_BLEND);

View File

@ -150,6 +150,7 @@ public class WorldRenderer {
ChunkCache var9 = new ChunkCache(this.worldObj, var1 - var8, var2 - var8, var3 - var8, var4 + var8, var5 + var8, var6 + var8, var8); ChunkCache var9 = new ChunkCache(this.worldObj, var1 - var8, var2 - var8, var3 - var8, var4 + var8, var5 + var8, var6 + var8, var8);
Profiler p = Minecraft.getMinecraft().mcProfiler; Profiler p = Minecraft.getMinecraft().mcProfiler;
if (!var9.extendedLevelsInChunkCache()) { if (!var9.extendedLevelsInChunkCache()) {
EaglerAdapter.hintAnisotropicFix(true);
++chunksUpdated; ++chunksUpdated;
RenderBlocks var10 = new RenderBlocks(var9); RenderBlocks var10 = new RenderBlocks(var9);
this.bytesDrawn = 0; this.bytesDrawn = 0;
@ -222,6 +223,7 @@ public class WorldRenderer {
break; break;
} }
} }
EaglerAdapter.hintAnisotropicFix(false);
} }
HashSet var22 = new HashSet(); HashSet var22 = new HashSet();

View File

@ -17,6 +17,7 @@ import org.teavm.jso.ajax.ReadyStateChangeHandler;
import org.teavm.jso.ajax.XMLHttpRequest; import org.teavm.jso.ajax.XMLHttpRequest;
import org.teavm.jso.browser.TimerHandler; import org.teavm.jso.browser.TimerHandler;
import org.teavm.jso.browser.Window; import org.teavm.jso.browser.Window;
import org.teavm.jso.core.JSNumber;
import org.teavm.jso.dom.events.EventListener; import org.teavm.jso.dom.events.EventListener;
import org.teavm.jso.dom.events.KeyboardEvent; import org.teavm.jso.dom.events.KeyboardEvent;
import org.teavm.jso.dom.events.MessageEvent; import org.teavm.jso.dom.events.MessageEvent;
@ -51,6 +52,7 @@ import org.teavm.jso.websocket.WebSocket;
import net.lax1dude.eaglercraft.AssetRepository; import net.lax1dude.eaglercraft.AssetRepository;
import net.lax1dude.eaglercraft.Base64; import net.lax1dude.eaglercraft.Base64;
import net.lax1dude.eaglercraft.EarlyLoadScreen; import net.lax1dude.eaglercraft.EarlyLoadScreen;
import net.lax1dude.eaglercraft.LocalStorageManager;
import net.lax1dude.eaglercraft.adapter.teavm.WebGLQuery; import net.lax1dude.eaglercraft.adapter.teavm.WebGLQuery;
import net.lax1dude.eaglercraft.adapter.teavm.WebGLVertexArray; import net.lax1dude.eaglercraft.adapter.teavm.WebGLVertexArray;
import net.minecraft.src.MathHelper; import net.minecraft.src.MathHelper;
@ -63,7 +65,7 @@ public class EaglerAdapterImpl2 {
public static final boolean _wisWebGL() { public static final boolean _wisWebGL() {
return true; return true;
} }
private static boolean isAnisotropicPatched = true; private static boolean isAnisotropicPatched = false;
public static final boolean _wisAnisotropicPatched() { public static final boolean _wisAnisotropicPatched() {
return isAnisotropicPatched; return isAnisotropicPatched;
} }
@ -71,6 +73,13 @@ public class EaglerAdapterImpl2 {
return "#version 300 es"; return "#version 300 es";
} }
@JSBody(params = { }, script = "return window.location.href;")
private static native String getLocationString();
public static final boolean isSSLPage() {
return getLocationString().startsWith("https");
}
public static final InputStream loadResource(String path) { public static final InputStream loadResource(String path) {
byte[] file = loadResourceBytes(path); byte[] file = loadResourceBytes(path);
if (file != null) { if (file != null) {
@ -148,10 +157,21 @@ public class EaglerAdapterImpl2 {
private static EventListener keyup = null; private static EventListener keyup = null;
private static EventListener keypress = null; private static EventListener keypress = null;
private static EventListener wheel = null; private static EventListener wheel = null;
private static String[] identifier = new String[0];
public static final String[] getIdentifier() {
return identifier;
}
@JSBody(params = { "v" }, script = "try { return \"\"+window.eval(v); } catch(e) { return \"<error>\"; }") @JSBody(params = { "v" }, script = "try { return \"\"+window.eval(v); } catch(e) { return \"<error>\"; }")
private static native String getString(String var); private static native String getString(String var);
public static void onWindowUnload() {
LocalStorageManager.saveStorageA();
LocalStorageManager.saveStorageG();
LocalStorageManager.saveStorageP();
}
public static final void initializeContext(HTMLElement rootElement, String assetPackageURI) { public static final void initializeContext(HTMLElement rootElement, String assetPackageURI) {
parent = rootElement; parent = rootElement;
String s = parent.getAttribute("style"); String s = parent.getAttribute("style");
@ -257,7 +277,7 @@ public class EaglerAdapterImpl2 {
isWindowFocused = true; isWindowFocused = true;
} }
}); });
execute("window.onbeforeunload = function(){return false;};"); onBeforeCloseRegister();
execute("window.eagsFileChooser = {\r\n" + execute("window.eagsFileChooser = {\r\n" +
"inputElement: null,\r\n" + "inputElement: null,\r\n" +
"openFileChooser: function(ext, mime){\r\n" + "openFileChooser: function(ext, mime){\r\n" +
@ -432,7 +452,11 @@ public class EaglerAdapterImpl2 {
public static final int _wGL_FRAMEBUFFER = FRAMEBUFFER; public static final int _wGL_FRAMEBUFFER = FRAMEBUFFER;
public static final class TextureGL { public static final class TextureGL {
protected final WebGLTexture obj; protected final WebGLTexture obj;
public int w = -1;
public int h = -1;
public boolean nearest = true;
public boolean anisotropic = false;
protected TextureGL(WebGLTexture obj) { protected TextureGL(WebGLTexture obj) {
this.obj = obj; this.obj = obj;
} }
@ -808,6 +832,19 @@ public class EaglerAdapterImpl2 {
public static final void _wglBlitFramebuffer(int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8, int p9, int p10) { public static final void _wglBlitFramebuffer(int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8, int p9, int p10) {
webgl.blitFramebuffer(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10); webgl.blitFramebuffer(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);
} }
@JSBody(params = { "ctx", "p" }, script = "return ctx.getTexParameter(0x0DE1, p) | 0;")
private static final native int __wglGetTexParameteri(WebGL2RenderingContext ctx, int p);
public static final int _wglGetTexParameteri(int p1) {
return __wglGetTexParameteri(webgl, p1);
}
@JSBody(params = { "ctx", "p" }, script = "return (0.0 + ctx.getTexParameter(0x0DE1, p));")
private static final native float __wglGetTexParameterf(WebGL2RenderingContext ctx, int p);
public static final float _wglGetTexParameterf(int p1) {
return __wglGetTexParameterf(webgl, p1);
}
public static final boolean isWindows() {
return getString("window.navigator.platform").toLowerCase().contains("win");
}
private static MouseEvent currentEvent = null; private static MouseEvent currentEvent = null;
private static KeyboardEvent currentEventK = null; private static KeyboardEvent currentEventK = null;
@ -1048,9 +1085,12 @@ public class EaglerAdapterImpl2 {
public static final void openLink(String url) { public static final void openLink(String url) {
win.open(url, "_blank"); win.open(url, "_blank");
} }
@JSBody(params = { "str" }, script = "window.eval(str);") @JSBody(params = { "str" }, script = "window.eval(str);")
private static native void execute(String str); private static native void execute(String str);
@JSBody(params = { }, script = "window.onbeforeunload = function(){javaMethods.get('net.lax1dude.eaglercraft.adapter.EaglerAdapterImpl2.onWindowUnload()V').invoke();return false;};")
private static native void onBeforeCloseRegister();
@JSBody(params = { "ext", "mime" }, script = "window.eagsFileChooser.openFileChooser(ext, mime);") @JSBody(params = { "ext", "mime" }, script = "window.eagsFileChooser.openFileChooser(ext, mime);")
public static native void openFileChooser(String ext, String mime); public static native void openFileChooser(String ext, String mime);

View File

@ -349,9 +349,9 @@ public class Tessellator {
public void setNormal(float par1, float par2, float par3) { public void setNormal(float par1, float par2, float par3) {
this.hasNormals = true; this.hasNormals = true;
float len = (float) Math.sqrt(par1 * par1 + par2 * par2 + par3 * par3); float len = (float) Math.sqrt(par1 * par1 + par2 * par2 + par3 * par3);
int var4 = (int)((par1 / len) * 128.0F) + 127; int var4 = (int)((par1 / len) * 127.0F) + 127;
int var5 = (int)((par2 / len) * 128.0F) + 127; int var5 = (int)((par2 / len) * 127.0F) + 127;
int var6 = (int)((par3 / len) * 128.0F) + 127; int var6 = (int)((par3 / len) * 127.0F) + 127;
this.normal = var4 & 255 | (var5 & 255) << 8 | (var6 & 255) << 16; this.normal = var4 & 255 | (var5 & 255) << 8 | (var6 & 255) << 16;
} }

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long