Mercurial > love-experiments
diff src/common/runtime.cpp @ 1117:3c6206da8bcf
Add Module::registerInstance() and Module::getInstance().
Module::registerInstance() registers a module instance which can later
be retrieved using Module::getInstance().
registerInstance() is called in luax_register_module().
getInstance() expects the full name (as returned by Module::getName())
of the requested module.
| author | vrld <vrld@vrld.org> |
|---|---|
| date | Sun, 05 Aug 2012 16:03:37 +0200 |
| parents | 86a44f2bc38f |
| children | 7c7332becb70 fb1bf6a0dede |
line wrap: on
line diff
--- a/src/common/runtime.cpp Fri Aug 03 19:39:41 2012 +0200 +++ b/src/common/runtime.cpp Sun Aug 05 16:03:37 2012 +0200 @@ -191,6 +191,9 @@ lua_setfield(L, -3, m.name); // love.graphics = table lua_remove(L, -2); // love + // Register module instance + Module::registerInstance(m.module); + return 1; }
