summaryrefslogtreecommitdiffstatshomepage
path: root/src/frontend
diff options
context:
space:
mode:
author cracyc <cracyc@users.noreply.github.com>2020-02-11 17:04:36 -0600
committer cracyc <cracyc@users.noreply.github.com>2020-02-11 17:04:36 -0600
commita0a658a11148f3dac497d24a3eb16460df9b69c0 (patch)
tree3eb19621f59b21631e7d17c99da629d4c7914add /src/frontend
parent712bd32a8ce5df7438775ee161aa3747bc340744 (diff)
fix various things. checkpointed the alphatpc16, will credit before next release (nw)
Diffstat (limited to 'src/frontend')
-rw-r--r--src/frontend/mame/luaengine.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/frontend/mame/luaengine.cpp b/src/frontend/mame/luaengine.cpp
index 411004676a9..993be513940 100644
--- a/src/frontend/mame/luaengine.cpp
+++ b/src/frontend/mame/luaengine.cpp
@@ -1498,13 +1498,11 @@ void lua_engine::initialize()
* #log - entry count
*/
- auto text_buffer_type = sol().registry().create_simple_usertype<wrap_textbuf>("new", sol::no_constructor);
- text_buffer_type.set("__metatable", [](){});
- text_buffer_type.set("__newindex", [](){});
- text_buffer_type.set("__index", [](wrap_textbuf &buf, int index) { return text_buffer_get_seqnum_line(buf.textbuf, index - 1); });
- text_buffer_type.set("__len", [](wrap_textbuf &buf) { return text_buffer_num_lines(buf.textbuf) + text_buffer_line_index_to_seqnum(buf.textbuf, 0) - 1; });
- sol().registry().set_usertype("text_buffer", text_buffer_type);
-
+ sol().registry().new_usertype<wrap_textbuf>("text_buffer", "new", sol::no_constructor,
+ "__metatable", [](){},
+ "__newindex", [](){},
+ "__index", [](wrap_textbuf &buf, int index) { return text_buffer_get_seqnum_line(buf.textbuf, index - 1); },
+ "__len", [](wrap_textbuf &buf) { return text_buffer_num_lines(buf.textbuf) + text_buffer_line_index_to_seqnum(buf.textbuf, 0) - 1; });
/* device_debug library (requires debugger to be active)
*