diff --git a/lua/luac.pro b/lua/luac.pro new file mode 100644 index 000000000..97016a193 --- /dev/null +++ b/lua/luac.pro @@ -0,0 +1,9 @@ +TEMPLATE = app +CONFIG += console +DESTDIR = bin +TARGET = luac +SOURCES += src/luac.c +INCLUDEPATH += src +win32 { + DEFINES += LUA_BUILD_AS_DLL +} diff --git a/lua/src/luac.c b/lua/src/luac.c index d07017391..e7e1d5bbb 100644 --- a/lua/src/luac.c +++ b/lua/src/luac.c @@ -4,6 +4,29 @@ ** See Copyright Notice in lua.h */ +#include "lapi.c" +#include "lcode.c" +#include "ldebug.c" +#include "ldo.c" +#include "ldump.c" +#include "lfunc.c" +#include "lgc.c" +#include "llex.c" +#include "lmem.c" +#include "lobject.c" +#include "lopcodes.c" +#include "lparser.c" +#include "lstate.c" +#include "lstring.c" +#include "ltable.c" +#include "ltm.c" +#include "lundump.c" +#include "lvm.c" +#include "lzio.c" + +#include "lauxlib.c" +#include "print.c" + #include #include #include diff --git a/plugins/controller/source/Android/jni/controllerbinder.cpp b/plugins/controller/source/Android/jni/controllerbinder.cpp index 740c89b58..237a91d74 100644 --- a/plugins/controller/source/Android/jni/controllerbinder.cpp +++ b/plugins/controller/source/Android/jni/controllerbinder.cpp @@ -6,6 +6,8 @@ #define abs_index(L, i) ((i) > 0 || (i) <= LUA_REGISTRYINDEX ? (i) : lua_gettop(L) + (i) + 1) #endif +static lua_State *L = NULL; + static void luaL_newweaktable(lua_State *L, const char *mode) { lua_newtable(L); // create table for instance list @@ -62,7 +64,7 @@ static char keyWeak = ' '; class Controller : public GEventDispatcherProxy { public: - Controller(lua_State *L) : L(L) + Controller(lua_State *L) { ghid_init(); ghid_addCallback(callback_s, this); @@ -212,7 +214,6 @@ class Controller : public GEventDispatcherProxy } private: - lua_State *L; bool initialized_; }; @@ -367,6 +368,7 @@ static int loader(lua_State *L) static void g_initializePlugin(lua_State *L) { + ::L = L; lua_getglobal(L, "package"); lua_getfield(L, -1, "preload"); @@ -378,7 +380,7 @@ static void g_initializePlugin(lua_State *L) static void g_deinitializePlugin(lua_State *L) { - + ::L = NULL; } REGISTER_PLUGIN("Controller", "1.0") diff --git a/plugins/controller/source/controllerbinder.cpp b/plugins/controller/source/controllerbinder.cpp index 5a0cf02ad..5c3b403e6 100644 --- a/plugins/controller/source/controllerbinder.cpp +++ b/plugins/controller/source/controllerbinder.cpp @@ -6,6 +6,8 @@ #define abs_index(L, i) ((i) > 0 || (i) <= LUA_REGISTRYINDEX ? (i) : lua_gettop(L) + (i) + 1) #endif +static lua_State *L = NULL; + static void luaL_newweaktable(lua_State *L, const char *mode) { lua_newtable(L); // create table for instance list @@ -45,7 +47,7 @@ static char keyWeak = ' '; class Controller : public GEventDispatcherProxy { public: - Controller(lua_State *L) : L(L) + Controller(lua_State *L) { ghid_init(); ghid_addCallback(callback_s, this); @@ -214,7 +216,6 @@ class Controller : public GEventDispatcherProxy } private: - lua_State *L; bool initialized_; }; @@ -372,6 +373,7 @@ static int loader(lua_State *L) static void g_initializePlugin(lua_State *L) { + ::L = L; lua_getglobal(L, "package"); lua_getfield(L, -1, "preload"); @@ -383,7 +385,7 @@ static void g_initializePlugin(lua_State *L) static void g_deinitializePlugin(lua_State *L) { - + ::L = NULL; } REGISTER_PLUGIN("Controller", "1.0") diff --git a/plugins/controller/source/iOS/Plugins/Controller/controllerbinder.cpp b/plugins/controller/source/iOS/Plugins/Controller/controllerbinder.cpp index a8fe3b5d8..8293bcb8d 100644 --- a/plugins/controller/source/iOS/Plugins/Controller/controllerbinder.cpp +++ b/plugins/controller/source/iOS/Plugins/Controller/controllerbinder.cpp @@ -6,6 +6,8 @@ #define abs_index(L, i) ((i) > 0 || (i) <= LUA_REGISTRYINDEX ? (i) : lua_gettop(L) + (i) + 1) #endif +static lua_State *L = NULL; + static void luaL_newweaktable(lua_State *L, const char *mode) { lua_newtable(L); // create table for instance list @@ -44,7 +46,7 @@ static char keyWeak = ' '; class Controller : public GEventDispatcherProxy { public: - Controller(lua_State *L) : L(L) + Controller(lua_State *L) { ghid_init(); ghid_addCallback(callback_s, this); @@ -194,7 +196,6 @@ class Controller : public GEventDispatcherProxy } private: - lua_State *L; bool initialized_; }; @@ -349,6 +350,7 @@ static int loader(lua_State *L) static void g_initializePlugin(lua_State *L) { + ::L = L; lua_getglobal(L, "package"); lua_getfield(L, -1, "preload"); @@ -360,7 +362,7 @@ static void g_initializePlugin(lua_State *L) static void g_deinitializePlugin(lua_State *L) { - + ::L = NULL; } REGISTER_PLUGIN("Controller", "1.0") diff --git a/plugins/googlelicensing/source/Android/jni/googlelvlbinder.cpp b/plugins/googlelicensing/source/Android/jni/googlelvlbinder.cpp index a1d42163a..6c3819cb0 100644 --- a/plugins/googlelicensing/source/Android/jni/googlelvlbinder.cpp +++ b/plugins/googlelicensing/source/Android/jni/googlelvlbinder.cpp @@ -7,6 +7,8 @@ #define abs_index(L, i) ((i) > 0 || (i) <= LUA_REGISTRYINDEX ? (i) : lua_gettop(L) + (i) + 1) #endif +static lua_State *L = NULL; + static void luaL_newweaktable(lua_State *L, const char *mode) { lua_newtable(L); // create table for instance list @@ -45,7 +47,7 @@ static char keyWeak = ' '; class GoogleLVL : public GEventDispatcherProxy { public: - GoogleLVL(lua_State *L) : L(L) + GoogleLVL(lua_State *L) { ggooglelvl_init(); ggooglelvl_addCallback(callback_s, this); @@ -173,7 +175,6 @@ class GoogleLVL : public GEventDispatcherProxy } private: - lua_State *L; bool initialized_; }; @@ -281,6 +282,7 @@ static int loader(lua_State *L) static void g_initializePlugin(lua_State *L) { + ::L = L; lua_getglobal(L, "package"); lua_getfield(L, -1, "preload"); @@ -292,7 +294,7 @@ static void g_initializePlugin(lua_State *L) static void g_deinitializePlugin(lua_State *L) { - + ::L = NULL; } REGISTER_PLUGIN("Google Licensing", "1.0") diff --git a/plugins/iab/source/Android/libs/in-app-purchasing-2.0.76.jar b/plugins/iab/source/Android/libs/in-app-purchasing-2.0.76.jar new file mode 100644 index 000000000..cd590eb9b Binary files /dev/null and b/plugins/iab/source/Android/libs/in-app-purchasing-2.0.76.jar differ diff --git a/plugins/iab/source/Android/src/com/giderosmobile/android/plugins/iab/frameworks/IabGoogle.java b/plugins/iab/source/Android/src/com/giderosmobile/android/plugins/iab/frameworks/IabGoogle.java index 122f30ac4..e81ffd60d 100644 --- a/plugins/iab/source/Android/src/com/giderosmobile/android/plugins/iab/frameworks/IabGoogle.java +++ b/plugins/iab/source/Android/src/com/giderosmobile/android/plugins/iab/frameworks/IabGoogle.java @@ -78,15 +78,17 @@ else if(sdkAvailable == 0) @Override public void request(Hashtable products) { - mHelper.flagEndAsync(); - List skuList = new ArrayList(); - Enumeration e = products.keys(); - while(e.hasMoreElements()) - { - String prodName = e.nextElement(); - skuList.add(products.get(prodName)); - } - mHelper.queryInventoryAsync(true, skuList, this); + if (sdkAvailable == 1) { + mHelper.flagEndAsync(); + List skuList = new ArrayList(); + Enumeration e = products.keys(); + while(e.hasMoreElements()) + { + String prodName = e.nextElement(); + skuList.add(products.get(prodName)); + } + mHelper.queryInventoryAsync(true, skuList, this); + } } @Override @@ -210,4 +212,4 @@ public void onQueryInventoryFinished(IabResult result, Inventory inv) { } -} +} \ No newline at end of file diff --git a/plugins/iab/source/IOS/Plugins/iab/iabbinder.cpp b/plugins/iab/source/IOS/Plugins/iab/iabbinder.cpp index 95c634cec..42b9ec720 100644 --- a/plugins/iab/source/IOS/Plugins/iab/iabbinder.cpp +++ b/plugins/iab/source/IOS/Plugins/iab/iabbinder.cpp @@ -10,6 +10,8 @@ #define abs_index(L, i) ((i) > 0 || (i) <= LUA_REGISTRYINDEX ? (i) : lua_gettop(L) + (i) + 1) #endif +static lua_State *L = NULL; + static void luaL_newweaktable(lua_State *L, const char *mode) { lua_newtable(L); // create table for instance list @@ -89,7 +91,7 @@ static char keyWeak = ' '; class IAB : public GEventDispatcherProxy { public: - IAB(lua_State *L, const char *iab) : L(L) + IAB(lua_State *L, const char *iab) { iab_ = strdup(iab); giab_initialize(iab); @@ -278,7 +280,6 @@ class IAB : public GEventDispatcherProxy } private: - lua_State *L; const char* iab_; }; @@ -479,6 +480,7 @@ static int loader(lua_State *L) static void g_initializePlugin(lua_State *L) { + ::L = L; lua_getglobal(L, "package"); lua_getfield(L, -1, "preload"); @@ -491,6 +493,7 @@ static void g_initializePlugin(lua_State *L) static void g_deinitializePlugin(lua_State *L) { + ::L = NULL; giab_cleanup(); } diff --git a/plugins/microphone/source/Android/jni/gmicrophonebinder.cpp b/plugins/microphone/source/Android/jni/gmicrophonebinder.cpp index f9f18da67..cb24f0c1f 100644 --- a/plugins/microphone/source/Android/jni/gmicrophonebinder.cpp +++ b/plugins/microphone/source/Android/jni/gmicrophonebinder.cpp @@ -13,6 +13,8 @@ microphone:stop() */ +static lua_State *L = NULL; + namespace { static const char* DATA_AVAILABLE = "dataAvailable"; @@ -52,7 +54,7 @@ static char keyWeak = ' '; class GMicrophone : public GEventDispatcherProxy { public: - GMicrophone(lua_State *L, const char *deviceName, int numChannels, int sampleRate, int bitsPerSample, gmicrophone_Error *error) : L(L) + GMicrophone(lua_State *L, const char *deviceName, int numChannels, int sampleRate, int bitsPerSample, gmicrophone_Error *error) { if (++instanceCount_ == 1) gmicrophone_Init(); @@ -214,7 +216,6 @@ class GMicrophone : public GEventDispatcherProxy } private: - lua_State *L; g_id microphone_; int numChannels_, sampleRate_, bitsPerSample_; g_id outputFile_; @@ -394,6 +395,7 @@ static int loader(lua_State* L) static void g_initializePlugin(lua_State *L) { + ::L = L; lua_getglobal(L, "package"); lua_getfield(L, -1, "preload"); @@ -405,6 +407,7 @@ static void g_initializePlugin(lua_State *L) static void g_deinitializePlugin(lua_State *L) { + ::L = NULL; } REGISTER_PLUGIN("Microphone", "1.0") diff --git a/plugins/microphone/source/gmicrophonebinder.cpp b/plugins/microphone/source/gmicrophonebinder.cpp index f9f18da67..083723360 100644 --- a/plugins/microphone/source/gmicrophonebinder.cpp +++ b/plugins/microphone/source/gmicrophonebinder.cpp @@ -13,6 +13,8 @@ microphone:stop() */ +static lua_State *L = NULL; + namespace { static const char* DATA_AVAILABLE = "dataAvailable"; @@ -52,7 +54,7 @@ static char keyWeak = ' '; class GMicrophone : public GEventDispatcherProxy { public: - GMicrophone(lua_State *L, const char *deviceName, int numChannels, int sampleRate, int bitsPerSample, gmicrophone_Error *error) : L(L) + GMicrophone(lua_State *L, const char *deviceName, int numChannels, int sampleRate, int bitsPerSample, gmicrophone_Error *error) { if (++instanceCount_ == 1) gmicrophone_Init(); @@ -214,7 +216,6 @@ class GMicrophone : public GEventDispatcherProxy } private: - lua_State *L; g_id microphone_; int numChannels_, sampleRate_, bitsPerSample_; g_id outputFile_; @@ -394,6 +395,7 @@ static int loader(lua_State* L) static void g_initializePlugin(lua_State *L) { + ::L = L; lua_getglobal(L, "package"); lua_getfield(L, -1, "preload"); @@ -405,6 +407,7 @@ static void g_initializePlugin(lua_State *L) static void g_deinitializePlugin(lua_State *L) { + ::L = NULL; } REGISTER_PLUGIN("Microphone", "1.0") diff --git a/plugins/microphone/source/iOS/gmicrophonebinder.cpp b/plugins/microphone/source/iOS/gmicrophonebinder.cpp index f9f18da67..cb24f0c1f 100644 --- a/plugins/microphone/source/iOS/gmicrophonebinder.cpp +++ b/plugins/microphone/source/iOS/gmicrophonebinder.cpp @@ -13,6 +13,8 @@ microphone:stop() */ +static lua_State *L = NULL; + namespace { static const char* DATA_AVAILABLE = "dataAvailable"; @@ -52,7 +54,7 @@ static char keyWeak = ' '; class GMicrophone : public GEventDispatcherProxy { public: - GMicrophone(lua_State *L, const char *deviceName, int numChannels, int sampleRate, int bitsPerSample, gmicrophone_Error *error) : L(L) + GMicrophone(lua_State *L, const char *deviceName, int numChannels, int sampleRate, int bitsPerSample, gmicrophone_Error *error) { if (++instanceCount_ == 1) gmicrophone_Init(); @@ -214,7 +216,6 @@ class GMicrophone : public GEventDispatcherProxy } private: - lua_State *L; g_id microphone_; int numChannels_, sampleRate_, bitsPerSample_; g_id outputFile_; @@ -394,6 +395,7 @@ static int loader(lua_State* L) static void g_initializePlugin(lua_State *L) { + ::L = L; lua_getglobal(L, "package"); lua_getfield(L, -1, "preload"); @@ -405,6 +407,7 @@ static void g_initializePlugin(lua_State *L) static void g_deinitializePlugin(lua_State *L) { + ::L = NULL; } REGISTER_PLUGIN("Microphone", "1.0")