Fix splash screen and font colors

This commit is contained in:
PeytonPlayz595 2024-06-13 00:59:31 -04:00
parent d58b256edb
commit 43fda0a957
3 changed files with 45 additions and 10 deletions

View File

@ -216,7 +216,7 @@ public class Minecraft implements Runnable {
GL11.glDisable(GL11.GL_FOG);
GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.renderEngine.getTexture("/title/mojang.png"));
var2.startDrawingQuads();
var2.setColorOpaque_I(16777215);
var2.setColorRGBA_F(255, 255, 255, 255);
var2.addVertexWithUV(0.0D, (double)this.displayHeight, 0.0D, 0.0D, 0.0D);
var2.addVertexWithUV((double)this.displayWidth, (double)this.displayHeight, 0.0D, 0.0D, 0.0D);
var2.addVertexWithUV((double)this.displayWidth, 0.0D, 0.0D, 0.0D, 0.0D);
@ -224,8 +224,7 @@ public class Minecraft implements Runnable {
var2.draw();
short var3 = 256;
short var4 = 256;
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
var2.setColorOpaque_I(16777215);
var2.setColorRGBA_F(255, 255, 255, 255);
this.func_6274_a((var1.getScaledWidth() - var3) / 2, (var1.getScaledHeight() - var4) / 2, 0, 0, var3, var4);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_FOG);

View File

@ -0,0 +1,12 @@
package net.minecraft.src;
public class Color3f {
public float r, g, b;
public Color3f(float r, float g, float b) {
this.r = r;
this.g = g;
this.b = b;
}
}

View File

@ -1,6 +1,9 @@
package net.minecraft.src;
import java.nio.IntBuffer;
import java.util.HashMap;
import java.util.Map;
import org.lwjgl.opengl.GL11;
import net.lax1dude.eaglercraft.BufferedImage;
@ -12,6 +15,8 @@ public class FontRenderer {
private int fontDisplayLists;
private IntBuffer buffer = GLAllocation.createDirectIntBuffer(1024);
private Map<Integer, Color3f> colorList = new HashMap<Integer, Color3f>();
public FontRenderer(GameSettings var1, String var2, RenderEngine var3) {
BufferedImage var4;
try {
@ -105,9 +110,7 @@ public class FontRenderer {
var22 /= 4;
}
GL11.glNewList(this.fontDisplayLists + 256 + var9, GL11.GL_COMPILE);
GL11.glColor3f((float)var11 / 255.0F, (float)var12 / 255.0F, (float)var22 / 255.0F);
GL11.glEndList();
colorList.put(this.fontDisplayLists + 256 + var9, new Color3f((float)var11 / 255.0F, (float)var12 / 255.0F, (float)var22 / 255.0F));
}
}
@ -155,7 +158,14 @@ public class FontRenderer {
this.buffer.put(this.fontDisplayLists + 256 + var11 + (var5 ? 16 : 0));
if(this.buffer.remaining() == 0) {
this.buffer.flip();
GL11.glCallLists(this.buffer);
while (buffer.hasRemaining()) {
int i = buffer.get();
if(colorList.containsKey(i)) {
Color3f color = colorList.get(i);
GL11.glColor3f(color.r, color.g, color.b);
}
GL11.glCallList(i);
}
this.buffer.clear();
}
}
@ -169,13 +179,27 @@ public class FontRenderer {
if(this.buffer.remaining() == 0) {
this.buffer.flip();
GL11.glCallLists(this.buffer);
while (buffer.hasRemaining()) {
int i = buffer.get();
if(colorList.containsKey(i)) {
Color3f color = colorList.get(i);
GL11.glColor3f(color.r, color.g, color.b);
}
GL11.glCallList(i);
}
this.buffer.clear();
}
}
this.buffer.flip();
GL11.glCallLists(this.buffer);
while (buffer.hasRemaining()) {
int i = buffer.get();
if(colorList.containsKey(i)) {
Color3f color = colorList.get(i);
GL11.glColor3f(color.r, color.g, color.b);
}
GL11.glCallList(i);
}
GL11.glPopMatrix();
}
}