GuiOverlayDebug, ItemModelMesher, RenderManager, Stitcher fixed + minor fixes in forge gui classes.

This commit is contained in:
RainWarrior committed 2016-03-02 15:32:22 +03:00
1 parent 3fd09af1d3
commit 24b66ff9f3
8 files changed
+61 -63

No files matched your search

@@ -40,8 +40,8 @@ import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.client.resources.I18n;
import net.minecraft.client.resources.IResourcePack;
import net.minecraft.util.TextComponentString;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StringUtils;
import net.minecraftforge.common.ForgeHooks;
@@ -53,7 +53,7 @@ import net.minecraftforge.fml.common.Loader;
import net.minecraftforge.fml.common.ModContainer;
import net.minecraftforge.fml.common.ModContainer.Disableable;
import net.minecraftforge.fml.common.versioning.ComparableVersion;
import static net.minecraft.util.EnumChatFormatting.*;
import static net.minecraft.util.text.TextFormatting.*;
import org.apache.logging.log4j.Level;
@@ -524,13 +524,13 @@ public class GuiModList extends GuiScreen
{
GlStateManager.enableBlend();
GuiModList.this.mc.renderEngine.bindTexture(logoPath);
VertexBuffer wr = tess.getVertexBuffer();
VertexBuffer wr = tess.getWorldRenderer();
int offset = (this.left + this.listWidth/2) - (logoDims.width / 2);
wr.begin(7, DefaultVertexFormats.POSITION_TEX);
wr.pos(offset, top + logoDims.height, zLevel).tex(0, 1).endVertex();
wr.pos(offset + logoDims.width, top + logoDims.height, zLevel).tex(1, 1).endVertex();
wr.pos(offset + logoDims.width, top, zLevel).tex(1, 0).endVertex();
wr.pos(offset, top, zLevel).tex(0, 0).endVertex();
wr.pos(offset, top + logoDims.height, zLevel).func_187315_a(0, 1).endVertex();
wr.pos(offset + logoDims.width, top + logoDims.height, zLevel).func_187315_a(1, 1).endVertex();
wr.pos(offset + logoDims.width, top, zLevel).func_187315_a(1, 0).endVertex();
wr.pos(offset, top, zLevel).func_187315_a(0, 0).endVertex();
tess.draw();
GlStateManager.disableBlend();
top += logoDims.height + 10;
@@ -570,7 +570,7 @@ public class GuiModList extends GuiScreen
for (ITextComponent part : (Iterable<ITextComponent>)line) {
if (!(part instanceof TextComponentString))
continue;
k += GuiModList.this.fontRendererObj.getStringWidth(((TextComponentString)part).getTextComponentString_TextValue());
k += GuiModList.this.fontRendererObj.getStringWidth(((TextComponentString)part).getChatComponentText_TextValue());
if (k >= x)
{
GuiModList.this.handleComponentClick(part);
@@ -263,7 +263,7 @@ public abstract class GuiScrollingList
this.applyScrollLimits();
Tessellator tess = Tessellator.getInstance();
VertexBuffer worldr = tess.getVertexBuffer();
VertexBuffer worldr = tess.getWorldRenderer();
ScaledResolution res = new ScaledResolution(client);
double scaleW = client.displayWidth / res.getScaledWidth_double();
@@ -284,10 +284,10 @@ public abstract class GuiScrollingList
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
float scale = 32.0F;
worldr.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
worldr.pos(this.left, this.bottom, 0.0D).tex(this.left / scale, (this.bottom + (int)this.scrollDistance) / scale).color(0x20, 0x20, 0x20, 0xFF).endVertex();
worldr.pos(this.right, this.bottom, 0.0D).tex(this.right / scale, (this.bottom + (int)this.scrollDistance) / scale).color(0x20, 0x20, 0x20, 0xFF).endVertex();
worldr.pos(this.right, this.top, 0.0D).tex(this.right / scale, (this.top + (int)this.scrollDistance) / scale).color(0x20, 0x20, 0x20, 0xFF).endVertex();
worldr.pos(this.left, this.top, 0.0D).tex(this.left / scale, (this.top + (int)this.scrollDistance) / scale).color(0x20, 0x20, 0x20, 0xFF).endVertex();
worldr.pos(this.left, this.bottom, 0.0D).func_187315_a(this.left / scale, (this.bottom + (int)this.scrollDistance) / scale).color(0x20, 0x20, 0x20, 0xFF).endVertex();
worldr.pos(this.right, this.bottom, 0.0D).func_187315_a(this.right / scale, (this.bottom + (int)this.scrollDistance) / scale).color(0x20, 0x20, 0x20, 0xFF).endVertex();
worldr.pos(this.right, this.top, 0.0D).func_187315_a(this.right / scale, (this.top + (int)this.scrollDistance) / scale).color(0x20, 0x20, 0x20, 0xFF).endVertex();
worldr.pos(this.left, this.top, 0.0D).func_187315_a(this.left / scale, (this.top + (int)this.scrollDistance) / scale).color(0x20, 0x20, 0x20, 0xFF).endVertex();
tess.draw();
}
@@ -311,14 +311,14 @@ public abstract class GuiScrollingList
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.disableTexture2D();
worldr.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
worldr.pos(min, slotTop + slotBuffer + 2, 0).tex(0, 1).color(0x80, 0x80, 0x80, 0xFF).endVertex();
worldr.pos(max, slotTop + slotBuffer + 2, 0).tex(1, 1).color(0x80, 0x80, 0x80, 0xFF).endVertex();
worldr.pos(max, slotTop - 2, 0).tex(1, 0).color(0x80, 0x80, 0x80, 0xFF).endVertex();
worldr.pos(min, slotTop - 2, 0).tex(0, 0).color(0x80, 0x80, 0x80, 0xFF).endVertex();
worldr.pos(min + 1, slotTop + slotBuffer + 1, 0).tex(0, 1).color(0x00, 0x00, 0x00, 0xFF).endVertex();
worldr.pos(max - 1, slotTop + slotBuffer + 1, 0).tex(1, 1).color(0x00, 0x00, 0x00, 0xFF).endVertex();
worldr.pos(max - 1, slotTop - 1, 0).tex(1, 0).color(0x00, 0x00, 0x00, 0xFF).endVertex();
worldr.pos(min + 1, slotTop - 1, 0).tex(0, 0).color(0x00, 0x00, 0x00, 0xFF).endVertex();
worldr.pos(min, slotTop + slotBuffer + 2, 0).func_187315_a(0, 1).color(0x80, 0x80, 0x80, 0xFF).endVertex();
worldr.pos(max, slotTop + slotBuffer + 2, 0).func_187315_a(1, 1).color(0x80, 0x80, 0x80, 0xFF).endVertex();
worldr.pos(max, slotTop - 2, 0).func_187315_a(1, 0).color(0x80, 0x80, 0x80, 0xFF).endVertex();
worldr.pos(min, slotTop - 2, 0).func_187315_a(0, 0).color(0x80, 0x80, 0x80, 0xFF).endVertex();
worldr.pos(min + 1, slotTop + slotBuffer + 1, 0).func_187315_a(0, 1).color(0x00, 0x00, 0x00, 0xFF).endVertex();
worldr.pos(max - 1, slotTop + slotBuffer + 1, 0).func_187315_a(1, 1).color(0x00, 0x00, 0x00, 0xFF).endVertex();
worldr.pos(max - 1, slotTop - 1, 0).func_187315_a(1, 0).color(0x00, 0x00, 0x00, 0xFF).endVertex();
worldr.pos(min + 1, slotTop - 1, 0).func_187315_a(0, 0).color(0x00, 0x00, 0x00, 0xFF).endVertex();
tess.draw();
GlStateManager.enableTexture2D();
}
@@ -347,22 +347,22 @@ public abstract class GuiScrollingList
GlStateManager.disableTexture2D();
worldr.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
worldr.pos(scrollBarLeft, this.bottom, 0.0D).tex(0.0D, 1.0D).color(0x00, 0x00, 0x00, 0xFF).endVertex();
worldr.pos(scrollBarRight, this.bottom, 0.0D).tex(1.0D, 1.0D).color(0x00, 0x00, 0x00, 0xFF).endVertex();
worldr.pos(scrollBarRight, this.top, 0.0D).tex(1.0D, 0.0D).color(0x00, 0x00, 0x00, 0xFF).endVertex();
worldr.pos(scrollBarLeft, this.top, 0.0D).tex(0.0D, 0.0D).color(0x00, 0x00, 0x00, 0xFF).endVertex();
worldr.pos(scrollBarLeft, this.bottom, 0.0D).func_187315_a(0.0D, 1.0D).color(0x00, 0x00, 0x00, 0xFF).endVertex();
worldr.pos(scrollBarRight, this.bottom, 0.0D).func_187315_a(1.0D, 1.0D).color(0x00, 0x00, 0x00, 0xFF).endVertex();
worldr.pos(scrollBarRight, this.top, 0.0D).func_187315_a(1.0D, 0.0D).color(0x00, 0x00, 0x00, 0xFF).endVertex();
worldr.pos(scrollBarLeft, this.top, 0.0D).func_187315_a(0.0D, 0.0D).color(0x00, 0x00, 0x00, 0xFF).endVertex();
tess.draw();
worldr.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
worldr.pos(scrollBarLeft, barTop + height, 0.0D).tex(0.0D, 1.0D).color(0x80, 0x80, 0x80, 0xFF).endVertex();
worldr.pos(scrollBarRight, barTop + height, 0.0D).tex(1.0D, 1.0D).color(0x80, 0x80, 0x80, 0xFF).endVertex();
worldr.pos(scrollBarRight, barTop, 0.0D).tex(1.0D, 0.0D).color(0x80, 0x80, 0x80, 0xFF).endVertex();
worldr.pos(scrollBarLeft, barTop, 0.0D).tex(0.0D, 0.0D).color(0x80, 0x80, 0x80, 0xFF).endVertex();
worldr.pos(scrollBarLeft, barTop + height, 0.0D).func_187315_a(0.0D, 1.0D).color(0x80, 0x80, 0x80, 0xFF).endVertex();
worldr.pos(scrollBarRight, barTop + height, 0.0D).func_187315_a(1.0D, 1.0D).color(0x80, 0x80, 0x80, 0xFF).endVertex();
worldr.pos(scrollBarRight, barTop, 0.0D).func_187315_a(1.0D, 0.0D).color(0x80, 0x80, 0x80, 0xFF).endVertex();
worldr.pos(scrollBarLeft, barTop, 0.0D).func_187315_a(0.0D, 0.0D).color(0x80, 0x80, 0x80, 0xFF).endVertex();
tess.draw();
worldr.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
worldr.pos(scrollBarLeft, barTop + height - 1, 0.0D).tex(0.0D, 1.0D).color(0xC0, 0xC0, 0xC0, 0xFF).endVertex();
worldr.pos(scrollBarRight - 1, barTop + height - 1, 0.0D).tex(1.0D, 1.0D).color(0xC0, 0xC0, 0xC0, 0xFF).endVertex();
worldr.pos(scrollBarRight - 1, barTop, 0.0D).tex(1.0D, 0.0D).color(0xC0, 0xC0, 0xC0, 0xFF).endVertex();
worldr.pos(scrollBarLeft, barTop, 0.0D).tex(0.0D, 0.0D).color(0xC0, 0xC0, 0xC0, 0xFF).endVertex();
worldr.pos(scrollBarLeft, barTop + height - 1, 0.0D).func_187315_a(0.0D, 1.0D).color(0xC0, 0xC0, 0xC0, 0xFF).endVertex();
worldr.pos(scrollBarRight - 1, barTop + height - 1, 0.0D).func_187315_a(1.0D, 1.0D).color(0xC0, 0xC0, 0xC0, 0xFF).endVertex();
worldr.pos(scrollBarRight - 1, barTop, 0.0D).func_187315_a(1.0D, 0.0D).color(0xC0, 0xC0, 0xC0, 0xFF).endVertex();
worldr.pos(scrollBarLeft, barTop, 0.0D).func_187315_a(0.0D, 0.0D).color(0xC0, 0xC0, 0xC0, 0xFF).endVertex();
tess.draw();
}
@@ -390,7 +390,7 @@ public abstract class GuiScrollingList
GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
GlStateManager.shadeModel(GL11.GL_SMOOTH);
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer VertexBuffer = tessellator.getVertexBuffer();
VertexBuffer VertexBuffer = tessellator.getWorldRenderer();
VertexBuffer.begin(7, DefaultVertexFormats.POSITION_COLOR);
VertexBuffer.pos(right, top, 0.0D).color(r1, g1, b1, a1).endVertex();
VertexBuffer.pos(left, top, 0.0D).color(r1, g1, b1, a1).endVertex();
@@ -23,7 +23,7 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.resources.I18n;
import net.minecraft.util.TextComponentString;
import net.minecraft.util.text.TextComponentString;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.client.config.GuiConfigEntries.IConfigEntry;
import net.minecraftforge.fml.client.event.ConfigChangedEvent;
@@ -184,12 +184,12 @@ public class GuiUtils
float uScale = 1f / 0x100;
float vScale = 1f / 0x100;
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer wr = tessellator.getVertexBuffer();
VertexBuffer wr = tessellator.getWorldRenderer();
wr.begin(7, DefaultVertexFormats.POSITION_TEX);
wr.pos(x , y + height, zLevel).tex( u * uScale, ((v + height) * vScale)).endVertex();
wr.pos(x + width, y + height, zLevel).tex((u + width) * uScale, ((v + height) * vScale)).endVertex();
wr.pos(x + width, y , zLevel).tex((u + width) * uScale, ( v * vScale)).endVertex();
wr.pos(x , y , zLevel).tex( u * uScale, ( v * vScale)).endVertex();
wr.pos(x , y + height, zLevel).func_187315_a( u * uScale, ((v + height) * vScale)).endVertex();
wr.pos(x + width, y + height, zLevel).func_187315_a((u + width) * uScale, ((v + height) * vScale)).endVertex();
wr.pos(x + width, y , zLevel).func_187315_a((u + width) * uScale, ( v * vScale)).endVertex();
wr.pos(x , y , zLevel).func_187315_a( u * uScale, ( v * vScale)).endVertex();
tessellator.draw();
}