diff --git a/project/java/Video.java b/project/java/Video.java index 3c2b49687..da7963403 100644 --- a/project/java/Video.java +++ b/project/java/Video.java @@ -62,6 +62,7 @@ import android.app.AlarmManager; import android.content.Intent; import android.view.View; import android.view.Display; +import android.net.Uri; class Mouse @@ -914,6 +915,11 @@ class DemoRenderer extends GLSurfaceView_SDL.Renderer return ret; } + + public void openExternalWebBrowser(String url) + { + context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url))); + } private int PowerOf2(int i) { diff --git a/project/jni/application/hid-pc-keyboard/src b/project/jni/application/hid-pc-keyboard/src index 562e93811..a883fb641 160000 --- a/project/jni/application/hid-pc-keyboard/src +++ b/project/jni/application/hid-pc-keyboard/src @@ -1 +1 @@ -Subproject commit 562e93811cd258c5a24087c77e4167006fe469a0 +Subproject commit a883fb64104798fa1cb0ae19001bc7c90df1255c diff --git a/project/jni/application/openttd/AndroidAppSettings.cfg b/project/jni/application/openttd/AndroidAppSettings.cfg index 8b973cfad..460cb2b96 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=14436 +AppVersionCode=14437 # Application user-visible version name (string) -AppVersionName="1.4.4.36" +AppVersionName="1.4.4.37" # 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 @@ -18,7 +18,7 @@ AppVersionName="1.4.4.36" # 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="!!Data files - 20 Mb|openttd-data-1.4.4.zip.xz|http://sourceforge.net/projects/libsdl-android/files/OpenTTD/openttd-data-1.4.4.zip.xz^!!Config file|:.openttd/openttd.cfg:openttd-1.4.0.30.cfg^!MIDI music support (18 Mb)|timidity.zip.xz|http://sourceforge.net/projects/libsdl-android/files/timidity.zip.xz^!!Internationalization files|icudt52l.zip.xz|http://sourceforge.net/projects/libsdl-android/files/icudt52l.zip.xz" +AppDataDownloadUrl="!!Data files - 20 Mb|openttd-data-1.4.4-1.zip.xz|http://sourceforge.net/projects/libsdl-android/files/OpenTTD/openttd-data-1.4.4-1.zip.xz^!!Config file|:.openttd/openttd.cfg:openttd-1.4.0.30.cfg^!MIDI music support (18 Mb)|timidity.zip.xz|http://sourceforge.net/projects/libsdl-android/files/timidity.zip.xz^!!Internationalization files|icudt52l.zip.xz|http://sourceforge.net/projects/libsdl-android/files/icudt52l.zip.xz" # Reset SDL config when updating application to the new version (y) / (n) ResetSdlConfigForThisVersion=n @@ -223,7 +223,7 @@ NDK_TOOLCHAIN_VERSION= # Specify architectures to compile, 'all' or 'y' to compile for all architectures. # Available architectures: armeabi armeabi-v7a armeabi-v7a-hard x86 mips -MultiABI='armeabi-v7a' +MultiABI='armeabi-v7a x86' # 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 diff --git a/project/jni/application/openttd/pack-data.sh b/project/jni/application/openttd/pack-data.sh index 05f426341..b7b45e24d 100755 --- a/project/jni/application/openttd/pack-data.sh +++ b/project/jni/application/openttd/pack-data.sh @@ -1,6 +1,6 @@ #!/bin/sh -VER=1.4.4 +VER=1.4.4-1 cd data rm -f ../AndroidData/openttd-data-*.zip.xz ../AndroidData/openttd-data-*.zip diff --git a/project/jni/application/openttd/src b/project/jni/application/openttd/src index 34ee01b2f..a2df2ce7a 160000 --- a/project/jni/application/openttd/src +++ b/project/jni/application/openttd/src @@ -1 +1 @@ -Subproject commit 34ee01b2f1994de4664310cc36abe99e8597f747 +Subproject commit a2df2ce7a55498b750a152e7a617f3e2d453074a diff --git a/project/jni/sdl-1.2/include/SDL_android.h b/project/jni/sdl-1.2/include/SDL_android.h index 8307ca4a3..43627f1f7 100644 --- a/project/jni/sdl-1.2/include/SDL_android.h +++ b/project/jni/sdl-1.2/include/SDL_android.h @@ -118,6 +118,9 @@ Returns 1 if load succeeded, 0 if user aborted sign-in, or there was no network */ extern DECLSPEC int SDLCALL SDL_ANDROID_CloudLoad(const char *filename, const char *saveId, const char *dialogTitle); +/* Open an Android web browser, or Chrome, or Youtube for video links */ +extern DECLSPEC void SDLCALL SDL_ANDROID_OpenExternalWebBrowser(const char *url); + #ifdef __cplusplus } #endif diff --git a/project/jni/sdl-1.2/src/video/android/SDL_androidvideo.c b/project/jni/sdl-1.2/src/video/android/SDL_androidvideo.c index 82edb2441..af72a9375 100644 --- a/project/jni/sdl-1.2/src/video/android/SDL_androidvideo.c +++ b/project/jni/sdl-1.2/src/video/android/SDL_androidvideo.c @@ -84,6 +84,7 @@ static jmethodID JavaSetAdvertisementPosition = NULL; static jmethodID JavaRequestNewAdvertisement = NULL; static jmethodID JavaRequestCloudSave = NULL; static jmethodID JavaRequestCloudLoad = NULL; +static jmethodID JavaRequestOpenExternalWebBrowser = NULL; static int glContextLost = 0; static int showScreenKeyboardDeferred = 0; static const char * showScreenKeyboardOldText = ""; @@ -355,6 +356,7 @@ JAVA_EXPORT_NAME(DemoRenderer_nativeInitJavaCallbacks) ( JNIEnv* env, jobject t "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;J)Z"); JavaRequestCloudLoad = (*JavaEnv)->GetMethodID(JavaEnv, JavaRendererClass, "cloudLoad", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Z"); + JavaRequestOpenExternalWebBrowser = (*JavaEnv)->GetMethodID(JavaEnv, JavaRendererClass, "openExternalWebBrowser", "(Ljava/lang/String;)V"); ANDROID_InitOSKeymap(); } @@ -569,6 +571,14 @@ int SDLCALL SDL_ANDROID_CloudLoad(const char *filename, const char *saveId, cons return result; } +void SDLCALL SDL_ANDROID_OpenExternalWebBrowser(const char *url) +{ + (*JavaEnv)->PushLocalFrame(JavaEnv, 1); + jstring s1 = (*JavaEnv)->NewStringUTF(JavaEnv, url); + (*JavaEnv)->CallVoidMethod( JavaEnv, JavaRenderer, JavaRequestOpenExternalWebBrowser, s1 ); + (*JavaEnv)->DeleteLocalRef(JavaEnv, s1); + (*JavaEnv)->PopLocalFrame(JavaEnv, NULL); +} // Dummy callback for SDL2 to satisfy linker extern void SDL_Android_Init(JNIEnv* env, jclass cls); diff --git a/todo.txt b/todo.txt index 239068226..fcfd30185 100644 --- a/todo.txt +++ b/todo.txt @@ -35,6 +35,6 @@ TODO, which will get actually done - S Planner Killer: options to restore calendar settiongs, and to kill lock-screen widget. -- OpenTTD: tutorial. - - OpenTTD: 24bpp color mode + 32bpp blitter in SDL menu. + +- OpenTTD: text input freezes OpenTTD and servers kick it.