Fix issue #259: oy ignored in love.graphics.drawq

This commit is contained in:
vrld
2011-07-18 02:07:46 +02:00
parent 9923c02b64
commit b1c5b948c3
2 changed files with 18 additions and 16 deletions
+16 -14
View File
@@ -96,7 +96,8 @@ namespace opengl
glGetTexEnviv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, &mode); glGetTexEnviv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, &mode);
s.colorMode = (mode == GL_MODULATE) ? Graphics::COLOR_MODULATE : Graphics::COLOR_REPLACE; s.colorMode = (mode == GL_MODULATE) ? Graphics::COLOR_MODULATE : Graphics::COLOR_REPLACE;
//get line style //get line style
s.lineStyle = (glIsEnabled(GL_POLYGON_SMOOTH) == GL_TRUE) ? Graphics::LINE_SMOOTH : Graphics::LINE_ROUGH; //s.lineStyle = (glIsEnabled(GL_POLYGON_SMOOTH) == GL_TRUE) ? Graphics::LINE_SMOOTH : Graphics::LINE_ROUGH;
s.lineStyle = Graphics::LINE_ROUGH;
//get the point size //get the point size
glGetFloatv(GL_POINT_SIZE, &s.pointSize); glGetFloatv(GL_POINT_SIZE, &s.pointSize);
//get point style //get point style
@@ -180,6 +181,7 @@ namespace opengl
{ {
SDL_GL_SetAttribute( SDL_GL_MULTISAMPLEBUFFERS, 1 ) ; SDL_GL_SetAttribute( SDL_GL_MULTISAMPLEBUFFERS, 1 ) ;
SDL_GL_SetAttribute( SDL_GL_MULTISAMPLESAMPLES, fsaa ) ; SDL_GL_SetAttribute( SDL_GL_MULTISAMPLESAMPLES, fsaa ) ;
glEnable(GL_MULTISAMPLE);
} }
// Fullscreen? // Fullscreen?
@@ -653,16 +655,16 @@ namespace opengl
void Graphics::setLineStyle(Graphics::LineStyle style ) void Graphics::setLineStyle(Graphics::LineStyle style )
{ {
// XXX: actually enables antialiasing for _all_ polygons. //// XXX: actually enables antialiasing for _all_ polygons.
// may need investigation if wanted or not //// may need investigation if wanted or not
// maybe rename to something else? //// maybe rename to something else?
if(style == LINE_ROUGH) //if(style == LINE_ROUGH)
glDisable (GL_POLYGON_SMOOTH); // glDisable (GL_POLYGON_SMOOTH);
else // type == LINE_SMOOTH //else // type == LINE_SMOOTH
{ //{
glEnable (GL_POLYGON_SMOOTH); // glEnable (GL_POLYGON_SMOOTH);
glHint (GL_POLYGON_SMOOTH_HINT, GL_NICEST); // glHint (GL_POLYGON_SMOOTH_HINT, GL_NICEST);
} //}
} }
void Graphics::setLine( float width, Graphics::LineStyle style ) void Graphics::setLine( float width, Graphics::LineStyle style )
@@ -683,9 +685,9 @@ namespace opengl
Graphics::LineStyle Graphics::getLineStyle() Graphics::LineStyle Graphics::getLineStyle()
{ {
if(glIsEnabled(GL_POLYGON_SMOOTH) == GL_TRUE) //if(glIsEnabled(GL_POLYGON_SMOOTH) == GL_TRUE)
return LINE_SMOOTH; // return LINE_SMOOTH;
else //else
return LINE_ROUGH; return LINE_ROUGH;
} }
@@ -757,8 +757,8 @@ namespace opengl
float sy = (float)luaL_optnumber(L, 7, sx); float sy = (float)luaL_optnumber(L, 7, sx);
float ox = (float)luaL_optnumber(L, 8, 0); float ox = (float)luaL_optnumber(L, 8, 0);
float oy = (float)luaL_optnumber(L, 9, 0); float oy = (float)luaL_optnumber(L, 9, 0);
float kx = (float)luaL_optnumber(L, 9, 0); float kx = (float)luaL_optnumber(L, 10, 0);
float ky = (float)luaL_optnumber(L, 10, 0); float ky = (float)luaL_optnumber(L, 11, 0);
image->drawq(q, x, y, angle, sx, sy, ox, oy, kx, ky); image->drawq(q, x, y, angle, sx, sy, ox, oy, kx, ky);
return 0; return 0;
} }