Merge branch 'sdl_android' of https://github.com/pelya/commandergenius into sdl_android

This commit is contained in:
lubomyr
2016-04-17 17:35:00 +03:00
9 changed files with 50 additions and 20 deletions

View File

@@ -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,

View File

@@ -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;

View File

@@ -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/

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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);

View File

@@ -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().