Remove unnecessary matrix stack manipulations.

glDrawTexiOES does not use the matix stack, so no need to modify it.
This commit is contained in:
Jack Palevich
2009-12-22 18:32:05 +08:00
parent 55de681445
commit 8e50990893

View File

@@ -351,17 +351,12 @@ public class LabelMaker {
*/ */
public void draw(GL10 gl, float x, float y, int labelID) { public void draw(GL10 gl, float x, float y, int labelID) {
checkState(STATE_DRAWING, STATE_DRAWING); checkState(STATE_DRAWING, STATE_DRAWING);
gl.glPushMatrix();
float snappedX = (float) Math.floor(x);
float snappedY = (float) Math.floor(y);
gl.glTranslatef(snappedX, snappedY, 0.0f);
Label label = mLabels.get(labelID); Label label = mLabels.get(labelID);
gl.glEnable(GL10.GL_TEXTURE_2D); gl.glEnable(GL10.GL_TEXTURE_2D);
((GL11)gl).glTexParameteriv(GL10.GL_TEXTURE_2D, ((GL11)gl).glTexParameteriv(GL10.GL_TEXTURE_2D,
GL11Ext.GL_TEXTURE_CROP_RECT_OES, label.mCrop, 0); GL11Ext.GL_TEXTURE_CROP_RECT_OES, label.mCrop, 0);
((GL11Ext)gl).glDrawTexiOES((int) snappedX, (int) snappedY, 0, ((GL11Ext)gl).glDrawTexiOES((int) x, (int) y, 0,
(int) label.width, (int) label.height); (int) label.width, (int) label.height);
gl.glPopMatrix();
} }
/** /**