mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Add basic lua 5.3 support
This commit is contained in:
@@ -72,7 +72,7 @@ int w_newTrueTypeRasterizer(lua_State *L)
|
||||
if (lua_type(L, 1) == LUA_TNUMBER || lua_isnone(L, 1))
|
||||
{
|
||||
// First argument is a number: use the default TrueType font.
|
||||
int size = luaL_optint(L, 1, 12);
|
||||
int size = (int) luaL_optnumber(L, 1, 12);
|
||||
|
||||
const char *hintstr = lua_isnoneornil(L, 2) ? nullptr : luaL_checkstring(L, 2);
|
||||
if (hintstr && !TrueTypeRasterizer::getConstant(hintstr, hinting))
|
||||
@@ -89,7 +89,7 @@ int w_newTrueTypeRasterizer(lua_State *L)
|
||||
else
|
||||
d = filesystem::luax_getfiledata(L, 1);
|
||||
|
||||
int size = luaL_optint(L, 2, 12);
|
||||
int size = (int) luaL_optnumber(L, 2, 12);
|
||||
|
||||
const char *hintstr = lua_isnoneornil(L, 3) ? nullptr : luaL_checkstring(L, 3);
|
||||
if (hintstr && !TrueTypeRasterizer::getConstant(hintstr, hinting))
|
||||
@@ -121,7 +121,7 @@ int w_newBMFontRasterizer(lua_State *L)
|
||||
|
||||
if (lua_istable(L, 2))
|
||||
{
|
||||
for (int i = 1; i <= (int) lua_objlen(L, 2); i++)
|
||||
for (int i = 1; i <= (int) luax_objlen(L, 2); i++)
|
||||
{
|
||||
lua_rawgeti(L, 2, i);
|
||||
|
||||
@@ -162,7 +162,7 @@ int w_newImageRasterizer(lua_State *L)
|
||||
|
||||
image::ImageData *d = luax_checktype<image::ImageData>(L, 1, IMAGE_IMAGE_DATA_ID);
|
||||
std::string glyphs = luax_checkstring(L, 2);
|
||||
int extraspacing = luaL_optint(L, 3, 0);
|
||||
int extraspacing = (int) luaL_optnumber(L, 3, 0);
|
||||
|
||||
luax_catchexcept(L, [&](){ t = instance()->newImageRasterizer(d, glyphs, extraspacing); });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user