From 837bd4667cb93a590906c3dd2d47a7bf5bb96875 Mon Sep 17 00:00:00 2001 From: Sergii Pylypenko Date: Wed, 21 May 2014 23:03:52 +0300 Subject: [PATCH 1/8] Updated todo --- todo.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/todo.txt b/todo.txt index 44fa920b7..4e596a474 100644 --- a/todo.txt +++ b/todo.txt @@ -27,6 +27,8 @@ TODO, which will get actually done - OpenTTD: 'build waypoint' button tries to build a train station. -- Debian Noroot: Audio support. +- Debian noroot: Audio support. - UQM: use gyroscope to steer the ship, search button for starmap. + +- USB Keyboard: modify /dev/hidg* permissions autmatically, using su. From 09fef74277cacd4900a5d8e82857216a1e762dfb Mon Sep 17 00:00:00 2001 From: Sergii Pylypenko Date: Mon, 26 May 2014 23:10:43 +0300 Subject: [PATCH 2/8] Updated TODO --- project/jni/application/openttd/AndroidAppSettings.cfg | 10 +++++----- todo.txt | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/project/jni/application/openttd/AndroidAppSettings.cfg b/project/jni/application/openttd/AndroidAppSettings.cfg index 578f2bcd7..78e8c2e73 100644 --- a/project/jni/application/openttd/AndroidAppSettings.cfg +++ b/project/jni/application/openttd/AndroidAppSettings.cfg @@ -7,10 +7,10 @@ AppName="OpenTTD" AppFullName=org.openttd.sdl # Application version code (integer) -AppVersionCode=14029 +AppVersionCode=14030 # Application user-visible version name (string) -AppVersionName="1.4.0.29" +AppVersionName="1.4.0.30" # 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 @@ -38,7 +38,7 @@ ScreenOrientation=h # 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=24 +VideoDepthBpp=16 # Enable OpenGL depth buffer (needed only for 3-d applications, small speed decrease) (y) or (n) NeedDepthBuffer=n @@ -201,7 +201,7 @@ 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=all +MultiABI=armeabi-v7a # Minimum amount of RAM application requires, in Mb, SDL will print warning to user if it's lower AppMinimumRAM=0 @@ -230,7 +230,7 @@ AppSubdirsBuild='' AppBuildExclude='' # Application command line parameters, including app name as 0-th param -AppCmdline='openttd -d 1 -b 32bpp-anim' +AppCmdline='openttd -d 1 -b 16bpp-simple' # 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/todo.txt b/todo.txt index 4e596a474..285d25a26 100644 --- a/todo.txt +++ b/todo.txt @@ -23,10 +23,10 @@ TODO, which will get actually done - OpenTTD: Two-finger scrolling. -- OpenTTD: auto-switch to full toolbar if enough space. - - OpenTTD: 'build waypoint' button tries to build a train station. +- OpenTTD: Add 'cheat' command to console. + - Debian noroot: Audio support. - UQM: use gyroscope to steer the ship, search button for starmap. From 4d60192c298ba84befc2ecffb1f6f9f7ad20af02 Mon Sep 17 00:00:00 2001 From: Sergii Pylypenko Date: Tue, 27 May 2014 21:18:02 +0300 Subject: [PATCH 3/8] Minor optimization to Java code --- project/java/GLSurfaceView_SDL.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/project/java/GLSurfaceView_SDL.java b/project/java/GLSurfaceView_SDL.java index 9f132e597..93c3a465e 100644 --- a/project/java/GLSurfaceView_SDL.java +++ b/project/java/GLSurfaceView_SDL.java @@ -209,6 +209,7 @@ public class GLSurfaceView_SDL extends SurfaceView implements SurfaceHolder.Call SurfaceHolder holder = getHolder(); holder.addCallback(this); holder.setType(SurfaceHolder.SURFACE_TYPE_GPU); + mKeyguardManager = ((KeyguardManager)getContext().getSystemService(Context.KEYGUARD_SERVICE)); } /** @@ -1106,7 +1107,7 @@ public class GLSurfaceView_SDL extends SurfaceView implements SurfaceHolder.Call } private boolean needToWait() { - if (((KeyguardManager)getContext().getSystemService(Context.KEYGUARD_SERVICE)).inKeyguardRestrictedInputMode()) { + if (mKeyguardManager.inKeyguardRestrictedInputMode()) { return true; // We're in lockscreen - sleep until user unlocks the device } @@ -1281,4 +1282,5 @@ public class GLSurfaceView_SDL extends SurfaceView implements SurfaceHolder.Call private EGLConfigChooser mEGLConfigChooser; private GLWrapper mGLWrapper; private int mDebugFlags; + private KeyguardManager mKeyguardManager; } From 3b184dc44fe21c421c707d1504e7e4aabe892dde Mon Sep 17 00:00:00 2001 From: Sergii Pylypenko Date: Tue, 27 May 2014 22:16:01 +0300 Subject: [PATCH 4/8] Updated OpenTTD --- project/jni/application/openttd/AndroidAppSettings.cfg | 8 ++++---- project/jni/application/openttd/src | 2 +- todo.txt | 2 ++ 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/project/jni/application/openttd/AndroidAppSettings.cfg b/project/jni/application/openttd/AndroidAppSettings.cfg index 78e8c2e73..312485416 100644 --- a/project/jni/application/openttd/AndroidAppSettings.cfg +++ b/project/jni/application/openttd/AndroidAppSettings.cfg @@ -18,17 +18,17 @@ AppVersionName="1.4.0.30" # 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 # Also please avoid 'https://' URLs, many Android devices do not have trust certificates and will fail to connect to SF.net over HTTPS -AppDataDownloadUrl="!!Data files - 20 Mb|http://sourceforge.net/projects/libsdl-android/files/OpenTTD/openttd-data-1.4.0-1.zip/download^!!Config file|:.openttd/openttd.cfg:openttd-1.4.0.27.cfg^!MIDI music support (18 Mb)|timidity.zip|http://sourceforge.net/projects/libsdl-android/files/timidity.zip^!!Internationalization files|http://sourceforge.net/projects/libsdl-android/files/icudt52l.zip/download" +AppDataDownloadUrl="!!Data files - 20 Mb|http://sourceforge.net/projects/libsdl-android/files/OpenTTD/openttd-data-1.4.0-2.zip/download^!!Config file|:.openttd/openttd.cfg:openttd-1.4.0.27.cfg^!MIDI music support (18 Mb)|timidity.zip|http://sourceforge.net/projects/libsdl-android/files/timidity.zip^!!Internationalization files|http://sourceforge.net/projects/libsdl-android/files/icudt52l.zip/download" # Reset SDL config when updating application to the new version (y) / (n) ResetSdlConfigForThisVersion=y # Delete application data files when upgrading (specify file/dir paths separated by spaces) -DeleteFilesOnUpgrade="baseset .openttd/windows.cfg .openttd/hotkeys.cfg .openttd/openttd.cfg" +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='If this update runs slowly - install OpenTTD-lowmem,\\\\nit is tuned for older devices, and uses simpler 8bpp graphics\\\\n^button:Install OpenTTD-lowmem:https://play.google.com/store/apps/details?id=org.openttd.sdl.lowmem' +ReadmeText='' # libSDL version to use (1.2/1.3/2.0) LibSdlVersion=1.2 @@ -234,7 +234,7 @@ AppCmdline='openttd -d 1 -b 16bpp-simple' # 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 -MinimumScreenSize=s +MinimumScreenSize=m # Your AdMob Publisher ID, (n) if you don't want advertisements AdmobPublisherId=n diff --git a/project/jni/application/openttd/src b/project/jni/application/openttd/src index fed40b76f..7748f7cbf 160000 --- a/project/jni/application/openttd/src +++ b/project/jni/application/openttd/src @@ -1 +1 @@ -Subproject commit fed40b76ff3533462aaaff943ee9d5e687d7e714 +Subproject commit 7748f7cbf1bc3c26e0fcb9b04ff20966d00aa6a0 diff --git a/todo.txt b/todo.txt index 285d25a26..8b9e1eece 100644 --- a/todo.txt +++ b/todo.txt @@ -27,6 +27,8 @@ TODO, which will get actually done - OpenTTD: Add 'cheat' command to console. +- OpenTTD: Split top toolbar into left/right toolbars. + - Debian noroot: Audio support. - UQM: use gyroscope to steer the ship, search button for starmap. From 91542ca0296b6444d2f9411f34f6295a1b4ce83f Mon Sep 17 00:00:00 2001 From: Sergii Pylypenko Date: Tue, 27 May 2014 23:14:55 +0300 Subject: [PATCH 5/8] OpenTTD: disabled edge scrolling in config --- project/jni/application/openttd/AndroidAppSettings.cfg | 2 +- .../{openttd-1.4.0.27.cfg => openttd-1.4.0.30.cfg} | 2 +- project/jni/application/openttd/src | 2 +- todo.txt | 4 ---- 4 files changed, 3 insertions(+), 7 deletions(-) rename project/jni/application/openttd/AndroidData/{openttd-1.4.0.27.cfg => openttd-1.4.0.30.cfg} (95%) diff --git a/project/jni/application/openttd/AndroidAppSettings.cfg b/project/jni/application/openttd/AndroidAppSettings.cfg index 312485416..c42d589ae 100644 --- a/project/jni/application/openttd/AndroidAppSettings.cfg +++ b/project/jni/application/openttd/AndroidAppSettings.cfg @@ -18,7 +18,7 @@ AppVersionName="1.4.0.30" # 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 # Also please avoid 'https://' URLs, many Android devices do not have trust certificates and will fail to connect to SF.net over HTTPS -AppDataDownloadUrl="!!Data files - 20 Mb|http://sourceforge.net/projects/libsdl-android/files/OpenTTD/openttd-data-1.4.0-2.zip/download^!!Config file|:.openttd/openttd.cfg:openttd-1.4.0.27.cfg^!MIDI music support (18 Mb)|timidity.zip|http://sourceforge.net/projects/libsdl-android/files/timidity.zip^!!Internationalization files|http://sourceforge.net/projects/libsdl-android/files/icudt52l.zip/download" +AppDataDownloadUrl="!!Data files - 20 Mb|http://sourceforge.net/projects/libsdl-android/files/OpenTTD/openttd-data-1.4.0-2.zip/download^!!Config file|:.openttd/openttd.cfg:openttd-1.4.0.30.cfg^!MIDI music support (18 Mb)|timidity.zip|http://sourceforge.net/projects/libsdl-android/files/timidity.zip^!!Internationalization files|http://sourceforge.net/projects/libsdl-android/files/icudt52l.zip/download" # Reset SDL config when updating application to the new version (y) / (n) ResetSdlConfigForThisVersion=y diff --git a/project/jni/application/openttd/AndroidData/openttd-1.4.0.27.cfg b/project/jni/application/openttd/AndroidData/openttd-1.4.0.30.cfg similarity index 95% rename from project/jni/application/openttd/AndroidData/openttd-1.4.0.27.cfg rename to project/jni/application/openttd/AndroidData/openttd-1.4.0.30.cfg index cc4467b06..6b9a85504 100644 --- a/project/jni/application/openttd/AndroidData/openttd-1.4.0.27.cfg +++ b/project/jni/application/openttd/AndroidData/openttd-1.4.0.30.cfg @@ -18,4 +18,4 @@ min_step_size = 40 [gui] left_mouse_btn_scrolling = true osk_activation = disabled -auto_scrolling = 2 +auto_scrolling = 0 diff --git a/project/jni/application/openttd/src b/project/jni/application/openttd/src index 7748f7cbf..1d82f5794 160000 --- a/project/jni/application/openttd/src +++ b/project/jni/application/openttd/src @@ -1 +1 @@ -Subproject commit 7748f7cbf1bc3c26e0fcb9b04ff20966d00aa6a0 +Subproject commit 1d82f579450fac1aa1807419b63de07d5fd8e487 diff --git a/todo.txt b/todo.txt index 8b9e1eece..cd1bf4b1b 100644 --- a/todo.txt +++ b/todo.txt @@ -19,14 +19,10 @@ TODO, which will get actually done - OpenTTD: no sounds with music on. -- OpenTTD: Fix multiplayer lobby dialog. - - OpenTTD: Two-finger scrolling. - OpenTTD: 'build waypoint' button tries to build a train station. -- OpenTTD: Add 'cheat' command to console. - - OpenTTD: Split top toolbar into left/right toolbars. - Debian noroot: Audio support. From c5449254f00719ec7337e683d7eef1f44252001a Mon Sep 17 00:00:00 2001 From: Sergii Pylypenko Date: Wed, 28 May 2014 15:59:56 +0300 Subject: [PATCH 6/8] Updated todo --- project/jni/application/openttd/src | 2 +- todo.txt | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/project/jni/application/openttd/src b/project/jni/application/openttd/src index 1d82f5794..657e563f7 160000 --- a/project/jni/application/openttd/src +++ b/project/jni/application/openttd/src @@ -1 +1 @@ -Subproject commit 1d82f579450fac1aa1807419b63de07d5fd8e487 +Subproject commit 657e563f7c2e1e31091b34c82f59af9ff54a1954 diff --git a/todo.txt b/todo.txt index cd1bf4b1b..6d7e8b063 100644 --- a/todo.txt +++ b/todo.txt @@ -15,10 +15,6 @@ TODO, which will get actually done - SuperTux: Update, enable OpenGL renderer, add touchscreen jump helper, add gamepad support, fix zoom in settings. -- OpenTTD: logarithmic music volume, restore volume on new track. - -- OpenTTD: no sounds with music on. - - OpenTTD: Two-finger scrolling. - OpenTTD: 'build waypoint' button tries to build a train station. @@ -30,3 +26,5 @@ TODO, which will get actually done - UQM: use gyroscope to steer the ship, search button for starmap. - USB Keyboard: modify /dev/hidg* permissions autmatically, using su. + +- XSDL: add downloadable raster fonts, add path to fonts to Debian/Gimp. From 11840f1028f1cbafd69fd1ab5c7ad35c0cce09ae Mon Sep 17 00:00:00 2001 From: Sergii Pylypenko Date: Wed, 28 May 2014 22:25:56 +0300 Subject: [PATCH 7/8] Added -q option to build.sh, for quick rebuilding C code --- .gitignore | 1 + build.sh | 25 +++++++++++++++++++++---- buildQuick.sh | 24 ------------------------ todo.txt | 4 ++++ 4 files changed, 26 insertions(+), 28 deletions(-) delete mode 100755 buildQuick.sh diff --git a/.gitignore b/.gitignore index 0036ba52c..b9564a031 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ project/local.properties project/bin project/gen +project/lib project/libs project/assets project/obj diff --git a/build.sh b/build.sh index 4e277c6ae..9acd53558 100755 --- a/build.sh +++ b/build.sh @@ -5,6 +5,7 @@ install_apk=false run_apk=false sign_apk=false build_release=true +quick_rebuild=false if [ "$#" -gt 0 -a "$1" = "-s" ]; then shift @@ -22,6 +23,11 @@ if [ "$#" -gt 0 -a "$1" = "-r" ]; then run_apk=true fi +if [ "$#" -gt 0 -a "$1" = "-q" ]; then + shift + quick_rebuild=true +fi + if [ "$#" -gt 0 -a "$1" = "release" ]; then shift build_release=true @@ -34,10 +40,11 @@ if [ "$#" -gt 0 -a "$1" = "debug" ]; then fi if [ "$#" -gt 0 -a "$1" = "-h" ]; then - echo "Usage: $0 [-s] [-i] [-r] [release]" + echo "Usage: $0 [-s] [-i] [-r] [-q] [debug|release]" echo " -s: sign APK file after building" echo " -i: install APK file to device after building" echo " -r: run APK file on device after building" + echo " -q: quick-rebuild C code, without rebuilding Java files" echo " debug: build debug package" echo " release: build release package (default)" exit 0 @@ -78,7 +85,7 @@ if uname -s | grep -i "windows" > /dev/null ; then fi grep "64.bit" "`which ndk-build | sed 's@/ndk-build@@'`/RELEASE.TXT" >/dev/null 2>&1 && MYARCH="${MYARCH}_64" -rm -r -f project/bin/* # New Android SDK introduced some lame-ass optimizations to the build system which we should take care about +$quick_rebuild || rm -r -f project/bin/* # New Android SDK introduced some lame-ass optimizations to the build system which we should take care about [ -x project/jni/application/src/AndroidPreBuild.sh ] && { cd project/jni/application/src ./AndroidPreBuild.sh || { echo "AndroidPreBuild.sh returned with error" ; exit 1 ; } @@ -119,11 +126,21 @@ cd project && env PATH=$NDKBUILDPATH BUILD_NUM_CPUS=$NCPU nice -n19 ndk-build -j || true ; } && \ cd .. && ./copyAssets.sh && cd project && \ { if $build_release ; then \ - ant release || exit 1 ; \ + $quick_rebuild && { \ + ln -s -f libs lib ; \ + zip -u -r bin/MainActivity-release-unsigned.apk lib assets || exit 1 ; \ + } || ant release || exit 1 ; \ jarsigner -verbose -keystore ~/.android/debug.keystore -storepass android -sigalg MD5withRSA -digestalg SHA1 bin/MainActivity-release-unsigned.apk androiddebugkey || exit 1 ; \ + rm -f bin/MainActivity-debug.apk ; \ zipalign 4 bin/MainActivity-release-unsigned.apk bin/MainActivity-debug.apk || exit 1 ; \ else \ - ant debug || exit 1 ; \ + $quick_rebuild && { \ + ln -s -f libs lib ; \ + zip -u -r bin/MainActivity-debug-unaligned.apk lib assets || exit 1 ; \ + jarsigner -verbose -keystore ~/.android/debug.keystore -storepass android -sigalg MD5withRSA -digestalg SHA1 bin/MainActivity-debug-unaligned.apk androiddebugkey || exit 1 ; \ + rm -f bin/MainActivity-debug.apk ; \ + zipalign 4 bin/MainActivity-debug-unaligned.apk bin/MainActivity-debug.apk || exit 1 ; \ + } || ant debug || exit 1 ; \ fi ; } && \ { if $sign_apk; then cd .. && ./sign.sh && cd project ; else true ; fi ; } && \ { $install_apk && [ -n "`adb devices | tail -n +2`" ] && \ diff --git a/buildQuick.sh b/buildQuick.sh deleted file mode 100755 index 7e6b8b950..000000000 --- a/buildQuick.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -# Set here your own NDK path if needed -# export PATH=$PATH:~/src/endless_space/android-ndk-r4b -# Set environment to CrystaX NDK with RTTI and exceptions instead of original NDK -# export PATH=$PATH:~/src/endless_space/android-ndk-r4-crystax/ndk-build -NDKBUILDPATH=$PATH -if grep "AppUseCrystaXToolchain=y" AndroidAppSettings.cfg > /dev/null ; then - NDKBUILDPATH=`which ndk-build | sed 's@/[^/]*/ndk-build@/android-ndk-r4-crystax@'`:$PATH -fi - -[ -e project/bin/lib ] || ln -s ../libs project/bin/lib - -cd project && \ -env PATH=$NDKBUILDPATH ndk-build -j2 V=1 && \ -cd bin && \ -rm -rf DemoActivity-debug-unaligned.apk && \ -cp DemoActivity.ap_ DemoActivity-debug-unaligned.apk && \ -zip -1 -r DemoActivity-debug-unaligned.apk classes.dex lib && \ -jarsigner -verbose -keystore ~/.android/debug.keystore -storepass android DemoActivity-debug-unaligned.apk androiddebugkey && \ -rm -rf DemoActivity-debug.apk && \ -zipalign 4 DemoActivity-debug-unaligned.apk DemoActivity-debug.apk && \ -adb install -r DemoActivity-debug.apk - diff --git a/todo.txt b/todo.txt index 6d7e8b063..a55991697 100644 --- a/todo.txt +++ b/todo.txt @@ -21,6 +21,10 @@ TODO, which will get actually done - OpenTTD: Split top toolbar into left/right toolbars. +- OpenTTD: Option to hide mouse cursor. + +- OpenTTD: Construct airport window is too tall. + - Debian noroot: Audio support. - UQM: use gyroscope to steer the ship, search button for starmap. From 92ed4ba5e3548efe957c8d1bfe099900239d792c Mon Sep 17 00:00:00 2001 From: Sergii Pylypenko Date: Wed, 28 May 2014 23:14:20 +0300 Subject: [PATCH 8/8] Updated TODO --- project/jni/application/openttd/src | 2 +- todo.txt | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/project/jni/application/openttd/src b/project/jni/application/openttd/src index 657e563f7..318ff9d37 160000 --- a/project/jni/application/openttd/src +++ b/project/jni/application/openttd/src @@ -1 +1 @@ -Subproject commit 657e563f7c2e1e31091b34c82f59af9ff54a1954 +Subproject commit 318ff9d373a9eb3f33f6c0afaebef8c6d3fffabd diff --git a/todo.txt b/todo.txt index a55991697..af40c00ca 100644 --- a/todo.txt +++ b/todo.txt @@ -17,13 +17,11 @@ TODO, which will get actually done - OpenTTD: Two-finger scrolling. -- OpenTTD: 'build waypoint' button tries to build a train station. - - OpenTTD: Split top toolbar into left/right toolbars. - OpenTTD: Option to hide mouse cursor. -- OpenTTD: Construct airport window is too tall. +- OpenTTD: Show info about facility on mouse up instead of mouse down. - Debian noroot: Audio support.