diff --git a/.hgignore b/.hgignore new file mode 100644 index 000000000..21240aa83 --- /dev/null +++ b/.hgignore @@ -0,0 +1,20 @@ +relre:platform/msvc2008/include/ +glob:platform/msvc2008/Debug/ +glob:platform/msvc2008/Release/ +glob:platform/msvc2008/lib/ +relre:platform/msvc2008/(.*)user +relre:platform/msvc2008/(.*)dll +relre:platform/msvc2008/(.*)ncb +relre:platform/msvc2008/(.*)txt +relre:platform/msvc2008/(.*)suo +relre:src/scripts/(.*)exe +relre:src/scripts/(.*)bat +glob:extra/reshax/Release/ +glob:extra/reshax/Debug/ +relre:src/resources/(.*)bat +relre:src/resources/(.*)exe +relre:extra/reshax/(.*)ncb +relre:extra/reshax/(.*)suo +relre:extra/reshax/(.*)user +glob:extra/reshax/resources.h +glob:extra/reshax/resources.cpp diff --git a/extra/reshax/reshax.cpp b/extra/reshax/reshax.cpp index 5219211b5..b92034ee2 100644 --- a/extra/reshax/reshax.cpp +++ b/extra/reshax/reshax.cpp @@ -56,7 +56,8 @@ int main(int argc, char *argv[]) // use boost::filesystem to list all the files (in v2 maybe) load(argv[i]); } - resources_cpp << "}\n"; + resources_cpp << "};\n"; + resources_cpp << "} // love\n"; resources_cpp.close(); resources_h << "}\n\n" diff --git a/platform/msvc2008/love.vcproj b/platform/msvc2008/love.vcproj index 759aa8dea..b7995c6d7 100644 --- a/platform/msvc2008/love.vcproj +++ b/platform/msvc2008/love.vcproj @@ -3143,6 +3143,14 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/common/runtime.cpp b/src/common/runtime.cpp index 39ce17ce8..e03f0b22d 100644 --- a/src/common/runtime.cpp +++ b/src/common/runtime.cpp @@ -155,8 +155,11 @@ namespace love return 0; } - int luax_register_module(lua_State * L, const luaL_Reg * fn, const lua_CFunction * types) + int luax_register_module(lua_State * L, const luaL_Reg * fn, const lua_CFunction * types, const char * name) { + // Gets the love table. + lua_getglobal(L, "love"); + // Create new table for module. lua_newtable(L); @@ -168,7 +171,10 @@ namespace love for(const lua_CFunction * t = types; *t != 0; t++) (*t)(L); - return 1; + lua_setfield(L, -2, name); // love.graphics = table + lua_pop(L, 1); // love + + return 0; } int luax_preload(lua_State * L, lua_CFunction f, const char * name) diff --git a/src/common/runtime.h b/src/common/runtime.h index 39adcfcd4..15ce3ac15 100644 --- a/src/common/runtime.h +++ b/src/common/runtime.h @@ -49,7 +49,7 @@ namespace love const char * provides, const char * desc, const char * author, lua_CFunction open); - int luax_register_module(lua_State * L, const luaL_Reg * fn, const lua_CFunction * types); + int luax_register_module(lua_State * L, const luaL_Reg * fn, const lua_CFunction * types, const char * name); int luax_preload(lua_State * L, lua_CFunction f, const char * name); int luax_register_type(lua_State * L, const char * tname, const luaL_Reg * fn); diff --git a/src/love.cpp b/src/love.cpp index d51bb24b4..8ba711d94 100644 --- a/src/love.cpp +++ b/src/love.cpp @@ -27,6 +27,7 @@ #include #include #include +#include // Modules #include