diff --git a/project/jni/application/openarena/AndroidAppSettings.cfg b/project/jni/application/openarena/AndroidAppSettings.cfg index 042384d3e..89d290692 100644 --- a/project/jni/application/openarena/AndroidAppSettings.cfg +++ b/project/jni/application/openarena/AndroidAppSettings.cfg @@ -13,12 +13,14 @@ AppVersionCode=08838 AppVersionName="0.8.8.38" # Specify path to download application data in zip archive in the form 'Description|URL|MirrorURL^Description2|URL2|MirrorURL2^...' -# If you'll start Description with '!' symbol it will be enabled by default, other downloads should be selected by user from startup config menu +# If you'll start Description with '!' symbol it will be enabled by default, '!!' will also hide the entry from the menu, so it cannot be disabled # If the URL in in the form ':dir/file.dat:http://URL/' it will be downloaded as binary BLOB to the application dir and not unzipped -# If the URL does not contain 'http://' it is treated as file from 'project/jni/application/src/AndroidData' dir - -# these files are put inside .apk package by build system -# You can specify Google Play expansion files in the form 'obb:main.12345' or 'obb:patch.12345' where 12345 is the app version, first associated with the file -AppDataDownloadUrl="!Game data|obb:main.8828|http://sourceforge.net/projects/libsdl-android/files/OpenArena/data-0.8.8.28.zip/download^!Game logic|:baseoa/pak7-android.pk3:pak7-android.pk3" +# If the URL does not contain 'http://' or 'https://', it is treated as file from 'project/jni/application/src/AndroidData' dir - +# these files are put inside .apk package by the build system +# You can specify Google Play expansion files in the form 'obb:main.12345' or 'obb:patch.12345' where 12345 is the app version for obb file +# You can use .zip.xz archives for better compression, but you need to add 'lzma' to CompiledLibraries +# Generate .zip.xz files like this: zip -0 -r data.zip your-data/* ; xz -8 data.zip +AppDataDownloadUrl="!Game data|obb:main.8828|https://sourceforge.net/projects/libsdl-android/files/OpenArena/data-0.8.8.28.zip/download^!Game logic|:baseoa/pak7-android.pk3:pak7-android.pk3" # Reset SDL config when updating application to the new version (y) / (n) ResetSdlConfigForThisVersion=n @@ -46,12 +48,16 @@ NeedDepthBuffer=y # Enable OpenGL stencil buffer (needed only for 3-d applications, small speed decrease) (y) or (n) NeedStencilBuffer=n -# Try to use GLES 2.x context - will revert to GLES 1.X if unsupported by device +# Use GLES 2.x context # you need this option only if you're developing 3-d app (y) or (n) NeedGles2=n -# Use glshim library for provide OpenGL 1.x functionality to OpenGL ES accelerated cards (y) or (n) -UseGlshim= +# Use GLES 3.x context +# you need this option only if you're developing 3-d app (y) or (n) +NeedGles3= + +# Use gl4es library for provide OpenGL 1.x functionality to OpenGL ES accelerated cards (y) or (n) +UseGl4es= # Application uses software video buffer - you're calling SDL_SetVideoMode() without SDL_HWSURFACE and without SDL_OPENGL, # this will allow small speed optimization. Enable this even when you're using SDL_HWSURFACE. (y) or (n) @@ -173,15 +179,21 @@ AppUsesMultitouch=y # This option will add additional permission to Android manifest (y)/(n) AppRecordsAudio=y -# Application needs to access SD card. Always disable it, unless you want to access user photos and downloads. (y) / (n) +# Application needs read/write access SD card. Always disable it, unless you want to access user photos and downloads. (y) / (n) AccessSdCard=y +# Application needs to read it's own OBB file. Enable this if you are using Play Store expansion files. (y) / (n) +ReadObbFile= + # Application needs Internet access. If you disable it, you'll have to bundle all your data files inside .apk (y) / (n) AccessInternet=y # Immersive mode - Android will hide on-screen Home/Back keys. Looks bad if you invoke Android keyboard. (y) / (n) ImmersiveMode= +# Hide Android system mouse cursor image when USB mouse is attached (y) or (n) - the app must draw it's own mouse cursor +HideSystemMousePointer= + # Application implements Android-specific routines to put to background, and will not draw anything to screen # between SDL_ACTIVEEVENT lost / gained notifications - you should check for them # rigth after SDL_Flip(), if (n) then SDL_Flip() will block till app in background (y) or (n) @@ -218,34 +230,50 @@ RedefinedKeysScreenKbNames="Change_weapon Sniper_view Show_scores Quick_rotate F TouchscreenKeysTheme=2 # Redefine gamepad keys to SDL keysyms, button order is: -# A B X Y L1 R1 L2 R2 LThumb RThumb +# A B X Y L1 R1 L2 R2 LThumb RThumb Start Select Up Down Left Right LThumbUp LThumbDown LThumbLeft LThumbRight RThumbUp RThumbDown RThumbLeft RThumbRight RedefinedKeysGamepad="SLASH BACKSPACE TAB END SPACE LCTRL SPACE LCTRL V E" +# Redefine keys for the second gamepad, same as the first gamepad if not set: +RedefinedKeysSecondGamepad="" + +# Redefine keys for the third gamepad, same as the first gamepad if not set: +RedefinedKeysThirdGamepad="" + +# Redefine keys for the fourth gamepad, same as the first gamepad if not set: +RedefinedKeysFourthGamepad="" + # How long to show startup menu button, in msec, 0 to disable startup menu StartupMenuButtonTimeout=3000 # Menu items to hide from startup menu, available menu items: -# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.CommandlineConfig SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout SettingsMenuKeyboard.ScreenKeyboardAdvanced +# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.StorageAccessConfig SettingsMenuMisc.CommandlineConfig SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout SettingsMenuKeyboard.ScreenKeyboardAdvanced HiddenMenuOptions='SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMouse.DisplaySizeConfig' # Menu items to show at startup - this is Java code snippet, leave empty for default # new SettingsMenuMisc.ShowReadme(), (AppUsesMouse \&\& \! ForceRelativeMouseMode \? new SettingsMenuMouse.DisplaySizeConfig(true) : new SettingsMenu.DummyMenu()), new SettingsMenuMisc.OptionalDownloadConfig(true), new SettingsMenuMisc.GyroscopeCalibration() # Available menu items: -# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.CommandlineConfig SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout SettingsMenuKeyboard.ScreenKeyboardAdvanced +# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.StorageAccessConfig SettingsMenuMisc.CommandlineConfig SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout SettingsMenuKeyboard.ScreenKeyboardAdvanced FirstStartMenuOptions='' # Minimum amount of RAM application requires, in Mb, SDL will print warning to user if it's lower AppMinimumRAM=300 # GCC version, or 'clang' for CLANG -NDK_TOOLCHAIN_VERSION=clang +NDK_TOOLCHAIN_VERSION= + +# Android platform version. +# android-16 = Android 4.1, the earliest supported version in NDK r18. +# android-18 = Android 4.3, the first version supporting GLES3. +# android-21 = Android 5.1, the first version with SO_REUSEPORT defined. +APP_PLATFORM= # Specify architectures to compile, 'all' or 'y' to compile for all architectures. -# Available architectures: armeabi armeabi-v7a x86 mips arm64-v8a -MultiABI='armeabi-v7a x86 arm64-v8a' +# Available architectures: armeabi-v7a arm64-v8a x86 x86_64 +MultiABI='armeabi-v7a x86 arm64-v8a x86_64' +#MultiABI='arm64-v8a' # Optional shared libraries to compile - removing some of them will save space -# MP3 support by libMAD is encumbered by patents and libMAD is GPL-ed +# MP3 patents are expired, but libmad license is GPL, not LGPL # Available libraries: mad (GPL-ed!) sdl_mixer sdl_image sdl_ttf sdl_net sdl_blitpool sdl_gfx sdl_sound intl xml2 lua jpeg png ogg flac tremor vorbis freetype xerces curl theora fluidsynth lzma lzo2 mikmod openal timidity zzip bzip2 yaml-cpp python boost_date_time boost_filesystem boost_iostreams boost_program_options boost_regex boost_signals boost_system boost_thread glu avcodec avdevice avfilter avformat avresample avutil swscale swresample bzip2 CompiledLibraries="sdl_mixer sdl_image freetype vorbis ogg openal crypto ssl curl" @@ -253,7 +281,10 @@ CompiledLibraries="sdl_mixer sdl_image freetype vorbis ogg openal crypto ssl cur CustomBuildScript=y # Aditional CFLAGS for application -AppCflags='-O2 -finline-functions' +AppCflags='' + +# Aditional C++-specific compiler flags for application, added after AppCflags +AppCppflags='' # Additional LDFLAGS for application AppLdflags='' @@ -286,3 +317,6 @@ AdmobBannerSize=BANNER # Google Play Game Services application ID, required for cloud saves to work GooglePlayGameServicesId= +# The app will open files with following extension, file path will be added to commandline params +AppOpenFileExtension='' + diff --git a/project/jni/application/openarena/AndroidBuild.sh b/project/jni/application/openarena/AndroidBuild.sh index adf998238..1a74a190b 100755 --- a/project/jni/application/openarena/AndroidBuild.sh +++ b/project/jni/application/openarena/AndroidBuild.sh @@ -3,26 +3,17 @@ LOCAL_PATH=`dirname $0` LOCAL_PATH=`cd $LOCAL_PATH && pwd` -if [ "$1" = "armeabi-v7a" ]; then ( - mkdir -p AndroidData - make -j8 -C vm BUILD_MISSIONPACK=0 || exit 1 - cd vm/build/release-linux-`uname -m`/baseq3 - #rm -f ../../../../AndroidData/binaries.zip ../../../../AndroidData/pak7-android.pk3 - zip -r ../../../../AndroidData/pak7-android.pk3 vm - cd ../../../android - zip -r ../../AndroidData/pak7-android.pk3 * - ln -sf ../engine/misc/quake3-tango.png ../../AndroidData/logo.png - exit 0 -) || exit 1 -fi - #env NO_SHARED_LIBS=1 V=1 ../setEnvironment-$1.sh make -C vm -j8 PLATFORM=android ARCH=$1 USE_LOCAL_HEADERS=0 BUILD_MISSIONPACK=0 || exit 1 # Do not generate shared game logic libs - QVM files are used instead # ../setEnvironment-armeabi.sh sh -c "cd vm/build/release-android-$1/baseq3 && \$STRIP --strip-unneeded *.so && zip ../../../../AndroidData/binaries.zip *.so" -env PATH=`pwd`/..:$PATH \ -../setEnvironment-$1.sh make -j8 -C engine release \ +mkdir -p AndroidData/lib/$1 +cp -f upnpc-$1 AndroidData/lib/$1/libupnpc.so + +env PATH=`pwd`/..:$PATH CFLAGS="-Oz -flto=thin" \ +LDFLAGS="-L$LOCAL_PATH/../../../obj/local/$1 -Oz -flto=thin -lGLESv1_CM" \ +../setEnvironment-$1.sh make -j8 -C engine release V=1 \ PLATFORM=android ARCH=$1 USE_GLES=1 USE_LOCAL_HEADERS=0 BUILD_CLIENT_SMP=0 \ USE_OPENAL=1 USE_OPENAL_DLOPEN=0 USE_VOIP=1 USE_CURL=1 USE_CURL_DLOPEN=0 USE_CODEC_VORBIS=1 USE_MUMBLE=0 USE_FREETYPE=1 \ USE_RENDERER_DLOPEN=0 USE_INTERNAL_ZLIB=0 USE_INTERNAL_JPEG=1 BUILD_RENDERER_REND2=0 C_ONLY=1 && \ diff --git a/project/jni/application/openarena/AndroidData/binaries-armeabi-v7a.zip b/project/jni/application/openarena/AndroidData/binaries-armeabi-v7a.zip deleted file mode 100644 index 99a6d44e1..000000000 Binary files a/project/jni/application/openarena/AndroidData/binaries-armeabi-v7a.zip and /dev/null differ diff --git a/project/jni/application/openarena/AndroidData/binaries-x86.zip b/project/jni/application/openarena/AndroidData/binaries-x86.zip deleted file mode 100644 index f57354718..000000000 Binary files a/project/jni/application/openarena/AndroidData/binaries-x86.zip and /dev/null differ diff --git a/project/jni/application/openarena/BuildVM.sh b/project/jni/application/openarena/BuildVM.sh new file mode 100755 index 000000000..a2bcd3d97 --- /dev/null +++ b/project/jni/application/openarena/BuildVM.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +LOCAL_PATH=`dirname $0` +LOCAL_PATH=`cd $LOCAL_PATH && pwd` + +mkdir -p AndroidData +make -j8 -C vm BUILD_MISSIONPACK=0 || exit 1 +cd vm/build/release-linux-`uname -m`/baseq3 +#rm -f ../../../../AndroidData/binaries.zip ../../../../AndroidData/pak7-android.pk3 +zip -r ../../../../AndroidData/pak7-android.pk3 vm +cd ../../../android +zip -r ../../AndroidData/pak7-android.pk3 * +ln -sf ../engine/misc/quake3-tango.png ../../AndroidData/logo.png diff --git a/project/jni/application/openarena/GamingEventCountdown.sh b/project/jni/application/openarena/GamingEventCountdown.sh deleted file mode 100755 index c891f7b26..000000000 --- a/project/jni/application/openarena/GamingEventCountdown.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/sh - -# Date format is free-form -DATE="This Friday 9PM +EST" -# Event message -MESSAGE="^2Friday ^1Frag ^2Evening ^7on ^3CyberXZT server\n^6" -# Message when no event is happening -NO_EVENT_MESSAGE="To change map, press ^3Back ^7-> ^3Vote" -# How long event will happen, in hours -DURATION=2 -# When to start announcing event, in days -ANNOUNCE_START=3 - -OUT="$1" -if [ -z "$OUT" ]; then - OUT=motd.cfg -fi - -S1=`date +%s -d "$DATE"` -S2=`date +%s -d "-20 seconds"` -SECONDS=`expr $S1 - $S2` -MINUTES=`expr $SECONDS / 60` -HOURS=`expr $MINUTES / 60` -DAYS=`expr $HOURS / 24` -MINUTES=`expr $MINUTES % 60` -HOURS=`expr $HOURS % 24` - -TXT="" -if [ $SECONDS -lt 0 ]; then - if [ $SECONDS -gt `expr -$DURATION '*' 3600` ]; then - TXT="come join right now!" - fi -else - if [ "$MINUTES" '!=' 0 ]; then - TXT="$MINUTES minutes" - fi - if [ "$HOURS" '!=' 0 ]; then - if [ "$HOURS" '=' 1 ]; then - TXT="$HOURS hour $TXT" - else - TXT="$HOURS hours $TXT" - fi - fi - if [ "$DAYS" '!=' 0 ]; then - if [ "$DAYS" '=' 1 ]; then - TXT="tomorrow $TXT" - else - TXT="in $DAYS days $TXT" - fi - else - TXT="in $TXT" - fi -fi - -if [ $SECONDS -gt `expr $ANNOUNCE_START '*' 3600 '*' 24` ]; then - TXT="" # Do not announce event if it's too far in the future -fi - -if [ -n "$TXT" ]; then - echo "$MESSAGE$TXT" > "$OUT" -else - echo "$NO_EVENT_MESSAGE" > "$OUT" -fi diff --git a/project/jni/application/openarena/engine b/project/jni/application/openarena/engine index 597f84219..00a701570 160000 --- a/project/jni/application/openarena/engine +++ b/project/jni/application/openarena/engine @@ -1 +1 @@ -Subproject commit 597f84219580bb77602835070d9b06306c3a3bff +Subproject commit 00a701570223549013ad88c3d65cce5becf96a72 diff --git a/project/jni/application/openarena/project.patch b/project/jni/application/openarena/project.patch index 9fd7f545d..f52cd188a 100644 --- a/project/jni/application/openarena/project.patch +++ b/project/jni/application/openarena/project.patch @@ -10,3 +10,11 @@ index 7956ad1..37b9de5 100644 +@@ -47,7 +47,6 @@ + + + +- + + + diff --git a/project/jni/application/openarena/readme.txt b/project/jni/application/openarena/readme.txt index d478cfef9..e8d3b7adc 100644 --- a/project/jni/application/openarena/readme.txt +++ b/project/jni/application/openarena/readme.txt @@ -1,12 +1,12 @@ Quick compilation guide for Debian/Ubuntu (Windows is not supported, MacOsX should be okay though): Download SDL Git repo from https://github.com/pelya/commandergenius, -install latest Android SDK, latest Android NDK, and "ant" tool (sudo apt-get install ant), -then launch commands: +install latest Android SDK, latest Android NDK, then launch commands: + git submodule update --init project/jni/application/openarena/engine git submodule update --init project/jni/application/openarena/vm - rm project/jni/application/src # ignore the error - ln -s openarena project/jni/application/src - ./changeAppSettings.sh -a - android update project -p project - ./build.sh + cd project/jni/application/openarena + ./BuildVM.sh + cd ../../../.. + ./build.sh openarena + That should do it. diff --git a/project/jni/application/openarena/upnpc-arm64-v8a b/project/jni/application/openarena/upnpc-arm64-v8a new file mode 100644 index 000000000..3d580792e Binary files /dev/null and b/project/jni/application/openarena/upnpc-arm64-v8a differ diff --git a/project/jni/application/openarena/upnpc-armeabi-v7a b/project/jni/application/openarena/upnpc-armeabi-v7a new file mode 100644 index 000000000..3d580792e Binary files /dev/null and b/project/jni/application/openarena/upnpc-armeabi-v7a differ diff --git a/project/jni/application/openarena/upnpc-x86 b/project/jni/application/openarena/upnpc-x86 new file mode 100644 index 000000000..71c915aba Binary files /dev/null and b/project/jni/application/openarena/upnpc-x86 differ diff --git a/project/jni/application/openarena/upnpc-x86_64 b/project/jni/application/openarena/upnpc-x86_64 new file mode 100644 index 000000000..71c915aba Binary files /dev/null and b/project/jni/application/openarena/upnpc-x86_64 differ diff --git a/project/jni/application/openarena/vm b/project/jni/application/openarena/vm index 20040462f..3cd271675 160000 --- a/project/jni/application/openarena/vm +++ b/project/jni/application/openarena/vm @@ -1 +1 @@ -Subproject commit 20040462faf0a78ebd4b813d35127416686e65d6 +Subproject commit 3cd2716756a134904c72d177d020e567e657732b