mirror of
https://github.com/love2d/love.git
synced 2026-08-17 19:23:38 +02:00
Make the default point style to setPoint 'smooth' (issue #543), and fix setPointStyle ignoring normal operation
This commit is contained in:
@@ -712,14 +712,11 @@ int w_setPointSize(lua_State *L)
|
|||||||
|
|
||||||
int w_setPointStyle(lua_State *L)
|
int w_setPointStyle(lua_State *L)
|
||||||
{
|
{
|
||||||
Graphics::PointStyle style = Graphics::POINT_SMOOTH;
|
Graphics::PointStyle style;
|
||||||
|
|
||||||
if (lua_gettop(L) >= 2)
|
const char *str = luaL_checkstring(L, 1);
|
||||||
{
|
if (!Graphics::getConstant(str, style))
|
||||||
const char *str = luaL_checkstring(L, 1);
|
return luaL_error(L, "Invalid point style: %s", str);
|
||||||
if (!Graphics::getConstant(str, style))
|
|
||||||
return luaL_error(L, "Invalid point style: %s", str);
|
|
||||||
}
|
|
||||||
|
|
||||||
instance->setPointStyle(style);
|
instance->setPointStyle(style);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -729,10 +726,14 @@ int w_setPoint(lua_State *L)
|
|||||||
{
|
{
|
||||||
float size = (float)luaL_checknumber(L, 1);
|
float size = (float)luaL_checknumber(L, 1);
|
||||||
|
|
||||||
Graphics::PointStyle style;
|
Graphics::PointStyle style = Graphics::POINT_SMOOTH;
|
||||||
const char *str = luaL_checkstring(L, 2);
|
|
||||||
if (!Graphics::getConstant(str, style))
|
if (lua_gettop(L) >= 2)
|
||||||
return luaL_error(L, "Invalid point style: %s", str);
|
{
|
||||||
|
const char *str = luaL_checkstring(L, 2);
|
||||||
|
if (!Graphics::getConstant(str, style))
|
||||||
|
return luaL_error(L, "Invalid point style: %s", str);
|
||||||
|
}
|
||||||
|
|
||||||
instance->setPoint(size, style);
|
instance->setPoint(size, style);
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user