mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-15 02:12:42 -04:00
Potential rendering improvements (mostly stuff discovered while porting to 1.8 that didn't seem to have an effect in 1.7, but can't hurt to clean up).
This commit is contained in:
parent
66763c3317
commit
43edfefa6e
@ -101,12 +101,12 @@ class Assembler(playerInventory: InventoryPlayer, val assembler: tileentity.Asse
|
|||||||
|
|
||||||
override def drawGuiContainerBackgroundLayer(dt: Float, mouseX: Int, mouseY: Int) {
|
override def drawGuiContainerBackgroundLayer(dt: Float, mouseX: Int, mouseY: Int) {
|
||||||
GL11.glColor3f(1, 1, 1) // Required under Linux.
|
GL11.glColor3f(1, 1, 1) // Required under Linux.
|
||||||
super.drawGuiContainerBackgroundLayer(dt, mouseX, mouseY)
|
|
||||||
mc.renderEngine.bindTexture(Textures.guiRobotAssembler)
|
mc.renderEngine.bindTexture(Textures.guiRobotAssembler)
|
||||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize)
|
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize)
|
||||||
if (assemblerContainer.isAssembling) progress.level = assemblerContainer.assemblyProgress / 100.0
|
if (assemblerContainer.isAssembling) progress.level = assemblerContainer.assemblyProgress / 100.0
|
||||||
else progress.level = 0
|
else progress.level = 0
|
||||||
drawWidgets()
|
drawWidgets()
|
||||||
|
drawInventorySlots()
|
||||||
}
|
}
|
||||||
|
|
||||||
override protected def drawDisabledSlot(slot: ComponentSlot) {}
|
override protected def drawDisabledSlot(slot: ComponentSlot) {}
|
||||||
|
@ -21,7 +21,6 @@ class Disassembler(playerInventory: InventoryPlayer, val disassembler: tileentit
|
|||||||
|
|
||||||
override def drawGuiContainerBackgroundLayer(dt: Float, mouseX: Int, mouseY: Int) {
|
override def drawGuiContainerBackgroundLayer(dt: Float, mouseX: Int, mouseY: Int) {
|
||||||
GL11.glColor3f(1, 1, 1) // Required under Linux.
|
GL11.glColor3f(1, 1, 1) // Required under Linux.
|
||||||
super.drawGuiContainerBackgroundLayer(dt, mouseX, mouseY)
|
|
||||||
mc.renderEngine.bindTexture(Textures.guiDisassembler)
|
mc.renderEngine.bindTexture(Textures.guiDisassembler)
|
||||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize)
|
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize)
|
||||||
progress.level = disassemblerContainer.disassemblyProgress / 100.0
|
progress.level = disassemblerContainer.disassemblyProgress / 100.0
|
||||||
|
@ -17,7 +17,6 @@ import net.minecraft.client.Minecraft
|
|||||||
import net.minecraft.client.gui.GuiButton
|
import net.minecraft.client.gui.GuiButton
|
||||||
import net.minecraft.client.renderer.Tessellator
|
import net.minecraft.client.renderer.Tessellator
|
||||||
import net.minecraft.entity.player.InventoryPlayer
|
import net.minecraft.entity.player.InventoryPlayer
|
||||||
import net.minecraft.inventory.Slot
|
|
||||||
import org.lwjgl.opengl.GL11
|
import org.lwjgl.opengl.GL11
|
||||||
|
|
||||||
class Drone(playerInventory: InventoryPlayer, val drone: entity.Drone) extends DynamicGuiContainer(new container.Drone(playerInventory, drone)) with traits.DisplayBuffer {
|
class Drone(playerInventory: InventoryPlayer, val drone: entity.Drone) extends DynamicGuiContainer(new container.Drone(playerInventory, drone)) with traits.DisplayBuffer {
|
||||||
@ -117,14 +116,7 @@ class Drone(playerInventory: InventoryPlayer, val drone: entity.Drone) extends D
|
|||||||
drawSelection()
|
drawSelection()
|
||||||
}
|
}
|
||||||
|
|
||||||
GL11.glPushMatrix()
|
drawInventorySlots()
|
||||||
GL11.glTranslatef(guiLeft, guiTop, 0)
|
|
||||||
for (slot <- 0 until inventorySlots.inventorySlots.size()) {
|
|
||||||
drawSlotInventory(inventorySlots.inventorySlots.get(slot).asInstanceOf[Slot])
|
|
||||||
}
|
|
||||||
GL11.glPopMatrix()
|
|
||||||
|
|
||||||
RenderState.makeItBlend()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override def drawGradientRect(par1: Int, par2: Int, par3: Int, par4: Int, par5: Int, par6: Int) {
|
protected override def drawGradientRect(par1: Int, par2: Int, par3: Int, par4: Int, par5: Int, par6: Int) {
|
||||||
|
@ -55,12 +55,17 @@ abstract class DynamicGuiContainer(container: Container) extends CustomGuiContai
|
|||||||
RenderState.makeItBlend()
|
RenderState.makeItBlend()
|
||||||
GL11.glDisable(GL11.GL_LIGHTING)
|
GL11.glDisable(GL11.GL_LIGHTING)
|
||||||
|
|
||||||
|
drawInventorySlots()
|
||||||
|
}
|
||||||
|
|
||||||
|
protected def drawInventorySlots(): Unit = {
|
||||||
GL11.glPushMatrix()
|
GL11.glPushMatrix()
|
||||||
GL11.glTranslatef(guiLeft, guiTop, 0)
|
GL11.glTranslatef(guiLeft, guiTop, 0)
|
||||||
for (slot <- 0 until inventorySlots.inventorySlots.size()) {
|
for (slot <- 0 until inventorySlots.inventorySlots.size()) {
|
||||||
drawSlotInventory(inventorySlots.inventorySlots.get(slot).asInstanceOf[Slot])
|
drawSlotInventory(inventorySlots.inventorySlots.get(slot).asInstanceOf[Slot])
|
||||||
}
|
}
|
||||||
GL11.glPopMatrix()
|
GL11.glPopMatrix()
|
||||||
|
RenderState.makeItBlend()
|
||||||
}
|
}
|
||||||
|
|
||||||
override def drawScreen(mouseX: Int, mouseY: Int, dt: Float) {
|
override def drawScreen(mouseX: Int, mouseY: Int, dt: Float) {
|
||||||
|
@ -21,7 +21,6 @@ class Raid(playerInventory: InventoryPlayer, val raid: tileentity.Raid) extends
|
|||||||
|
|
||||||
override def drawGuiContainerBackgroundLayer(dt: Float, mouseX: Int, mouseY: Int) {
|
override def drawGuiContainerBackgroundLayer(dt: Float, mouseX: Int, mouseY: Int) {
|
||||||
GL11.glColor3f(1, 1, 1) // Required under Linux.
|
GL11.glColor3f(1, 1, 1) // Required under Linux.
|
||||||
super.drawGuiContainerBackgroundLayer(dt, mouseX, mouseY)
|
|
||||||
mc.renderEngine.bindTexture(Textures.guiRaid)
|
mc.renderEngine.bindTexture(Textures.guiRaid)
|
||||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize)
|
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize)
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,6 @@ import net.minecraft.client.Minecraft
|
|||||||
import net.minecraft.client.gui.GuiButton
|
import net.minecraft.client.gui.GuiButton
|
||||||
import net.minecraft.client.renderer.Tessellator
|
import net.minecraft.client.renderer.Tessellator
|
||||||
import net.minecraft.entity.player.InventoryPlayer
|
import net.minecraft.entity.player.InventoryPlayer
|
||||||
import net.minecraft.inventory.Slot
|
|
||||||
import org.lwjgl.input.Keyboard
|
import org.lwjgl.input.Keyboard
|
||||||
import org.lwjgl.input.Mouse
|
import org.lwjgl.input.Mouse
|
||||||
import org.lwjgl.opengl.GL11
|
import org.lwjgl.opengl.GL11
|
||||||
@ -159,14 +158,7 @@ class Robot(playerInventory: InventoryPlayer, val robot: tileentity.Robot) exten
|
|||||||
drawSelection()
|
drawSelection()
|
||||||
}
|
}
|
||||||
|
|
||||||
GL11.glPushMatrix()
|
drawInventorySlots()
|
||||||
GL11.glTranslatef(guiLeft, guiTop, 0)
|
|
||||||
for (slot <- 0 until inventorySlots.inventorySlots.size()) {
|
|
||||||
drawSlotInventory(inventorySlots.inventorySlots.get(slot).asInstanceOf[Slot])
|
|
||||||
}
|
|
||||||
GL11.glPopMatrix()
|
|
||||||
|
|
||||||
RenderState.makeItBlend()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override def drawGradientRect(par1: Int, par2: Int, par3: Int, par4: Int, par5: Int, par6: Int) {
|
protected override def drawGradientRect(par1: Int, par2: Int, par3: Int, par4: Int, par5: Int, par6: Int) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user