made the world render (mostly)

This commit is contained in:
LAX1DUDE 2022-04-18 01:50:38 -07:00
parent 9bc06a1de8
commit 6c26e742d2
14 changed files with 77 additions and 327 deletions

View File

@ -358,4 +358,17 @@ public class Tessellator {
this.yOffset += (double) par2; this.yOffset += (double) par2;
this.zOffset += (double) par3; this.zOffset += (double) par3;
} }
public double debugGetTranslationX() {
return xOffset;
}
public double debugGetTranslationY() {
return yOffset;
}
public double debugGetTranslationZ() {
return zOffset;
}
} }

View File

@ -65,7 +65,7 @@ public class EaglerAdapterGL30 extends EaglerAdapterImpl2 {
public static final int GL_FRONT = RealOpenGLEnums.GL_FRONT; public static final int GL_FRONT = RealOpenGLEnums.GL_FRONT;
public static final int GL_COMPILE = RealOpenGLEnums.GL_COMPILE; public static final int GL_COMPILE = RealOpenGLEnums.GL_COMPILE;
public static final int GL_NEAREST = RealOpenGLEnums.GL_NEAREST; public static final int GL_NEAREST = RealOpenGLEnums.GL_NEAREST;
public static final int GL_CLAMP = RealOpenGLEnums.GL_CLAMP; public static final int GL_CLAMP = RealOpenGLEnums.GL_CLAMP_TO_EDGE;
public static final int GL_TEXTURE_WRAP_S = RealOpenGLEnums.GL_TEXTURE_WRAP_S; public static final int GL_TEXTURE_WRAP_S = RealOpenGLEnums.GL_TEXTURE_WRAP_S;
public static final int GL_TEXTURE_WRAP_T = RealOpenGLEnums.GL_TEXTURE_WRAP_T; public static final int GL_TEXTURE_WRAP_T = RealOpenGLEnums.GL_TEXTURE_WRAP_T;
public static final int GL_REPEAT = RealOpenGLEnums.GL_REPEAT; public static final int GL_REPEAT = RealOpenGLEnums.GL_REPEAT;
@ -354,7 +354,7 @@ public class EaglerAdapterGL30 extends EaglerAdapterImpl2 {
deevis.set(p1, p2, p3); deevis.set(p1, p2, p3);
getMatrix().translate(deevis); getMatrix().translate(deevis);
if (isCompilingDisplayList) { if (isCompilingDisplayList) {
System.err.println("matrix is not supported while recording display list use tessellator class instead"); throw new IllegalArgumentException("matrix is not supported while recording display list use tessellator class instead");
} }
} }
@ -506,7 +506,7 @@ public class EaglerAdapterGL30 extends EaglerAdapterImpl2 {
deevis.set(p2, p3, p4); deevis.set(p2, p3, p4);
getMatrix().rotate(p1 * toRad, deevis); getMatrix().rotate(p1 * toRad, deevis);
if (isCompilingDisplayList) { if (isCompilingDisplayList) {
System.err.println("matrix is not supported while recording display list use tessellator class instead"); throw new IllegalArgumentException("matrix is not supported while recording display list use tessellator class instead");
} }
} }
@ -563,7 +563,7 @@ public class EaglerAdapterGL30 extends EaglerAdapterImpl2 {
deevis.set(p1, p2, p3); deevis.set(p1, p2, p3);
getMatrix().scale(deevis); getMatrix().scale(deevis);
if (isCompilingDisplayList) { if (isCompilingDisplayList) {
System.err.println("matrix is not supported while recording display list use tessellator class instead"); throw new IllegalArgumentException("matrix is not supported while recording display list use tessellator class instead");
} }
} }

View File

@ -1,259 +0,0 @@
package net.lax1dude.eaglercraft.glemu;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.IntBuffer;
import net.lax1dude.eaglercraft.EaglerAdapter;
import net.minecraft.client.Minecraft;
import static net.lax1dude.eaglercraft.adapter.EaglerAdapterImpl2._wGL_DEPTH_TEST;
import static net.lax1dude.eaglercraft.adapter.EaglerAdapterImpl2._wglDisable;
import static net.lax1dude.eaglercraft.glemu.EaglerAdapterGL30.*;
public class EffectPipelineFXAA {
private static boolean isUsingFXAA = false;
private static FramebufferGL framebuffer = null;
private static RenderbufferGL framebuffer_color = null;
private static RenderbufferGL framebuffer_depth = null;
private static ProgramGL fxaaProgram = null;
private static TextureGL fxaaSourceTexture = null;
private static UniformGL fxaaScreenSize = null;
private static BufferArrayGL renderQuadArray = null;
private static BufferGL renderQuadBuffer;
public static int displayWidth = -1;
public static int displayHeight = -1;
public static int width = -1;
public static int height = -1;
private static int[] originalViewport = new int[4];
private static int state = 1;
private static int newState = -1;
private static boolean msaaInit = false;
private static void initFXAA() {
if (fxaaProgram == null) {
renderQuadArray = _wglCreateVertexArray();
renderQuadBuffer = _wglCreateBuffer();
IntBuffer upload = (isWebGL ? IntBuffer.wrap(new int[12])
: ByteBuffer.allocateDirect(12 << 2).order(ByteOrder.nativeOrder()).asIntBuffer());
upload.put(Float.floatToRawIntBits(0.0f));
upload.put(Float.floatToRawIntBits(0.0f));
upload.put(Float.floatToRawIntBits(0.0f));
upload.put(Float.floatToRawIntBits(1.0f));
upload.put(Float.floatToRawIntBits(1.0f));
upload.put(Float.floatToRawIntBits(0.0f));
upload.put(Float.floatToRawIntBits(0.0f));
upload.put(Float.floatToRawIntBits(1.0f));
upload.put(Float.floatToRawIntBits(1.0f));
upload.put(Float.floatToRawIntBits(1.0f));
upload.put(Float.floatToRawIntBits(1.0f));
upload.put(Float.floatToRawIntBits(0.0f));
upload.flip();
_wglBindVertexArray(renderQuadArray);
_wglBindBuffer(_wGL_ARRAY_BUFFER, renderQuadBuffer);
_wglBufferData0(_wGL_ARRAY_BUFFER, upload, _wGL_STATIC_DRAW);
_wglEnableVertexAttribArray(0);
_wglVertexAttribPointer(0, 2, _wGL_FLOAT, false, 8, 0);
ShaderGL pvert_shader = _wglCreateShader(_wGL_VERTEX_SHADER);
_wglShaderSource(pvert_shader, _wgetShaderHeader() + "\n" + fileContents("/glsl/pvert.glsl"));
_wglCompileShader(pvert_shader);
if (!_wglGetShaderCompiled(pvert_shader))
System.err.println(
("\n" + _wglGetShaderInfoLog(pvert_shader)).replace("\n", "\n[/glsl/pvert.glsl] ") + "\n");
ShaderGL fxaa_shader = _wglCreateShader(_wGL_FRAGMENT_SHADER);
_wglShaderSource(fxaa_shader, _wgetShaderHeader() + "\n" + fileContents("/glsl/fxaa.glsl"));
_wglCompileShader(fxaa_shader);
if (!_wglGetShaderCompiled(fxaa_shader))
System.err.println(
("\n" + _wglGetShaderInfoLog(fxaa_shader)).replace("\n", "\n[/glsl/fxaa.glsl] ") + "\n");
fxaaProgram = _wglCreateProgram();
_wglAttachShader(fxaaProgram, pvert_shader);
_wglAttachShader(fxaaProgram, fxaa_shader);
_wglLinkProgram(fxaaProgram);
_wglDetachShader(fxaaProgram, pvert_shader);
_wglDetachShader(fxaaProgram, fxaa_shader);
_wglDeleteShader(pvert_shader);
_wglDeleteShader(fxaa_shader);
if (!_wglGetProgramLinked(fxaaProgram)) {
System.err.println(
("\n" + _wglGetProgramInfoLog(fxaaProgram)).replace("\n", "\n[/glsl/fxaa.glsl][LINKER] ")
+ "\n");
fxaaProgram = null;
throw new RuntimeException("Invalid shader code");
}
_wglUseProgram(fxaaProgram);
UniformGL c = _wglGetUniformLocation(fxaaProgram, "f_color");
if (c != null)
_wglUniform1i(c, 0);
fxaaScreenSize = _wglGetUniformLocation(fxaaProgram, "screenSize");
}
destroy();
isUsingFXAA = true;
framebuffer = _wglCreateFramebuffer();
fxaaSourceTexture = _wglGenTextures();
_wglBindTexture(_wGL_TEXTURE_2D, fxaaSourceTexture);
_wglTexParameteri(_wGL_TEXTURE_2D, _wGL_TEXTURE_MAG_FILTER, _wGL_NEAREST);
_wglTexParameteri(_wGL_TEXTURE_2D, _wGL_TEXTURE_MIN_FILTER, _wGL_NEAREST);
_wglTexParameteri(_wGL_TEXTURE_2D, _wGL_TEXTURE_WRAP_S, _wGL_CLAMP);
_wglTexParameteri(_wGL_TEXTURE_2D, _wGL_TEXTURE_WRAP_T, _wGL_CLAMP);
_wglTexImage2D(_wGL_TEXTURE_2D, 0, _wGL_RGB8, width, height, 0, _wGL_RGB, _wGL_UNSIGNED_BYTE,
(ByteBuffer) null);
framebuffer_depth = _wglCreateRenderBuffer();
_wglBindRenderbuffer(framebuffer_depth);
_wglRenderbufferStorage(_wGL_DEPTH_COMPONENT32F, width, height);
_wglBindFramebuffer(_wGL_FRAMEBUFFER, framebuffer);
_wglFramebufferTexture2D(_wGL_COLOR_ATTACHMENT0, fxaaSourceTexture);
_wglFramebufferRenderbuffer(_wGL_DEPTH_ATTACHMENT, framebuffer_depth);
}
private static void initMSAA() {
destroy();
msaaInit = true;
framebuffer = _wglCreateFramebuffer();
framebuffer_color = _wglCreateRenderBuffer();
framebuffer_depth = _wglCreateRenderBuffer();
_wglBindFramebuffer(_wGL_FRAMEBUFFER, framebuffer);
_wglBindRenderbuffer(framebuffer_color);
_wglRenderbufferStorageMultisample(state == 2 ? 4 : 8, _wGL_RGB8, width, height);
_wglBindRenderbuffer(framebuffer_depth);
_wglRenderbufferStorageMultisample(state == 2 ? 4 : 8, _wGL_DEPTH_COMPONENT32F, width, height);
_wglFramebufferRenderbuffer(_wGL_COLOR_ATTACHMENT0, framebuffer_color);
_wglFramebufferRenderbuffer(_wGL_DEPTH_ATTACHMENT, framebuffer_depth);
}
public static void destroy() {
isUsingFXAA = false;
msaaInit = false;
if (framebuffer != null)
_wglDeleteFramebuffer(framebuffer);
if (framebuffer_color != null)
_wglDeleteRenderbuffer(framebuffer_color);
if (framebuffer_depth != null)
_wglDeleteRenderbuffer(framebuffer_depth);
if (fxaaSourceTexture != null)
_wglDeleteTextures(fxaaSourceTexture);
framebuffer = null;
framebuffer_color = null;
framebuffer_depth = null;
fxaaSourceTexture = null;
}
public static void beginPipelineRender() {
if (displayWidth <= 0 || displayHeight <= 0) {
return;
}
int mode = 1; // Minecraft.getMinecraft().gameSettings.antialiasMode; //TODO: add
if (mode == 0)
newState = 0;
if (mode == 1)
newState = Minecraft.getMinecraft().gameSettings.fancyGraphics ? 1 : 0;
if (mode == 2)
newState = 1;
if (mode == 3)
newState = 2;
if (mode == 4)
newState = 3;
if (newState == 0) {
state = newState;
destroy();
return;
}
if (newState != state && !(newState == 3 && state == 2)) {
destroy();
}
// _wglGetParameter(_wGL_VIEWPORT, 4, originalViewport);
if (displayWidth != width || displayHeight != height || state != newState) {
state = newState;
width = displayWidth;
height = displayHeight;
originalViewport[0] = 0;
originalViewport[1] = 0;
originalViewport[2] = width;
originalViewport[3] = height;
if (state == 1) {
if (isUsingFXAA == false) {
initFXAA();
} else {
_wglBindTexture(_wGL_TEXTURE_2D, fxaaSourceTexture);
_wglTexImage2D(_wGL_TEXTURE_2D, 0, _wGL_RGB8, width, height, 0, _wGL_RGB, _wGL_UNSIGNED_BYTE,
(ByteBuffer) null);
_wglBindRenderbuffer(framebuffer_depth);
_wglRenderbufferStorage(_wGL_DEPTH_COMPONENT32F, width, height);
}
} else if (state == 2 || state == 3) {
if (msaaInit == false) {
initMSAA();
} else {
_wglBindRenderbuffer(framebuffer_color);
_wglRenderbufferStorageMultisample(state == 2 ? 4 : 8, _wGL_RGB8, width, height);
_wglBindRenderbuffer(framebuffer_depth);
_wglRenderbufferStorageMultisample(state == 2 ? 4 : 8, _wGL_DEPTH_COMPONENT32F, width, height);
}
}
}
_wglBindFramebuffer(_wGL_FRAMEBUFFER, framebuffer);
_wglViewport(0, 0, width, height);
if (!EaglerAdapter.isWebGL && (state == 2 || state == 3)) {
_wglEnable(_wGL_MULTISAMPLE);
_wglEnable(_wGL_LINE_SMOOTH);
}
}
public static void endPipelineRender() {
if (displayWidth <= 0 || displayHeight <= 0 || state == 0) {
return;
}
_wglBindFramebuffer(_wGL_FRAMEBUFFER, null);
_wglClear(_wGL_COLOR_BUFFER_BIT | _wGL_DEPTH_BUFFER_BIT);
if (state == 1) {
_wglViewport(originalViewport[0], originalViewport[1], originalViewport[2], originalViewport[3]);
_wglActiveTexture(_wGL_TEXTURE0);
_wglBindTexture(_wGL_TEXTURE_2D, fxaaSourceTexture);
_wglDisable(_wGL_DEPTH_TEST);
_wglDisable(_wGL_CULL_FACE);
_wglDepthMask(false);
_wglUseProgram(fxaaProgram);
_wglUniform2f(fxaaScreenSize, width, height);
_wglBindVertexArray(renderQuadArray);
_wglDrawArrays(_wGL_TRIANGLES, 0, 6);
_wglEnable(_wGL_DEPTH_TEST);
_wglDepthMask(true);
} else if (state == 2 || state == 3) {
if (!EaglerAdapter.isWebGL) {
_wglDisable(_wGL_MULTISAMPLE);
_wglDisable(_wGL_LINE_SMOOTH);
}
_wglViewport(originalViewport[0], originalViewport[1], originalViewport[2], originalViewport[3]);
_wglBindFramebuffer(_wGL_READ_FRAMEBUFFER, framebuffer);
_wglBindFramebuffer(_wGL_DRAW_FRAMEBUFFER, null);
_wglDrawBuffer(_wGL_BACK);
_wglBlitFramebuffer(0, 0, width, height, 0, 0, width, height, _wGL_COLOR_BUFFER_BIT, _wGL_NEAREST);
_wglBindFramebuffer(_wGL_READ_FRAMEBUFFER, null);
}
}
}

View File

@ -59,8 +59,7 @@ public class FixedFunctionShader {
if ((i & UNIT0) == UNIT0) { if ((i & UNIT0) == UNIT0) {
CC_unit0 = true; CC_unit0 = true;
} }
s = new FixedFunctionShader(i, CC_a_color, CC_a_normal, CC_a_texture0, CC_lighting, CC_fog, CC_alphatest, s = new FixedFunctionShader(i, CC_a_color, CC_a_normal, CC_a_texture0, CC_lighting, CC_fog, CC_alphatest, CC_unit0);
CC_unit0);
instances[i] = s; instances[i] = s;
} }
return s; return s;

View File

@ -19,12 +19,15 @@ public class Minecraft implements Runnable {
instance = this; instance = this;
fullscreen = false; fullscreen = false;
timer = new Timer(20F); timer = new Timer(20F);
session = null; session = new Session("fuck", "shit");
hideQuitButton = true; hideQuitButton = true;
isWorldLoaded = false; isWorldLoaded = false;
currentScreen = null; currentScreen = null;
displayWidth = EaglerAdapter.getCanvasWidth();
displayHeight = EaglerAdapter.getCanvasHeight();
loadingScreen = new LoadingScreenRenderer(this); loadingScreen = new LoadingScreenRenderer(this);
entityRenderer = new EntityRenderer(this); entityRenderer = new EntityRenderer(this);
mouseHelper = new MouseHelper();
ticksRan = 0; ticksRan = 0;
field_6282_S = 0; field_6282_S = 0;
field_6307_v = false; field_6307_v = false;

View File

@ -17,7 +17,6 @@ public class FontRenderer {
public FontRenderer(GameSettings gamesettings, String s, RenderEngine renderengine) { public FontRenderer(GameSettings gamesettings, String s, RenderEngine renderengine) {
charWidth = new int[256]; charWidth = new int[256];
fontTextureName = 0; fontTextureName = 0;
buffer = GLAllocation.createDirectIntBuffer(1024 /* GL_FRONT_LEFT */);
BufferedImage bufferedimage; BufferedImage bufferedimage;
try { try {
bufferedimage = ImageIO.read((RenderEngine.class).getResourceAsStream(s)); bufferedimage = ImageIO.read((RenderEngine.class).getResourceAsStream(s));
@ -74,7 +73,6 @@ public class FontRenderer {
tessellator.addVertexWithUV(0.0F + f, 0.0D, 0.0D, ((float) l1 + f) / 128F + f1, (float) k2 / 128F + f2); tessellator.addVertexWithUV(0.0F + f, 0.0D, 0.0D, ((float) l1 + f) / 128F + f1, (float) k2 / 128F + f2);
tessellator.addVertexWithUV(0.0D, 0.0D, 0.0D, (float) l1 / 128F + f1, (float) k2 / 128F + f2); tessellator.addVertexWithUV(0.0D, 0.0D, 0.0D, (float) l1 / 128F + f1, (float) k2 / 128F + f2);
tessellator.draw(); tessellator.draw();
EaglerAdapter.glTranslatef(charWidth[i1], 0.0F, 0.0F);
EaglerAdapter.glEndList(); EaglerAdapter.glEndList();
} }
@ -134,7 +132,6 @@ public class FontRenderer {
f3 = 1.0F; f3 = 1.0F;
} }
EaglerAdapter.glColor4f(f, f1, f2, f3); EaglerAdapter.glColor4f(f, f1, f2, f3);
buffer.clear();
EaglerAdapter.glPushMatrix(); EaglerAdapter.glPushMatrix();
EaglerAdapter.glTranslatef(i, j, 0.0F); EaglerAdapter.glTranslatef(i, j, 0.0F);
for (int i1 = 0; i1 < s.length(); i1++) { for (int i1 = 0; i1 < s.length(); i1++) {
@ -143,29 +140,19 @@ public class FontRenderer {
if (j1 < 0 || j1 > 15) { if (j1 < 0 || j1 > 15) {
j1 = 15; j1 = 15;
} }
buffer.put(fontDisplayLists + 256 + j1 + (flag ? 16 : 0)); EaglerAdapter.glCallList(fontDisplayLists + 256 + j1 + (flag ? 16 : 0));
if (buffer.remaining() == 0) { EaglerAdapter.glTranslatef(charWidth[256 + j1 + (flag ? 16 : 0)] * 0.5f, 0.0F, 0.0F);
buffer.flip();
EaglerAdapter.glCallLists(buffer);
buffer.clear();
}
} }
if (i1 < s.length()) { if (i1 < s.length()) {
int k1 = FontAllowedCharacters.allowedCharacters.indexOf(s.charAt(i1)); int k1 = FontAllowedCharacters.allowedCharacters.indexOf(s.charAt(i1));
if (k1 >= 0) { if (k1 >= 0) {
buffer.put(fontDisplayLists + k1 + 32); EaglerAdapter.glCallList(fontDisplayLists + k1 + 32);
EaglerAdapter.glTranslatef(charWidth[k1 + 32], 0.0F, 0.0F);
} }
} }
if (buffer.remaining() == 0) {
buffer.flip();
EaglerAdapter.glCallLists(buffer);
buffer.clear();
}
} }
buffer.flip();
EaglerAdapter.glCallLists(buffer);
EaglerAdapter.glPopMatrix(); EaglerAdapter.glPopMatrix();
} }

View File

@ -5,8 +5,9 @@ package net.minecraft.src;
// Decompiler options: packimports(3) braces deadcode // Decompiler options: packimports(3) braces deadcode
import java.io.*; import java.io.*;
import net.lax1dude.eaglercraft.EaglerAdapter;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import org.lwjgl.input.Keyboard;
public class GameSettings { public class GameSettings {
@ -91,7 +92,7 @@ public class GameSettings {
} }
public String getOptionDisplayString(int i) { public String getOptionDisplayString(int i) {
return Keyboard.getKeyName(keyBindings[i].keyCode); return EaglerAdapter.getKeyName(keyBindings[i].keyCode);
} }
public void setKeyBinding(int i, int j) { public void setKeyBinding(int i, int j) {

View File

@ -1,8 +1,8 @@
package net.minecraft.src; package net.minecraft.src;
import net.lax1dude.eaglercraft.EaglerAdapter;
// Decompiled with: CFR 0.152 // Decompiled with: CFR 0.152
// Class Version: 5
import org.lwjgl.input.Keyboard;
public class GuiChat extends GuiScreen { public class GuiChat extends GuiScreen {
protected String field_985_a = ""; protected String field_985_a = "";
@ -10,11 +10,11 @@ public class GuiChat extends GuiScreen {
private static final String field_20082_i = FontAllowedCharacters.allowedCharacters; private static final String field_20082_i = FontAllowedCharacters.allowedCharacters;
public void initGui() { public void initGui() {
Keyboard.enableRepeatEvents(true); EaglerAdapter.enableRepeatEvents(true);
} }
public void onGuiClosed() { public void onGuiClosed() {
Keyboard.enableRepeatEvents(false); EaglerAdapter.enableRepeatEvents(false);
} }
public void updateScreen() { public void updateScreen() {

View File

@ -6,8 +6,9 @@ package net.minecraft.src;
import java.util.List; import java.util.List;
import java.util.Random; import java.util.Random;
import net.lax1dude.eaglercraft.EaglerAdapter;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import org.lwjgl.input.Keyboard;
public class GuiCreateWorld extends GuiScreen { public class GuiCreateWorld extends GuiScreen {
@ -22,7 +23,7 @@ public class GuiCreateWorld extends GuiScreen {
public void initGui() { public void initGui() {
StringTranslate stringtranslate = StringTranslate.getInstance(); StringTranslate stringtranslate = StringTranslate.getInstance();
Keyboard.enableRepeatEvents(true); EaglerAdapter.enableRepeatEvents(true);
controlList.clear(); controlList.clear();
controlList.add(new GuiButton(0, width / 2 - 100, height / 4 + 96 + 12, controlList.add(new GuiButton(0, width / 2 - 100, height / 4 + 96 + 12,
stringtranslate.translateKey("selectWorld.create"))); stringtranslate.translateKey("selectWorld.create")));
@ -55,7 +56,7 @@ public class GuiCreateWorld extends GuiScreen {
} }
public void onGuiClosed() { public void onGuiClosed() {
Keyboard.enableRepeatEvents(false); EaglerAdapter.enableRepeatEvents(false);
} }
protected void actionPerformed(GuiButton guibutton) { protected void actionPerformed(GuiButton guibutton) {

View File

@ -5,8 +5,9 @@ package net.minecraft.src;
// Decompiler options: packimports(3) braces deadcode // Decompiler options: packimports(3) braces deadcode
import java.util.List; import java.util.List;
import net.lax1dude.eaglercraft.EaglerAdapter;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import org.lwjgl.input.Keyboard;
public class GuiMultiplayer extends GuiScreen { public class GuiMultiplayer extends GuiScreen {
@ -20,7 +21,7 @@ public class GuiMultiplayer extends GuiScreen {
public void initGui() { public void initGui() {
StringTranslate stringtranslate = StringTranslate.getInstance(); StringTranslate stringtranslate = StringTranslate.getInstance();
Keyboard.enableRepeatEvents(true); EaglerAdapter.enableRepeatEvents(true);
controlList.clear(); controlList.clear();
controlList.add(new GuiButton(0, width / 2 - 100, height / 4 + 96 + 12, controlList.add(new GuiButton(0, width / 2 - 100, height / 4 + 96 + 12,
stringtranslate.translateKey("multiplayer.connect"))); stringtranslate.translateKey("multiplayer.connect")));
@ -34,7 +35,7 @@ public class GuiMultiplayer extends GuiScreen {
} }
public void onGuiClosed() { public void onGuiClosed() {
Keyboard.enableRepeatEvents(false); EaglerAdapter.enableRepeatEvents(false);
} }
protected void actionPerformed(GuiButton guibutton) { protected void actionPerformed(GuiButton guibutton) {

View File

@ -5,9 +5,10 @@ package net.minecraft.src;
// Decompiler options: packimports(3) braces deadcode // Decompiler options: packimports(3) braces deadcode
import java.util.List; import java.util.List;
import net.minecraft.client.Minecraft;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
import net.lax1dude.eaglercraft.EaglerAdapter;
public class GuiRenameWorld extends GuiScreen { public class GuiRenameWorld extends GuiScreen {
public GuiRenameWorld(GuiScreen guiscreen, String s) { public GuiRenameWorld(GuiScreen guiscreen, String s) {
@ -21,7 +22,7 @@ public class GuiRenameWorld extends GuiScreen {
public void initGui() { public void initGui() {
StringTranslate stringtranslate = StringTranslate.getInstance(); StringTranslate stringtranslate = StringTranslate.getInstance();
Keyboard.enableRepeatEvents(true); EaglerAdapter.enableRepeatEvents(true);
controlList.clear(); controlList.clear();
controlList.add(new GuiButton(0, width / 2 - 100, height / 4 + 96 + 12, controlList.add(new GuiButton(0, width / 2 - 100, height / 4 + 96 + 12,
stringtranslate.translateKey("selectWorld.renameButton"))); stringtranslate.translateKey("selectWorld.renameButton")));
@ -36,7 +37,7 @@ public class GuiRenameWorld extends GuiScreen {
} }
public void onGuiClosed() { public void onGuiClosed() {
Keyboard.enableRepeatEvents(false); EaglerAdapter.enableRepeatEvents(false);
} }
protected void actionPerformed(GuiButton guibutton) { protected void actionPerformed(GuiButton guibutton) {

View File

@ -4,46 +4,36 @@ package net.minecraft.src;
// Jad home page: http://www.kpdus.com/jad.html // Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode // Decompiler options: packimports(3) braces deadcode
import java.awt.Component;
import java.nio.IntBuffer; import java.nio.IntBuffer;
import org.lwjgl.LWJGLException;
import org.lwjgl.input.Cursor; import net.lax1dude.eaglercraft.EaglerAdapter;
import org.lwjgl.input.Mouse;
public class MouseHelper { public class MouseHelper {
public MouseHelper(Component component) { public MouseHelper() {
field_1115_e = 10; field_1115_e = 10;
field_1117_c = component;
IntBuffer intbuffer = GLAllocation.createDirectIntBuffer(1); IntBuffer intbuffer = GLAllocation.createDirectIntBuffer(1);
intbuffer.put(0); intbuffer.put(0);
intbuffer.flip(); intbuffer.flip();
IntBuffer intbuffer1 = GLAllocation.createDirectIntBuffer(1024); IntBuffer intbuffer1 = GLAllocation.createDirectIntBuffer(1024);
try {
field_1116_d = new Cursor(32, 32, 16, 16, 1, intbuffer1, intbuffer);
} catch (LWJGLException lwjglexception) {
lwjglexception.printStackTrace();
}
} }
public void func_774_a() { public void func_774_a() {
Mouse.setGrabbed(true); EaglerAdapter.mouseSetGrabbed(true);
deltaX = 0; deltaX = 0;
deltaY = 0; deltaY = 0;
} }
public void func_773_b() { public void func_773_b() {
Mouse.setCursorPosition(field_1117_c.getWidth() / 2, field_1117_c.getHeight() / 2); EaglerAdapter.mouseSetCursorPosition(EaglerAdapter.getCanvasWidth() / 2, EaglerAdapter.getCanvasHeight() / 2);
Mouse.setGrabbed(false); EaglerAdapter.mouseSetGrabbed(false);
} }
public void mouseXYChange() { public void mouseXYChange() {
deltaX = Mouse.getDX(); deltaX = EaglerAdapter.mouseGetDX();
deltaY = Mouse.getDY(); deltaY = EaglerAdapter.mouseGetDY();
} }
private Component field_1117_c;
private Cursor field_1116_d;
public int deltaX; public int deltaX;
public int deltaY; public int deltaY;
private int field_1115_e; private int field_1115_e;

View File

@ -497,11 +497,11 @@ public class RenderGlobal implements IWorldAccess {
double d1 = entityliving.lastTickPosX + (entityliving.posX - entityliving.lastTickPosX) * d; double d1 = entityliving.lastTickPosX + (entityliving.posX - entityliving.lastTickPosX) * d;
double d2 = entityliving.lastTickPosY + (entityliving.posY - entityliving.lastTickPosY) * d; double d2 = entityliving.lastTickPosY + (entityliving.posY - entityliving.lastTickPosY) * d;
double d3 = entityliving.lastTickPosZ + (entityliving.posZ - entityliving.lastTickPosZ) * d; double d3 = entityliving.lastTickPosZ + (entityliving.posZ - entityliving.lastTickPosZ) * d;
/*
int k1 = 0; int k1 = 0;
for (int l1 = 0; l1 < field_1414_S.length; l1++) { for (int l1 = 0; l1 < field_1414_S.length; l1++) {
field_1414_S[l1].func_859_b(); field_1414_S[l1].func_859_b();
} }
for (int i2 = 0; i2 < field_1415_R.size(); i2++) { for (int i2 = 0; i2 < field_1415_R.size(); i2++) {
WorldRenderer worldrenderer = (WorldRenderer) field_1415_R.get(i2); WorldRenderer worldrenderer = (WorldRenderer) field_1415_R.get(i2);
int j2 = -1; int j2 = -1;
@ -521,6 +521,16 @@ public class RenderGlobal implements IWorldAccess {
} }
func_944_a(k, d); func_944_a(k, d);
*/
for (int i2 = 0; i2 < field_1415_R.size(); i2++) {
WorldRenderer worldrenderer = (WorldRenderer) field_1415_R.get(i2);
EaglerAdapter.glPushMatrix();
EaglerAdapter.glTranslatef((float)(worldrenderer.field_1755_i - d1), (float)(worldrenderer.field_1754_j - d2), (float)(worldrenderer.field_1753_k - d3));
EaglerAdapter.glCallList(worldrenderer.getGLCallListForPass(k));
EaglerAdapter.glPopMatrix();
}
return l; return l;
} }
@ -891,7 +901,7 @@ public class RenderGlobal implements IWorldAccess {
aworldrenderer[k2] = worldrenderer1; aworldrenderer[k2] = worldrenderer1;
continue; continue;
} }
} else if (!worldrenderer1.isInFrustum) { }else if (!worldrenderer1.isInFrustum) {
continue; continue;
} }
if (arraylist == null) { if (arraylist == null) {

View File

@ -40,9 +40,9 @@ public class WorldRenderer {
field_1746_q = i + sizeWidth / 2; field_1746_q = i + sizeWidth / 2;
field_1743_r = j + sizeHeight / 2; field_1743_r = j + sizeHeight / 2;
field_1741_s = k + sizeDepth / 2; field_1741_s = k + sizeDepth / 2;
field_1752_l = i & 0x3ff; field_1752_l = i;// & 0x3ff;
field_1751_m = j; field_1751_m = j;
field_1750_n = k & 0x3ff; field_1750_n = k;// & 0x3ff;
field_1755_i = i - field_1752_l; field_1755_i = i - field_1752_l;
field_1754_j = j - field_1751_m; field_1754_j = j - field_1751_m;
field_1753_k = k - field_1750_n; field_1753_k = k - field_1750_n;
@ -103,16 +103,19 @@ public class WorldRenderer {
if (!flag2) { if (!flag2) {
flag2 = true; flag2 = true;
EaglerAdapter.glNewList(glRenderList + i2, 4864 /* GL_COMPILE */); EaglerAdapter.glNewList(glRenderList + i2, 4864 /* GL_COMPILE */);
EaglerAdapter.glPushMatrix(); //EaglerAdapter.glPushMatrix();
setupGLTranslation(); //tessellator.setTranslationF(field_1752_l, field_1751_m, field_1750_n);
//setupGLTranslation();
/*
float f = 1.000001F; float f = 1.000001F;
EaglerAdapter.glTranslatef((float) (-sizeDepth) / 2.0F, (float) (-sizeHeight) / 2.0F, EaglerAdapter.glTranslatef((float) (-sizeDepth) / 2.0F, (float) (-sizeHeight) / 2.0F,
(float) (-sizeDepth) / 2.0F); (float) (-sizeDepth) / 2.0F);
EaglerAdapter.glScalef(f, f, f); EaglerAdapter.glScalef(f, f, f);
EaglerAdapter.glTranslatef((float) sizeDepth / 2.0F, (float) sizeHeight / 2.0F, EaglerAdapter.glTranslatef((float) sizeDepth / 2.0F, (float) sizeHeight / 2.0F,
(float) sizeDepth / 2.0F); (float) sizeDepth / 2.0F);
*/
tessellator.startDrawingQuads(); tessellator.startDrawingQuads();
tessellator.setTranslationD(-posX, -posY, -posZ); //tessellator.setTranslationD(-posX, -posY, -posZ);
} }
if (i2 == 0 && Block.isBlockContainer[i3]) { if (i2 == 0 && Block.isBlockContainer[i3]) {
TileEntity tileentity = chunkcache.getBlockTileEntity(l2, j2, k2); TileEntity tileentity = chunkcache.getBlockTileEntity(l2, j2, k2);
@ -137,7 +140,7 @@ public class WorldRenderer {
if (flag2) { if (flag2) {
tessellator.draw(); tessellator.draw();
EaglerAdapter.glPopMatrix(); //EaglerAdapter.glPopMatrix();
EaglerAdapter.glEndList(); EaglerAdapter.glEndList();
tessellator.setTranslationD(0.0D, 0.0D, 0.0D); tessellator.setTranslationD(0.0D, 0.0D, 0.0D);
} else { } else {