From e98f71ccfd03c59368773904d1b38f121f82c3e0 Mon Sep 17 00:00:00 2001 From: Grant Bagwell Date: Thu, 11 Mar 2021 18:37:57 +0100 Subject: [PATCH] Added support for OGG files Added support for OGG files via libvorbis. Must have this in a new SupportLibs folder in JNI --- Projects/Android/jni/Android.mk | 7 +++++-- Projects/Android/jni/Application.mk | 8 +++++++- Projects/Android/jni/darkplaces/quakedef.h | 1 + 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Projects/Android/jni/Android.mk b/Projects/Android/jni/Android.mk index 963e848..a8c8a16 100644 --- a/Projects/Android/jni/Android.mk +++ b/Projects/Android/jni/Android.mk @@ -10,9 +10,11 @@ LOCAL_CFLAGS := -std=c99 LOCAL_MODULE := quakequest LOCAL_LDLIBS := -llog -landroid -lGLESv3 -lEGL # include default libraries -LOCAL_C_INCLUDES := ../QuakeQuestSrc/ ../darkplaces/ +LOCAL_C_INCLUDES := ../QuakeQuestSrc/ \ +../darkplaces/ \ +$(SUPPORT_LIBS)/liboggvorbis/include -LOCAL_SHARED_LIBRARIES := vrapi +LOCAL_SHARED_LIBRARIES := vrapi libvorbis libogg libvorbis-jni SRC_SND_COMMON := \ darkplaces/snd_main.c \ @@ -131,5 +133,6 @@ LOCAL_SRC_FILES := \ $(SRC_COMMON) include $(BUILD_SHARED_LIBRARY) +include $(SUPPORT_LIBS)/liboggvorbis/Android.mk $(call import-module,VrApi/Projects/AndroidPrebuilt/jni) \ No newline at end of file diff --git a/Projects/Android/jni/Application.mk b/Projects/Android/jni/Application.mk index 28cd441..0fd7759 100644 --- a/Projects/Android/jni/Application.mk +++ b/Projects/Android/jni/Application.mk @@ -2,10 +2,16 @@ # one. I use that to obtain the Application.mk dir then import the root # Application.mk. ROOT_DIR := $(dir $(lastword $(MAKEFILE_LIST)))../../../../.. +NDK_MODULE_PATH := $(ROOT_DIR) APP_PLATFORM := android-24 -NDK_MODULE_PATH := $(ROOT_DIR) +APP_CFLAGS += -Wl,--no-undefined + +APPLICATIONMK_PATH = $(call my-dir) + +TOP_DIR := $(APPLICATIONMK_PATH) +SUPPORT_LIBS := $(APPLICATIONMK_PATH)/SupportLibs APP_STL := c++_shared diff --git a/Projects/Android/jni/darkplaces/quakedef.h b/Projects/Android/jni/darkplaces/quakedef.h index 2962cb4..15ad348 100644 --- a/Projects/Android/jni/darkplaces/quakedef.h +++ b/Projects/Android/jni/darkplaces/quakedef.h @@ -420,6 +420,7 @@ extern cvar_t sessionid; # define DP_OS_NAME "Android" # define DP_OS_STR "android" # define USE_GLES2 1 +# define LINK_TO_LIBVORBIS 1 #if defined(__GNUC__) # if defined(__i386__)