rotate tiles on center

This commit is contained in:
Josh Holtrop 2012-12-01 09:40:46 -05:00
parent 03c1d29ea0
commit 76423f3729

View File

@ -119,10 +119,10 @@ public class MyRenderer implements GLSurfaceView.Renderer
public void onSurfaceCreated(GL10 unused, EGLConfig config) public void onSurfaceCreated(GL10 unused, EGLConfig config)
{ {
final float attribs[] = { final float attribs[] = {
1, 1, 0.8f, 0.8f, 1, 0.5f, 0.5f, 0.8f, 0.8f, 1,
0, 1, 0, 0, 1, -0.5f, 0.5f, 0, 0, 1,
0, 0, 0.8f, 0.8f, 1, -0.5f, -0.5f, 0.8f, 0.8f, 1,
1, 0, 0, 0, 1 0.5f, -0.5f, 0, 0, 1
}; };
checkGLError("onSurfaceCreated"); checkGLError("onSurfaceCreated");
ByteBuffer bb = ByteBuffer.allocateDirect(attribs.length * 4); ByteBuffer bb = ByteBuffer.allocateDirect(attribs.length * 4);
@ -221,7 +221,8 @@ public class MyRenderer implements GLSurfaceView.Renderer
Tile t = m_tiles[x][y]; Tile t = m_tiles[x][y];
Matrix.setIdentityM(m_modelview, 0); Matrix.setIdentityM(m_modelview, 0);
Matrix.translateM(m_modelview, 0, Matrix.translateM(m_modelview, 0,
x - GRID_WIDTH / 2.0f, y - GRID_HEIGHT / 2.0f, x + 0.5f - GRID_WIDTH / 2.0f,
y + 0.5f - GRID_HEIGHT / 2.0f,
-DISTANCE); -DISTANCE);
if (t.flipping) if (t.flipping)
{ {