|
@@ -44,14 +44,6 @@ extern "C" {
|
|
|
#include "common/ios.h"
|
|
|
#endif
|
|
|
|
|
|
-#ifdef LOVE_ANDROID
|
|
|
-#include "common/android.h"
|
|
|
-extern "C"
|
|
|
-{
|
|
|
-#include "luajit.h"
|
|
|
-}
|
|
|
-#endif
|
|
|
-
|
|
|
#ifdef LOVE_WINDOWS
|
|
|
extern "C"
|
|
|
{
|
|
@@ -140,39 +132,6 @@ static int love_preload(lua_State *L, lua_CFunction f, const char *name)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-#ifdef LOVE_ANDROID
|
|
|
-static int l_print_sdl_log(lua_State *L)
|
|
|
-{
|
|
|
- int nargs = lua_gettop(L);
|
|
|
-
|
|
|
- lua_getglobal(L, "tostring");
|
|
|
-
|
|
|
- std::string outstring;
|
|
|
-
|
|
|
- for (int i = 1; i <= nargs; i++)
|
|
|
- {
|
|
|
- // Call tostring(arg) and leave the result on the top of the stack.
|
|
|
- lua_pushvalue(L, -1);
|
|
|
- lua_pushvalue(L, i);
|
|
|
- lua_call(L, 1, 1);
|
|
|
-
|
|
|
- const char *s = lua_tostring(L, -1);
|
|
|
- if (s == nullptr)
|
|
|
- return luaL_error(L, "'tostring' must return a string to 'print'");
|
|
|
-
|
|
|
- if (i > 1)
|
|
|
- outstring += "\t";
|
|
|
-
|
|
|
- outstring += s;
|
|
|
-
|
|
|
- lua_pop(L, 1); // Pop the result of tostring(arg).
|
|
|
- }
|
|
|
-
|
|
|
- SDL_Log("[LOVE] %s", outstring.c_str());
|
|
|
- return 0;
|
|
|
-}
|
|
|
-#endif
|
|
|
-
|
|
|
enum DoneAction
|
|
|
{
|
|
|
DONE_QUIT,
|
|
@@ -201,11 +160,6 @@ static DoneAction runlove(int argc, char **argv, int &retval)
|
|
|
lua_State *L = luaL_newstate();
|
|
|
luaL_openlibs(L);
|
|
|
|
|
|
-#ifdef LOVE_ANDROID
|
|
|
- luaJIT_setmode(L, 0, LUAJIT_MODE_ENGINE| LUAJIT_MODE_OFF);
|
|
|
- lua_register(L, "print", l_print_sdl_log);
|
|
|
-#endif
|
|
|
-
|
|
|
// Add love to package.preload for easy requiring.
|
|
|
love_preload(L, luaopen_love, "love");
|
|
|
|
|
@@ -257,9 +211,7 @@ static DoneAction runlove(int argc, char **argv, int &retval)
|
|
|
lua_pushvalue(L, -2);
|
|
|
int stackpos = lua_gettop(L);
|
|
|
while (lua_resume(L, 0) == LUA_YIELD)
|
|
|
- {
|
|
|
lua_pop(L, lua_gettop(L) - stackpos);
|
|
|
- }
|
|
|
|
|
|
retval = 0;
|
|
|
DoneAction done = DONE_QUIT;
|