From 9e5cba8aab1388d1c2b8941a4d840db4237041bd Mon Sep 17 00:00:00 2001 From: pelya Date: Thu, 2 Jan 2014 01:17:03 +0200 Subject: [PATCH] Updated C-Dogs --- project/jni/application/android_debug.h | 1 + .../application/c-dogs/AndroidAppSettings.cfg | 84 ++++++++++++------- .../jni/application/c-dogs/AndroidPreBuild.sh | 2 + project/jni/application/c-dogs/android.diff | 13 +++ project/jni/application/c-dogs/src | 2 +- 5 files changed, 70 insertions(+), 32 deletions(-) diff --git a/project/jni/application/android_debug.h b/project/jni/application/android_debug.h index 575da41fb..6b535fb66 100644 --- a/project/jni/application/android_debug.h +++ b/project/jni/application/android_debug.h @@ -1,6 +1,7 @@ #ifndef __ANDROID_DEBUG_H__ #define __ANDROID_DEBUG_H__ +#include #include #ifdef __cplusplus diff --git a/project/jni/application/c-dogs/AndroidAppSettings.cfg b/project/jni/application/c-dogs/AndroidAppSettings.cfg index d8df41994..cccb72ec6 100644 --- a/project/jni/application/c-dogs/AndroidAppSettings.cfg +++ b/project/jni/application/c-dogs/AndroidAppSettings.cfg @@ -1,21 +1,16 @@ # The application settings for Android libSDL port -AppSettingVersion=19 - -# libSDL version to use (1.2 or 1.3, specify 1.3 for SDL2) -LibSdlVersion=1.2 - # Specify application name (e.x. My Application) AppName="C-Dogs" # Specify reversed site name of application (e.x. com.mysite.myapp) AppFullName=cxong.cdogs -# Specify screen orientation: (v)ertical/(p)ortrait or (h)orizontal/(l)andscape -ScreenOrientation=h +# Application version code (integer) +AppVersionCode=101 -# Do not allow device to sleep when the application is in foreground, set this for video players or apps which use accelerometer -InhibitSuspend=n +# Application user-visible version name (string) +AppVersionName="1.01" # 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 @@ -25,6 +20,25 @@ InhibitSuspend=n # Also please avoid 'https://' URLs, many Android devices do not have trust certificates and will fail to connect to SF.net over HTTPS AppDataDownloadUrl="!!Game data|data.zip" +# Reset SDL config when updating application to the new version (y) / (n) +ResetSdlConfigForThisVersion=n + +# Delete application data files when upgrading (specify file/dir paths separated by spaces) +DeleteFilesOnUpgrade="%" + +# Here you may type readme text, which will be shown during startup. Format is: +# Text in English, use \\\\n to separate lines (that's four backslashes)^de:Text in Deutsch^ru:Text in Russian^button:Button that will open some URL:http://url-to-open/ +ReadmeText='^Readme text' + +# libSDL version to use (1.2/1.3/2.0) +LibSdlVersion=1.2 + +# Specify screen orientation: (v)ertical/(p)ortrait or (h)orizontal/(l)andscape +ScreenOrientation=h + +# Do not allow device to sleep when the application is in foreground, set this for video players or apps which use accelerometer +InhibitSuspend=n + # Video color depth - 16 BPP is the fastest and supported for all modes, 24 bpp is supported only # with SwVideoMode=y, SDL_OPENGL mode supports everything. (16)/(24)/(32) VideoDepthBpp=16 @@ -75,6 +89,10 @@ CompatibilityHacksSlowCompatibleEventQueue=n # Save and restore OpenGL state when drawing on-screen keyboard for apps that use SDL_OPENGL CompatibilityHacksTouchscreenKeyboardSaveRestoreOpenGLState=n +# Application uses SDL_UpdateRects() properly, and does not draw in any region outside those rects. +# This improves drawing speed, but I know only one application that does that, and it's written by me (y)/(n) +CompatibilityHacksProperUsageOfSDL_UpdateRects= + # Application uses mouse (y) or (n), this will show mouse emulation dialog to the user AppUsesMouse=n @@ -84,6 +102,9 @@ AppNeedsTwoButtonMouse=n # Show SDL mouse cursor, for applications that do not draw cursor at all (y) or (n) ShowMouseCursor=n +# Generate more touch events, by default SDL generates one event per one video frame, this is useful for drawing apps (y) or (n) +GenerateSubframeTouchEvents= + # Force relative (laptop) mouse movement mode, useful when both on-screen keyboard and mouse are needed (y) or (n) ForceRelativeMouseMode=n @@ -113,6 +134,12 @@ AppUsesMultitouch=n # This option will add additional permission to Android manifest (y)/(n) AppRecordsAudio=n +# Application needs to access SD card. If your data files are bigger than 5 Mb, enable it. (y) / (n) +AccessSdCard= + +# Immersive mode - Android will hide on-screen Home/Back keys. Looks bad if you invoke Android keyboard. (y) / (n) +ImmersiveMode= + # 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) @@ -133,11 +160,22 @@ AppTouchscreenKeyboardKeysAmount=3 AppTouchscreenKeyboardKeysAmountAutoFire=0 # Redefine on-screen keyboard keys to SDL keysyms - 6 keyboard keys + 4 multitouch gestures (zoom in/out and rotate left/right) -RedefinedKeysScreenKb="RSHIFT RETURN TAB" +RedefinedKeysScreenKb="RETURN RSHIFT TAB" # Names for on-screen keyboard keys, such as Fire, Jump, Run etc, separated by spaces, they are used in SDL config menu RedefinedKeysScreenKbNames="Fire Weapons Map" +# On-screen keys theme +# 0 = Ultimate Droid by Sean Stieber (green, with gamepad joystick) +# 1 = Simple Theme by Beholder (white, with gamepad joystick) +# 2 = Sun by Sirea (yellow, with round joystick) +# 3 = Keen by Gerstrong (multicolor, with round joystick) +TouchscreenKeysTheme=1 + +# Redefine gamepad keys to SDL keysyms, button order is: +# A B X Y L1 R1 L2 R2 LThumb RThumb +RedefinedKeysGamepad="RETURN RSHIFT TAB TAB RSHIFT RETURN" + # How long to show startup menu button, in msec, 0 to disable startup menu StartupMenuButtonTimeout=0 @@ -153,23 +191,11 @@ FirstStartMenuOptions='' # Enable multi-ABI binary, with hardware FPU support - it will also work on old devices, # but .apk size is 2x bigger (y) / (n) / (x86) / (all) -MultiABI=n +MultiABI=all # Minimum amount of RAM application requires, in Mb, SDL will print warning to user if it's lower AppMinimumRAM=0 -# Application version code (integer) -AppVersionCode=101 - -# Application user-visible version name (string) -AppVersionName="1.01" - -# Reset SDL config when updating application to the new version (y) / (n) -ResetSdlConfigForThisVersion=n - -# Delete application data files when upgrading (specify file/dir paths separated by spaces) -DeleteFilesOnUpgrade="%" - # 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 # 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 @@ -179,7 +205,7 @@ CompiledLibraries="sdl_image sdl_mixer" CustomBuildScript=n # Aditional CFLAGS for application -AppCflags='-O2 -finline-functions -D__MACTYPES__' +AppCflags='-O2 -finline-functions -D__MACTYPES__ --include jni/application/android_debug.h' # Additional LDFLAGS for application AppLdflags='' @@ -188,17 +214,13 @@ AppLdflags='' AppOverlapsSystemHeaders= # Build only following subdirs (empty will build all dirs, ignored with custom script) -AppSubdirsBuild='src/src src/src/cdogs src/src/json src/src/missions src/src/tinydir' +AppSubdirsBuild='src/src src/src/cdogs src/src/json src/src/missions src/src/tinydir src/src/cdogs/hqx/src' # Exclude these files from build -AppBuildExclude='src/src/cdogsed.c' +AppBuildExclude='src/src/cdogsed.c src/src/cdogs/hqx/src/hqx.c' # Application command line parameters, including app name as 0-th param -AppCmdline='' - -# Here you may type readme text, which will be shown during startup. Format is: -# Text in English, use \\\\n to separate lines^de:Text in Deutsch^ru:Text in Russian, and so on (that's four backslashes, nice isn't it?) -ReadmeText='^Readme text' +AppCmdline='cdogs --fullscreen --screen=800x480' # Screen size is used by Google Play to prevent an app to be installed on devices with smaller screens # Minimum screen size that application supports: (s)mall / (m)edium / (l)arge diff --git a/project/jni/application/c-dogs/AndroidPreBuild.sh b/project/jni/application/c-dogs/AndroidPreBuild.sh index e06c98f5c..7a6fde842 100755 --- a/project/jni/application/c-dogs/AndroidPreBuild.sh +++ b/project/jni/application/c-dogs/AndroidPreBuild.sh @@ -6,6 +6,8 @@ echo "Patching..." echo "Archiving data" mkdir -p AndroidData cd src +#git submodule update --init --recursive +cmake . -DCDOGS_DATA_DIR=\"./\" || { echo "Please install cmake: sudo apt-get install cmake" ; exit 1 ; } || exit 1 zip -r ../AndroidData/data.zip doc dogfights graphics missions music sounds >/dev/null exit 0 diff --git a/project/jni/application/c-dogs/android.diff b/project/jni/application/c-dogs/android.diff index c488cf1cf..063787e32 100644 --- a/project/jni/application/c-dogs/android.diff +++ b/project/jni/application/c-dogs/android.diff @@ -23,3 +23,16 @@ index fb928d4..be53ea8 100644 enum LEX_VALUE +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c44844e..3d1170d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -95,7 +95,7 @@ else() + endif() + endif() + +-set(CDOGS_DATA_DIR "../") ++set(CDOGS_DATA_DIR "./") + set(CDOGS_CFG_DIR ".cdogs/") + SET(SOURCE_DIRECTORY ".") + SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ".") diff --git a/project/jni/application/c-dogs/src b/project/jni/application/c-dogs/src index 9bc80efc5..095f9fdff 160000 --- a/project/jni/application/c-dogs/src +++ b/project/jni/application/c-dogs/src @@ -1 +1 @@ -Subproject commit 9bc80efc5ec791ad236d367333894e0ae70b70dc +Subproject commit 095f9fdff6d6401818432764cf41151d11e08ff5