From 8f061fe8c8db5a64c47c9305d2a5f087ce3d60f5 Mon Sep 17 00:00:00 2001 From: pelya Date: Thu, 2 Dec 2010 17:32:10 +0200 Subject: [PATCH] Updated openttd and TeeWorlds projects --- project/jni/application/commandergenius | 2 +- .../openttd-lowmem/AndroidAppSettings.cfg | 4 +- .../openttd/openttd-trunk-android.patch | 18 +++--- project/jni/application/src | 2 +- .../teeworlds/AndroidAppSettings.cfg | 9 ++- .../teeworlds/src/engine/client/ec_gfx.cpp | 57 +++++++++++-------- .../src/game/client/components/binds.cpp | 1 + todo.txt | 4 ++ 8 files changed, 57 insertions(+), 40 deletions(-) diff --git a/project/jni/application/commandergenius b/project/jni/application/commandergenius index 800f65404..3add96a0e 160000 --- a/project/jni/application/commandergenius +++ b/project/jni/application/commandergenius @@ -1 +1 @@ -Subproject commit 800f654045bd13411fcb83cf34a83d60d278f7a4 +Subproject commit 3add96a0eed06a4438bac6324a3aee6be550402b diff --git a/project/jni/application/openttd-lowmem/AndroidAppSettings.cfg b/project/jni/application/openttd-lowmem/AndroidAppSettings.cfg index d09c77e5c..014a1e992 100644 --- a/project/jni/application/openttd-lowmem/AndroidAppSettings.cfg +++ b/project/jni/application/openttd-lowmem/AndroidAppSettings.cfg @@ -21,8 +21,8 @@ RedefinedKeys="LALT RETURN KP_PLUS KP_MINUS DELETE" AppTouchscreenKeyboardKeysAmount=0 AppTouchscreenKeyboardKeysAmountAutoFire=0 MultiABI=n -AppVersionCode=10504 -AppVersionName="1.0.5.04" +AppVersionCode=10506 +AppVersionName="1.0.5.06" CompiledLibraries="png lzo2" CustomBuildScript=y AppCflags='' diff --git a/project/jni/application/openttd/openttd-trunk-android.patch b/project/jni/application/openttd/openttd-trunk-android.patch index 5eb4888fe..231ab404c 100644 --- a/project/jni/application/openttd/openttd-trunk-android.patch +++ b/project/jni/application/openttd/openttd-trunk-android.patch @@ -1,6 +1,6 @@ Index: src/video/sdl_v.cpp =================================================================== ---- src/video/sdl_v.cpp (revision 21311) +--- src/video/sdl_v.cpp (revision 21293) +++ src/video/sdl_v.cpp (working copy) @@ -485,6 +485,9 @@ SDL_CALL SDL_EnableUNICODE(1); @@ -14,7 +14,7 @@ Index: src/video/sdl_v.cpp } Index: src/sound/sdl_s.cpp =================================================================== ---- src/sound/sdl_s.cpp (revision 21311) +--- src/sound/sdl_s.cpp (revision 21293) +++ src/sound/sdl_s.cpp (working copy) @@ -20,9 +20,16 @@ @@ -27,7 +27,7 @@ Index: src/sound/sdl_s.cpp static void CDECL fill_sound_buffer(void *userdata, Uint8 *stream, int len) { MxMixSamples(stream, len / 4); -+#ifdef ANDROID ++#if defined(ANDROID) && defined(LIBTIMIDITY) + Android_MidiMixMusic((Sint16 *)stream, len / 2); +#endif } @@ -35,7 +35,7 @@ Index: src/sound/sdl_s.cpp const char *SoundDriver_SDL::Start(const char * const *parm) Index: src/music/libtimidity.cpp =================================================================== ---- src/music/libtimidity.cpp (revision 21311) +--- src/music/libtimidity.cpp (revision 21293) +++ src/music/libtimidity.cpp (working copy) @@ -23,10 +23,13 @@ #include @@ -78,7 +78,7 @@ Index: src/music/libtimidity.cpp Index: src/os/unix/unix.cpp =================================================================== ---- src/os/unix/unix.cpp (revision 21311) +--- src/os/unix/unix.cpp (revision 21293) +++ src/os/unix/unix.cpp (working copy) @@ -24,7 +24,7 @@ @@ -103,7 +103,7 @@ Index: src/os/unix/unix.cpp int ret; Index: src/os/unix/crashlog_unix.cpp =================================================================== ---- src/os/unix/crashlog_unix.cpp (revision 21311) +--- src/os/unix/crashlog_unix.cpp (revision 21293) +++ src/os/unix/crashlog_unix.cpp (working copy) @@ -141,7 +141,11 @@ }; @@ -119,7 +119,7 @@ Index: src/os/unix/crashlog_unix.cpp * Entry point for the crash handler. Index: src/network/core/os_abstraction.h =================================================================== ---- src/network/core/os_abstraction.h (revision 21311) +--- src/network/core/os_abstraction.h (revision 21293) +++ src/network/core/os_abstraction.h (working copy) @@ -159,7 +159,7 @@ # include @@ -132,7 +132,7 @@ Index: src/network/core/os_abstraction.h * the list of IPs from the system. */ Index: src/debug.cpp =================================================================== ---- src/debug.cpp (revision 21311) +--- src/debug.cpp (revision 21293) +++ src/debug.cpp (working copy) @@ -16,6 +16,9 @@ #include "string_func.h" @@ -156,7 +156,7 @@ Index: src/debug.cpp char buf2[1024 + 32]; Index: src/main_gui.cpp =================================================================== ---- src/main_gui.cpp (revision 21311) +--- src/main_gui.cpp (revision 21293) +++ src/main_gui.cpp (working copy) @@ -275,7 +275,11 @@ } diff --git a/project/jni/application/src b/project/jni/application/src index 550b7b622..299033683 120000 --- a/project/jni/application/src +++ b/project/jni/application/src @@ -1 +1 @@ -openttd \ No newline at end of file +teeworlds \ No newline at end of file diff --git a/project/jni/application/teeworlds/AndroidAppSettings.cfg b/project/jni/application/teeworlds/AndroidAppSettings.cfg index 5adde9152..a41e05a71 100644 --- a/project/jni/application/teeworlds/AndroidAppSettings.cfg +++ b/project/jni/application/teeworlds/AndroidAppSettings.cfg @@ -1,5 +1,5 @@ # The application settings for Android libSDL port -AppSettingVersion=12 +AppSettingVersion=15 LibSdlVersion=1.2 AppName="TeeWorlds" AppFullName=com.teeworlds @@ -10,7 +10,9 @@ SdlVideoResize=n SdlVideoResizeKeepAspect=n NeedDepthBuffer=n AppUsesMouse=y +AppNeedsTwoButtonMouse=y AppNeedsArrowKeys=y +AppNeedsTextInput=y AppUsesJoystick=n AppHandlesJoystickSensitivity=n AppUsesMultitouch=n @@ -19,12 +21,13 @@ RedefinedKeys="SPACE RETURN LEFT RIGHT LSHIFT ESCAPE RSHIFT LSHIFT" AppTouchscreenKeyboardKeysAmount=6 AppTouchscreenKeyboardKeysAmountAutoFire=0 MultiABI=y -AppVersionCode=5203 -AppVersionName="0.5.2.03 - fixed crashes for some devices" +AppVersionCode=5204 +AppVersionName="0.5.2.04" CompiledLibraries="sdl_image freetype" CustomBuildScript=n AppCflags='-O3' AppLdflags='' AppSubdirsBuild='' AppUseCrystaXToolchain=n +AppCmdline='' ReadmeText='^You may press "Home" now - the data will be downloaded in background' diff --git a/project/jni/application/teeworlds/src/engine/client/ec_gfx.cpp b/project/jni/application/teeworlds/src/engine/client/ec_gfx.cpp index 209f6263f..48c8922b7 100644 --- a/project/jni/application/teeworlds/src/engine/client/ec_gfx.cpp +++ b/project/jni/application/teeworlds/src/engine/client/ec_gfx.cpp @@ -309,45 +309,54 @@ static int try_init() #if defined(ANDROID) // Redefine button layout { + // Disable DPAD SDL_Rect pos = {0, 0, 0, 0}; SDL_ANDROID_SetScreenKeyboardButtonPos(SDL_ANDRIOD_SCREENKEYBOARD_BUTTON_DPAD, &pos); - - pos.x = screen_width - screen_width / 16; - pos.y = screen_height - screen_height / 8; - pos.w = screen_width / 2 /*(SDL_ANDROID_GetScreenKeyboardSize() + 2)*/ / 4; - pos.h = pos.w; - pos.x -= pos.w/2; - pos.y -= pos.h/2; + + // Rope button in lower-right + pos.x = screen_width; + pos.y = screen_height; + pos.w = screen_width / 6; + pos.h = pos.w * 2 / 3; + pos.x -= pos.w; + pos.y -= pos.h; SDL_ANDROID_SetScreenKeyboardButtonPos(SDL_ANDRIOD_SCREENKEYBOARD_BUTTON_0, &pos); - pos.x -= screen_width / 8; - - SDL_ANDROID_SetScreenKeyboardButtonPos(SDL_ANDRIOD_SCREENKEYBOARD_BUTTON_1, &pos); - - pos.x = screen_width / 16; - pos.x -= pos.w/2; + // Move and jump buttons overlapped in lower-left + pos.x = 0; + pos.y = screen_height; + pos.w = screen_width / 8; + pos.h = pos.w*1.5; + pos.y -= pos.h; SDL_ANDROID_SetScreenKeyboardButtonPos(SDL_ANDRIOD_SCREENKEYBOARD_BUTTON_2, &pos); - pos.x += screen_width / 8; + pos.x += pos.w; SDL_ANDROID_SetScreenKeyboardButtonPos(SDL_ANDRIOD_SCREENKEYBOARD_BUTTON_3, &pos); - //pos.y = screen_height - screen_height / 8 - screen_height / 4; - //pos.y -= pos.h/2; + pos.w *= 2; + pos.h = pos.w*2/3; + pos.x = 0; + pos.y -= pos.h/2; - pos.y -= pos.h; - - pos.x = screen_width / 16; - pos.x -= pos.w/2; + SDL_ANDROID_SetScreenKeyboardButtonPos(SDL_ANDRIOD_SCREENKEYBOARD_BUTTON_1, &pos); + + // weapprev weapnext buttons + + pos.x = screen_width; + pos.y = screen_height / 6; + pos.w = screen_width / 10; + pos.h = pos.w; + pos.x -= pos.w; + + SDL_ANDROID_SetScreenKeyboardButtonPos(SDL_ANDRIOD_SCREENKEYBOARD_BUTTON_5, &pos); + + pos.x = 0; SDL_ANDROID_SetScreenKeyboardButtonPos(SDL_ANDRIOD_SCREENKEYBOARD_BUTTON_4, &pos); - pos.x = screen_width - screen_width / 16; - pos.x -= pos.w/2; - - SDL_ANDROID_SetScreenKeyboardButtonPos(SDL_ANDRIOD_SCREENKEYBOARD_BUTTON_5, &pos); } #endif diff --git a/project/jni/application/teeworlds/src/game/client/components/binds.cpp b/project/jni/application/teeworlds/src/game/client/components/binds.cpp index 28a8daae0..7ab5ba407 100644 --- a/project/jni/application/teeworlds/src/game/client/components/binds.cpp +++ b/project/jni/application/teeworlds/src/game/client/components/binds.cpp @@ -92,6 +92,7 @@ void BINDS::set_defaults() bind(KEY_DOWN, "+hook"); bind(KEY_RETURN, "+jump"); bind(KEY_SPACE, "+hook"); + bind(KEY_MOUSE_2, "+hook"); bind(KEY_LSHIFT, "+nextweapon"); bind(KEY_RSHIFT, "+prevweapon"); diff --git a/todo.txt b/todo.txt index cf978a6b6..2aebb243c 100644 --- a/todo.txt +++ b/todo.txt @@ -19,4 +19,8 @@ Bugs to fix - Zoom and rotate multitouch gestures should return some keycodes. +- Adjustable speed for moving mouse via joystick + +- Mouse buttons assigned to hw buttons only + And that's all, I won't be doing any more development or fix other bugs (see bugs.txt for details).