Renamed CompressedData:getNumMipmaps to CompressedData:getMipmapCount; Improved type-checking error messages for some functions which expect function arguments

This commit is contained in:
Alex Szpakowski
2013-05-02 17:26:50 -04:00
parent 77c6efd8fd
commit 3bf43dadd8
14 changed files with 43 additions and 44 deletions
+9 -10
View File
@@ -44,8 +44,7 @@ int w_Canvas_renderTo(lua_State *L)
}
Canvas *canvas = luax_checkcanvas(L, 1);
if (!lua_isfunction(L, 2))
return luaL_error(L, "Need a function to render to canvas.");
luaL_checktype(L, 2, LUA_TFUNCTION);
try
{
@@ -182,19 +181,19 @@ int w_Canvas_clear(lua_State *L)
for (int i = 1; i <= 4; i++)
lua_rawgeti(L, 2, i);
c.r = (unsigned char)luaL_checkint(L, -4);
c.g = (unsigned char)luaL_checkint(L, -3);
c.b = (unsigned char)luaL_checkint(L, -2);
c.a = (unsigned char)luaL_optint(L, -1, 255);
c.r = (unsigned char)luaL_checkinteger(L, -4);
c.g = (unsigned char)luaL_checkinteger(L, -3);
c.b = (unsigned char)luaL_checkinteger(L, -2);
c.a = (unsigned char)luaL_optinteger(L, -1, 255);
lua_pop(L, 4);
}
else
{
c.r = (unsigned char)luaL_checkint(L, 2);
c.g = (unsigned char)luaL_checkint(L, 3);
c.b = (unsigned char)luaL_checkint(L, 4);
c.a = (unsigned char)luaL_optint(L, 5, 255);
c.r = (unsigned char)luaL_checkinteger(L, 2);
c.g = (unsigned char)luaL_checkinteger(L, 3);
c.b = (unsigned char)luaL_checkinteger(L, 4);
c.a = (unsigned char)luaL_optinteger(L, 5, 255);
}
canvas->clear(c);