Replaced internal calls to luaL_register (deprecated in Lua 5.2) with an alternative

This commit is contained in:
Alex Szpakowski
2013-07-16 23:23:58 -03:00
parent 3725b4122f
commit 5a3055dd3b
5 changed files with 39 additions and 8 deletions
+3
View File
@@ -744,6 +744,8 @@ Image::Wrap Canvas::getWrap() const
bool Canvas::loadVolatile()
{
fbo = depth_stencil = img = 0;
// glTexImage2D is guaranteed to error in this case.
if (width > gl.getMaxTextureSize() || height > gl.getMaxTextureSize())
{
@@ -764,6 +766,7 @@ bool Canvas::loadVolatile()
void Canvas::unloadVolatile()
{
strategy->deleteFBO(fbo, depth_stencil, img);
fbo = depth_stencil = img = 0;
for (size_t i = 0; i < attachedCanvases.size(); i++)
attachedCanvases[i]->release();
@@ -155,14 +155,14 @@ int w_Geometry_getVertexMap(lua_State *L)
{
Geometry *g = luax_checkgeometry(L, 1);
size_t elementcount = g->getElementCount();
size_t elemcount = g->getElementCount();
const uint16 *elements = g->getElementArray();
if (elementcount == 0 || elements == 0)
if (elemcount == 0 || elements == 0)
return 0;
lua_createtable(L, elementcount, 0);
for (size_t i = 0; i < elementcount; i++)
lua_createtable(L, elemcount, 0);
for (size_t i = 0; i < elemcount; i++)
{
lua_pushinteger(L, elements[i]);
lua_rawseti(L, -2, i + 1);
+2 -2
View File
@@ -130,7 +130,7 @@ static const luaL_Reg modules[] = {
};
#ifdef LOVE_LEGENDARY_CONSOLE_IO_HACK
int w__openConsole(lua_State * L);
int w__openConsole(lua_State *L);
#endif // LOVE_LEGENDARY_CONSOLE_IO_HACK
const char *love_version()
@@ -201,7 +201,7 @@ int luaopen_love(lua_State * L)
#ifdef LOVE_LEGENDARY_CONSOLE_IO_HACK
int w__openConsole(lua_State * L)
int w__openConsole(lua_State *L)
{
static bool is_open = false;
if (is_open)