summaryrefslogtreecommitdiffstats
path: root/src/frontend/mame/luaengine_render.cpp
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2022-03-16 04:13:18 +1100
committer Vas Crabb <vas@vastheman.com>2022-03-16 04:13:18 +1100
commit394e5f18b6fb034b04fae0f35575dc24a4a1d620 (patch)
tree86875ae05bd30adcd3d25fa66f6dbe1093f4d3df /src/frontend/mame/luaengine_render.cpp
parentc074526b03e51a8a1368813cee130a543a560c0f (diff)
Fixed some debugger memory view annoyances and cleaned up Lua bindings.
Made the debugger memory view not depend on isprint which is affected by the global locale. Assume the OSD will display as ISO-8869-1 and replace problematic printable characters. Started changing Lua function bindings to use set_function to avoid potential issues related to ThePhD/sol2#608, and worked out what was causing problems with symbol table read_memory/write_memory. (They aren't really essential - you can do the same thing with the address space object itself, but they're easier to parameterise.)
Diffstat (limited to 'src/frontend/mame/luaengine_render.cpp')
-rw-r--r--src/frontend/mame/luaengine_render.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/frontend/mame/luaengine_render.cpp b/src/frontend/mame/luaengine_render.cpp
index 21a68dc65cb..893412a4b30 100644
--- a/src/frontend/mame/luaengine_render.cpp
+++ b/src/frontend/mame/luaengine_render.cpp
@@ -418,7 +418,7 @@ void lua_engine::initialize_render(sol::table &emu)
ctnr.add_line(x1, y1, x2, y2, UI_LINE_WIDTH, rgb_t(*color), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
};
render_container_type["draw_text"] =
- [this] (render_container &ctnr, sol::object xobj, float y, char const *msg, std::optional<uint32_t> fgcolor, std::optional<uint32_t> bgcolor)
+ [] (render_container &ctnr, sol::this_state s, sol::object xobj, float y, char const *msg, std::optional<uint32_t> fgcolor, std::optional<uint32_t> bgcolor)
{
auto justify = ui::text_layout::text_justify::LEFT;
float x = 0;
@@ -438,7 +438,7 @@ void lua_engine::initialize_render(sol::table &emu)
}
else
{
- luaL_error(m_lua_state, "Error in param 1 to draw_text");
+ luaL_error(s, "Error in param 1 to draw_text");
return;
}
y = std::clamp(y, 0.0f, 1.0f);