Merge pull request #819 from dumganhar/gles20

issue #1056: Fixed a bug in CCDirector::setProjection.
We should invoking kmGLMultMatrix(&orthoMatrix) after invoking kmMat4OrthographicProjection.
This commit is contained in:
James Chen 2012-03-28 02:05:53 -07:00
commit f80b779941
3 changed files with 5 additions and 4 deletions

View File

@ -339,6 +339,7 @@ void CCDirector::setProjection(ccDirectorProjection kProjection)
kmGLLoadIdentity();
kmMat4 orthoMatrix;
kmMat4OrthographicProjection(&orthoMatrix, 0, size.width, 0, size.height, -1024, 1024 );
kmGLMultMatrix(&orthoMatrix);
kmGLMatrixMode(KM_GL_MODELVIEW);
kmGLLoadIdentity();
}

View File

@ -87,9 +87,9 @@ int gaussj(kmMat4 *a, kmMat4 *b)
{
int i, icol = 0, irow = 0, j, k, l, ll, n = 4, m = 4;
float big, dum, pivinv;
int indxc[4];
int indxr[4];
int ipiv[4];
int indxc[4] = {0};
int indxr[4] = {0};
int ipiv[4] = {0};
for (j = 0; j < n; j++) {
ipiv[j] = 0;

View File

@ -180,7 +180,7 @@ void CCTMXLayer::setupTiles()
// XXX: gid == 0 --> empty tile
if( gid != 0 )
{
this->appendTileForGID(gid, ccp((float)x, (float)y));
this->appendTileForGID(gid, ccp(x, y));
// Optimization: update min and max GID rendered by the layer
m_uMinGID = MIN(gid, m_uMinGID);