FPS go brrr

This commit is contained in:
PeytonPlayz595 2023-07-19 18:17:30 -04:00
parent 7b66ffceac
commit 58cdf0ccf7
5 changed files with 1005 additions and 1005 deletions

1982
js/app.js

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -146,7 +146,7 @@ public final class HUDScreen extends Screen {
}
}
var5.drawString("Minecraft Classic (Modified) Webport", 2, 2, 16777215);
var5.drawString("0.30 WebGL", 2, 2, 16777215);
if(this.mc.settings.showFrameRate) {
var5.drawString(this.mc.debug, 2, 12, 16777215);
}

View File

@ -17,7 +17,7 @@ public final class LevelRenderer {
public Level level;
public int listId;
public IntBuffer buffer = GLAllocation.createDirectIntBuffer(65536);
public IntBuffer buffer = GLAllocation.createDirectIntBuffer(4096);
public List<Chunk> chunks = new ArrayList<Chunk>();
private Chunk[] loadQueue;
public Chunk[] chunkCache;
@ -26,7 +26,7 @@ public final class LevelRenderer {
private int zChunks;
private int baseListId;
public Minecraft minecraft;
private int[] chunkDataCache = new int[4096];
private int[] chunkDataCache = new int[1024];
public int ticks = 0;
private float lastLoadX = -9999.0F;
private float lastLoadY = -9999.0F;
@ -37,7 +37,7 @@ public final class LevelRenderer {
public LevelRenderer(Minecraft var1) {
this.minecraft = var1;
this.listId = GL11.glGenLists(2);
this.baseListId = GL11.glGenLists(4096 << 6 << 1);
this.baseListId = GL11.glGenLists(4096);
}
public final void refresh() {

View File

@ -111,9 +111,9 @@ public class Tessellator {
GL11.glEnableVertexAttrib(GL11.GL_COLOR_ARRAY);
}
if (this.hasNormals) {
GL11.glEnableVertexAttrib(GL11.GL_NORMAL_ARRAY);
}
// if (this.hasNormals) {
// GL11.glEnableVertexAttrib(GL11.GL_NORMAL_ARRAY);
// }
GL11.glDrawArrays(7, 0, this.vertexCount, Int32Array.create(intBuffer.getBuffer(), 0, this.vertexCount * 7));
@ -125,9 +125,9 @@ public class Tessellator {
GL11.glDisableVertexAttrib(GL11.GL_COLOR_ARRAY);
}
if (this.hasNormals) {
GL11.glDisableVertexAttrib(GL11.GL_NORMAL_ARRAY);
}
// if (this.hasNormals) {
// GL11.glDisableVertexAttrib(GL11.GL_NORMAL_ARRAY);
// }
}
int var1 = this.rawBufferIndex * 4;
@ -319,9 +319,9 @@ public class Tessellator {
public void setNormal(float par1, float par2, float par3) {
this.hasNormals = true;
float len = (float) Math.sqrt(par1 * par1 + par2 * par2 + par3 * par3);
int var4 = (int)((par1 / len) * 127.0F) + 127;
int var5 = (int)((par2 / len) * 127.0F) + 127;
int var6 = (int)((par3 / len) * 127.0F) + 127;
int var4 = (int)((par1 / len) * 125.0F) + 125;
int var5 = (int)((par2 / len) * 125.0F) + 125;
int var6 = (int)((par3 / len) * 125.0F) + 125;
this.normal = var4 & 255 | (var5 & 255) << 8 | (var6 & 255) << 16;
}