mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-18 03:36:47 -04:00
Pushing all attribs in font renderer, let's see if this helps...
Also no tessellator in another display list.
This commit is contained in:
parent
5e365572eb
commit
84a6aa18d7
@ -64,7 +64,7 @@ object MonospaceFontRenderer {
|
|||||||
else
|
else
|
||||||
textureManager.bindTexture(Textures.fontAliased)
|
textureManager.bindTexture(Textures.fontAliased)
|
||||||
GL11.glPushMatrix()
|
GL11.glPushMatrix()
|
||||||
GL11.glPushAttrib(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT | GL11.GL_TEXTURE_BIT)
|
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS)
|
||||||
|
|
||||||
GL11.glTranslatef(x, y, 0)
|
GL11.glTranslatef(x, y, 0)
|
||||||
GL11.glScalef(0.5f, 0.5f, 1)
|
GL11.glScalef(0.5f, 0.5f, 1)
|
||||||
@ -110,15 +110,14 @@ object MonospaceFontRenderer {
|
|||||||
case i => i
|
case i => i
|
||||||
})
|
})
|
||||||
if (col != cfg) {
|
if (col != cfg) {
|
||||||
// Color changed, force flush and adjust colors.
|
// Color changed.
|
||||||
cfg = col
|
cfg = col
|
||||||
GL11.glColor3ub(
|
GL11.glColor3ub(
|
||||||
((cfg & 0xFF0000) >> 16).toByte,
|
((cfg & 0xFF0000) >> 16).toByte,
|
||||||
((cfg & 0x00FF00) >> 8).toByte,
|
((cfg & 0x00FF00) >> 8).toByte,
|
||||||
((cfg & 0x0000FF) >> 0).toByte)
|
((cfg & 0x0000FF) >> 0).toByte)
|
||||||
}
|
}
|
||||||
{
|
if (ch != ' ') {
|
||||||
if (index != ' ') {
|
|
||||||
// Don't render whitespace.
|
// Don't render whitespace.
|
||||||
val x = (index - 1) % cols
|
val x = (index - 1) % cols
|
||||||
val y = (index - 1) / cols
|
val y = (index - 1) / cols
|
||||||
@ -135,7 +134,6 @@ object MonospaceFontRenderer {
|
|||||||
}
|
}
|
||||||
posX += charWidth
|
posX += charWidth
|
||||||
}
|
}
|
||||||
}
|
|
||||||
GL11.glEnd()
|
GL11.glEnd()
|
||||||
|
|
||||||
RenderState.checkError(getClass.getName + ".drawString: foreground")
|
RenderState.checkError(getClass.getName + ".drawString: foreground")
|
||||||
|
@ -27,6 +27,8 @@ object BufferRenderer {
|
|||||||
|
|
||||||
def compileBackground(bufferWidth: Int, bufferHeight: Int) =
|
def compileBackground(bufferWidth: Int, bufferHeight: Int) =
|
||||||
if (textureManager.isDefined) {
|
if (textureManager.isDefined) {
|
||||||
|
RenderState.checkError(getClass.getName + ".compileBackground: entering (aka: wasntme)")
|
||||||
|
|
||||||
val innerWidth = innerMargin * 2 + bufferWidth
|
val innerWidth = innerMargin * 2 + bufferWidth
|
||||||
val innerHeight = innerMargin * 2 + bufferHeight
|
val innerHeight = innerMargin * 2 + bufferHeight
|
||||||
|
|
||||||
@ -34,6 +36,8 @@ object BufferRenderer {
|
|||||||
|
|
||||||
textureManager.get.bindTexture(Textures.guiBorders)
|
textureManager.get.bindTexture(Textures.guiBorders)
|
||||||
|
|
||||||
|
GL11.glBegin(GL11.GL_QUADS)
|
||||||
|
|
||||||
// Top border (left corner, middle bar, right corner).
|
// Top border (left corner, middle bar, right corner).
|
||||||
drawBorder(
|
drawBorder(
|
||||||
0, 0, margin, margin,
|
0, 0, margin, margin,
|
||||||
@ -67,7 +71,11 @@ object BufferRenderer {
|
|||||||
margin + innerWidth, margin + innerHeight, margin, margin,
|
margin + innerWidth, margin + innerHeight, margin, margin,
|
||||||
8, 8, 15, 15)
|
8, 8, 15, 15)
|
||||||
|
|
||||||
|
GL11.glEnd()
|
||||||
|
|
||||||
GL11.glEndList()
|
GL11.glEndList()
|
||||||
|
|
||||||
|
RenderState.checkError(getClass.getName + ".compileBackground: leaving")
|
||||||
}
|
}
|
||||||
|
|
||||||
def drawBackground() =
|
def drawBackground() =
|
||||||
@ -90,12 +98,13 @@ object BufferRenderer {
|
|||||||
val u2d = u2 / 16.0
|
val u2d = u2 / 16.0
|
||||||
val v1d = v1 / 16.0
|
val v1d = v1 / 16.0
|
||||||
val v2d = v2 / 16.0
|
val v2d = v2 / 16.0
|
||||||
val t = Tessellator.instance
|
GL11.glTexCoord2d(u1d, v2d)
|
||||||
t.startDrawingQuads()
|
GL11.glVertex3d(x, y + h, 0)
|
||||||
t.addVertexWithUV(x, y + h, 0, u1d, v2d)
|
GL11.glTexCoord2d(u2d, v2d)
|
||||||
t.addVertexWithUV(x + w, y + h, 0, u2d, v2d)
|
GL11.glVertex3d(x + w, y + h, 0)
|
||||||
t.addVertexWithUV(x + w, y, 0, u2d, v1d)
|
GL11.glTexCoord2d(u2d, v1d)
|
||||||
t.addVertexWithUV(x, y, 0, u1d, v1d)
|
GL11.glVertex3d(x + w, y, 0)
|
||||||
t.draw()
|
GL11.glTexCoord2d(u1d, v1d)
|
||||||
|
GL11.glVertex3d(x, y, 0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user