bottom -= center_y;
float vertices[] = {
- left*ca - top*sa + center_x, left*sa + top*ca + center_y,
- right*ca - top*sa + center_x, right*sa + top*ca + center_y,
- right*ca - bottom*sa + center_x, right*sa + bottom*ca + center_y,
- left*ca - bottom*sa + center_x, left*sa + bottom*ca + center_y
- };
+ left*ca - top*sa + center_x, left*sa + top*ca + center_y,
+ right*ca - top*sa + center_x, right*sa + top*ca + center_y,
+ right*ca - bottom*sa + center_x, right*sa + bottom*ca + center_y,
+ left*ca - bottom*sa + center_x, left*sa + bottom*ca + center_y
+ };
glVertexPointer(2, GL_FLOAT, 0, vertices);
float uvs[] = {
Lightmap::~Lightmap()
{
- texture_manager->remove_texture(lightmap);
+ if(texture_manager){
+ texture_manager->remove_texture(lightmap);
+ }
delete lightmap;
}
glViewport(0, screen->h - lightmap_height, lightmap_width, lightmap_height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
+#ifdef GL_VERSION_ES_CM_1_0
+ glOrthof(0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, -1.0, 1.0);
+#else
glOrtho(0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, -1.0, 1.0);
+#endif
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glViewport(0, 0, screen->w, screen->h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
+#ifdef GL_VERSION_ES_CM_1_0
+ glOrthof(0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, -1.0, 1.0);
+#else
glOrtho(0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, -1.0, 1.0);
+#endif
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glEnable(GL_BLEND);