Fixed Google Play Game Services bindings, added more Java keycodes

This commit is contained in:
Sergii Pylypenko
2015-03-12 22:51:24 +02:00
parent 16ce2c32aa
commit bd2c959a17
9 changed files with 90 additions and 33 deletions

View File

@@ -141,7 +141,7 @@ public class CloudSave implements GameHelper.GameHelperListener {
if( crapshot == null )
return false;
crapshot.writeBytes(readFile(filename));
crapshot.getSnapshotContents().writeBytes(readFile(filename));
Bitmap bmp = BitmapFactory.decodeFile(imageFile);
while( bmp != null && bmp.getByteCount() > Games.Snapshots.getMaxCoverImageSize(getApiClient()) )
@@ -212,7 +212,7 @@ public class CloudSave implements GameHelper.GameHelperListener {
return false;
}
boolean written = writeFile(filename, result.getSnapshot().readFully());
boolean written = writeFile(filename, result.getSnapshot().getSnapshotContents().readFully());
Log.i("SDL", "CloudSave: load: status: " + written);
return written;
}

View File

@@ -17,7 +17,7 @@ AppVersionName="1.4.4.36"
# If the URL in in the form ':dir/file.dat:http://URL/' it will be downloaded as binary BLOB to the application dir and not unzipped
# 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
# 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"
# Reset SDL config when updating application to the new version (y) / (n)
@@ -113,6 +113,9 @@ RightMouseButtonLongPress=
# Show SDL mouse cursor, for applications that do not draw cursor at all (y) or (n)
ShowMouseCursor=n
# Screen follows mouse cursor, when it's covered by soft keyboard, this works only in software video mode (y) or (n)
ScreenFollowsMouse=
# Generate more touch events, by default SDL generates one event per one video frame, this is useful for drawing apps (y) or (n)
GenerateSubframeTouchEvents=
@@ -188,10 +191,11 @@ RedefinedKeysScreenKb="LALT RETURN KP_PLUS KP_MINUS SPACE DELETE KP_PLUS KP_MINU
RedefinedKeysScreenKbNames="LALT RETURN KP_PLUS KP_MINUS SPACE DELETE KP_PLUS KP_MINUS 1 2"
# On-screen keys theme
# 0 = Ultimate Droid by Sean Stieber (green, with gamepad joystick)
# 1 = Simple Theme by Beholder (white, with gamepad joystick)
# 0 = Ultimate Droid by Sean Stieber (green, with cross joystick)
# 1 = Simple Theme by Beholder (white, with cross joystick)
# 2 = Sun by Sirea (yellow, with round joystick)
# 3 = Keen by Gerstrong (multicolor, with round joystick)
# 4 = Retro by Santiago Radeff (red/white, with cross joystick)
TouchscreenKeysTheme=2
# Redefine gamepad keys to SDL keysyms, button order is:
@@ -211,13 +215,16 @@ HiddenMenuOptions='SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMouse.Dis
# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout SettingsMenuKeyboard.ScreenKeyboardAdvanced
FirstStartMenuOptions=''
# 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 x86' #armeabi-v7a x86
# Minimum amount of RAM application requires, in Mb, SDL will print warning to user if it's lower
AppMinimumRAM=0
# GCC version, 4.6 (default) or 4.8, CLANG is not supported yet
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'
# 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
# Available libraries: mad (GPL-ed!) sdl_mixer sdl_image sdl_ttf sdl_net sdl_blitpool sdl_gfx sdl_sound intl xml2 lua jpeg png ogg flac tremor vorbis freetype xerces curl theora fluidsynth lzma lzo2 mikmod openal timidity zzip bzip2 yaml-cpp python boost_date_time boost_filesystem boost_iostreams boost_program_options boost_regex boost_signals boost_system boost_thread glu avcodec avdevice avfilter avformat avresample avutil swscale swresample bzip2

View File

@@ -211,16 +211,76 @@ KEYCODE_BUTTON_14 = 201,
KEYCODE_BUTTON_15 = 202,
KEYCODE_BUTTON_16 = 203,
// Press mouse buttons with keyboard events
KEYCODE_MOUSE_LEFT = 248,
KEYCODE_MOUSE_MIDDLE = 249,
KEYCODE_MOUSE_RIGHT = 250,
KEYCODE_MOUSE_WHEEL_UP = 251,
KEYCODE_MOUSE_WHEEL_DOWN= 252,
KEYCODE_MOUSE_X1 = 253,
KEYCODE_MOUSE_X2 = 254,
// ZOMG Lollipop keycodes, why so many?
KEYCODE_LAST = 255 // Android 2.3 added several new gaming keys, Android 3.1 added even more - plz keep in sync with Keycodes.java
KEYCODE_LANGUAGE_SWITCH = 204,
KEYCODE_MANNER_MODE = 205,
KEYCODE_3D_MODE = 206,
KEYCODE_CONTACTS = 207,
KEYCODE_CALENDAR = 208,
KEYCODE_MUSIC = 209,
KEYCODE_CALCULATOR = 210,
KEYCODE_ZENKAKU_HANKAKU = 211,
KEYCODE_EISU = 212,
KEYCODE_MUHENKAN = 213,
KEYCODE_HENKAN = 214,
KEYCODE_KATAKANA_HIRAGANA = 215,
KEYCODE_YEN = 216,
KEYCODE_RO = 217,
KEYCODE_KANA = 218,
KEYCODE_ASSIST = 219,
KEYCODE_BRIGHTNESS_DOWN = 220,
KEYCODE_BRIGHTNESS_UP = 221,
KEYCODE_MEDIA_AUDIO_TRACK = 222,
KEYCODE_SLEEP = 223,
KEYCODE_WAKEUP = 224,
KEYCODE_PAIRING = 225,
KEYCODE_MEDIA_TOP_MENU = 226,
// WTF where's KEYCODE_10?
KEYCODE_11 = 227,
KEYCODE_12 = 228,
KEYCODE_LAST_CHANNEL = 229,
KEYCODE_TV_DATA_SERVICE = 230,
KEYCODE_VOICE_ASSIST = 231,
KEYCODE_TV_RADIO_SERVICE = 232,
KEYCODE_TV_TELETEXT = 233,
KEYCODE_TV_NUMBER_ENTRY = 234,
KEYCODE_TV_TERRESTRIAL_ANALOG = 235,
KEYCODE_TV_TERRESTRIAL_DIGITAL = 236,
KEYCODE_TV_SATELLITE = 237,
KEYCODE_TV_SATELLITE_BS = 238,
KEYCODE_TV_SATELLITE_CS = 239,
KEYCODE_TV_SATELLITE_SERVICE = 240,
KEYCODE_TV_NETWORK = 241,
KEYCODE_TV_ANTENNA_CABLE = 242,
KEYCODE_TV_INPUT_HDMI_1 = 243,
KEYCODE_TV_INPUT_HDMI_2 = 244,
KEYCODE_TV_INPUT_HDMI_3 = 245,
KEYCODE_TV_INPUT_HDMI_4 = 246,
KEYCODE_TV_INPUT_COMPOSITE_1 = 247,
KEYCODE_TV_INPUT_COMPOSITE_2 = 248,
KEYCODE_TV_INPUT_COMPONENT_1 = 249,
KEYCODE_TV_INPUT_COMPONENT_2 = 250,
KEYCODE_TV_INPUT_VGA_1 = 251,
KEYCODE_TV_AUDIO_DESCRIPTION = 252,
KEYCODE_TV_AUDIO_DESCRIPTION_MIX_UP = 253,
KEYCODE_TV_AUDIO_DESCRIPTION_MIX_DOWN = 254,
KEYCODE_TV_ZOOM_MODE = 255,
KEYCODE_TV_CONTENTS_MENU = 256,
KEYCODE_TV_MEDIA_CONTEXT_MENU = 257,
KEYCODE_TV_TIMER_PROGRAMMING = 258,
KEYCODE_HELP = 259,
// Press mouse buttons with keyboard events
KEYCODE_MOUSE_LEFT = 293,
KEYCODE_MOUSE_MIDDLE = 294,
KEYCODE_MOUSE_RIGHT = 295,
KEYCODE_MOUSE_WHEEL_UP = 296,
KEYCODE_MOUSE_WHEEL_DOWN= 297,
KEYCODE_MOUSE_X1 = 298,
KEYCODE_MOUSE_X2 = 299,
KEYCODE_LAST = 300 // Android 2.3 added several new gaming keys, Android 3.1 added even more - plz keep in sync with Keycodes.java
};
#endif

View File

@@ -11,4 +11,4 @@
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target.
target=Google Inc.:Google APIs:21
target=android-22

View File

@@ -14,7 +14,7 @@ Install latest Android SDK and NDK from http://developer.android.com/index.html
You'll need to install Java Ant too. Since for building apk files some java classes are needed as well,
it is recommended to install OpenJDK and its development files. (On RPM based distros
usually called java-x.x.x-openjdk and java-x.x.x-openjdk-devel)
The application will run on Android 1.6 and above, but will use features from Android 5.0 if available.
The application will run on Android 1.6 and above, but will use features from Android 5.1 if available.
The most supported environment for this port is Linux, MacOs should be okay too.
If you're developing under Windows you'd better install Portable Ubuntu, to get proper Linux environment
running inside Windows, then install Linux toolchain on it.

View File

@@ -37,14 +37,4 @@ TODO, which will get actually done
- OpenTTD: tutorial.
- OpenTTD: horizintal toobar popup menu out of screen.
- OpenTTD: tap anywhere to close popup menu.
- OpenTTD: Ctrl key does not work when using physical keyboard.
- OpenTTD: 24bpp color mode + 32bpp blitter in SDL menu.
- OpenTTD: better support for hardware right mouse button.
- Add glshim library: https://github.com/lunixbochs/glshim