summaryrefslogtreecommitdiffstatshomepage
path: root/src/frontend
diff options
context:
space:
mode:
author cracyc <cracyc@users.noreply.github.com>2018-03-03 14:46:12 -0600
committer cracyc <cracyc@users.noreply.github.com>2018-03-03 14:46:12 -0600
commit5a018f17f350736ef99aacbc5473a4ec3eeb9b3c (patch)
tree9bdf7387bcd8a8c9ac1b6bfdf7fdece4a26fadf6 /src/frontend
parent3fd745c2a7ed5e77f1c9223dbf149d97a2ec356a (diff)
luaengine: use screen_device_iterator rather than first_screen (nw)
Diffstat (limited to 'src/frontend')
-rw-r--r--src/frontend/mame/luaengine.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/frontend/mame/luaengine.cpp b/src/frontend/mame/luaengine.cpp
index bb7c263d679..fe9bdc553ea 100644
--- a/src/frontend/mame/luaengine.cpp
+++ b/src/frontend/mame/luaengine.cpp
@@ -1181,11 +1181,10 @@ void lua_engine::initialize()
}),
"screens", sol::property([this](running_machine &r) {
sol::table table = sol().create_table();
- for(device_t *dev = r.first_screen(); dev != nullptr; dev = dev->next())
+ for (screen_device &sc : screen_device_iterator(r.root_device()))
{
- screen_device *sc = dynamic_cast<screen_device *>(dev);
- if (sc && sc->configured() && sc->started() && sc->type())
- table[sc->tag()] = sc;
+ if (sc.configured() && sc.started() && sc.type())
+ table[sc.tag()] = &sc;
}
return table;
}),