diff --git a/.gitignore b/.gitignore index 6f310b42..9e679227 100644 --- a/.gitignore +++ b/.gitignore @@ -3,5 +3,12 @@ obj bin gen +jni/src/HLSDK/halflife +jni/src/NanoGL/nanogl +jni/src/SDL2/SDL-mirrir +jni/src/Xash3D/xash3d +jni/src/XashXT/XashXT +jni/src/MobileTouchControls/MobileTouchControls + local.properties diff --git a/jni/Application.mk b/jni/Application.mk index 4d2374fd..6e6b8393 100644 --- a/jni/Application.mk +++ b/jni/Application.mk @@ -3,7 +3,9 @@ # See CPLUSPLUS-SUPPORT.html in the NDK documentation for more information APP_STL := stlport_static - +CFLAGS_OPT := -O3 -funsafe-math-optimizations -ftree-vectorize -fgraphite-identity -floop-interchange -funsafe-loop-optimizations -finline-limit=1024 +CFLAGS_OPT_ARM := -mthumb -pipe -mfloat-abi=softfp -mfpu=neon -mcpu=cortex-a9 +CFLAGS_OPT_X86 := -msse3 APPLICATIONMK_PATH = $(call my-dir) diff --git a/jni/src/HLSDK/halflife b/jni/src/HLSDK/halflife deleted file mode 160000 index c3b365fe..00000000 --- a/jni/src/HLSDK/halflife +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c3b365fe0831e68199bb39e9f565ca724c7cc430 diff --git a/jni/src/HLSDK/halflife b/jni/src/HLSDK/halflife new file mode 120000 index 00000000..f4ef87ee --- /dev/null +++ b/jni/src/HLSDK/halflife @@ -0,0 +1 @@ +../../../../halflife/ \ No newline at end of file diff --git a/jni/src/MobileTouchControls/Android.mk b/jni/src/MobileTouchControls/Android.mk new file mode 100644 index 00000000..2033758d --- /dev/null +++ b/jni/src/MobileTouchControls/Android.mk @@ -0,0 +1,9 @@ +TOUCHCONTROLS_PATH:= $(call my-dir)/MobileTouchControls + + +include $(TOUCHCONTROLS_PATH)/sigc++/Android.mk +include $(TOUCHCONTROLS_PATH)/TinyXML/Android.mk +include $(TOUCHCONTROLS_PATH)/libpng/Android.mk +include $(TOUCHCONTROLS_PATH)/libzip/Android.mk + +include $(TOUCHCONTROLS_PATH)/Android_TouchControls.mk \ No newline at end of file diff --git a/jni/src/NanoGL/nanogl b/jni/src/NanoGL/nanogl deleted file mode 160000 index 63045ea1..00000000 --- a/jni/src/NanoGL/nanogl +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 63045ea16759232df455140efd8d5ed67986882d diff --git a/jni/src/NanoGL/nanogl b/jni/src/NanoGL/nanogl new file mode 120000 index 00000000..393a797f --- /dev/null +++ b/jni/src/NanoGL/nanogl @@ -0,0 +1 @@ +../../../../nanogl/ \ No newline at end of file diff --git a/jni/src/SDL2 b/jni/src/SDL2 deleted file mode 120000 index 9a5b88cf..00000000 --- a/jni/src/SDL2 +++ /dev/null @@ -1 +0,0 @@ -/home/a1ba/projects/Xash3D/3rdparty/SDL2 \ No newline at end of file diff --git a/jni/src/SDL2/Android.mk b/jni/src/SDL2/Android.mk new file mode 100644 index 00000000..8b6fd24f --- /dev/null +++ b/jni/src/SDL2/Android.mk @@ -0,0 +1,77 @@ +LOCAL_PATH := $(call my-dir)/SDL-mirror + +########################### +# +# SDL shared library +# +########################### + +include $(CLEAR_VARS) + +LOCAL_MODULE := SDL2 + +LOCAL_C_INCLUDES := $(LOCAL_PATH)/include + +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES) + +LOCAL_SRC_FILES := \ + $(subst $(LOCAL_PATH)/,, \ + $(wildcard $(LOCAL_PATH)/src/*.c) \ + $(wildcard $(LOCAL_PATH)/src/audio/*.c) \ + $(wildcard $(LOCAL_PATH)/src/audio/android/*.c) \ + $(wildcard $(LOCAL_PATH)/src/audio/dummy/*.c) \ + $(LOCAL_PATH)/src/atomic/SDL_atomic.c \ + $(LOCAL_PATH)/src/atomic/SDL_spinlock.c.arm \ + $(wildcard $(LOCAL_PATH)/src/core/android/*.c) \ + $(wildcard $(LOCAL_PATH)/src/cpuinfo/*.c) \ + $(wildcard $(LOCAL_PATH)/src/dynapi/*.c) \ + $(wildcard $(LOCAL_PATH)/src/events/*.c) \ + $(wildcard $(LOCAL_PATH)/src/file/*.c) \ + $(wildcard $(LOCAL_PATH)/src/haptic/*.c) \ + $(wildcard $(LOCAL_PATH)/src/haptic/dummy/*.c) \ + $(wildcard $(LOCAL_PATH)/src/joystick/*.c) \ + $(wildcard $(LOCAL_PATH)/src/joystick/android/*.c) \ + $(wildcard $(LOCAL_PATH)/src/loadso/dlopen/*.c) \ + $(wildcard $(LOCAL_PATH)/src/power/*.c) \ + $(wildcard $(LOCAL_PATH)/src/power/android/*.c) \ + $(wildcard $(LOCAL_PATH)/src/filesystem/android/*.c) \ + $(wildcard $(LOCAL_PATH)/src/render/*.c) \ + $(wildcard $(LOCAL_PATH)/src/render/*/*.c) \ + $(wildcard $(LOCAL_PATH)/src/stdlib/*.c) \ + $(wildcard $(LOCAL_PATH)/src/thread/*.c) \ + $(wildcard $(LOCAL_PATH)/src/thread/pthread/*.c) \ + $(wildcard $(LOCAL_PATH)/src/timer/*.c) \ + $(wildcard $(LOCAL_PATH)/src/timer/unix/*.c) \ + $(wildcard $(LOCAL_PATH)/src/video/*.c) \ + $(wildcard $(LOCAL_PATH)/src/video/android/*.c) \ + $(wildcard $(LOCAL_PATH)/src/test/*.c)) + +LOCAL_CFLAGS += $(CFLAGS_OPT) +ifeq ($(TARGET_ARCH),arm) +LOCAL_CFLAGS += $(CFLAGS_OPT_ARM) +endif +ifeq ($(TARGET_ARCH),x86) +LOCAL_CFLAGS += $(CFLAGS_OPT_X86) +endif + +LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES +LOCAL_LDLIBS := -ldl -lGLESv1_CM -lGLESv2 -llog -landroid + +include $(BUILD_SHARED_LIBRARY) + +########################### +# +# SDL static library +# +########################### + +LOCAL_MODULE := SDL2_static + +LOCAL_MODULE_FILENAME := libSDL2 + +LOCAL_SRC_FILES += $(subst $(LOCAL_PATH)/,,$(LOCAL_PATH)/src/main/android/SDL_android_main.c) + +LOCAL_LDLIBS := +LOCAL_EXPORT_LDLIBS := -Wl,--undefined=Java_org_libsdl_app_SDLActivity_nativeInit -ldl -lGLESv1_CM -lGLESv2 -llog -landroid + +include $(BUILD_STATIC_LIBRARY) diff --git a/jni/src/SDL2/SDL-mirror b/jni/src/SDL2/SDL-mirror new file mode 120000 index 00000000..01d79510 --- /dev/null +++ b/jni/src/SDL2/SDL-mirror @@ -0,0 +1 @@ +../../../../SDL2/ \ No newline at end of file diff --git a/jni/src/SDL2_image b/jni/src/SDL2_image deleted file mode 120000 index 665ba8e0..00000000 --- a/jni/src/SDL2_image +++ /dev/null @@ -1 +0,0 @@ -/home/a1ba/projects/Xash3D/3rdparty/SDL2_image \ No newline at end of file diff --git a/jni/src/Xash3D/xash3d b/jni/src/Xash3D/xash3d deleted file mode 160000 index 8e493fcd..00000000 --- a/jni/src/Xash3D/xash3d +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8e493fcd57ae8f2ab183a5e1d69580f0aa679740 diff --git a/jni/src/Xash3D/xash3d b/jni/src/Xash3D/xash3d new file mode 120000 index 00000000..02fea2ca --- /dev/null +++ b/jni/src/Xash3D/xash3d @@ -0,0 +1 @@ +../../../../xash3d/ \ No newline at end of file diff --git a/jni/src/XashXT/XashXT b/jni/src/XashXT/XashXT deleted file mode 160000 index 222d4845..00000000 --- a/jni/src/XashXT/XashXT +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 222d4845a6b0cf8926775bcf3c207ef0d31eb53b diff --git a/jni/src/XashXT/XashXT b/jni/src/XashXT/XashXT new file mode 120000 index 00000000..97365f9c --- /dev/null +++ b/jni/src/XashXT/XashXT @@ -0,0 +1 @@ +../../../../XashXT/ \ No newline at end of file