diff --git a/project/java/Settings.java b/project/java/Settings.java index 9f4bb6a1a..98247cf4b 100644 --- a/project/java/Settings.java +++ b/project/java/Settings.java @@ -885,7 +885,23 @@ class Settings } return true; } - + + static final int SDL_ANDROID_CONFIG_VIDEO_DEPTH_BPP = 0; + + public static void setConfigOptionFromSDL(int option, int value) + { + switch (option) + { + case SDL_ANDROID_CONFIG_VIDEO_DEPTH_BPP: + Globals.VideoDepthBpp = value; + break; + default: + Log.e("SDL", "setConfigOptionFromSDL: cannot find option with ID " + option + ", value " + value); + break; + } + Save(MainActivity.instance); + } + private static native void nativeSetAccelerometerSettings(int sensitivity, int centerPos); private static native void nativeSetMouseUsed(int RightClickMethod, int ShowScreenUnderFinger, int LeftClickMethod, int MoveMouseWithJoystick, int ClickMouseWithDpad, int MaxForce, int MaxRadius, diff --git a/project/java/Video.java b/project/java/Video.java index 37b16258f..1ea47578b 100644 --- a/project/java/Video.java +++ b/project/java/Video.java @@ -942,6 +942,11 @@ class DemoRenderer extends GLSurfaceView_SDL.Renderer System.exit(0); } + public void setConfigOptionFromSDL(int option, int value) + { + Settings.setConfigOptionFromSDL(option, value); + } + private int PowerOf2(int i) { int value = 1; diff --git a/project/jni/application/openttd/AndroidAppSettings.cfg b/project/jni/application/openttd/AndroidAppSettings.cfg index 934ee3e05..52e33eeb7 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=16053 +AppVersionCode=16054 # Application user-visible version name (string) -AppVersionName="1.6.0.53" +AppVersionName="1.6.0.54" # 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,13 +18,13 @@ AppVersionName="1.6.0.53" # 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.6.0-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^HD graphics - 220 Mb download|http://sourceforge.net/projects/libsdl-android/files/OpenTTD/zBase-v5588.zip.xz/download" +AppDataDownloadUrl="!!Data files - 20 Mb|openttd-data-1.6.0-5.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^HD graphics - 220 Mb download|http://sourceforge.net/projects/libsdl-android/files/OpenTTD/zBase-v5588.zip.xz/download" # Reset SDL config when updating application to the new version (y) / (n) -ResetSdlConfigForThisVersion=y +ResetSdlConfigForThisVersion=n # Delete application data files when upgrading (specify file/dir paths separated by spaces) -DeleteFilesOnUpgrade="baseset ai game lang libsdl-DownloadFinished-0.flag" +DeleteFilesOnUpgrade="libsdl-DownloadFinished-0.flag" # 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/ diff --git a/project/jni/application/openttd/build-pc.sh b/project/jni/application/openttd/build-pc.sh index 6a481139e..14b490a3d 100755 --- a/project/jni/application/openttd/build-pc.sh +++ b/project/jni/application/openttd/build-pc.sh @@ -17,8 +17,8 @@ cd bin export LD_LIBRARY_PATH=/usr/local/lib if [ -z "$1" ]; then - ./openttd -d 2 -r 854x480 -b 32bpp-anim + ./openttd -d 2 -r 854x480 else - #gdb -ex run --args \ - ./openttd -d 2 -r 854x480 -b 32bpp-anim -g opntitle.sav + gdb -ex run --args \ + ./openttd -d 2 -r 854x480 -g opntitle.sav fi diff --git a/project/jni/application/openttd/pack-data.sh b/project/jni/application/openttd/pack-data.sh index c3dcf4c0a..480d438d9 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.6.0-4 +VER=1.6.0-5 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 05d1643d2..1f4570c14 160000 --- a/project/jni/application/openttd/src +++ b/project/jni/application/openttd/src @@ -1 +1 @@ -Subproject commit 05d1643d26564e1fce9394f8dd385f8381614a47 +Subproject commit 1f4570c14b08ab354bdffd5c34e36d66b5c1292f diff --git a/project/jni/sdl-1.2/include/SDL_android.h b/project/jni/sdl-1.2/include/SDL_android.h index 9a50c5619..f7e268a46 100644 --- a/project/jni/sdl-1.2/include/SDL_android.h +++ b/project/jni/sdl-1.2/include/SDL_android.h @@ -126,6 +126,14 @@ extern DECLSPEC void SDLCALL SDL_ANDROID_OpenExternalWebBrowser(const char *url) /* Restart current app, you can pass a string to the new app instance, which can be retrieved with getenv("SDL_RESTART_PARAMS") */ extern DECLSPEC void SDLCALL SDL_ANDROID_RestartMyself(const char *restartParams); +enum { + SDL_ANDROID_CONFIG_VIDEO_DEPTH_BPP = 0, /* Can be 16 or 24 for software video modes, OpenGL supports 16/24/32 */ + /* TODO: more options, see Globals.java */ +}; + +/* Set SDL Android-specifc option, such as video depth or mouse emulation mode. Most options require restarting the app. */ +extern DECLSPEC void SDLCALL SDL_ANDROID_SetConfigOption(int option, int value); + #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 85504cdcc..d72741986 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 @@ -87,6 +87,7 @@ static jmethodID JavaRequestCloudSave = NULL; static jmethodID JavaRequestCloudLoad = NULL; static jmethodID JavaRequestOpenExternalApp = NULL; static jmethodID JavaRequestRestartMyself = NULL; +static jmethodID JavaRequestSetConfigOption = NULL; static int glContextLost = 0; static int showScreenKeyboardDeferred = 0; static const char * showScreenKeyboardOldText = ""; @@ -359,6 +360,7 @@ JAVA_EXPORT_NAME(DemoRenderer_nativeInitJavaCallbacks) ( JNIEnv* env, jobject t "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Z"); JavaRequestOpenExternalApp = (*JavaEnv)->GetMethodID(JavaEnv, JavaRendererClass, "openExternalApp", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V"); JavaRequestRestartMyself = (*JavaEnv)->GetMethodID(JavaEnv, JavaRendererClass, "restartMyself", "(Ljava/lang/String;)V"); + JavaRequestSetConfigOption = (*JavaEnv)->GetMethodID(JavaEnv, JavaRendererClass, "setConfigOptionFromSDL", "(II)V"); ANDROID_InitOSKeymap(); } @@ -595,6 +597,11 @@ void SDLCALL SDL_ANDROID_RestartMyself(const char *restartParams) (*JavaEnv)->PopLocalFrame(JavaEnv, NULL); } +void SDLCALL SDL_ANDROID_SetConfigOption(int option, int value) +{ + (*JavaEnv)->CallVoidMethod( JavaEnv, JavaRenderer, JavaRequestSetConfigOption, (jint)option, (jint)value ); +} + void SDLCALL SDL_ANDROID_OpenExternalWebBrowser(const char *url) { SDL_ANDROID_OpenExternalApp(NULL, NULL, url); diff --git a/todo.txt b/todo.txt index 896fea906..445c5ed98 100644 --- a/todo.txt +++ b/todo.txt @@ -5,22 +5,16 @@ TODO, which will get actually done - TeeWorlds: navigate UI with gamepad, auto-switch to correct aiming mode when gamepad is used. -- TeeWorlds: aiming with gyroscope. +- TeeWorlds: tap-and-swipe controls. - OpenArena: add dynamic camera/joystick, add option for joystick tap action. - OpenArena: add Google Play Games network support. +- OpenArena: first-person mode camera sometimes looks down after respawn. + - USB Keyboard: options for camera feed size and for redefining remote menu hotkey. -- OpenTTD: 24bpp color mode + 32bpp blitter in SDL menu. - -- OpenTTD: station names truncated on high resolution. - -- OpenTTD: Fix team chat with 6 or more players. - -- OpenTTD: tap to confirm construciton, and hide all dialogs when constructing something. - - UQM HD: add fonts from http://mosc-portal.bursa.ru/showthread.php?t=206 and switch back to joystick controls, set 4:3 aspect ratio as default. - SDL: implement SDL_GL_LoadLibrary() / SDL_GL_GetProcAddress() / SDL_GL_SetAttribute() / SDL_GL_GetAttribute().