diff --git a/build.sh b/build.sh index e15231af4..a29a68bee 100755 --- a/build.sh +++ b/build.sh @@ -58,6 +58,7 @@ fi if uname -s | grep -i "windows" > /dev/null ; then MYARCH=windows-x86 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 [ -x project/jni/application/src/AndroidPreBuild.sh ] && { diff --git a/project/jni/application/openarena/vm b/project/jni/application/openarena/vm index e8f073059..2fa31601b 160000 --- a/project/jni/application/openarena/vm +++ b/project/jni/application/openarena/vm @@ -1 +1 @@ -Subproject commit e8f073059e4d207bdd20814a6156299bc3c9696e +Subproject commit 2fa31601b2ae97b92daac0d43060fdf560c90345 diff --git a/project/jni/application/openttd/AndroidAppSettings.cfg b/project/jni/application/openttd/AndroidAppSettings.cfg index 9ebf24a23..a43bf9f31 100644 --- a/project/jni/application/openttd/AndroidAppSettings.cfg +++ b/project/jni/application/openttd/AndroidAppSettings.cfg @@ -5,7 +5,7 @@ AppName="OpenTTD" AppFullName=org.openttd.sdl ScreenOrientation=h InhibitSuspend=n -AppDataDownloadUrl="!Data files - 20 Mb|http://sourceforge.net/projects/libsdl-android/files/OpenTTD/openttd-data-1.2.3.zip^!MIDI music support (18 Mb)|timidity.zip|http://sourceforge.net/projects/libsdl-android/files/timidity.zip^!Config file|:.openttd/openttd.cfg:openttd-1.2.3.24.cfg" +AppDataDownloadUrl="!Data files - 20 Mb|http://sourceforge.net/projects/libsdl-android/files/OpenTTD/openttd-data-1.3.0.zip/download^!MIDI music support (18 Mb)|timidity.zip|http://sourceforge.net/projects/libsdl-android/files/timidity.zip^!Config file|:.openttd/openttd.cfg:openttd-1.3.0.25.cfg" VideoDepthBpp=16 NeedDepthBuffer=n NeedStencilBuffer=n @@ -18,6 +18,9 @@ CompatibilityHacksStaticInit=n CompatibilityHacksTextInputEmulatesHwKeyboard=n CompatibilityHacksPreventAudioChopping=n CompatibilityHacksAppIgnoresAudioBufferSize=n +CompatibilityHacksAdditionalPreloadedSharedLibraries="" +CompatibilityHacksSlowCompatibleEventQueue=n +CompatibilityHacksTouchscreenKeyboardSaveRestoreOpenGLState= AppUsesMouse=y AppNeedsTwoButtonMouse=y ShowMouseCursor=n @@ -26,26 +29,31 @@ AppNeedsArrowKeys=n AppNeedsTextInput=y AppUsesJoystick=n AppUsesAccelerometer=n +AppUsesGyroscope=n AppUsesMultitouch=n +AppRecordsAudio=n NonBlockingSwapBuffers=n RedefinedKeys="LALT RETURN NO_REMAP NO_REMAP SPACE DELETE" AppTouchscreenKeyboardKeysAmount=0 AppTouchscreenKeyboardKeysAmountAutoFire=0 RedefinedKeysScreenKb="LALT RETURN KP_PLUS KP_MINUS SPACE DELETE KP_PLUS KP_MINUS 1 2" +RedefinedKeysScreenKbNames="LALT RETURN KP_PLUS KP_MINUS SPACE DELETE KP_PLUS KP_MINUS 1 2" StartupMenuButtonTimeout=3000 HiddenMenuOptions='OptionalDownloadConfig' FirstStartMenuOptions='' MultiABI=n AppMinimumRAM=0 -AppVersionCode=12325 -AppVersionName="1.2.3.25" +AppVersionCode=13025 +AppVersionName="1.3.0.25" ResetSdlConfigForThisVersion=n DeleteFilesOnUpgrade="%" CompiledLibraries="jpeg png freetype timidity lzma lzo2" CustomBuildScript=y AppCflags='' AppLdflags='' +AppOverlapsSystemHeaders= AppSubdirsBuild='' +AppBuildExclude='' AppCmdline='openttd' ReadmeText='^You may press "Home" now - the data will be downloaded in background' MinimumScreenSize=s diff --git a/project/jni/application/openttd/AndroidBuild.sh b/project/jni/application/openttd/AndroidBuild.sh index 10a6ebcc5..b77e2b136 100755 --- a/project/jni/application/openttd/AndroidBuild.sh +++ b/project/jni/application/openttd/AndroidBuild.sh @@ -2,7 +2,7 @@ LOCAL_PATH=`dirname $0` LOCAL_PATH=`cd $LOCAL_PATH && pwd` -VER=1.2.3 +VER=1.3.0 if [ \! -d openttd-$VER ] ; then diff --git a/project/jni/application/openttd/AndroidData/openttd-1.2.3.24.cfg b/project/jni/application/openttd/AndroidData/openttd-1.3.0.25.cfg similarity index 91% rename from project/jni/application/openttd/AndroidData/openttd-1.2.3.24.cfg rename to project/jni/application/openttd/AndroidData/openttd-1.3.0.25.cfg index 1fa1db32e..d96caaed6 100644 --- a/project/jni/application/openttd/AndroidData/openttd-1.2.3.24.cfg +++ b/project/jni/application/openttd/AndroidData/openttd-1.3.0.25.cfg @@ -20,4 +20,5 @@ opengfx+biggui.grf = [gui] left_mouse_btn_scrolling = true +osk_activation = immediately diff --git a/project/jni/application/openttd/openttd-trunk-android.patch b/project/jni/application/openttd/openttd-trunk-android.patch index d369d093f..0d0acdf2f 100644 --- a/project/jni/application/openttd/openttd-trunk-android.patch +++ b/project/jni/application/openttd/openttd-trunk-android.patch @@ -1,5 +1,5 @@ ---- src/debug.cpp 2012-10-31 23:39:00.000000000 +0200 -+++ src/debug.cpp 2012-11-22 19:01:14.510763002 +0200 +--- src/debug.cpp 2013-03-31 23:56:27.000000000 +0300 ++++ src/debug.cpp 2013-04-04 21:22:32.082336178 +0300 @@ -16,6 +16,9 @@ #include "string_func.h" #include "fileio_func.h" @@ -10,7 +10,7 @@ #include -@@ -82,6 +85,9 @@ +@@ -107,6 +110,9 @@ */ static void debug_print(const char *dbg, const char *buf) { @@ -20,8 +20,8 @@ #if defined(ENABLE_NETWORK) if (_debug_socket != INVALID_SOCKET) { char buf2[1024 + 32]; ---- src/fontcache.cpp 2012-10-31 23:39:00.000000000 +0200 -+++ src/fontcache.cpp 2012-11-23 20:02:36.768406013 +0200 +--- src/fontcache.cpp 2013-03-31 23:56:27.000000000 +0300 ++++ src/fontcache.cpp 2013-04-04 21:22:32.082336178 +0300 @@ -808,7 +808,15 @@ return ret; } @@ -39,8 +39,8 @@ FT_Error GetFontByFaceName(const char *font_name, FT_Face *face) {return FT_Err_Cannot_Open_Resource;} bool SetFallbackFont(FreeTypeSettings *settings, const char *language_isocode, int winlangid, MissingGlyphSearcher *callback) { return false; } #endif /* WITH_FONTCONFIG */ ---- src/music/libtimidity.cpp 2012-10-31 23:38:54.000000000 +0200 -+++ src/music/libtimidity.cpp 2012-11-22 19:01:14.510763002 +0200 +--- src/music/libtimidity.cpp 2013-03-31 23:56:08.000000000 +0300 ++++ src/music/libtimidity.cpp 2013-04-04 21:22:32.082336178 +0300 @@ -13,6 +13,7 @@ #include "../openttd.h" #include "../sound_type.h" @@ -82,8 +82,8 @@ /** Factory for the libtimidity driver. */ static FMusicDriver_LibTimidity iFMusicDriver_LibTimidity; ---- src/network/core/os_abstraction.h 2012-10-31 23:38:59.000000000 +0200 -+++ src/network/core/os_abstraction.h 2012-11-22 19:01:14.506763002 +0200 +--- src/network/core/os_abstraction.h 2013-03-31 23:56:21.000000000 +0300 ++++ src/network/core/os_abstraction.h 2013-04-04 21:22:32.086336178 +0300 @@ -161,7 +161,7 @@ # include /* According to glibc/NEWS, appeared in glibc-2.3. */ @@ -93,8 +93,8 @@ /* If for any reason ifaddrs.h does not exist on your system, comment out * the following two lines and an alternative way will be used to fetch * the list of IPs from the system. */ ---- src/os/unix/crashlog_unix.cpp 2012-10-31 23:38:54.000000000 +0200 -+++ src/os/unix/crashlog_unix.cpp 2012-11-22 19:01:14.506763002 +0200 +--- src/os/unix/crashlog_unix.cpp 2013-03-31 23:56:09.000000000 +0300 ++++ src/os/unix/crashlog_unix.cpp 2013-04-04 21:22:32.086336178 +0300 @@ -141,7 +141,11 @@ }; @@ -107,8 +107,8 @@ /** * Entry point for the crash handler. ---- src/os/unix/unix.cpp 2012-10-31 23:38:54.000000000 +0200 -+++ src/os/unix/unix.cpp 2012-11-22 19:01:14.506763002 +0200 +--- src/os/unix/unix.cpp 2013-03-31 23:56:09.000000000 +0300 ++++ src/os/unix/unix.cpp 2013-04-04 21:22:32.086336178 +0300 @@ -25,7 +25,7 @@ #ifdef __APPLE__ @@ -130,8 +130,8 @@ int CDECL main(int argc, char *argv[]) { int ret; ---- src/osk_gui.cpp 2012-10-31 23:39:00.000000000 +0200 -+++ src/osk_gui.cpp 2012-11-22 19:01:14.506763002 +0200 +--- src/osk_gui.cpp 2013-03-31 23:56:27.000000000 +0300 ++++ src/osk_gui.cpp 2013-04-04 21:24:19.418335198 +0300 @@ -21,6 +21,9 @@ #include "table/sprites.h" @@ -142,10 +142,10 @@ char _keyboard_opt[2][OSK_KEYBOARD_ENTRIES * 4 + 1]; static WChar _keyboard[2][OSK_KEYBOARD_ENTRIES]; -@@ -439,6 +442,14 @@ +@@ -411,6 +414,14 @@ GetKeyboardLayout(); - new OskWindow(&_osk_desc, parent, button, cancel, ok); + new OskWindow(&_osk_desc, parent, button); +#ifdef __ANDROID__ + SDL_ANDROID_GetScreenKeyboardTextInput(parent->text.buf, parent->text.max_bytes); /* Invoke Android built-in screen keyboard */ + OskWindow *osk = dynamic_cast(FindWindowById(WC_OSK, 0)); @@ -157,8 +157,8 @@ } /** ---- src/script/api/script_date.cpp 2012-10-31 23:38:58.000000000 +0200 -+++ src/script/api/script_date.cpp 2012-11-22 19:01:14.510763002 +0200 +--- src/script/api/script_date.cpp 2013-03-31 23:56:17.000000000 +0300 ++++ src/script/api/script_date.cpp 2013-04-04 21:22:32.090336178 +0300 @@ -9,8 +9,8 @@ /** @file script_date.cpp Implementation of ScriptDate. */ @@ -169,8 +169,8 @@ #include "script_date.hpp" #include "../../date_func.h" ---- src/sound/sdl_s.cpp 2012-10-31 23:38:54.000000000 +0200 -+++ src/sound/sdl_s.cpp 2012-11-22 19:01:14.506763002 +0200 +--- src/sound/sdl_s.cpp 2013-03-31 23:56:07.000000000 +0300 ++++ src/sound/sdl_s.cpp 2013-04-04 21:22:32.090336178 +0300 @@ -21,6 +21,10 @@ /** Factory for the SDL sound driver. */ static FSoundDriver_SDL iFSoundDriver_SDL; @@ -192,8 +192,8 @@ } const char *SoundDriver_SDL::Start(const char * const *parm) ---- src/video/sdl_v.cpp 2012-10-31 23:38:49.000000000 +0200 -+++ src/video/sdl_v.cpp 2012-11-22 19:01:14.506763002 +0200 +--- src/video/sdl_v.cpp 2013-03-31 23:55:59.000000000 +0300 ++++ src/video/sdl_v.cpp 2013-04-04 21:26:10.534334178 +0300 @@ -25,6 +25,9 @@ #include "../fileio_func.h" #include "sdl_v.h" @@ -204,11 +204,10 @@ static FVideoDriver_SDL iFVideoDriver_SDL; -@@ -241,7 +244,14 @@ - SDL_CALL SDL_FreeSurface(icon); - } - } -- +@@ -348,6 +351,15 @@ + * surface, for example). */ + _requested_hwpalette = want_hwpalette; + +#ifdef __ANDROID__ + SDL_Rect r; + r.h = SDL_ListModes(NULL, 0)[0]->h / 10; @@ -217,10 +216,11 @@ + r.y = SDL_ListModes(NULL, 0)[0]->h - r.h; + SDL_ANDROID_SetScreenKeyboardButtonPos(SDL_ANDROID_SCREENKEYBOARD_BUTTON_TEXT, &r); +#endif ++ /* DO NOT CHANGE TO HWSURFACE, IT DOES NOT WORK */ - newscreen = SDL_CALL SDL_SetVideoMode(w, h, bpp, SDL_SWSURFACE | SDL_HWPALETTE | (_fullscreen ? SDL_FULLSCREEN : SDL_RESIZABLE)); + newscreen = SDL_CALL SDL_SetVideoMode(w, h, bpp, SDL_SWSURFACE | (want_hwpalette ? SDL_HWPALETTE : 0) | (_fullscreen ? SDL_FULLSCREEN : SDL_RESIZABLE)); if (newscreen == NULL) { -@@ -381,6 +391,8 @@ +@@ -515,6 +527,8 @@ if (sym->scancode == 49) key = WKC_BACKSPACE; #elif defined(__sgi__) if (sym->scancode == 22) key = WKC_BACKQUOTE; @@ -229,7 +229,7 @@ #else if (sym->scancode == 49) key = WKC_BACKQUOTE; #endif -@@ -456,7 +468,7 @@ +@@ -590,7 +604,7 @@ } HandleMouseEvents(); break; @@ -238,7 +238,7 @@ case SDL_ACTIVEEVENT: if (!(ev.active.state & SDL_APPMOUSEFOCUS)) break; -@@ -467,7 +479,7 @@ +@@ -601,7 +615,7 @@ _cursor.in_window = false; } break; @@ -247,7 +247,7 @@ case SDL_QUIT: HandleExitGameRequest(); break; -@@ -480,13 +492,14 @@ +@@ -614,13 +628,14 @@ HandleKeypress(ConvertSdlKeyIntoMy(&ev.key.keysym)); } break; @@ -263,7 +263,7 @@ case SDL_VIDEOEXPOSE: { /* Force a redraw of the entire screen. Note * that SDL 1.2 seems to do this automatically -@@ -519,6 +532,9 @@ +@@ -654,6 +669,9 @@ SDL_CALL SDL_EnableUNICODE(1); _draw_threaded = GetDriverParam(parm, "no_threads") == NULL && GetDriverParam(parm, "no_thread") == NULL;