_normals is defined above the DrawPolygonflat function as is:
and is only used on this function
static const bool _normals = false;
and is only used on this function
static const bool _normals = false;
std::vector<GLfloat> vtx;
std::vector<GLfloat> nrm;
glEnableClientState(GL_VERTEX_ARRAY);
if (_normals) {
glEnableClientState(GL_NORMAL_ARRAY);
}
while (verticesCount--)
{
vtx.push_back( vertices->x ); vtx.push_back( vertices->y ); vtx.push_back( vertices->z );
if (_normals) {
Vertex4f n;
n.x = vertices->nx; n.y = vertices->ny; n.z = vertices->nz;
n.normalize();
nrm.push_back( n.x ); nrm.push_back( n.y ); nrm.push_back( n.z );
}
++vertices;
}
glVertexPointer(3, GL_FLOAT, 0, &vtx.at(0));
if (_normals) {
glNormalPointer(GL_FLOAT, 0, &nrm.at(0));
}
glDrawArrays(GL_TRIANGLE_FAN,0,vtx.size()/3);
glDisableClientState(GL_VERTEX_ARRAY);
if (_normals) {
glDisableClientState(GL_NORMAL_ARRAY);
}
struct Vertex {
int x, y, z;
int nx, ny, nz;
};
std::vector<int16_t> vtx;glVertexPointer(3, GL_SHORT, 0, &vtx.at(0));
struct Vertex {
int16_t x, y, z;
int16_t nx, ny, nz;
};
glEnableClientState(GL_VERTEX_ARRAY);
//if (_normals) {
//glEnableClientState(GL_NORMAL_ARRAY);
//}
/*
while (verticesCount--)
{
vtx.push_back( vertices->x ); vtx.push_back( vertices->y ); vtx.push_back( vertices->z );
if (_normals) {
Vertex4f n;
n.x = vertices->nx; n.y = vertices->ny; n.z = vertices->nz;
n.normalize();
nrm.push_back( n.x ); nrm.push_back( n.y ); nrm.push_back( n.z );
}
++vertices;
}
*/
glVertexPointer(3, GL_SHORT, sizeof(int16_t)*6, vertices);
//if (_normals) {
//glNormalPointer(GL_SHORT, 0, &nrm.at(0));
//}
glDrawArrays(GL_TRIANGLE_FAN,0,verticesCount);
glDisableClientState(GL_VERTEX_ARRAY);
//if (_normals) {
//glDisableClientState(GL_NORMAL_ARRAY);
//}
int16_t vtx7[] = {
vertices[0].x, vertices[0].y, vertices[0].z,
vertices[1].x, vertices[1].y, vertices[1].z,
vertices[2].x, vertices[2].y, vertices[2].z,
vertices[3].x, vertices[3].y, vertices[3].z
};
...
glVertexPointer(3, GL_SHORT, 0, vtx7);
-mcpu=cortex-a8
-march=armv7-a
-mfpu=neon
-ftree-vectorize
-funsafe-math-optimizations
-mthumb
-ffast-math
Maybe try to deactivate them one by one and try to find the crashy option. The cpu and architecture identifiers should't be a problem.
std::vector<GLfloat> vtx;
std::vector<GLfloat> nrm;
glEnableClientState(GL_VERTEX_ARRAY);
if (_normals) {
glEnableClientState(GL_NORMAL_ARRAY);
}
while (verticesCount--)
{
vtx.push_back( vertices->x ); vtx.push_back( vertices->y ); vtx.push_back( vertices->z );
if (_normals) {
Vertex4f n;
n.x = vertices->nx; n.y = vertices->ny; n.z = vertices->nz;
n.normalize();
nrm.push_back( n.x ); nrm.push_back( n.y ); nrm.push_back( n.z );
}
++vertices;
}
glVertexPointer(3, GL_FLOAT, 0, &vtx.at(0));
if (_normals) {
glNormalPointer(GL_FLOAT, 0, &nrm.at(0));
}
glDrawArrays(GL_TRIANGLE_FAN,0,vtx.size()/3);
glDisableClientState(GL_VERTEX_ARRAY);
if (_normals) {
glDisableClientState(GL_NORMAL_ARRAY);
}
Yes i know it...but if using the normal version (with the Vertex as int16_t and changed all the arrays to int16_t and use GL_SHORT on vertex drawing) the game work..._normals is false, so i expect you arnt using them anyway.
//std::vector<int16_t> vtx;
std::vector<GLfloat> vtx;
glEnableClientState(GL_VERTEX_ARRAY);
//glVertexPointer(3, GL_SHORT, sizeof(int16_t)*6, vertices);
glVertexPointer(3, GL_FLOAT, sizeof(int16_t)*6, vertices);
glDrawArrays(GL_TRIANGLE_FAN,0,verticesCount);
glDisableClientState(GL_VERTEX_ARRAY);
kTickDuration is declared as : static const int kTickDuration = 30;#ifndef PANDORA
SDL_Delay(kTickDuration);
#endif