summaryrefslogtreecommitdiffstats
path: root/src/control
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2015-12-09 23:52:21 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2015-12-10 00:42:02 +0100
commit4135928a9f74bf431b6cbca4ad47f00fa47aea56 (patch)
tree44d0536118212734f0c6e723745fd406739669d7 /src/control
parentc5a98c282b86d97330352fe17a7b6998b38237e5 (diff)
downloadrpgedit-4135928a9f74bf431b6cbca4ad47f00fa47aea56.tar
rpgedit-4135928a9f74bf431b6cbca4ad47f00fa47aea56.zip
Update to Lua 5.3old/sdl
Diffstat (limited to 'src/control')
-rw-r--r--src/control/ScriptContext.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/control/ScriptContext.cpp b/src/control/ScriptContext.cpp
index b92c8e5..e92e275 100644
--- a/src/control/ScriptContext.cpp
+++ b/src/control/ScriptContext.cpp
@@ -34,15 +34,17 @@ namespace Control {
void ScriptContext::setupEnv() {
const std::pair<const char *, lua_CFunction> libs[] = {
{"_G", luaopen_base},
- {"bit32", luaopen_bit32},
{"math", luaopen_math},
{"string", luaopen_string},
{"table", luaopen_table},
+ {"utf8", luaopen_utf8},
};
for (auto &lib : libs) {
- luaL_requiref(L, lib.first, lib.second, 1);
- lua_pop(L, 1);
+ lua_pushcfunction(L, lib.second);
+ lua_pushstring(L, lib.first);
+ lua_call(L, 1, 1);
+ lua_setglobal(L, lib.first);
}
for (const char *f : {"dofile", "loadfile", "require"}) {