Fixed drawTextureScaled and made the code more readable

This commit is contained in:
bdew committed 2014-02-24 20:52:00 +02:00
1 parent 7b588d896d
commit 82e88157f2
2 files changed
+8 -4

No files matched your search

+4
View File
@@ -15,4 +15,8 @@ case class Rect(x: Int, y: Int, w: Int, h: Int) {
def origin = new Point(x, y)
def +(p: Point) = new Rect(origin + p, w, h)
def -(p: Point) = new Rect(origin - p, w, h)
def x1 = x
def x2 = x + w
def y1 = y
def y2 = y + w
}
+4 -4
View File
@@ -98,10 +98,10 @@ class WidgetContainerWindow(val parent: BaseScreen, xSz: Int, ySz: Int) extends
Minecraft.getMinecraft.renderEngine.bindTexture(l.resource)
color.activate()
Tessellator.instance.startDrawingQuads()
addVertexUVScaled(r.x, r.y + r.w, z, t.x, t.y + t.w)
addVertexUVScaled(r.x + r.h, r.y + r.w, z, t.x + t.h, t.y + t.w)
addVertexUVScaled(r.x + r.h, r.y, z, t.x + t.h, t.y)
addVertexUVScaled(r.x, r.y, z, t.x, t.y)
addVertexUVScaled(r.x1, r.y2, z, t.x1, t.y2)
addVertexUVScaled(r.x2, r.y2, z, t.x2, t.y2)
addVertexUVScaled(r.x2, r.y1, z, t.x2, t.y1)
addVertexUVScaled(r.x1, r.y1, z, t.x1, t.y1)
Tessellator.instance.draw()
}