Răsfoiți Sursa

Support to disable platform impl. allowing integration into apps that can write their own.

seanpaultaylor 11 ani în urmă
părinte
comite
4518183e5a

+ 2 - 0
gameplay/gameplay.pro

@@ -10,6 +10,8 @@ CONFIG += staticlib
 CONFIG += c++11
 CONFIG -= qt
 
+#DEFINES += GP_NO_PLATFORM
+
 SOURCES += src/AbsoluteLayout.cpp \
     src/AIAgent.cpp \
     src/AIController.cpp \

+ 2 - 0
gameplay/src/PlatformAndroid.cpp

@@ -1,3 +1,4 @@
+#ifndef GP_NO_PLATFORM
 #ifdef __ANDROID__
 
 #include "Base.h"
@@ -1787,4 +1788,5 @@ JNIEXPORT void JNICALL Java_org_gameplay3d_GamePlayNativeActivity_screenOrientat
 }
 
 #endif
+#endif
 

+ 2 - 0
gameplay/src/PlatformLinux.cpp

@@ -1,3 +1,4 @@
+#ifndef GP_NO_PLATFORM
 #ifdef __linux__
 
 #include "Base.h"
@@ -1745,3 +1746,4 @@ std::string Platform::displayFileDialog(size_t mode, const char* title, const ch
 }
 
 #endif
+#endif

+ 2 - 0
gameplay/src/PlatformMacOSX.mm

@@ -1,3 +1,4 @@
+#ifndef GP_NO_PLATFORM
 #ifdef __APPLE__
 
 #include "Base.h"
@@ -2391,3 +2392,4 @@ std::string Platform::displayFileDialog(size_t mode, const char* title, const ch
 }
 
 #endif
+#endif

+ 2 - 0
gameplay/src/PlatformWindows.cpp

@@ -1,3 +1,4 @@
+#ifndef GP_NO_PLATFORM
 #ifdef WIN32
 
 #include "Base.h"
@@ -1437,3 +1438,4 @@ std::string Platform::displayFileDialog(size_t mode, const char* title, const ch
 }
 
 #endif
+#endif

+ 2 - 0
gameplay/src/PlatformiOS.mm

@@ -1,3 +1,4 @@
+#ifndef GP_NO_PLATFORM
 #ifdef __APPLE__
 
 #include "Base.h"
@@ -1730,3 +1731,4 @@ std::string Platform::displayFileDialog(size_t mode, const char* title, const ch
 }
 
 #endif
+#endif

+ 2 - 2
gameplay/src/ScriptController.cpp

@@ -2,7 +2,7 @@
 #include "FileSystem.h"
 #include "ScriptController.h"
 
-#ifndef NO_LUA_BINDINGS
+#ifndef GP_NO_LUA_BINDINGS
 #include "lua/lua_all_bindings.h"
 #endif
 
@@ -716,7 +716,7 @@ void ScriptController::initialize()
         GP_ERROR("Failed to initialize Lua scripting engine.");
     luaL_openlibs(_lua);
 
-#ifndef NO_LUA_BINDINGS
+#ifndef GP_NO_LUA_BINDINGS
     lua_RegisterAllBindings();
     ScriptUtil::registerFunction("convert", ScriptController::convert);
 #endif

+ 2 - 0
gameplay/src/gameplay-main-android.cpp

@@ -1,3 +1,4 @@
+#ifndef GP_NO_PLATFORM
 #ifdef __ANDROID__
 
 #include <android_native_app_glue.h>
@@ -29,3 +30,4 @@ void android_main(struct android_app* state)
 }
 
 #endif
+#endif

+ 2 - 0
gameplay/src/gameplay-main-ios.mm

@@ -1,3 +1,4 @@
+#ifndef GP_NO_PLATFORM
 #ifdef __APPLE__
 
 #import <Foundation/Foundation.h>
@@ -26,3 +27,4 @@ int main(int argc, char** argv)
 }
 
 #endif
+#endif

+ 2 - 0
gameplay/src/gameplay-main-linux.cpp

@@ -1,3 +1,4 @@
+#ifndef GP_NO_PLATFORM
 #ifdef __linux__
 
 #include "gameplay.h"
@@ -23,3 +24,4 @@ int main(int argc, char** argv)
 }
 
 #endif
+#endif

+ 2 - 0
gameplay/src/gameplay-main-macosx.mm

@@ -1,3 +1,4 @@
+#ifndef GP_NO_PLATFORM
 #ifdef __APPLE__
 
 #import <Foundation/Foundation.h>
@@ -25,4 +26,5 @@ int main(int argc, char** argv)
     return result;
 }
 
+#endif
 #endif

+ 2 - 0
gameplay/src/gameplay-main-windows.cpp

@@ -1,3 +1,4 @@
+#ifndef GP_NO_PLATFORM
 #ifdef WIN32
 
 #include "gameplay.h"
@@ -23,3 +24,4 @@ extern "C" int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LP
 }
 
 #endif
+#endif