diff --git a/JGE/src/pc/JGfx.cpp b/JGE/src/pc/JGfx.cpp index 7c802121a..475ca88ec 100644 --- a/JGE/src/pc/JGfx.cpp +++ b/JGE/src/pc/JGfx.cpp @@ -7,9 +7,7 @@ // Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) // //------------------------------------------------------------------------------------- -#ifdef QT_CONFIG #define GL_GLEXT_PROTOTYPES -#endif //QT_CONFIG #ifdef WIN32 #pragma warning(disable : 4786) @@ -44,6 +42,7 @@ extern "C" { #endif #endif +//#define FORCE_GL2 #ifdef FORCE_GL2 // This code is to force the windows code to use GL_VERSION_2_0 even if it's not defined in the header files // It's mostly to try to debug the shaders on Windows. @@ -275,8 +274,6 @@ static glslFunctions g_glslfuncts; #define GL_VERSION_2_0 #endif -//#undef GL_VERSION_2_0 - JQuad::JQuad(JTexture *tex, float x, float y, float width, float height) :mTex(tex), mX(x), mY(y), mWidth(width), mHeight(height) { @@ -869,16 +866,11 @@ void JRenderer::RenderQuad(JQuad* quad, float xo, float yo, float angle, float x ESMatrix mvpMatrix; memcpy(&mvpMatrix, &theMvpMatrix, sizeof(ESMatrix)); - /* this fix the menu but breaks the game by reversing a couple of cards :( - if(angle < 0 ) - { - if(xScale >= 0 && yScale >= 0) - xScale *= -1; - yScale *= -1; - }*/ - esTranslate(&mvpMatrix, xo, yo, 0.0f); - esRotate(&mvpMatrix, -angle*RAD2DEG, 0.0f, 0.0f, 1.0f); + + // see http://code.google.com/p/wagic/issues/detail?id=460 + // in openGL1, we rotate with -angle, but here we use +angle. Why ? + esRotate(&mvpMatrix, angle*RAD2DEG, 0.0f, 0.0f, 1.0f); esScale(&mvpMatrix, xScale, yScale, 1.0f); @@ -2723,8 +2715,8 @@ void JRenderer::DrawRoundRect(float x, float y, float w, float h, float radius, glDisable(GL_TEXTURE_2D); #if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0) - int i, index = 1; - int number = 360+2*ceil(h)+2*ceil(w); + int i; + int number = 360; GLfloat* vVertices = new GLfloat[3*number]; GLubyte* colors = new GLubyte[4*number]; @@ -2736,62 +2728,35 @@ void JRenderer::DrawRoundRect(float x, float y, float w, float h, float radius, colors[4*i+3]= col.a; } - index = 0; + for(i=0; i<90;i++) { - vVertices[3*(index+i)+0] = x+radius*COSF(i); - vVertices[3*(index+i)+1] = SCREEN_HEIGHT_F-y+radius*SINF(i); - vVertices[3*(index+i)+2] = 0.0f; + vVertices[3 * i + 0] = x+radius*COSF(i); + vVertices[3 * i + 1] = SCREEN_HEIGHT_F-(y+radius*SINF(i)); + vVertices[3 * i + 2] = 0.0f; } - index += 90; - for(i=0; i