| 79 | |
| 80 | |
| 81 | SScriptModule_Lua::SScriptModule_Lua() |
| 82 | { |
| 83 | d_state = luaL_newstate(); |
| 84 | if(d_state) |
| 85 | { |
| 86 | luaL_openlibs(d_state); |
| 87 | SOUI_Export_Lua(d_state); |
| 88 | lua_register(d_state, "A2W", Utf8ToW); |
| 89 | lua_tinker::def(d_state, "cast_a2w", cast_a2w); |
| 90 | luaL_dostring(d_state,"function L (str)\n return cast_a2w(A2W(str));\nend");//注册一个全局的"L"函数,用来将utf8编码的字符串转换为WCHAR |
| 91 | |
| 92 | lua_register(d_state, "A2T", Utf8ToT); |
| 93 | lua_tinker::def(d_state, "cast_a2t", cast_a2t); |
| 94 | luaL_dostring(d_state,"function T (str)\n return cast_a2t(A2T(str));\nend");//注册一个全局的"T"函数,用来将utf8编码的字符串转换为TCHAR |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | |
| 99 | SScriptModule_Lua::~SScriptModule_Lua() |
nothing calls this directly
no test coverage detected