fix lua issue (nw)

This commit is contained in:
Miodrag Milanovic 2016-04-23 17:08:59 +02:00
parent a931b486fe
commit 3fc8cfd679
3 changed files with 12 additions and 8 deletions

View File

@ -16,8 +16,8 @@ for file in lfs.dir("plugins") do
if (file~="." and file~=".." and lfs.attributes("plugins/" .. file,"mode")=="directory") then
local filename = "plugins/" .. file .. "/plugin.json"
local meta = json.parse(readAll(filename))
if (meta["plugin"]["type"]=="plugin") and (manager:plugins().entries[meta["plugin"]["name"]]~=nil) then
local entry = manager:plugins().entries[meta["plugin"]["name"]]
if (meta["plugin"]["type"]=="plugin") and (mame_manager:plugins().entries[meta["plugin"]["name"]]~=nil) then
local entry = mame_manager:plugins().entries[meta["plugin"]["name"]]
if (entry:value()==true) then
emu.print_verbose("Starting plugin " .. meta["plugin"]["name"] .. "...")
plugin = require(meta["plugin"]["name"])

View File

@ -2169,10 +2169,13 @@ void lua_engine::initialize()
.addCFunction ("print_error", l_osd_printf_error )
.addCFunction ("print_info", l_osd_printf_info )
.addCFunction ("print_debug", l_osd_printf_debug )
.beginClass <mame_machine_manager> ("manager")
.addFunction ("machine", &machine_manager::machine)
.addFunction ("options", &machine_manager::options)
.beginClass <machine_manager>("manager")
.addFunction("machine", &machine_manager::machine)
.addFunction("options", &machine_manager::options)
.endClass()
.beginClass <mame_machine_manager> ("mame_manager")
.addFunction ("plugins", &mame_machine_manager::plugins)
.addFunction ("cheat", &mame_machine_manager::cheat)
.endClass ()
.beginClass <lua_machine> ("lua_machine")
.addCFunction ("popmessage", &lua_machine::l_popmessage)
@ -2190,7 +2193,6 @@ void lua_engine::initialize()
.addFunction ("render", &running_machine::render)
.addFunction ("ioport", &running_machine::ioport)
.addFunction ("parameters", &running_machine::parameters)
.addFunction ("cheat", &mame_machine_manager::cheat)
.addFunction ("memory", &running_machine::memory)
.addFunction ("options", &running_machine::options)
.addFunction ("outputs", &running_machine::output)
@ -2501,8 +2503,10 @@ void lua_engine::initialize()
.endClass()
.endNamespace();
luabridge::push (m_lua_state, mame_machine_manager::instance());
luabridge::push (m_lua_state, (machine_manager*)mame_machine_manager::instance());
lua_setglobal(m_lua_state, "manager");
luabridge::push(m_lua_state, mame_machine_manager::instance());
lua_setglobal(m_lua_state, "mame_manager");
}
void lua_engine::start_console()

View File

@ -35,7 +35,7 @@ class mame_ui_manager;
// ======================> machine_manager
class mame_machine_manager : machine_manager
class mame_machine_manager : public machine_manager
{
DISABLE_COPYING(mame_machine_manager);
private: