EncodedImageData was implemented really stupidly. Now it's less stupid.

This commit is contained in:
Bill Meltsner
2010-04-11 23:09:29 -04:00
parent 5f2197158d
commit b1dac7f381
13 changed files with 160 additions and 36 deletions
+16 -15
View File
@@ -205,21 +205,21 @@ namespace love
int luax_register_searcher(lua_State * L, lua_CFunction f)
{
// Add the package loader to the package.loaders table.
lua_getglobal(L, "package");
if(lua_isnil(L, -1))
return luaL_error(L, "Can't register searcher: package table does not exist.");
lua_getfield(L, -1, "loaders");
if(lua_isnil(L, -1))
return luaL_error(L, "Can't register searcher: package.loaders table does not exist.");
int len = lua_objlen(L, -1);
lua_pushinteger(L, len+1);
lua_pushcfunction(L, f);
lua_settable(L, -3);
// Add the package loader to the package.loaders table.
lua_getglobal(L, "package");
if(lua_isnil(L, -1))
return luaL_error(L, "Can't register searcher: package table does not exist.");
lua_getfield(L, -1, "loaders");
if(lua_isnil(L, -1))
return luaL_error(L, "Can't register searcher: package.loaders table does not exist.");
int len = lua_objlen(L, -1);
lua_pushinteger(L, len+1);
lua_pushcfunction(L, f);
lua_settable(L, -3);
lua_pop(L, 2);
return 0;
}
@@ -362,6 +362,7 @@ namespace love
// Image
{"ImageData", IMAGE_IMAGE_DATA_ID},
{"EncodedImageData", IMAGE_ENCODED_IMAGE_DATA_ID},
// Audio
{"Source", AUDIO_SOURCE_ID},