From f9132a0e48f322ce167bc7431d7e23a5bd0087f4 Mon Sep 17 00:00:00 2001 From: pelya Date: Fri, 18 Oct 2013 21:44:00 +0300 Subject: [PATCH] Updated UQM-HD --- .../application/uqm-hd/AndroidAppSettings.cfg | 25 +- .../application/uqm-hd/AndroidData/data.zip | Bin 223 -> 6490 bytes project/jni/application/uqm-hd/android.diff | 2742 +++++++++-------- todo.txt | 2 - 4 files changed, 1463 insertions(+), 1306 deletions(-) diff --git a/project/jni/application/uqm-hd/AndroidAppSettings.cfg b/project/jni/application/uqm-hd/AndroidAppSettings.cfg index 3b6c7d158..d3097f274 100644 --- a/project/jni/application/uqm-hd/AndroidAppSettings.cfg +++ b/project/jni/application/uqm-hd/AndroidAppSettings.cfg @@ -1,6 +1,6 @@ # The application settings for Android libSDL port -AppSettingVersion=18 +AppSettingVersion=19 # libSDL version to use (1.2 or 1.3, specify 1.3 for SDL2) LibSdlVersion=1.2 @@ -23,7 +23,7 @@ InhibitSuspend=n # 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 -AppDataDownloadUrl="!!640x480 graphics (160 Mb)|:packages/uqm-content.uqm:http://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/uqm-hd-content-640-1.uqm/download^1280x960 graphics (360 Mb)|:packages/hires4x.uqm:http://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/uqm-hd-content-1280-1.uqm/download^!UQM music remix pack (240 Mb)|:addons/uqm-remix.uqm:http://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/uqm-remix.uqm/download^!Voice pack (120 Mb)|:addons/uqm-0.7.0-voice.uqm:http://sourceforge.net/projects/sc2/files/UQM/0.7/uqm-0.7.0-voice.uqm/download^3DO music (20 Mb)|:addons/uqm-0.7.0-3domusic.uqm:http://sourceforge.net/projects/sc2/files/UQM/0.7/uqm-0.7.0-3domusic.uqm/download^Russian translation|http://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/translations/uqm-hd-russian-1.uqm/download^Deutsch translation|:addons/lang/shadow-content/lang.zip:http://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/translations/2/deutsch.zip/download^Spanish translation|:addons/lang/shadow-content/lang.zip:http://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/translations/2/spanish.zip/download^Slovak translation|:addons/lang/shadow-content/lang.zip:http://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/translations/2/slovak.zip/download^Finnish translation|:addons/lang/shadow-content/lang.zip:http://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/translations/2/finnish.zip/download^!!Game data|data.zip" +AppDataDownloadUrl="!!640x480 graphics (160 Mb)|:packages/hires2x.uqm:http://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/uqm-hd-hires2x_0.2.uqm/download^1280x960 graphics (360 Mb)|:packages/hires4x.uqm:http://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/uqm-hd-hires4x_0.2.uqm/download^!UQM music remix pack (240 Mb)|:addons/uqm-remix.uqm:http://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/uqm-remix.uqm/download^3DO music (20 Mb)|:addons/uqm-0.7.0-3domusic.uqm:http://sourceforge.net/projects/sc2/files/UQM/0.7/uqm-0.7.0-3domusic.uqm/download^!English voice pack (150 Mb)|:addons/uqm-0.7.0-voice.uqm:http://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/uqm-hd-voice_0.2.uqm/download^Japanese voice pack (130 Mb)|:addons/uqm-0.7.0-voice.uqm:http://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/uqm-hd-voice-jp_0.2.uqm/download^Russian translation|:addons/lang/shadow-content/lang.zip:http://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/translations/2/russian2.zip/download^Deutsch translation|:addons/lang/shadow-content/lang.zip:http://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/translations/2/deutsch.zip/download^Spanish translation|:addons/lang/shadow-content/lang.zip:http://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/translations/2/spanish.zip/download^Slovak translation|:addons/lang/shadow-content/lang.zip:http://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/translations/2/slovak.zip/download^Finnish translation|:addons/lang/shadow-content/lang.zip:http://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/translations/2/finnish.zip/download^!!Game data|data.zip^!!Game data|:packages/uqm-content.uqm:http://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/uqm-hd-content_0.2.uqm/download" # Video color depth - 16 BPP is the fastest and supported for all modes, 24 bpp is supported only # with SwVideoMode=y, SDL_OPENGL mode supports everything. (16)/(24)/(32) @@ -138,17 +138,28 @@ RedefinedKeysScreenKb="RCTRL RSHIFT END PAGEUP PAGEDOWN W UNKNOWN UNKNOWN UNKNOW # Names for on-screen keyboard keys, such as Fire, Jump, Run etc, separated by spaces, they are used in SDL config menu RedefinedKeysScreenKbNames="Fire Secondary_weapon Thrust Player_2_fire Player_2_secondary_weapon Player_2_thrust" +# On-screen keys theme +# 0 = Ultimate Droid by Sean Stieber (green, with gamepad joystick) +# 1 = Simple Theme by Beholder (white, with gamepad joystick) +# 2 = Sun by Sirea (yellow, with round joystick) +# 3 = Keen by Gerstrong (multicolor, with round joystick) +TouchscreenKeysTheme=2 + +# Redefine gamepad keys to SDL keysyms, button order is: +# A B X Y L1 R1 L2 R2 LThumb RThumb +RedefinedKeysGamepad="RCTRL RSHIFT END ESCAPE RCTRL PAGEUP RSHIFT PAGEDOWN END W" + # How long to show startup menu button, in msec, 0 to disable startup menu StartupMenuButtonTimeout=3000 # Menu items to hide from startup menu, available menu items: -# OkButton DummyMenu MainMenu MouseConfigMainMenu KeyboardConfigMainMenu DownloadConfig OptionalDownloadConfig ScreenKeyboardSizeConfig ScreenKeyboardDrawSizeConfig ScreenKeyboardThemeConfig ScreenKeyboardTransparencyConfig AudioConfig DisplaySizeConfig LeftClickConfig RightClickConfig AdditionalMouseConfig JoystickMouseConfig TouchPressureMeasurementTool RemapHwKeysConfig RemapScreenKbConfig ScreenGesturesConfig CalibrateTouchscreenMenu CustomizeScreenKbLayout VideoSettingsConfig ShowReadme GyroscopeCalibration ResetToDefaultsConfig +# 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 HiddenMenuOptions='' -# Menu items to show at startup - this is Java code snippet, leave empty for default: -# new Settings.ShowReadme(), (AppUsesMouse \&\& \! ForceRelativeMouseMode \? new Settings.DisplaySizeConfig(true) : new Settings.DummyMenu()), new Settings.OptionalDownloadConfig(true), new Settings.GyroscopeCalibration() +# Menu items to show at startup - this is Java code snippet, leave empty for default +# new SettingsMenuMisc.ShowReadme(), (AppUsesMouse \&\& \! ForceRelativeMouseMode \? new SettingsMenuMouse.DisplaySizeConfig(true) : new SettingsMenu.DummyMenu()), new SettingsMenuMisc.OptionalDownloadConfig(true), new SettingsMenuMisc.GyroscopeCalibration() # Available menu items: -# new Settings.OkButton(), new Settings.DummyMenu(), new Settings.MainMenu(), new Settings.MouseConfigMainMenu(), new Settings.KeyboardConfigMainMenu(), new Settings.DownloadConfig(), new Settings.OptionalDownloadConfig(), new Settings.ScreenKeyboardSizeConfig(), new Settings.ScreenKeyboardDrawSizeConfig(), new Settings.ScreenKeyboardThemeConfig(), new Settings.ScreenKeyboardTransparencyConfig(), new Settings.AudioConfig(), new Settings.DisplaySizeConfig(), new Settings.LeftClickConfig(), new Settings.RightClickConfig(), new Settings.AdditionalMouseConfig(), new Settings.JoystickMouseConfig(), new Settings.TouchPressureMeasurementTool(), new Settings.RemapHwKeysConfig(), new Settings.RemapScreenKbConfig(), new Settings.ScreenGesturesConfig(), new Settings.CalibrateTouchscreenMenu(), new Settings.CustomizeScreenKbLayout(), new Settings.VideoSettingsConfig(), new Settings.ShowReadme(), new Settings.GyroscopeCalibration(), new Settings.ResetToDefaultsConfig(), +# 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 FirstStartMenuOptions='' # Enable multi-ABI binary, with hardware FPU support - it will also work on old devices, @@ -194,7 +205,7 @@ AppSubdirsBuild='src src/libs/* src/uqm/*' AppBuildExclude='src/libs/uio/hashtable.c src/libs/uio/memdebug.c src/libs/network/socket/socket_win.c src/libs/network/network_win.c src/libs/network/netmanager/netmanager_win.c src/libs/cdp/cdpapi.c src/libs/cdp/cdp.c src/libs/cdp/windl.c' # Application command line parameters, including app name as 0-th param -AppCmdline='uqm -x -f --addon lang' +AppCmdline='uqm -x -f --addon android --addon lang' # Here you may type readme text, which will be shown during startup. Format is: # Text in English, use \\\\n to separate lines^de:Text in Deutsch^ru:Text in Russian, and so on (that's four backslashes, nice isn't it?) diff --git a/project/jni/application/uqm-hd/AndroidData/data.zip b/project/jni/application/uqm-hd/AndroidData/data.zip index 0db1c1186da19c3e4d6827935142004bccd3d86f..e77415c8c860a281e7dd585dd7dceff2a9871dac 100644 GIT binary patch literal 6490 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 i++) + { ++ log_add (log_Info, "Mounting ZIP '%s'", dirList->names[i]); + if (uio_mountDir (repository, mountPoint, uio_FSTYPE_ZIP, + dirHandle, dirList->names[i], "/", autoMount, + relativeFlags | uio_MOUNT_RDONLY, +Index: options.h +=================================================================== +--- options.h (revision 1351) ++++ options.h (working copy) +@@ -54,6 +54,7 @@ + extern BOOLEAN optRotatingIpPlanets; + extern BOOLEAN optTexturedIpPlanets; + extern BOOLEAN optCheatMode; ++extern BOOLEAN optDirectionalJoystick; + + extern BOOLEAN opt3doMusic; + extern BOOLEAN optRemixMusic; +Index: uqm.c +=================================================================== +--- uqm.c (revision 1351) ++++ uqm.c (working copy) +@@ -63,6 +63,22 @@ + // Including this is actually necessary on OSX. + #endif + ++#if defined (ANDROID) ++# include ++static void AndroidAppPutToBackgroundCallback (void) ++{ ++ SDL_ANDROID_PauseAudioPlayback (); ++ GameActive = FALSE; ++ //GamePaused = TRUE; ++} ++static void SDLCALL AndroidAppRestoredCallback (void) ++{ ++ SDL_ANDROID_ResumeAudioPlayback (); ++ GameActive = TRUE; ++ //GamePaused = FALSE; ++} ++#endif ++ + struct bool_option + { + bool value; +@@ -138,6 +154,7 @@ + DECL_CONFIG_OPTION(bool, rotatingIpPlanets); // JMS + DECL_CONFIG_OPTION(bool, texturedIpPlanets); // JMS + DECL_CONFIG_OPTION(bool, cheatMode); // JMS ++ DECL_CONFIG_OPTION(bool, directionalJoystick); + + #define INIT_CONFIG_OPTION(name, val) \ + { val, false } +@@ -256,8 +273,8 @@ + INIT_CONFIG_OPTION( gamma, 0.0f ), + INIT_CONFIG_OPTION( soundDriver, audio_DRIVER_MIXSDL ), + INIT_CONFIG_OPTION( soundQuality, audio_QUALITY_MEDIUM ), +- INIT_CONFIG_OPTION( use3doMusic, true ), +- INIT_CONFIG_OPTION( useRemixMusic, false ), ++ INIT_CONFIG_OPTION( use3doMusic, false ), ++ INIT_CONFIG_OPTION( useRemixMusic, true ), + INIT_CONFIG_OPTION( whichCoarseScan, OPT_PC ), + INIT_CONFIG_OPTION( whichMenu, OPT_PC ), + INIT_CONFIG_OPTION( whichFonts, OPT_PC ), +@@ -269,17 +286,18 @@ + INIT_CONFIG_OPTION( stereoSFX, false ), + INIT_CONFIG_OPTION( musicVolumeScale, 1.0f ), + INIT_CONFIG_OPTION( sfxVolumeScale, 1.0f ), +- INIT_CONFIG_OPTION( speechVolumeScale, 0.3f ), ++ INIT_CONFIG_OPTION( speechVolumeScale, 0.7f ), + INIT_CONFIG_OPTION( safeMode, false ), +- INIT_CONFIG_OPTION( resolutionFactor, 2 ), ++ INIT_CONFIG_OPTION( resolutionFactor, 1 ), + INIT_CONFIG_OPTION( forceAspectRatio, false ), + INIT_CONFIG_OPTION( loresBlowupScale, 0 ), + INIT_CONFIG_OPTION( mainmenuMusic, true ), +- INIT_CONFIG_OPTION( mineralSubmenu, true ), ++ INIT_CONFIG_OPTION( mineralSubmenu, false ), + INIT_CONFIG_OPTION( nebulae, true ), + INIT_CONFIG_OPTION( rotatingIpPlanets, true), + INIT_CONFIG_OPTION( texturedIpPlanets, true), + INIT_CONFIG_OPTION( cheatMode, false ), ++ INIT_CONFIG_OPTION( directionalJoystick, true ), + }; + struct options_struct defaults = options; + int optionsResult; +@@ -346,6 +364,14 @@ + return optionsResult; + } + ++#if defined (ANDROID) ++ SDL_ANDROID_SetApplicationPutToBackgroundCallback (AndroidAppPutToBackgroundCallback, AndroidAppRestoredCallback); ++ if( !fileExists("config/save") ) { ++ // Copy savegames from UQM non-HD, I'm too lazy to do that properly. ++ system("SAVEDIR=`pwd`/config/save ; mkdir -p $SAVEDIR ; cd ../../../../app-data/com.sourceforge.sc2/config/save || exit 1 ; for f in * ; do cat $f > $SAVEDIR/$f ; done"); ++ } ++#endif ++ + TFB_PreInit (); + mem_init (); + InitThreadSystem (); +@@ -413,6 +439,7 @@ + optRotatingIpPlanets = options.rotatingIpPlanets.value; // JMS + optTexturedIpPlanets = options.texturedIpPlanets.value || optRotatingIpPlanets; // JMS + optCheatMode = options.cheatMode.value; // JMS ++ optDirectionalJoystick = options.directionalJoystick.value; + + prepareContentDir (options.contentDir, options.addonDir, argv[0]); + prepareMeleeDir (); +@@ -696,6 +723,7 @@ + getBoolConfigValue (&options->rotatingIpPlanets, "config.rotatingIpPlanets"); + getBoolConfigValue (&options->texturedIpPlanets, "config.texturedIpPlanets"); + getBoolConfigValue (&options->cheatMode, "config.cheatMode"); ++ getBoolConfigValue (&options->directionalJoystick, "config.directionaljoystick"); + + if (res_IsInteger ("config.player1control")) + { +Index: libs/md5/md5.c +=================================================================== +--- libs/md5/md5.c (revision 1351) ++++ libs/md5/md5.c (working copy) @@ -21,7 +21,7 @@ /* Written by Ulrich Drepper , 1995. */ @@ -11,10 +142,103 @@ Index: src/libs/md5/md5.c #include "md5.h" -Index: src/libs/input/sdl/input.c +Index: libs/sound/decoders/oggaud.c =================================================================== ---- src/libs/input/sdl/input.c (revision 1330) -+++ src/libs/input/sdl/input.c (working copy) +--- libs/sound/decoders/oggaud.c (revision 1351) ++++ libs/sound/decoders/oggaud.c (working copy) +@@ -270,7 +270,7 @@ + // this is the closest to a frame there is in ogg vorbis stream + // doesn't seem to be a func to retrive it + #ifdef OVCODEC_TREMOR +- return ova->vf.os->pageno; ++ return ova->vf.os.pageno; + #else + return ova->vf.os.pageno; + #endif /* OVCODEC_TREMOR */ +Index: libs/resource/filecntl.c +=================================================================== +--- libs/resource/filecntl.c (revision 1351) ++++ libs/resource/filecntl.c (working copy) +@@ -26,6 +26,7 @@ + #include "port.h" + #include "resintrn.h" + #include "libs/uio.h" ++#include "libs/log.h" + + uio_Stream * + res_OpenResFile (uio_DirHandle *dir, const char *filename, const char *mode) +@@ -34,7 +35,10 @@ + struct stat sb; + + if (uio_stat (dir, filename, &sb) == 0 && S_ISDIR(sb.st_mode)) ++ { ++ log_add (log_Debug, "res_OpenResFile('%s', '%s') - cannot open dir as file", filename, mode); + return ((uio_Stream *) ~0); ++ } + + fp = uio_fopen (dir, filename, mode); + +Index: libs/strings/unicode.c +=================================================================== +--- libs/strings/unicode.c (revision 1351) ++++ libs/strings/unicode.c (working copy) +@@ -41,7 +41,8 @@ + // function. + UniChar + getCharFromString(const unsigned char **ptr) { +- UniChar result; ++ const unsigned char *origPtr = *ptr; ++ UniChar result, errData; + + if (**ptr < 0x80) { + // 0xxxxxxx, regular ASCII +@@ -121,7 +122,14 @@ + } + + err: +- log_add(log_Warning, "Warning: Invalid UTF8 sequence."); ++ errData = origPtr[0] * 0x1000000; ++ if (origPtr[0] && origPtr[1]) ++ errData &= origPtr[1] * 0x10000; ++ if (origPtr[0] && origPtr[1] && origPtr[2]) ++ errData &= origPtr[2] * 0x100; ++ if (origPtr[0] && origPtr[1] && origPtr[2] && origPtr[3]) ++ errData &= origPtr[3]; ++ log_add(log_Warning, "Warning: Invalid UTF8 sequence: result 0x%x last byte 0x%02x str 0x%08x %s", result, (unsigned)(**ptr), errData, origPtr); + + // Resynchronise (skip everything starting with 0x10xxxxxx): + resyncUTF8(ptr); +Index: libs/input/input_common.h +=================================================================== +--- libs/input/input_common.h (revision 1351) ++++ libs/input/input_common.h (working copy) +@@ -31,7 +31,7 @@ + extern int TFB_InitInput (int driver, int flags); + extern void TFB_UninitInput (void); + +-#define MAX_FLIGHT_ALTERNATES 2 ++#define MAX_FLIGHT_ALTERNATES 3 + + extern void TFB_SetInputVectors (volatile int menu[], int num_menu, + volatile int flight[], int num_templ, int num_flight); +Index: libs/input/sdl/vcontrol.h +=================================================================== +--- libs/input/sdl/vcontrol.h (revision 1351) ++++ libs/input/sdl/vcontrol.h (working copy) +@@ -76,6 +76,9 @@ + void VControl_ProcessJoyAxis (int port, int axis, int value); + void VControl_ProcessJoyHat (int port, int which, Uint8 value); + ++int VControl_GetJoyAxis(int port, int axis); ++int VControl_GetJoysticksAmount(); ++ + /* Force the input into the blank state. For preventing "sticky" keys. */ + void VControl_ResetInput (void); + +Index: libs/input/sdl/input.c +=================================================================== +--- libs/input/sdl/input.c (revision 1351) ++++ libs/input/sdl/input.c (working copy) @@ -88,6 +88,7 @@ "weapon", "special", @@ -32,10 +256,10 @@ Index: src/libs/input/sdl/input.c register_flight_controls (); return; -Index: src/libs/input/sdl/vcontrol.c +Index: libs/input/sdl/vcontrol.c =================================================================== ---- src/libs/input/sdl/vcontrol.c (revision 1330) -+++ src/libs/input/sdl/vcontrol.c (working copy) +--- libs/input/sdl/vcontrol.c (revision 1351) ++++ libs/input/sdl/vcontrol.c (working copy) @@ -46,6 +46,7 @@ typedef struct vcontrol_joystick_axis { keybinding *neg, *pos; @@ -95,73 +319,168 @@ Index: src/libs/input/sdl/vcontrol.c void VControl_ResetInput (void) { -Index: src/libs/input/sdl/vcontrol.h +Index: libs/log/msgbox_stub.c =================================================================== ---- src/libs/input/sdl/vcontrol.h (revision 1330) -+++ src/libs/input/sdl/vcontrol.h (working copy) -@@ -76,6 +76,9 @@ - void VControl_ProcessJoyAxis (int port, int axis, int value); - void VControl_ProcessJoyHat (int port, int which, Uint8 value); +--- libs/log/msgbox_stub.c (revision 1351) ++++ libs/log/msgbox_stub.c (working copy) +@@ -16,6 +16,9 @@ -+int VControl_GetJoyAxis(int port, int axis); -+int VControl_GetJoysticksAmount(); + #include "msgbox.h" + #include "loginternal.h" ++#ifdef ANDROID ++#include ++#endif + + void + log_displayBox (const /*UTF-8*/char *title, int isError, +@@ -26,6 +29,9 @@ + // So just inform the user of our predicament + fprintf (streamOut, "Do not know how to display %s box\n", + isError ? "an error" : "a"); ++#ifdef ANDROID ++ __android_log_print( isError ? ANDROID_LOG_FATAL : ANDROID_LOG_INFO, "Ur-Quan Masters", "%s: %s", title, msg ); ++#endif + + // Suppress the compiler warnings in any case. + (void)title; +Index: libs/log/uqmlog.c +=================================================================== +--- libs/log/uqmlog.c (revision 1351) ++++ libs/log/uqmlog.c (working copy) +@@ -23,6 +23,9 @@ + #include + #include + #include ++#ifdef ANDROID ++#include ++#endif + #include "libs/threadlib.h" + + #ifndef MAX_LOG_ENTRY_SIZE +@@ -190,6 +193,9 @@ + if ((int)level <= maxStreamLevel) + { + fprintf (streamOut, "%s\n", full_msg); ++#ifdef ANDROID ++ __android_log_print( ANDROID_LOG_INFO, "Ur-Quan Masters", "%s", full_msg ); ++#endif + } + + if ((int)level <= maxLevel) +@@ -226,6 +232,9 @@ + if ((int)level <= maxStreamLevel) + { + fprintf (streamOut, "%s\n", full_msg); ++#ifdef ANDROID ++ __android_log_print( ANDROID_LOG_INFO, "Ur-Quan Masters", "%s", full_msg ); ++#endif + } + + if ((int)level <= maxLevel) +Index: libs/log/msgbox_win.c +=================================================================== +--- libs/log/msgbox_win.c (revision 1351) ++++ libs/log/msgbox_win.c (working copy) +@@ -14,6 +14,7 @@ + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + ++#ifndef ANDROID + #include "msgbox.h" + #define WIN32_LEAN_AND_MEAN + #include +@@ -64,4 +65,4 @@ + free (swTitle); + free (swMsg); + } +- ++#endif +Index: libs/uio/zip/zip.c +=================================================================== +--- libs/uio/zip/zip.c (revision 1351) ++++ libs/uio/zip/zip.c (working copy) +@@ -1366,6 +1366,10 @@ + gPFileData->gid = (uid_t) makeUInt16(buf[12], buf[13]); + break; + } ++ case 0x7875: // 'Unix string UID/GID' ++ // Just skip it ++ break; + - /* Force the input into the blank state. For preventing "sticky" keys. */ - void VControl_ResetInput (void); - -Index: src/libs/input/input_common.h + default: + #ifdef DEBUG + fprintf(stderr, "Debug: Extra field 0x%04x unsupported, " +Index: libs/uio/io.c =================================================================== ---- src/libs/input/input_common.h (revision 1330) -+++ src/libs/input/input_common.h (working copy) -@@ -31,7 +31,7 @@ - extern int TFB_InitInput (int driver, int flags); - extern void TFB_UninitInput (void); +--- libs/uio/io.c (revision 1351) ++++ libs/uio/io.c (working copy) +@@ -35,6 +35,7 @@ + #include "mem.h" + #include "uioutils.h" + #include "uioport.h" ++#include "../log.h" + #ifdef uio_MEM_DEBUG + # include "memdebug.h" + #endif +@@ -193,6 +194,7 @@ + errno = EINVAL; + return NULL; + } ++ log_add (log_Info, "uio_open %s", sourcePath); + handle = uio_open(sourceDir, sourcePath, + ((flags & uio_MOUNT_RDONLY) == uio_MOUNT_RDONLY ? + O_RDONLY : O_RDWR) +@@ -201,12 +203,14 @@ + #endif + , 0); + if (handle == NULL) { ++ log_add (log_Info, "uio_open failed for %s", sourcePath); + // errno is set + return NULL; + } + } --#define MAX_FLIGHT_ALTERNATES 2 -+#define MAX_FLIGHT_ALTERNATES 3 - - extern void TFB_SetInputVectors (volatile int menu[], int num_menu, - volatile int flight[], int num_templ, int num_flight); -Index: src/libs/resource/filecntl.c + handler = uio_getFileSystemHandler(fsType); ++ log_add (log_Info, "uio_getFileSystemHandler %p", handler); + if (handler == NULL) { + if (handle) + uio_close(handle); +@@ -703,6 +707,7 @@ + &readMountInfo, &readPDirHandle, NULL, + &writeMountInfo, &writePDirHandle, NULL, &name) == -1) { + // errno is set ++ log_add (log_Info, "uio_open: uio_getPhysicalAccess failed for '%s'", path); + return NULL; + } + +@@ -729,6 +734,7 @@ + uio_PDirHandle_unref(readPDirHandle); + uio_PDirHandle_unref(writePDirHandle); + errno = EEXIST; ++ log_add (log_Info, "uio_open: O_CREAT | O_EXCL: file already exists '%s'", name); + return NULL; + } + if ((flags & O_TRUNC) == O_TRUNC) { +@@ -745,6 +751,7 @@ + uio_PDirHandle_unref(readPDirHandle); + uio_PDirHandle_unref(writePDirHandle); + errno = savedErrno; ++ log_add (log_Info, "uio_open: uio_copyFilePhysical failed '%s'", name); + return NULL; + } + } +@@ -766,6 +773,7 @@ + handle = (pDirHandle->pRoot->handler->open)(pDirHandle, name, flags, mode); + // Also adds a new entry to the physical dir if appropriate. + if (handle == NULL) { ++ log_add (log_Info, "uio_open: open file failed '%s'", name); + int savedErrno = errno; + uio_free(name); + uio_PDirHandle_unref(pDirHandle); +Index: libs/graphics/gfx_common.h =================================================================== ---- src/libs/resource/filecntl.c (revision 1330) -+++ src/libs/resource/filecntl.c (working copy) -@@ -26,6 +26,7 @@ - #include "port.h" - #include "resintrn.h" - #include "libs/uio.h" -+#include "libs/log.h" - - uio_Stream * - res_OpenResFile (uio_DirHandle *dir, const char *filename, const char *mode) -@@ -34,7 +35,10 @@ - struct stat sb; - - if (uio_stat (dir, filename, &sb) == 0 && S_ISDIR(sb.st_mode)) -+ { -+ log_add (log_Debug, "res_OpenResFile('%s', '%s') - cannot open dir as file", filename, mode); - return ((uio_Stream *) ~0); -+ } - - fp = uio_fopen (dir, filename, mode); - -Index: src/libs/sound/decoders/oggaud.c -=================================================================== ---- src/libs/sound/decoders/oggaud.c (revision 1330) -+++ src/libs/sound/decoders/oggaud.c (working copy) -@@ -270,7 +270,7 @@ - // this is the closest to a frame there is in ogg vorbis stream - // doesn't seem to be a func to retrive it - #ifdef OVCODEC_TREMOR -- return ova->vf.os->pageno; -+ return ova->vf.os.pageno; - #else - return ova->vf.os.pageno; - #endif /* OVCODEC_TREMOR */ -Index: src/libs/graphics/gfx_common.h -=================================================================== ---- src/libs/graphics/gfx_common.h (revision 1330) -+++ src/libs/graphics/gfx_common.h (working copy) +--- libs/graphics/gfx_common.h (revision 1351) ++++ libs/graphics/gfx_common.h (working copy) @@ -119,4 +119,10 @@ extern int ScreenColorDepth; extern int GraphicsDriver; @@ -173,46 +492,10 @@ Index: src/libs/graphics/gfx_common.h +void TFB_SetOnScreenKeyboard_TwoPlayersMelee (void); + #endif -Index: src/libs/graphics/sdl/pure.c +Index: libs/graphics/sdl/sdl_common.c =================================================================== ---- src/libs/graphics/sdl/pure.c (revision 1330) -+++ src/libs/graphics/sdl/pure.c (working copy) -@@ -128,6 +128,7 @@ - { - int i, videomode_flags; - SDL_PixelFormat conv_fmt; -+ int BPP = 32; - - GraphicsDriver = driver; - -@@ -169,6 +170,14 @@ - } - } - -+#ifdef ANDROID -+ videomode_flags = SDL_SWSURFACE; -+ //ScreenWidthActual = 1280; -+ //ScreenHeightActual = 960; -+ graphics_backend = &pure_unscaled_backend; -+ BPP = 24; -+#endif -+ - videomode_flags |= SDL_ANYFORMAT; - if (flags & TFB_GFXFLAGS_FULLSCREEN) - videomode_flags |= SDL_FULLSCREEN; -@@ -176,7 +185,7 @@ - /* We'll ask for a 32bpp frame, but it doesn't really matter, because we've set - SDL_ANYFORMAT */ - SDL_Video = SDL_SetVideoMode (ScreenWidthActual, ScreenHeightActual, -- 32, videomode_flags); -+ BPP, videomode_flags); - - if (SDL_Video == NULL) - { -Index: src/libs/graphics/sdl/sdl_common.c -=================================================================== ---- src/libs/graphics/sdl/sdl_common.c (revision 1330) -+++ src/libs/graphics/sdl/sdl_common.c (working copy) +--- libs/graphics/sdl/sdl_common.c (revision 1351) ++++ libs/graphics/sdl/sdl_common.c (working copy) @@ -34,7 +34,11 @@ #include "libs/memlib.h" #include "libs/vidlib.h" @@ -390,10 +673,10 @@ Index: src/libs/graphics/sdl/sdl_common.c +} + +#endif -Index: src/libs/graphics/sdl/sdl_common.h +Index: libs/graphics/sdl/sdl_common.h =================================================================== ---- src/libs/graphics/sdl/sdl_common.h (revision 1330) -+++ src/libs/graphics/sdl/sdl_common.h (working copy) +--- libs/graphics/sdl/sdl_common.h (revision 1351) ++++ libs/graphics/sdl/sdl_common.h (working copy) @@ -50,4 +50,6 @@ SDL_Surface* TFB_DisplayFormatAlpha (SDL_Surface *surface); @@ -401,168 +684,53 @@ Index: src/libs/graphics/sdl/sdl_common.h +void TFB_InitOnScreenKeyboard (void); + #endif -Index: src/libs/log/msgbox_stub.c +Index: libs/graphics/sdl/pure.c =================================================================== ---- src/libs/log/msgbox_stub.c (revision 1330) -+++ src/libs/log/msgbox_stub.c (working copy) -@@ -16,6 +16,9 @@ - - #include "msgbox.h" - #include "loginternal.h" -+#ifdef ANDROID -+#include -+#endif - - void - log_displayBox (const /*UTF-8*/char *title, int isError, -@@ -26,6 +29,9 @@ - // So just inform the user of our predicament - fprintf (streamOut, "Do not know how to display %s box\n", - isError ? "an error" : "a"); -+#ifdef ANDROID -+ __android_log_print( isError ? ANDROID_LOG_FATAL : ANDROID_LOG_INFO, "Ur-Quan Masters", "%s: %s", title, msg ); -+#endif +--- libs/graphics/sdl/pure.c (revision 1351) ++++ libs/graphics/sdl/pure.c (working copy) +@@ -128,6 +128,7 @@ + { + int i, videomode_flags; + SDL_PixelFormat conv_fmt; ++ int BPP = 32; - // Suppress the compiler warnings in any case. - (void)title; -Index: src/libs/log/uqmlog.c -=================================================================== ---- src/libs/log/uqmlog.c (revision 1330) -+++ src/libs/log/uqmlog.c (working copy) -@@ -23,6 +23,9 @@ - #include - #include - #include -+#ifdef ANDROID -+#include -+#endif - #include "libs/threadlib.h" + GraphicsDriver = driver; - #ifndef MAX_LOG_ENTRY_SIZE -@@ -190,6 +193,9 @@ - if ((int)level <= maxStreamLevel) - { - fprintf (streamOut, "%s\n", full_msg); -+#ifdef ANDROID -+ __android_log_print( ANDROID_LOG_INFO, "Ur-Quan Masters", "%s", full_msg ); -+#endif - } - - if ((int)level <= maxLevel) -@@ -226,6 +232,9 @@ - if ((int)level <= maxStreamLevel) - { - fprintf (streamOut, "%s\n", full_msg); -+#ifdef ANDROID -+ __android_log_print( ANDROID_LOG_INFO, "Ur-Quan Masters", "%s", full_msg ); -+#endif - } - - if ((int)level <= maxLevel) -Index: src/libs/log/msgbox_win.c -=================================================================== ---- src/libs/log/msgbox_win.c (revision 1330) -+++ src/libs/log/msgbox_win.c (working copy) -@@ -14,6 +14,7 @@ - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -+#ifndef ANDROID - #include "msgbox.h" - #define WIN32_LEAN_AND_MEAN - #include -@@ -64,4 +65,4 @@ - free (swTitle); - free (swMsg); - } -- -+#endif -Index: src/libs/uio/io.c -=================================================================== ---- src/libs/uio/io.c (revision 1330) -+++ src/libs/uio/io.c (working copy) -@@ -35,6 +35,7 @@ - #include "mem.h" - #include "uioutils.h" - #include "uioport.h" -+#include "../log.h" - #ifdef uio_MEM_DEBUG - # include "memdebug.h" - #endif -@@ -193,6 +194,7 @@ - errno = EINVAL; - return NULL; - } -+ log_add (log_Info, "uio_open %s", sourcePath); - handle = uio_open(sourceDir, sourcePath, - ((flags & uio_MOUNT_RDONLY) == uio_MOUNT_RDONLY ? - O_RDONLY : O_RDWR) -@@ -201,12 +203,14 @@ - #endif - , 0); - if (handle == NULL) { -+ log_add (log_Info, "uio_open failed for %s", sourcePath); - // errno is set - return NULL; +@@ -169,6 +170,14 @@ } } - handler = uio_getFileSystemHandler(fsType); -+ log_add (log_Info, "uio_getFileSystemHandler %p", handler); - if (handler == NULL) { - if (handle) - uio_close(handle); -@@ -703,6 +707,7 @@ - &readMountInfo, &readPDirHandle, NULL, - &writeMountInfo, &writePDirHandle, NULL, &name) == -1) { - // errno is set -+ log_add (log_Info, "uio_open: uio_getPhysicalAccess failed for '%s'", path); - return NULL; - } - -@@ -729,6 +734,7 @@ - uio_PDirHandle_unref(readPDirHandle); - uio_PDirHandle_unref(writePDirHandle); - errno = EEXIST; -+ log_add (log_Info, "uio_open: O_CREAT | O_EXCL: file already exists '%s'", name); - return NULL; - } - if ((flags & O_TRUNC) == O_TRUNC) { -@@ -745,6 +751,7 @@ - uio_PDirHandle_unref(readPDirHandle); - uio_PDirHandle_unref(writePDirHandle); - errno = savedErrno; -+ log_add (log_Info, "uio_open: uio_copyFilePhysical failed '%s'", name); - return NULL; - } - } -@@ -766,6 +773,7 @@ - handle = (pDirHandle->pRoot->handler->open)(pDirHandle, name, flags, mode); - // Also adds a new entry to the physical dir if appropriate. - if (handle == NULL) { -+ log_add (log_Info, "uio_open: open file failed '%s'", name); - int savedErrno = errno; - uio_free(name); - uio_PDirHandle_unref(pDirHandle); -Index: src/libs/uio/zip/zip.c -=================================================================== ---- src/libs/uio/zip/zip.c (revision 1330) -+++ src/libs/uio/zip/zip.c (working copy) -@@ -1366,6 +1366,10 @@ - gPFileData->gid = (uid_t) makeUInt16(buf[12], buf[13]); - break; - } -+ case 0x7875: // 'Unix string UID/GID' -+ // Just skip it -+ break; ++#ifdef ANDROID ++ videomode_flags = SDL_SWSURFACE; ++ //ScreenWidthActual = 1280; ++ //ScreenHeightActual = 960; ++ graphics_backend = &pure_unscaled_backend; ++ BPP = 24; ++#endif + - default: - #ifdef DEBUG - fprintf(stderr, "Debug: Extra field 0x%04x unsupported, " -Index: src/config_unix.h + videomode_flags |= SDL_ANYFORMAT; + if (flags & TFB_GFXFLAGS_FULLSCREEN) + videomode_flags |= SDL_FULLSCREEN; +@@ -176,7 +185,7 @@ + /* We'll ask for a 32bpp frame, but it doesn't really matter, because we've set + SDL_ANYFORMAT */ + SDL_Video = SDL_SetVideoMode (ScreenWidthActual, ScreenHeightActual, +- 32, videomode_flags); ++ BPP, videomode_flags); + + if (SDL_Video == NULL) + { +Index: svnversion.h =================================================================== ---- src/config_unix.h (revision 0) -+++ src/config_unix.h (working copy) +--- svnversion.h (revision 1351) ++++ svnversion.h (working copy) +@@ -1 +1 @@ +-#define UQMHD_SVN_REVISION "1337M" ++#define UQMHD_SVN_REVISION "1351M" +Index: config_unix.h +=================================================================== +--- config_unix.h (revision 0) ++++ config_unix.h (working copy) @@ -0,0 +1,63 @@ +/* This file contains some compile-time configuration options for *nix + * systems. @@ -627,83 +795,10 @@ Index: src/config_unix.h + +#endif /* _CONFIG_UNIX_H */ + -Index: src/uqm/setupmenu.c +Index: uqm/setupmenu.h =================================================================== ---- src/uqm/setupmenu.c (revision 1330) -+++ src/uqm/setupmenu.c (working copy) -@@ -83,7 +83,7 @@ - #endif - - #define MENU_COUNT 8 --#define CHOICE_COUNT 29 // JMS: New options added. -+#define CHOICE_COUNT 30 // JMS: New options added. - #define SLIDER_COUNT 3 - #define BUTTON_COUNT 10 - #define LABEL_COUNT 4 -@@ -106,7 +106,7 @@ - static int choice_widths[CHOICE_COUNT] = { - 3, 2, 3, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 3, 3, 2, 3, 3, -- 3, 2, 3, 2, 2, 2, 2, 2, 2 }; -+ 3, 2, 3, 2, 2, 2, 2, 2, 2, 2 }; - - static HANDLER button_handlers[BUTTON_COUNT] = { - quit_main_menu, quit_sub_menu, do_graphics, do_engine, -@@ -117,7 +117,7 @@ - // JMS: The first 8 was 7 (sound options.) Added mainmenumusic on/off. - // JMS: The HAVE_OPENGL options were 5 and 4. Added cheatMode, mineralSubmenu, nebulae and planet options. - static int menu_sizes[MENU_COUNT] = { -- 7, 6, 8, 8, 2, 5, -+ 7, 6, 8, 8, 2, 6, - #ifdef HAVE_OPENGL - 10, - #else -@@ -185,6 +185,7 @@ - static WIDGET *keyconfig_widgets[] = { - (WIDGET *)(&choices[18]), - (WIDGET *)(&choices[19]), -+ (WIDGET *)(&choices[29]), // Directional joystick - (WIDGET *)(&labels[1]), - (WIDGET *)(&buttons[8]), - (WIDGET *)(&buttons[1]) }; -@@ -414,6 +415,7 @@ - choices[26].selected = opts.rotatingIpPlanets; // JMS - choices[27].selected = opts.texturedIpPlanets || opts.rotatingIpPlanets; // JMS - choices[28].selected = opts.cheatMode; // JMS -+ choices[29].selected = opts.directionalJoystick; - - sliders[0].value = opts.musicvol; - sliders[1].value = opts.sfxvol; -@@ -452,6 +454,7 @@ - opts.rotatingIpPlanets = choices[26].selected; // JMS - opts.texturedIpPlanets = choices[27].selected || opts.rotatingIpPlanets; // JMS - opts.cheatMode = choices[28].selected; // JMS -+ opts.directionalJoystick = choices[29].selected; - - opts.musicvol = sliders[0].value; - opts.sfxvol = sliders[1].value; -@@ -1164,6 +1167,7 @@ - opts->rotatingIpPlanets = optRotatingIpPlanets ? OPTVAL_ENABLED : OPTVAL_DISABLED; - opts->texturedIpPlanets = (optTexturedIpPlanets ? OPTVAL_ENABLED : OPTVAL_DISABLED) || opts->rotatingIpPlanets; - opts->cheatMode = optCheatMode ? OPTVAL_ENABLED : OPTVAL_DISABLED; -+ opts->directionalJoystick = optDirectionalJoystick ? OPTVAL_ENABLED : OPTVAL_DISABLED; - - /* Work out resolution. On the way, try to guess a good default - * for config.alwaysgl, then overwrite it if it was set previously. */ -@@ -1376,6 +1380,9 @@ - res_PutBoolean ("config.cheatMode", opts->cheatMode == OPTVAL_ENABLED); - optCheatMode = opts->cheatMode == OPTVAL_ENABLED; - -+ res_PutBoolean ("config.directionaljoystick", opts->directionalJoystick == OPTVAL_ENABLED); -+ optDirectionalJoystick = (opts->directionalJoystick == OPTVAL_ENABLED) ? TRUE : FALSE; -+ - if (NewWidth == 320 && NewHeight == 240) - { - switch (opts->scaler) -Index: src/uqm/setupmenu.h -=================================================================== ---- src/uqm/setupmenu.h (revision 1330) -+++ src/uqm/setupmenu.h (working copy) +--- uqm/setupmenu.h (revision 1351) ++++ uqm/setupmenu.h (working copy) @@ -86,7 +86,7 @@ OPT_CONSOLETYPE menu, text, cscan, scroll, intro, meleezoom, shield; CONTROL_TEMPLATE player1, player2; @@ -713,10 +808,84 @@ Index: src/uqm/setupmenu.h } GLOBALOPTS; void SetupMenu (void); -Index: src/uqm/shipstat.c +Index: uqm/confirm.c =================================================================== ---- src/uqm/shipstat.c (revision 1330) -+++ src/uqm/shipstat.c (working copy) +--- uqm/confirm.c (revision 1351) ++++ uqm/confirm.c (working copy) +@@ -34,9 +34,11 @@ + #include + + +-#define CONFIRM_WIN_WIDTH (80 << RESOLUTION_FACTOR) // JMS_GFX ++#define CONFIRM_WIN_WIDTH (160 << RESOLUTION_FACTOR) // JMS_GFX + #define CONFIRM_WIN_HEIGHT (22 << RESOLUTION_FACTOR) // JMS_GFX + ++BOOLEAN EmergencyEscapeWarpUnitActivatedFromMenu = FALSE; ++ + static void + DrawConfirmationWindow (BOOLEAN answer) + { +@@ -67,6 +69,8 @@ + font_DrawText (&t); + t.baseline.x += (r.extent.width >> 1); + t.pStr = GAME_STRING (QUITMENU_STRING_BASE + 2); // "No" ++ if (GLOBAL (CurrentActivity) & IN_BATTLE) ++ t.pStr = "Escape unit"; // GAME_STRING (QUITMENU_STRING_BASE + 3); // TODO: modify gamestrings.txt + SetContextForeGroundColor (answer ? MENU_TEXT_COLOR : MENU_HIGHLIGHT_COLOR); + font_DrawText (&t); + +@@ -111,8 +115,16 @@ + + FlushInput (); + done = FALSE; ++ ++ #ifdef ANDROID ++ if ( !(GLOBAL (CurrentActivity) & IN_BATTLE) ) { ++ /* Abort immediately */ ++ response = TRUE; ++ done = TRUE; ++ } ++ #endif + +- do { ++ while (!done) { + // Forbid recursive calls or pausing here! + ExitRequested = FALSE; + GamePaused = FALSE; +@@ -139,7 +151,7 @@ + PlayMenuSound (MENU_SOUND_MOVE); + } + SleepThread (ONE_SECOND / 30); +- } while (!done); ++ } + + // Restore the screen under the confirmation window + DrawStamp (&s); +@@ -152,6 +164,8 @@ + } + else + { ++ if (GLOBAL (CurrentActivity) & IN_BATTLE) ++ EmergencyEscapeWarpUnitActivatedFromMenu = TRUE; + result = FALSE; + } + ExitRequested = FALSE; +Index: uqm/starcon.c +=================================================================== +--- uqm/starcon.c (revision 1351) ++++ uqm/starcon.c (working copy) +@@ -240,6 +240,7 @@ + if (LastActivity == (CHECK_LOAD | CHECK_RESTART)) + AskNameForCaptainAndShip(); + ++ TFB_SetOnScreenKeyboard_Melee (); + do + { + #ifdef DEBUG +Index: uqm/shipstat.c +=================================================================== +--- uqm/shipstat.c (revision 1351) ++++ uqm/shipstat.c (working copy) @@ -144,6 +144,45 @@ DrawFilledRectangle (&r); } @@ -894,10 +1063,10 @@ Index: src/uqm/shipstat.c } } -Index: src/uqm/units.h +Index: uqm/units.h =================================================================== ---- src/uqm/units.h (revision 1330) -+++ src/uqm/units.h (working copy) +--- uqm/units.h (revision 1351) ++++ uqm/units.h (working copy) @@ -67,6 +67,7 @@ #define RADAR_WIDTH (STATUS_WIDTH - RES_STAT_SCALE(8)) // JMS_GFX #define RADAR_HEIGHT RES_STAT_SCALE(53) // JMS_GFX @@ -906,10 +1075,849 @@ Index: src/uqm/units.h /* Blue boxes which display messages and the green date box. */ #define SIS_TITLE_BOX_WIDTH (57 << RESOLUTION_FACTOR) // JMS_GFX -Index: src/uqm/gameinp.c +Index: uqm/planets/solarsys.c =================================================================== ---- src/uqm/gameinp.c (revision 1330) -+++ src/uqm/gameinp.c (working copy) +--- uqm/planets/solarsys.c (revision 1351) ++++ uqm/planets/solarsys.c (working copy) +@@ -1245,18 +1245,19 @@ + static void + ProcessShipControls (void) + { +- COUNT index; ++ COUNT index = GetFrameIndex (GLOBAL (ShipStamp.frame));; + SIZE delta_x, delta_y; ++ BATTLE_INPUT_STATE InputState = GetDirectionalJoystickInput(index, 0); + +- if (CurrentInputState.key[PlayerControls[0]][KEY_UP]) ++ if (InputState & BATTLE_THRUST) + delta_y = -1; + else + delta_y = 0; + + delta_x = 0; +- if (CurrentInputState.key[PlayerControls[0]][KEY_LEFT]) ++ if (InputState & BATTLE_LEFT) + delta_x -= 1; +- if (CurrentInputState.key[PlayerControls[0]][KEY_RIGHT]) ++ if (InputState & BATTLE_RIGHT) + delta_x += 1; + + if (delta_x || delta_y < 0) +@@ -1269,7 +1270,6 @@ + else + delta_y = 0; + +- index = GetFrameIndex (GLOBAL (ShipStamp.frame)); + if (pSolarSysState->turn_counter) + --pSolarSysState->turn_counter; + else if (delta_x) +@@ -2473,7 +2473,9 @@ + InitSolarSys (); + SetMenuSounds (MENU_SOUND_NONE, MENU_SOUND_NONE); + SolarSysState.InputFunc = DoIpFlight; ++ TFB_SetOnScreenKeyboard_Melee (); + DoInput (&SolarSysState, FALSE); ++ TFB_SetOnScreenKeyboard_Menu (); + UninitSolarSys (); + pSolarSysState = 0; + } +@@ -2751,13 +2753,17 @@ + + if (pSS->InOrbit) + { // CheckShipLocation() or InitSolarSys() sent us to orbital ++ TFB_SetOnScreenKeyboard_Menu (); + EnterPlanetOrbit (); ++ TFB_SetOnScreenKeyboard_Melee (); + SetMenuSounds (MENU_SOUND_NONE, MENU_SOUND_NONE); + pSS->InOrbit = FALSE; + } + else if (cancel || LastActivity == CHECK_LOAD) + { ++ TFB_SetOnScreenKeyboard_Menu (); + SolarSysMenu (); ++ TFB_SetOnScreenKeyboard_Melee (); + SetMenuSounds (MENU_SOUND_NONE, MENU_SOUND_NONE); + } + else +Index: uqm/planets/pstarmap.c +=================================================================== +--- uqm/planets/pstarmap.c (revision 1351) ++++ uqm/planets/pstarmap.c (working copy) +@@ -2005,7 +2005,9 @@ + SetMenuSounds (MENU_SOUND_NONE, MENU_SOUND_NONE); + SetMenuRepeatDelay (MIN_ACCEL_DELAY, MAX_ACCEL_DELAY, STEP_ACCEL_DELAY, + TRUE); ++ TFB_SetOnScreenKeyboard_Starmap (); + DoInput (&MenuState, FALSE); ++ TFB_SetOnScreenKeyboard_Menu (); + SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT); + SetDefaultMenuRepeatDelay (); + +Index: uqm/planets/lander.c +=================================================================== +--- uqm/planets/lander.c (revision 1351) ++++ uqm/planets/lander.c (working copy) +@@ -1852,15 +1852,15 @@ + if (crew_left) + { + SIZE index = GetFrameIndex (LanderFrame[0]); ++ BATTLE_INPUT_STATE InputState = GetDirectionalJoystickInput(index, 0); + if (turn_wait) + --turn_wait; +- else if (CurrentInputState.key[PlayerControls[0]][KEY_LEFT] || +- CurrentInputState.key[PlayerControls[0]][KEY_RIGHT]) ++ else if ((InputState & BATTLE_LEFT) || (InputState & BATTLE_RIGHT)) + { + COUNT landerSpeedNumer; + COUNT angle; + +- if (CurrentInputState.key[PlayerControls[0]][KEY_LEFT]) ++ if (InputState & BATTLE_LEFT) + --index; + else + ++index; +@@ -1884,7 +1884,7 @@ + turn_wait = SHUTTLE_TURN_WAIT; + } + +- if (!CurrentInputState.key[PlayerControls[0]][KEY_UP]) ++ if (!(InputState & BATTLE_THRUST)) + { + dx = 0; + dy = 0; +@@ -2212,7 +2212,9 @@ + landerInputState.Initialized = FALSE; + landerInputState.InputFunc = DoPlanetSide; + SetMenuSounds (MENU_SOUND_NONE, MENU_SOUND_NONE); ++ TFB_SetOnScreenKeyboard_Melee (); + DoInput (&landerInputState, FALSE); ++ TFB_SetOnScreenKeyboard_Menu (); + + if (!(GLOBAL (CurrentActivity) & CHECK_ABORT)) + { +Index: uqm/battle.c +=================================================================== +--- uqm/battle.c (revision 1351) ++++ uqm/battle.c (working copy) +@@ -16,6 +16,10 @@ + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + ++#ifdef ANDROID ++#include ++#endif ++ + #include "battle.h" + + #include "battlecontrols.h" +@@ -43,6 +47,8 @@ + #include "libs/graphics/gfx_common.h" + #include "libs/log.h" + #include "libs/mathlib.h" ++#include "globdata.h" ++#include "libs/input/sdl/vcontrol.h" + + + BYTE battle_counter[NUM_SIDES]; +@@ -137,7 +143,8 @@ + frameInputHuman (HumanInputContext *context, STARSHIP *StarShipPtr) + { + (void) StarShipPtr; +- return CurrentInputToBattleInput (context->playerNr); ++ ++ return CurrentInputToBattleInput (context->playerNr, StarShipPtr ? StarShipPtr->ShipFacing : -1); + } + + static void +@@ -207,8 +214,11 @@ + StarShipPtr->ship_input_state |= SPECIAL; + + if (CanRunAway && cur_player == 0 && +- (InputState & BATTLE_ESCAPE)) ++ ((InputState & BATTLE_ESCAPE) || EmergencyEscapeWarpUnitActivatedFromMenu)) ++ { ++ EmergencyEscapeWarpUnitActivatedFromMenu = FALSE; + DoRunAway (StarShipPtr); ++ } + } + } + +@@ -399,6 +409,11 @@ + + LockMutex (GraphicsLock); + ++ TFB_SetOnScreenKeyboard_Melee (); ++ if (PlayerControl[1] & HUMAN_CONTROL) { ++ TFB_SetOnScreenKeyboard_TwoPlayersMelee (); ++ } ++ + #if !(DEMO_MODE || CREATE_JOURNAL) + if (LOBYTE (GLOBAL (CurrentActivity)) != SUPER_MELEE) { + // In Supermelee, the RNG is already initialised. +@@ -512,6 +527,8 @@ + UninitShips (); + FreeBattleSong (); + ++ TFB_SetOnScreenKeyboard_Menu (); ++ + UnlockMutex (GraphicsLock); + + return (BOOLEAN) (num_ships < 0); +Index: uqm/outfit.c +=================================================================== +--- uqm/outfit.c (revision 1351) ++++ uqm/outfit.c (working copy) +@@ -59,7 +59,7 @@ + OldContext = SetContext (StatusContext); + GetContextClipRect (&r); + s.origin.x = RADAR_X - r.corner.x; +- s.origin.y = RADAR_Y - r.corner.y - 19 * RESOLUTION_FACTOR; // JMS_GFX; ++ s.origin.y = RADAR_Y_LIFTED_UP - r.corner.y + RES_CASE(10,6,12); // JMS_GFX; + r.corner.x = s.origin.x - 1; + r.corner.y = s.origin.y - 11; + r.extent.width = RADAR_WIDTH + 2; +Index: uqm/sis.c +=================================================================== +--- uqm/sis.c (revision 1351) ++++ uqm/sis.c (working copy) +@@ -1810,7 +1810,7 @@ + GetContextClipRect (&clip_r); + pRect = &temp_r; + temp_r.corner.x = RADAR_X - clip_r.corner.x; +- temp_r.corner.y = RADAR_Y - clip_r.corner.y; ++ temp_r.corner.y = RADAR_Y_LIFTED_UP - clip_r.corner.y; + temp_r.extent.width = RADAR_WIDTH; + temp_r.extent.height = RADAR_HEIGHT; + SetContext (ScreenContext); +Index: uqm/globdata.c +=================================================================== +--- uqm/globdata.c (revision 1351) ++++ uqm/globdata.c (working copy) +@@ -130,7 +130,7 @@ + OldContext = SetContext (RadarContext); + SetContextFGFrame (Screen); + r.corner.x = RADAR_X; +- r.corner.y = RADAR_Y; ++ r.corner.y = RADAR_Y_LIFTED_UP; + r.extent.width = RADAR_WIDTH; + r.extent.height = RADAR_HEIGHT; + SetContextClipRect (&r); +Index: uqm/shipyard.c +=================================================================== +--- uqm/shipyard.c (revision 1351) ++++ uqm/shipyard.c (working copy) +@@ -212,9 +212,9 @@ + OldContext = SetContext (StatusContext); + GetContextClipRect (&r); + s.origin.x = RADAR_X - r.corner.x; +- s.origin.y = RADAR_Y - r.corner.y; ++ s.origin.y = RADAR_Y_LIFTED_UP - r.corner.y; + r.corner.x = s.origin.x - 1; +- r.corner.y = s.origin.y - RES_CASE(11,24,33); // JMS_GFX ++ r.corner.y = s.origin.y - RES_CASE(1,2,3); // JMS_GFX + r.extent.width = RADAR_WIDTH + 2; + r.extent.height = RES_CASE(11,24,33); // JMS_GFX + BatchGraphics (); +@@ -242,8 +242,6 @@ + hStarShip = GetAvailableRaceFromIndex (NewRaceItem); + NewRaceItem = GetIndexFromStarShip (&GLOBAL (avail_race_q), + hStarShip); +- s.frame = SetAbsFrameIndex (pMS->ModuleFrame, 3 + NewRaceItem); +- DrawStamp (&s); + FleetPtr = LockFleetInfo (&GLOBAL (avail_race_q), hStarShip); + s.frame = FleetPtr->melee_icon; + UnlockFleetInfo (&GLOBAL (avail_race_q), hStarShip); +@@ -253,6 +251,12 @@ + s.origin.x += (RADAR_WIDTH >> 1); + s.origin.y += (RADAR_HEIGHT >> 1); + DrawStamp (&s); ++ // Draw the ship name, above the ship image. ++ s.origin.x -= (RADAR_WIDTH >> 1); ++ s.origin.y -= (RADAR_HEIGHT >> 2); ++ s.frame = SetAbsFrameIndex (pMS->ModuleFrame, 3 + NewRaceItem); ++ DrawStamp (&s); ++ + t.align = ALIGN_RIGHT; + t.CharCount = (COUNT)~0; + t.pStr = buf; +Index: uqm/status.c +=================================================================== +--- uqm/status.c (revision 1351) ++++ uqm/status.c (working copy) +@@ -328,7 +328,7 @@ + StarShipPtr->RaceDescPtr->characteristics.energy_wait; + + DeltaStatistics (ShipInfoPtr, status_y_offsets[StarShipPtr->playerNr], +- 0, energy_delta); ++ 0, energy_delta, StarShipPtr->playerNr); + } + + return (retval); +@@ -370,7 +370,7 @@ + } + + DeltaStatistics (ShipInfoPtr, status_y_offsets[StarShipPtr->playerNr], +- crew_delta, 0); ++ crew_delta, 0, StarShipPtr->playerNr); + + return (retval); + } +Index: uqm/status.h +=================================================================== +--- uqm/status.h (revision 1351) ++++ uqm/status.h (working copy) +@@ -36,9 +36,15 @@ + #define CAPTAIN_HEIGHT RES_STAT_SCALE(30) // JMS_GFX + #define CAPTAIN_XOFFS ((STATUS_WIDTH - CAPTAIN_WIDTH) >> 1) // JMS_GFX + #define CAPTAIN_YOFFS (SHIP_INFO_HEIGHT + (4 << RESOLUTION_FACTOR)) // JMS_GFX +-#define SHIP_STATUS_HEIGHT (STATUS_HEIGHT >> 1) +-#define BAD_GUY_YOFFS 0 +-#define GOOD_GUY_YOFFS SHIP_STATUS_HEIGHT ++#define SHIP_STATUS_HEIGHT ((STATUS_HEIGHT >> 1) - (17 << RESOLUTION_FACTOR)) ++#define BAD_GUY_YOFFS (-1 << RESOLUTION_FACTOR) ++#define GOOD_GUY_YOFFS (STATUS_HEIGHT - SHIP_STATUS_HEIGHT) ++#define HORIZ_CREW_ENERGY_SIZE (18 << RESOLUTION_FACTOR) ++#define HORIZ_CREW_XOFFS (2 << RESOLUTION_FACTOR) ++#define BAD_GUY_HORIZ_CREW_YOFFS (BAD_GUY_YOFFS + SHIP_STATUS_HEIGHT + (HORIZ_CREW_ENERGY_SIZE >> 1)) ++#define GOOD_GUY_HORIZ_CREW_YOFFS (GOOD_GUY_YOFFS - HORIZ_CREW_ENERGY_SIZE + (1 << RESOLUTION_FACTOR)) ++#define BAD_GUY_HORIZ_ENERGY_YOFFS (BAD_GUY_YOFFS + SHIP_STATUS_HEIGHT) ++#define GOOD_GUY_HORIZ_ENERGY_YOFFS (GOOD_GUY_YOFFS - (HORIZ_CREW_ENERGY_SIZE >> 1) + (1 << RESOLUTION_FACTOR)) + #define STARCON_TEXT_HEIGHT (7 << RESOLUTION_FACTOR) // JMS_GFX + #define TINY_TEXT_HEIGHT (9 << RESOLUTION_FACTOR) // JMS_GFX + #define BATTLE_CREW_X RES_STAT_SCALE(10) // JMS_GFX +@@ -54,7 +60,7 @@ + extern void InitShipStatus (SHIP_INFO *ShipInfoPtr, STARSHIP *StarShipPtr, RECT *pClipRect, BOOLEAN inMeleeMenu); + // StarShipPtr or pClipRect can be NULL + extern void DeltaStatistics (SHIP_INFO *ShipInfoPtr, COORD y_offs, +- SIZE crew_delta, SIZE energy_delta); ++ SIZE crew_delta, SIZE energy_delta, SIZE player_num); + extern void DrawBattleCrewAmount (SHIP_INFO *ShipInfoPtr, COORD y_offs); + + extern void DrawCaptainsWindow (STARSHIP *StarShipPtr); +Index: uqm/hyper.c +=================================================================== +--- uqm/hyper.c (revision 1351) ++++ uqm/hyper.c (working copy) +@@ -1930,7 +1930,6 @@ + Color OldColor; + CONTEXT OldContext; + MENU_STATE MenuState; +- + UnbatchGraphics (); + + OldContext = SetContext (SpaceContext); +Index: uqm/intro.c +=================================================================== +--- uqm/intro.c (revision 1351) ++++ uqm/intro.c (working copy) +@@ -35,7 +35,7 @@ + + #include + +-static BOOLEAN ShowSlidePresentation (STRING PresStr); ++static BOOLEAN ShowSlidePresentation (STRING PresStr, RESOURCE PresName, BOOLEAN NoMusic); + + typedef struct + { +@@ -52,6 +52,7 @@ + FONT Fonts[MAX_FONTS]; + FRAME Frame; + MUSIC_REF MusicRef; ++ BOOLEAN MusicOverride; + BOOLEAN Batched; + FRAME SisFrame; + FRAME RotatedFrame; +@@ -285,10 +286,10 @@ + } + + static BOOLEAN +-ShowPresentationFile (const char *name) ++ShowPresentationFile (const char *name, BOOLEAN NoMusic) + { + STRING pres = CaptureStringTable (LoadStringTableFile (contentDir, name)); +- BOOLEAN result = ShowSlidePresentation (pres); ++ BOOLEAN result = ShowSlidePresentation (pres, "", NoMusic); + DestroyStringTable (ReleaseStringTable (pres)); + return result; + } +@@ -518,14 +519,17 @@ + } + else if (strcmp (Opcode, "MUSIC") == 0) + { /* set music */ +- utf8StringCopy (pPIS->Buffer, sizeof (pPIS->Buffer), pStr); +- if (pPIS->MusicRef) ++ if (!pPIS->MusicOverride) + { +- StopMusic (); +- DestroyMusic (pPIS->MusicRef); ++ utf8StringCopy (pPIS->Buffer, sizeof (pPIS->Buffer), pStr); ++ if (pPIS->MusicRef) ++ { ++ StopMusic (); ++ DestroyMusic (pPIS->MusicRef); ++ } ++ pPIS->MusicRef = LoadMusicFile (pPIS->Buffer); ++ PlayMusic (pPIS->MusicRef, FALSE, 1); + } +- pPIS->MusicRef = LoadMusicFile (pPIS->Buffer); +- PlayMusic (pPIS->MusicRef, FALSE, 1); + } + else if (strcmp (Opcode, "WAIT") == 0) + { /* wait */ +@@ -817,7 +821,7 @@ + Present_UnbatchGraphics (pPIS, TRUE); + + utf8StringCopy (pPIS->Buffer, sizeof (pPIS->Buffer), pStr); +- ShowPresentationFile (pPIS->Buffer); ++ ShowPresentationFile (pPIS->Buffer, pPIS->MusicOverride); + } + else if (strcmp (Opcode, "LINE") == 0) + { +@@ -880,12 +884,13 @@ + } + + static BOOLEAN +-ShowSlidePresentation (STRING PresStr) ++ShowSlidePresentation (STRING PresStr, RESOURCE PresName, BOOLEAN NoMusic) + { + CONTEXT OldContext; + FONT OldFont; + RECT OldRect; + PRESENTATION_INPUT_STATE pis; ++ char MusicOverrideRes[256]; + int i; + + memset (&pis, 0, sizeof(pis)); +@@ -901,6 +906,24 @@ + OldFont = SetContextFont (NULL); + SetContextBackGroundColor (BLACK_COLOR); + UnlockMutex (GraphicsLock); ++ /* Override intro and ending music with Precursors remix, if it's available */ ++ pis.MusicOverride = NoMusic; ++ if (!NoMusic && strlen(PresName) < sizeof(MusicOverrideRes) - 10) ++ { ++ const char *ResType; ++ strcpy (MusicOverrideRes, PresName); ++ strcat (MusicOverrideRes, ".music"); ++ ResType = res_GetResourceType (MusicOverrideRes); ++ if (strcmp(ResType, "MUSICRES") == 0) ++ { ++ pis.MusicRef = LoadMusic (MusicOverrideRes); ++ if (pis.MusicRef) ++ { ++ pis.MusicOverride = TRUE; ++ PlayMusic (pis.MusicRef, FALSE, 1); ++ } ++ } ++ } + + SetMenuSounds (MENU_SOUND_NONE, MENU_SOUND_NONE); + pis.InputFunc = DoPresentation; +@@ -909,7 +932,9 @@ + pis.MovieFrame = -1; + pis.StartTime = GetTimeCounter (); + pis.LastSyncTime = pis.StartTime; ++ TFB_SetOnScreenKeyboard_Hidden (); + DoInput (&pis, TRUE); ++ TFB_SetOnScreenKeyboard_Menu(); + + SleepThreadUntil (FadeMusic (0, ONE_SECOND)); + StopMusic (); +@@ -1001,7 +1026,9 @@ + vis.InputFunc = DoVideoInput; + vis.CurVideo = ref; + SetMenuSounds (MENU_SOUND_NONE, MENU_SOUND_NONE); ++ TFB_SetOnScreenKeyboard_Hidden (); + DoInput (&vis, TRUE); ++ TFB_SetOnScreenKeyboard_Menu (); + + StopLegacyVideo (ref); + FadeClearScreen (); +@@ -1017,10 +1044,11 @@ + { + return FALSE; + } ++ + if (!strcmp (resType, "STRTAB")) + { + STRING pres = CaptureStringTable (LoadStringTable (res)); +- BOOLEAN result = ShowSlidePresentation (pres); ++ BOOLEAN result = ShowSlidePresentation (pres, res, FALSE); + DestroyStringTable (ReleaseStringTable (pres)); + return result; + } +Index: uqm/menu.c +=================================================================== +--- uqm/menu.c (revision 1351) ++++ uqm/menu.c (working copy) +@@ -508,7 +508,7 @@ + s.origin.x = RADAR_X - r.corner.x; + s.origin.y = RADAR_Y - r.corner.y; + r.corner.x = s.origin.x - 1; +- r.corner.y = s.origin.y - (11 << RESOLUTION_FACTOR); // JMS_GFX ++ r.corner.y = s.origin.y - (40 << RESOLUTION_FACTOR); // JMS_GFX + r.extent.width = RADAR_WIDTH + 2; + BatchGraphics (); + SetContextForeGroundColor ( +Index: uqm/comm/supox/supoxc.c +=================================================================== +--- uqm/comm/supox/supoxc.c (revision 1351) ++++ uqm/comm/supox/supoxc.c (working copy) +@@ -18,7 +18,7 @@ + + #include "../commall.h" + #include "resinst.h" +-#include "strings.h" ++#include "../supox/strings.h" + + #include "uqm/build.h" + +Index: uqm/comm/vux/vuxc.c +=================================================================== +--- uqm/comm/vux/vuxc.c (revision 1351) ++++ uqm/comm/vux/vuxc.c (working copy) +@@ -18,7 +18,7 @@ + + #include "../commall.h" + #include "resinst.h" +-#include "strings.h" ++#include "../vux/strings.h" + + static LOCDATA vux_desc_1x = + { +Index: uqm/comm/shofixt/shofixt.c +=================================================================== +--- uqm/comm/shofixt/shofixt.c (revision 1351) ++++ uqm/comm/shofixt/shofixt.c (working copy) +@@ -18,7 +18,7 @@ + + #include "../commall.h" + #include "resinst.h" +-#include "strings.h" ++#include "../shofixt/strings.h" + + #include "uqm/gameev.h" + +Index: uqm/comm/pkunk/pkunkc.c +=================================================================== +--- uqm/comm/pkunk/pkunkc.c (revision 1351) ++++ uqm/comm/pkunk/pkunkc.c (working copy) +@@ -18,7 +18,7 @@ + + #include "../commall.h" + #include "resinst.h" +-#include "strings.h" ++#include "../pkunk/strings.h" + + #include "uqm/build.h" + #include "uqm/gameev.h" +Index: uqm/comm/spathi/spathic.c +=================================================================== +--- uqm/comm/spathi/spathic.c (revision 1351) ++++ uqm/comm/spathi/spathic.c (working copy) +@@ -18,7 +18,7 @@ + + #include "../commall.h" + #include "resinst.h" +-#include "strings.h" ++#include "../spathi/strings.h" + + #include "uqm/build.h" + +Index: uqm/comm/rebel/rebel.c +=================================================================== +--- uqm/comm/rebel/rebel.c (revision 1351) ++++ uqm/comm/rebel/rebel.c (working copy) +@@ -18,7 +18,7 @@ + + #include "../commall.h" + #include "../yehat/resinst.h" +-#include "strings.h" ++#include "../rebel/strings.h" + + #include "uqm/build.h" + +Index: uqm/comm/druuge/druugec.c +=================================================================== +--- uqm/comm/druuge/druugec.c (revision 1351) ++++ uqm/comm/druuge/druugec.c (working copy) +@@ -18,7 +18,7 @@ + + #include "../commall.h" + #include "resinst.h" +-#include "strings.h" ++#include "../druuge/strings.h" + + #include "uqm/build.h" + #include "uqm/setup.h" +Index: uqm/comm/spahome/spahome.c +=================================================================== +--- uqm/comm/spahome/spahome.c (revision 1351) ++++ uqm/comm/spahome/spahome.c (working copy) +@@ -18,7 +18,7 @@ + + #include "../commall.h" + #include "../spathi/resinst.h" +-#include "strings.h" ++#include "../spahome/strings.h" + + #include "uqm/build.h" + #include "uqm/gameev.h" +Index: uqm/comm/starbas/starbas.c +=================================================================== +--- uqm/comm/starbas/starbas.c (revision 1351) ++++ uqm/comm/starbas/starbas.c (working copy) +@@ -18,7 +18,7 @@ + + #include "../commall.h" + #include "../comandr/resinst.h" +-#include "strings.h" ++#include "../starbas/strings.h" + + #include "uqm/build.h" + #include "uqm/setup.h" +Index: uqm/comm/utwig/utwigc.c +=================================================================== +--- uqm/comm/utwig/utwigc.c (revision 1351) ++++ uqm/comm/utwig/utwigc.c (working copy) +@@ -18,7 +18,7 @@ + + #include "../commall.h" + #include "resinst.h" +-#include "strings.h" ++#include "../utwig/strings.h" + + #include "uqm/build.h" + #include "uqm/gameev.h" +Index: uqm/comm/umgah/umgahc.c +=================================================================== +--- uqm/comm/umgah/umgahc.c (revision 1351) ++++ uqm/comm/umgah/umgahc.c (working copy) +@@ -18,7 +18,7 @@ + + #include "../commall.h" + #include "resinst.h" +-#include "strings.h" ++#include "../umgah/strings.h" + + #include "uqm/build.h" + +Index: uqm/comm/talkpet/talkpet.c +=================================================================== +--- uqm/comm/talkpet/talkpet.c (revision 1351) ++++ uqm/comm/talkpet/talkpet.c (working copy) +@@ -18,7 +18,7 @@ + + #include "../commall.h" + #include "resinst.h" +-#include "strings.h" ++#include "../talkpet/strings.h" + + #include "uqm/build.h" + +Index: uqm/comm/syreen/syreenc.c +=================================================================== +--- uqm/comm/syreen/syreenc.c (revision 1351) ++++ uqm/comm/syreen/syreenc.c (working copy) +@@ -18,7 +18,7 @@ + + #include "../commall.h" + #include "resinst.h" +-#include "strings.h" ++#include "../syreen/strings.h" + + #include "libs/sound/sound.h" + #include "uqm/build.h" +Index: uqm/comm/melnorm/melnorm.c +=================================================================== +--- uqm/comm/melnorm/melnorm.c (revision 1351) ++++ uqm/comm/melnorm/melnorm.c (working copy) +@@ -18,7 +18,7 @@ + + #include "../commall.h" + #include "resinst.h" +-#include "strings.h" ++#include "../melnorm/strings.h" + + #include "uqm/gameev.h" + #include "uqm/setup.h" +Index: uqm/comm/yehat/yehatc.c +=================================================================== +--- uqm/comm/yehat/yehatc.c (revision 1351) ++++ uqm/comm/yehat/yehatc.c (working copy) +@@ -18,7 +18,7 @@ + + #include "../commall.h" + #include "resinst.h" +-#include "strings.h" ++#include "../yehat/strings.h" + + #include "uqm/build.h" + #include "uqm/gameev.h" +Index: uqm/comm/orz/orzc.c +=================================================================== +--- uqm/comm/orz/orzc.c (revision 1351) ++++ uqm/comm/orz/orzc.c (working copy) +@@ -18,7 +18,7 @@ + + #include "../commall.h" + #include "resinst.h" +-#include "strings.h" ++#include "../orz/strings.h" + + #include "uqm/build.h" + +Index: uqm/comm/slyhome/slyhome.c +=================================================================== +--- uqm/comm/slyhome/slyhome.c (revision 1351) ++++ uqm/comm/slyhome/slyhome.c (working copy) +@@ -18,7 +18,7 @@ + + #include "../commall.h" + #include "resinst.h" +-#include "strings.h" ++#include "../slyhome/strings.h" + + #include "uqm/gameev.h" + +Index: uqm/comm/zoqfot/zoqfotc.c +=================================================================== +--- uqm/comm/zoqfot/zoqfotc.c (revision 1351) ++++ uqm/comm/zoqfot/zoqfotc.c (working copy) +@@ -18,7 +18,7 @@ + + #include "../commall.h" + #include "resinst.h" +-#include "strings.h" ++#include "../zoqfot/strings.h" + + #include "uqm/build.h" + #include "uqm/gameev.h" +Index: uqm/comm/blackur/blackurc.c +=================================================================== +--- uqm/comm/blackur/blackurc.c (revision 1351) ++++ uqm/comm/blackur/blackurc.c (working copy) +@@ -18,7 +18,7 @@ + + #include "../commall.h" + #include "resinst.h" +-#include "strings.h" ++#include "../blackur/strings.h" + + static LOCDATA blackurq_desc = + { +Index: uqm/comm/comandr/comandr.c +=================================================================== +--- uqm/comm/comandr/comandr.c (revision 1351) ++++ uqm/comm/comandr/comandr.c (working copy) +@@ -20,7 +20,7 @@ + + #include "../commall.h" + #include "resinst.h" +-#include "strings.h" ++#include "../comandr/strings.h" + + #include "uqm/setup.h" + #include "uqm/sis.h" +Index: uqm/comm/mycon/myconc.c +=================================================================== +--- uqm/comm/mycon/myconc.c (revision 1351) ++++ uqm/comm/mycon/myconc.c (working copy) +@@ -18,7 +18,7 @@ + + #include "../commall.h" + #include "resinst.h" +-#include "strings.h" ++#include "../mycon/strings.h" + + #include "uqm/gameev.h" + #include "libs/mathlib.h" +Index: uqm/comm/arilou/arilouc.c +=================================================================== +--- uqm/comm/arilou/arilouc.c (revision 1351) ++++ uqm/comm/arilou/arilouc.c (working copy) +@@ -18,7 +18,7 @@ + + #include "../commall.h" + #include "resinst.h" +-#include "strings.h" ++#include "../arilou/strings.h" + + #include "uqm/gameev.h" + +Index: uqm/comm/slyland/slyland.c +=================================================================== +--- uqm/comm/slyland/slyland.c (revision 1351) ++++ uqm/comm/slyland/slyland.c (working copy) +@@ -16,10 +16,10 @@ + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + ++#include "../slyland/strings.h" ++#include + #include "../commall.h" +-#include + #include "resinst.h" +-#include "strings.h" + + #include "options.h" + #include "uqm/battle.h" +Index: uqm/comm/thradd/thraddc.c +=================================================================== +--- uqm/comm/thradd/thraddc.c (revision 1351) ++++ uqm/comm/thradd/thraddc.c (working copy) +@@ -18,7 +18,7 @@ + + #include "../commall.h" + #include "resinst.h" +-#include "strings.h" ++#include "../thradd/strings.h" + + #include "uqm/build.h" + #include "uqm/gameev.h" +Index: uqm/comm/chmmr/chmmrc.c +=================================================================== +--- uqm/comm/chmmr/chmmrc.c (revision 1351) ++++ uqm/comm/chmmr/chmmrc.c (working copy) +@@ -18,7 +18,7 @@ + + #include "../commall.h" + #include "resinst.h" +-#include "strings.h" ++#include "../chmmr/strings.h" + + #include "uqm/build.h" + #include "uqm/hyper.h" +Index: uqm/comm/ilwrath/ilwrathc.c +=================================================================== +--- uqm/comm/ilwrath/ilwrathc.c (revision 1351) ++++ uqm/comm/ilwrath/ilwrathc.c (working copy) +@@ -18,7 +18,7 @@ + + #include "../commall.h" + #include "resinst.h" +-#include "strings.h" ++#include "../ilwrath/strings.h" + + #include "uqm/gameev.h" + +Index: uqm/comm/urquan/urquanc.c +=================================================================== +--- uqm/comm/urquan/urquanc.c (revision 1351) ++++ uqm/comm/urquan/urquanc.c (working copy) +@@ -18,7 +18,7 @@ + + #include "../commall.h" + #include "resinst.h" +-#include "strings.h" ++#include "../urquan/strings.h" + + static LOCDATA urquan_desc = + { +Index: uqm/gameinp.c +=================================================================== +--- uqm/gameinp.c (revision 1351) ++++ uqm/gameinp.c (working copy) @@ -16,6 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ @@ -1131,380 +2139,27 @@ Index: src/uqm/gameinp.c + } + return InputState; +} -Index: src/uqm/planets/lander.c +Index: uqm/intel.c =================================================================== ---- src/uqm/planets/lander.c (revision 1330) -+++ src/uqm/planets/lander.c (working copy) -@@ -1852,15 +1852,15 @@ - if (crew_left) - { - SIZE index = GetFrameIndex (LanderFrame[0]); -+ BATTLE_INPUT_STATE InputState = GetDirectionalJoystickInput(index, 0); - if (turn_wait) - --turn_wait; -- else if (CurrentInputState.key[PlayerControls[0]][KEY_LEFT] || -- CurrentInputState.key[PlayerControls[0]][KEY_RIGHT]) -+ else if ((InputState & BATTLE_LEFT) || (InputState & BATTLE_RIGHT)) - { - COUNT landerSpeedNumer; - COUNT angle; - -- if (CurrentInputState.key[PlayerControls[0]][KEY_LEFT]) -+ if (InputState & BATTLE_LEFT) - --index; - else - ++index; -@@ -1884,7 +1884,7 @@ - turn_wait = SHUTTLE_TURN_WAIT; - } - -- if (!CurrentInputState.key[PlayerControls[0]][KEY_UP]) -+ if (!(InputState & BATTLE_THRUST)) - { - dx = 0; - dy = 0; -@@ -2212,7 +2212,9 @@ - landerInputState.Initialized = FALSE; - landerInputState.InputFunc = DoPlanetSide; - SetMenuSounds (MENU_SOUND_NONE, MENU_SOUND_NONE); -+ TFB_SetOnScreenKeyboard_Melee (); - DoInput (&landerInputState, FALSE); -+ TFB_SetOnScreenKeyboard_Menu (); - - if (!(GLOBAL (CurrentActivity) & CHECK_ABORT)) - { -Index: src/uqm/planets/solarsys.c -=================================================================== ---- src/uqm/planets/solarsys.c (revision 1330) -+++ src/uqm/planets/solarsys.c (working copy) -@@ -1245,18 +1245,19 @@ - static void - ProcessShipControls (void) - { -- COUNT index; -+ COUNT index = GetFrameIndex (GLOBAL (ShipStamp.frame));; - SIZE delta_x, delta_y; -+ BATTLE_INPUT_STATE InputState = GetDirectionalJoystickInput(index, 0); - -- if (CurrentInputState.key[PlayerControls[0]][KEY_UP]) -+ if (InputState & BATTLE_THRUST) - delta_y = -1; - else - delta_y = 0; - - delta_x = 0; -- if (CurrentInputState.key[PlayerControls[0]][KEY_LEFT]) -+ if (InputState & BATTLE_LEFT) - delta_x -= 1; -- if (CurrentInputState.key[PlayerControls[0]][KEY_RIGHT]) -+ if (InputState & BATTLE_RIGHT) - delta_x += 1; - - if (delta_x || delta_y < 0) -@@ -1269,7 +1270,6 @@ - else - delta_y = 0; - -- index = GetFrameIndex (GLOBAL (ShipStamp.frame)); - if (pSolarSysState->turn_counter) - --pSolarSysState->turn_counter; - else if (delta_x) -@@ -2473,7 +2473,9 @@ - InitSolarSys (); - SetMenuSounds (MENU_SOUND_NONE, MENU_SOUND_NONE); - SolarSysState.InputFunc = DoIpFlight; -+ TFB_SetOnScreenKeyboard_Melee (); - DoInput (&SolarSysState, FALSE); -+ TFB_SetOnScreenKeyboard_Menu (); - UninitSolarSys (); - pSolarSysState = 0; - } -@@ -2751,13 +2753,17 @@ - - if (pSS->InOrbit) - { // CheckShipLocation() or InitSolarSys() sent us to orbital -+ TFB_SetOnScreenKeyboard_Menu (); - EnterPlanetOrbit (); -+ TFB_SetOnScreenKeyboard_Melee (); - SetMenuSounds (MENU_SOUND_NONE, MENU_SOUND_NONE); - pSS->InOrbit = FALSE; - } - else if (cancel || LastActivity == CHECK_LOAD) - { -+ TFB_SetOnScreenKeyboard_Menu (); - SolarSysMenu (); -+ TFB_SetOnScreenKeyboard_Melee (); - SetMenuSounds (MENU_SOUND_NONE, MENU_SOUND_NONE); - } - else -Index: src/uqm/planets/pstarmap.c -=================================================================== ---- src/uqm/planets/pstarmap.c (revision 1330) -+++ src/uqm/planets/pstarmap.c (working copy) -@@ -2005,7 +2005,9 @@ - SetMenuSounds (MENU_SOUND_NONE, MENU_SOUND_NONE); - SetMenuRepeatDelay (MIN_ACCEL_DELAY, MAX_ACCEL_DELAY, STEP_ACCEL_DELAY, - TRUE); -+ TFB_SetOnScreenKeyboard_Starmap (); - DoInput (&MenuState, FALSE); -+ TFB_SetOnScreenKeyboard_Menu (); - SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT); - SetDefaultMenuRepeatDelay (); - -Index: src/uqm/menu.c -=================================================================== ---- src/uqm/menu.c (revision 1330) -+++ src/uqm/menu.c (working copy) -@@ -508,7 +508,7 @@ - s.origin.x = RADAR_X - r.corner.x; - s.origin.y = RADAR_Y - r.corner.y; - r.corner.x = s.origin.x - 1; -- r.corner.y = s.origin.y - (11 << RESOLUTION_FACTOR); // JMS_GFX -+ r.corner.y = s.origin.y - (40 << RESOLUTION_FACTOR); // JMS_GFX - r.extent.width = RADAR_WIDTH + 2; - BatchGraphics (); - SetContextForeGroundColor ( -Index: src/uqm/globdata.c -=================================================================== ---- src/uqm/globdata.c (revision 1330) -+++ src/uqm/globdata.c (working copy) -@@ -130,7 +130,7 @@ - OldContext = SetContext (RadarContext); - SetContextFGFrame (Screen); - r.corner.x = RADAR_X; -- r.corner.y = RADAR_Y; -+ r.corner.y = RADAR_Y_LIFTED_UP; - r.extent.width = RADAR_WIDTH; - r.extent.height = RADAR_HEIGHT; - SetContextClipRect (&r); -Index: src/uqm/shipyard.c -=================================================================== ---- src/uqm/shipyard.c (revision 1330) -+++ src/uqm/shipyard.c (working copy) -@@ -212,9 +212,9 @@ - OldContext = SetContext (StatusContext); - GetContextClipRect (&r); - s.origin.x = RADAR_X - r.corner.x; -- s.origin.y = RADAR_Y - r.corner.y; -+ s.origin.y = RADAR_Y_LIFTED_UP - r.corner.y; - r.corner.x = s.origin.x - 1; -- r.corner.y = s.origin.y - RES_CASE(11,24,33); // JMS_GFX -+ r.corner.y = s.origin.y - RES_CASE(1,2,3); // JMS_GFX - r.extent.width = RADAR_WIDTH + 2; - r.extent.height = RES_CASE(11,24,33); // JMS_GFX - BatchGraphics (); -@@ -242,8 +242,6 @@ - hStarShip = GetAvailableRaceFromIndex (NewRaceItem); - NewRaceItem = GetIndexFromStarShip (&GLOBAL (avail_race_q), - hStarShip); -- s.frame = SetAbsFrameIndex (pMS->ModuleFrame, 3 + NewRaceItem); -- DrawStamp (&s); - FleetPtr = LockFleetInfo (&GLOBAL (avail_race_q), hStarShip); - s.frame = FleetPtr->melee_icon; - UnlockFleetInfo (&GLOBAL (avail_race_q), hStarShip); -@@ -253,6 +251,12 @@ - s.origin.x += (RADAR_WIDTH >> 1); - s.origin.y += (RADAR_HEIGHT >> 1); - DrawStamp (&s); -+ // Draw the ship name, above the ship image. -+ s.origin.x -= (RADAR_WIDTH >> 1); -+ s.origin.y -= (RADAR_HEIGHT >> 2); -+ s.frame = SetAbsFrameIndex (pMS->ModuleFrame, 3 + NewRaceItem); -+ DrawStamp (&s); -+ - t.align = ALIGN_RIGHT; - t.CharCount = (COUNT)~0; - t.pStr = buf; -Index: src/uqm/confirm.c -=================================================================== ---- src/uqm/confirm.c (revision 1330) -+++ src/uqm/confirm.c (working copy) -@@ -34,9 +34,11 @@ - #include - - --#define CONFIRM_WIN_WIDTH (80 << RESOLUTION_FACTOR) // JMS_GFX -+#define CONFIRM_WIN_WIDTH (160 << RESOLUTION_FACTOR) // JMS_GFX - #define CONFIRM_WIN_HEIGHT (22 << RESOLUTION_FACTOR) // JMS_GFX - -+BOOLEAN EmergencyEscapeWarpUnitActivatedFromMenu = FALSE; -+ - static void - DrawConfirmationWindow (BOOLEAN answer) - { -@@ -67,6 +69,8 @@ - font_DrawText (&t); - t.baseline.x += (r.extent.width >> 1); - t.pStr = GAME_STRING (QUITMENU_STRING_BASE + 2); // "No" -+ if (GLOBAL (CurrentActivity) & IN_BATTLE) -+ t.pStr = "Escape unit"; // GAME_STRING (QUITMENU_STRING_BASE + 3); // TODO: modify gamestrings.txt - SetContextForeGroundColor (answer ? MENU_TEXT_COLOR : MENU_HIGHLIGHT_COLOR); - font_DrawText (&t); - -@@ -111,8 +115,16 @@ - - FlushInput (); - done = FALSE; -+ -+ #ifdef ANDROID -+ if ( !(GLOBAL (CurrentActivity) & IN_BATTLE) ) { -+ /* Abort immediately */ -+ response = TRUE; -+ done = TRUE; -+ } -+ #endif - -- do { -+ while (!done) { - // Forbid recursive calls or pausing here! - ExitRequested = FALSE; - GamePaused = FALSE; -@@ -139,7 +151,7 @@ - PlayMenuSound (MENU_SOUND_MOVE); - } - SleepThread (ONE_SECOND / 30); -- } while (!done); -+ } - - // Restore the screen under the confirmation window - DrawStamp (&s); -@@ -152,6 +164,8 @@ - } - else - { -+ if (GLOBAL (CurrentActivity) & IN_BATTLE) -+ EmergencyEscapeWarpUnitActivatedFromMenu = TRUE; - result = FALSE; +--- uqm/intel.c (revision 1351) ++++ uqm/intel.c (working copy) +@@ -45,10 +45,10 @@ + // Allow a player to warp-escape in cyborg mode + if (StarShipPtr->playerNr == RPG_PLAYER_NUM) + InputState |= CurrentInputToBattleInput ( +- context->playerNr) & BATTLE_ESCAPE; ++ context->playerNr, -1) & BATTLE_ESCAPE; } - ExitRequested = FALSE; -Index: src/uqm/hyper.c -=================================================================== ---- src/uqm/hyper.c (revision 1330) -+++ src/uqm/hyper.c (working copy) -@@ -1930,7 +1930,6 @@ - Color OldColor; - CONTEXT OldContext; - MENU_STATE MenuState; -- - UnbatchGraphics (); - - OldContext = SetContext (SpaceContext); -Index: src/uqm/intro.c -=================================================================== ---- src/uqm/intro.c (revision 1330) -+++ src/uqm/intro.c (working copy) -@@ -909,7 +909,9 @@ - pis.MovieFrame = -1; - pis.StartTime = GetTimeCounter (); - pis.LastSyncTime = pis.StartTime; -+ TFB_SetOnScreenKeyboard_Hidden (); - DoInput (&pis, TRUE); -+ TFB_SetOnScreenKeyboard_Menu(); - - SleepThreadUntil (FadeMusic (0, ONE_SECOND)); - StopMusic (); -@@ -1001,7 +1003,9 @@ - vis.InputFunc = DoVideoInput; - vis.CurVideo = ref; - SetMenuSounds (MENU_SOUND_NONE, MENU_SOUND_NONE); -+ TFB_SetOnScreenKeyboard_Hidden (); - DoInput (&vis, TRUE); -+ TFB_SetOnScreenKeyboard_Menu (); - - StopLegacyVideo (ref); - FadeClearScreen (); -@@ -1017,6 +1021,7 @@ - { - return FALSE; + else +- InputState = CurrentInputToBattleInput (context->playerNr); ++ InputState = CurrentInputToBattleInput (context->playerNr, -1); } -+ - if (!strcmp (resType, "STRTAB")) - { - STRING pres = CaptureStringTable (LoadStringTable (res)); -Index: src/uqm/starcon.c + else if (!(PlayerControl[context->playerNr] & PSYTRON_CONTROL)) + InputState = 0; +Index: uqm/controls.h =================================================================== ---- src/uqm/starcon.c (revision 1330) -+++ src/uqm/starcon.c (working copy) -@@ -240,6 +240,7 @@ - if (LastActivity == (CHECK_LOAD | CHECK_RESTART)) - AskNameForCaptainAndShip(); - -+ TFB_SetOnScreenKeyboard_Melee (); - do - { - #ifdef DEBUG -Index: src/uqm/battle.c -=================================================================== ---- src/uqm/battle.c (revision 1330) -+++ src/uqm/battle.c (working copy) -@@ -16,6 +16,10 @@ - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -+#ifdef ANDROID -+#include -+#endif -+ - #include "battle.h" - - #include "battlecontrols.h" -@@ -43,6 +47,8 @@ - #include "libs/graphics/gfx_common.h" - #include "libs/log.h" - #include "libs/mathlib.h" -+#include "globdata.h" -+#include "libs/input/sdl/vcontrol.h" - - - BYTE battle_counter[NUM_SIDES]; -@@ -137,7 +143,8 @@ - frameInputHuman (HumanInputContext *context, STARSHIP *StarShipPtr) - { - (void) StarShipPtr; -- return CurrentInputToBattleInput (context->playerNr); -+ -+ return CurrentInputToBattleInput (context->playerNr, StarShipPtr ? StarShipPtr->ShipFacing : -1); - } - - static void -@@ -207,8 +214,11 @@ - StarShipPtr->ship_input_state |= SPECIAL; - - if (CanRunAway && cur_player == 0 && -- (InputState & BATTLE_ESCAPE)) -+ ((InputState & BATTLE_ESCAPE) || EmergencyEscapeWarpUnitActivatedFromMenu)) -+ { -+ EmergencyEscapeWarpUnitActivatedFromMenu = FALSE; - DoRunAway (StarShipPtr); -+ } - } - } - -@@ -399,6 +409,11 @@ - - LockMutex (GraphicsLock); - -+ TFB_SetOnScreenKeyboard_Melee (); -+ if (PlayerControl[1] & HUMAN_CONTROL) { -+ TFB_SetOnScreenKeyboard_TwoPlayersMelee (); -+ } -+ - #if !(DEMO_MODE || CREATE_JOURNAL) - if (LOBYTE (GLOBAL (CurrentActivity)) != SUPER_MELEE) { - // In Supermelee, the RNG is already initialised. -@@ -512,6 +527,8 @@ - UninitShips (); - FreeBattleSong (); - -+ TFB_SetOnScreenKeyboard_Menu (); -+ - UnlockMutex (GraphicsLock); - - return (BOOLEAN) (num_ships < 0); -Index: src/uqm/controls.h -=================================================================== ---- src/uqm/controls.h (revision 1330) -+++ src/uqm/controls.h (working copy) +--- uqm/controls.h (revision 1351) ++++ uqm/controls.h (working copy) @@ -32,6 +32,7 @@ KEY_WEAPON, KEY_SPECIAL, @@ -1538,417 +2193,10 @@ Index: src/uqm/controls.h void DoPopupWindow(const char *msg); typedef void (InputFrameCallback) (void); -Index: src/uqm/outfit.c +Index: uqm/supermelee/melee.c =================================================================== ---- src/uqm/outfit.c (revision 1330) -+++ src/uqm/outfit.c (working copy) -@@ -59,7 +59,7 @@ - OldContext = SetContext (StatusContext); - GetContextClipRect (&r); - s.origin.x = RADAR_X - r.corner.x; -- s.origin.y = RADAR_Y - r.corner.y - 19 * RESOLUTION_FACTOR; // JMS_GFX; -+ s.origin.y = RADAR_Y_LIFTED_UP - r.corner.y + RES_CASE(10,6,12); // JMS_GFX; - r.corner.x = s.origin.x - 1; - r.corner.y = s.origin.y - 11; - r.extent.width = RADAR_WIDTH + 2; -Index: src/uqm/comm/vux/vuxc.c -=================================================================== ---- src/uqm/comm/vux/vuxc.c (revision 1330) -+++ src/uqm/comm/vux/vuxc.c (working copy) -@@ -18,7 +18,7 @@ - - #include "../commall.h" - #include "resinst.h" --#include "strings.h" -+#include "../vux/strings.h" - - static LOCDATA vux_desc_1x = - { -Index: src/uqm/comm/shofixt/shofixt.c -=================================================================== ---- src/uqm/comm/shofixt/shofixt.c (revision 1330) -+++ src/uqm/comm/shofixt/shofixt.c (working copy) -@@ -18,7 +18,7 @@ - - #include "../commall.h" - #include "resinst.h" --#include "strings.h" -+#include "../shofixt/strings.h" - - #include "uqm/gameev.h" - -Index: src/uqm/comm/pkunk/pkunkc.c -=================================================================== ---- src/uqm/comm/pkunk/pkunkc.c (revision 1330) -+++ src/uqm/comm/pkunk/pkunkc.c (working copy) -@@ -18,7 +18,7 @@ - - #include "../commall.h" - #include "resinst.h" --#include "strings.h" -+#include "../pkunk/strings.h" - - #include "uqm/build.h" - #include "uqm/gameev.h" -Index: src/uqm/comm/spathi/spathic.c -=================================================================== ---- src/uqm/comm/spathi/spathic.c (revision 1330) -+++ src/uqm/comm/spathi/spathic.c (working copy) -@@ -18,7 +18,7 @@ - - #include "../commall.h" - #include "resinst.h" --#include "strings.h" -+#include "../spathi/strings.h" - - #include "uqm/build.h" - -Index: src/uqm/comm/rebel/rebel.c -=================================================================== ---- src/uqm/comm/rebel/rebel.c (revision 1330) -+++ src/uqm/comm/rebel/rebel.c (working copy) -@@ -18,7 +18,7 @@ - - #include "../commall.h" - #include "../yehat/resinst.h" --#include "strings.h" -+#include "../rebel/strings.h" - - #include "uqm/build.h" - -Index: src/uqm/comm/druuge/druugec.c -=================================================================== ---- src/uqm/comm/druuge/druugec.c (revision 1330) -+++ src/uqm/comm/druuge/druugec.c (working copy) -@@ -18,7 +18,7 @@ - - #include "../commall.h" - #include "resinst.h" --#include "strings.h" -+#include "../druuge/strings.h" - - #include "uqm/build.h" - #include "uqm/setup.h" -Index: src/uqm/comm/spahome/spahome.c -=================================================================== ---- src/uqm/comm/spahome/spahome.c (revision 1330) -+++ src/uqm/comm/spahome/spahome.c (working copy) -@@ -18,7 +18,7 @@ - - #include "../commall.h" - #include "../spathi/resinst.h" --#include "strings.h" -+#include "../spahome/strings.h" - - #include "uqm/build.h" - #include "uqm/gameev.h" -Index: src/uqm/comm/starbas/starbas.c -=================================================================== ---- src/uqm/comm/starbas/starbas.c (revision 1330) -+++ src/uqm/comm/starbas/starbas.c (working copy) -@@ -18,7 +18,7 @@ - - #include "../commall.h" - #include "../comandr/resinst.h" --#include "strings.h" -+#include "../starbas/strings.h" - - #include "uqm/build.h" - #include "uqm/setup.h" -Index: src/uqm/comm/utwig/utwigc.c -=================================================================== ---- src/uqm/comm/utwig/utwigc.c (revision 1330) -+++ src/uqm/comm/utwig/utwigc.c (working copy) -@@ -18,7 +18,7 @@ - - #include "../commall.h" - #include "resinst.h" --#include "strings.h" -+#include "../utwig/strings.h" - - #include "uqm/build.h" - #include "uqm/gameev.h" -Index: src/uqm/comm/umgah/umgahc.c -=================================================================== ---- src/uqm/comm/umgah/umgahc.c (revision 1330) -+++ src/uqm/comm/umgah/umgahc.c (working copy) -@@ -18,7 +18,7 @@ - - #include "../commall.h" - #include "resinst.h" --#include "strings.h" -+#include "../umgah/strings.h" - - #include "uqm/build.h" - -Index: src/uqm/comm/talkpet/talkpet.c -=================================================================== ---- src/uqm/comm/talkpet/talkpet.c (revision 1330) -+++ src/uqm/comm/talkpet/talkpet.c (working copy) -@@ -18,7 +18,7 @@ - - #include "../commall.h" - #include "resinst.h" --#include "strings.h" -+#include "../talkpet/strings.h" - - #include "uqm/build.h" - -Index: src/uqm/comm/syreen/syreenc.c -=================================================================== ---- src/uqm/comm/syreen/syreenc.c (revision 1330) -+++ src/uqm/comm/syreen/syreenc.c (working copy) -@@ -18,7 +18,7 @@ - - #include "../commall.h" - #include "resinst.h" --#include "strings.h" -+#include "../syreen/strings.h" - - #include "libs/sound/sound.h" - #include "uqm/build.h" -Index: src/uqm/comm/melnorm/melnorm.c -=================================================================== ---- src/uqm/comm/melnorm/melnorm.c (revision 1330) -+++ src/uqm/comm/melnorm/melnorm.c (working copy) -@@ -18,7 +18,7 @@ - - #include "../commall.h" - #include "resinst.h" --#include "strings.h" -+#include "../melnorm/strings.h" - - #include "uqm/gameev.h" - #include "uqm/setup.h" -Index: src/uqm/comm/yehat/yehatc.c -=================================================================== ---- src/uqm/comm/yehat/yehatc.c (revision 1330) -+++ src/uqm/comm/yehat/yehatc.c (working copy) -@@ -18,7 +18,7 @@ - - #include "../commall.h" - #include "resinst.h" --#include "strings.h" -+#include "../yehat/strings.h" - - #include "uqm/build.h" - #include "uqm/gameev.h" -Index: src/uqm/comm/orz/orzc.c -=================================================================== ---- src/uqm/comm/orz/orzc.c (revision 1330) -+++ src/uqm/comm/orz/orzc.c (working copy) -@@ -18,7 +18,7 @@ - - #include "../commall.h" - #include "resinst.h" --#include "strings.h" -+#include "../orz/strings.h" - - #include "uqm/build.h" - -Index: src/uqm/comm/slyhome/slyhome.c -=================================================================== ---- src/uqm/comm/slyhome/slyhome.c (revision 1330) -+++ src/uqm/comm/slyhome/slyhome.c (working copy) -@@ -18,7 +18,7 @@ - - #include "../commall.h" - #include "resinst.h" --#include "strings.h" -+#include "../slyhome/strings.h" - - #include "uqm/gameev.h" - -Index: src/uqm/comm/zoqfot/zoqfotc.c -=================================================================== ---- src/uqm/comm/zoqfot/zoqfotc.c (revision 1330) -+++ src/uqm/comm/zoqfot/zoqfotc.c (working copy) -@@ -18,7 +18,7 @@ - - #include "../commall.h" - #include "resinst.h" --#include "strings.h" -+#include "../zoqfot/strings.h" - - #include "uqm/build.h" - #include "uqm/gameev.h" -Index: src/uqm/comm/comandr/comandr.c -=================================================================== ---- src/uqm/comm/comandr/comandr.c (revision 1330) -+++ src/uqm/comm/comandr/comandr.c (working copy) -@@ -20,7 +20,7 @@ - - #include "../commall.h" - #include "resinst.h" --#include "strings.h" -+#include "../comandr/strings.h" - - #include "uqm/setup.h" - #include "uqm/sis.h" -Index: src/uqm/comm/blackur/blackurc.c -=================================================================== ---- src/uqm/comm/blackur/blackurc.c (revision 1330) -+++ src/uqm/comm/blackur/blackurc.c (working copy) -@@ -18,7 +18,7 @@ - - #include "../commall.h" - #include "resinst.h" --#include "strings.h" -+#include "../blackur/strings.h" - - static LOCDATA blackurq_desc = - { -Index: src/uqm/comm/mycon/myconc.c -=================================================================== ---- src/uqm/comm/mycon/myconc.c (revision 1330) -+++ src/uqm/comm/mycon/myconc.c (working copy) -@@ -18,7 +18,7 @@ - - #include "../commall.h" - #include "resinst.h" --#include "strings.h" -+#include "../mycon/strings.h" - - #include "uqm/gameev.h" - #include "libs/mathlib.h" -Index: src/uqm/comm/arilou/arilouc.c -=================================================================== ---- src/uqm/comm/arilou/arilouc.c (revision 1330) -+++ src/uqm/comm/arilou/arilouc.c (working copy) -@@ -18,7 +18,7 @@ - - #include "../commall.h" - #include "resinst.h" --#include "strings.h" -+#include "../arilou/strings.h" - - #include "uqm/gameev.h" - -Index: src/uqm/comm/chmmr/chmmrc.c -=================================================================== ---- src/uqm/comm/chmmr/chmmrc.c (revision 1330) -+++ src/uqm/comm/chmmr/chmmrc.c (working copy) -@@ -18,7 +18,7 @@ - - #include "../commall.h" - #include "resinst.h" --#include "strings.h" -+#include "../chmmr/strings.h" - - #include "uqm/build.h" - #include "uqm/hyper.h" -Index: src/uqm/comm/thradd/thraddc.c -=================================================================== ---- src/uqm/comm/thradd/thraddc.c (revision 1330) -+++ src/uqm/comm/thradd/thraddc.c (working copy) -@@ -18,7 +18,7 @@ - - #include "../commall.h" - #include "resinst.h" --#include "strings.h" -+#include "../thradd/strings.h" - - #include "uqm/build.h" - #include "uqm/gameev.h" -Index: src/uqm/comm/slyland/slyland.c -=================================================================== ---- src/uqm/comm/slyland/slyland.c (revision 1330) -+++ src/uqm/comm/slyland/slyland.c (working copy) -@@ -16,10 +16,10 @@ - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -+#include "../slyland/strings.h" -+#include - #include "../commall.h" --#include - #include "resinst.h" --#include "strings.h" - - #include "options.h" - #include "uqm/battle.h" -Index: src/uqm/comm/ilwrath/ilwrathc.c -=================================================================== ---- src/uqm/comm/ilwrath/ilwrathc.c (revision 1330) -+++ src/uqm/comm/ilwrath/ilwrathc.c (working copy) -@@ -18,7 +18,7 @@ - - #include "../commall.h" - #include "resinst.h" --#include "strings.h" -+#include "../ilwrath/strings.h" - - #include "uqm/gameev.h" - -Index: src/uqm/comm/urquan/urquanc.c -=================================================================== ---- src/uqm/comm/urquan/urquanc.c (revision 1330) -+++ src/uqm/comm/urquan/urquanc.c (working copy) -@@ -18,7 +18,7 @@ - - #include "../commall.h" - #include "resinst.h" --#include "strings.h" -+#include "../urquan/strings.h" - - static LOCDATA urquan_desc = - { -Index: src/uqm/comm/supox/supoxc.c -=================================================================== ---- src/uqm/comm/supox/supoxc.c (revision 1330) -+++ src/uqm/comm/supox/supoxc.c (working copy) -@@ -18,7 +18,7 @@ - - #include "../commall.h" - #include "resinst.h" --#include "strings.h" -+#include "../supox/strings.h" - - #include "uqm/build.h" - -Index: src/uqm/intel.c -=================================================================== ---- src/uqm/intel.c (revision 1330) -+++ src/uqm/intel.c (working copy) -@@ -45,10 +45,10 @@ - // Allow a player to warp-escape in cyborg mode - if (StarShipPtr->playerNr == RPG_PLAYER_NUM) - InputState |= CurrentInputToBattleInput ( -- context->playerNr) & BATTLE_ESCAPE; -+ context->playerNr, -1) & BATTLE_ESCAPE; - } - else -- InputState = CurrentInputToBattleInput (context->playerNr); -+ InputState = CurrentInputToBattleInput (context->playerNr, -1); - } - else if (!(PlayerControl[context->playerNr] & PSYTRON_CONTROL)) - InputState = 0; -Index: src/uqm/status.c -=================================================================== ---- src/uqm/status.c (revision 1330) -+++ src/uqm/status.c (working copy) -@@ -328,7 +328,7 @@ - StarShipPtr->RaceDescPtr->characteristics.energy_wait; - - DeltaStatistics (ShipInfoPtr, status_y_offsets[StarShipPtr->playerNr], -- 0, energy_delta); -+ 0, energy_delta, StarShipPtr->playerNr); - } - - return (retval); -@@ -370,7 +370,7 @@ - } - - DeltaStatistics (ShipInfoPtr, status_y_offsets[StarShipPtr->playerNr], -- crew_delta, 0); -+ crew_delta, 0, StarShipPtr->playerNr); - - return (retval); - } -Index: src/uqm/supermelee/melee.c -=================================================================== ---- src/uqm/supermelee/melee.c (revision 1330) -+++ src/uqm/supermelee/melee.c (working copy) +--- uqm/supermelee/melee.c (revision 1351) ++++ uqm/supermelee/melee.c (working copy) @@ -2124,7 +2124,7 @@ PlayerControl[0] = HUMAN_CONTROL | STANDARD_RATING; Melee_LocalChange_team (&MenuState, 0, @@ -1958,176 +2206,76 @@ Index: src/uqm/supermelee/melee.c Melee_LocalChange_team (&MenuState, 1, MenuState.load.preBuiltList[1]); } -Index: src/uqm/status.h +Index: uqm/setupmenu.c =================================================================== ---- src/uqm/status.h (revision 1330) -+++ src/uqm/status.h (working copy) -@@ -36,9 +36,15 @@ - #define CAPTAIN_HEIGHT RES_STAT_SCALE(30) // JMS_GFX - #define CAPTAIN_XOFFS ((STATUS_WIDTH - CAPTAIN_WIDTH) >> 1) // JMS_GFX - #define CAPTAIN_YOFFS (SHIP_INFO_HEIGHT + (4 << RESOLUTION_FACTOR)) // JMS_GFX --#define SHIP_STATUS_HEIGHT (STATUS_HEIGHT >> 1) --#define BAD_GUY_YOFFS 0 --#define GOOD_GUY_YOFFS SHIP_STATUS_HEIGHT -+#define SHIP_STATUS_HEIGHT ((STATUS_HEIGHT >> 1) - (17 << RESOLUTION_FACTOR)) -+#define BAD_GUY_YOFFS (-1 << RESOLUTION_FACTOR) -+#define GOOD_GUY_YOFFS (STATUS_HEIGHT - SHIP_STATUS_HEIGHT) -+#define HORIZ_CREW_ENERGY_SIZE (18 << RESOLUTION_FACTOR) -+#define HORIZ_CREW_XOFFS (2 << RESOLUTION_FACTOR) -+#define BAD_GUY_HORIZ_CREW_YOFFS (BAD_GUY_YOFFS + SHIP_STATUS_HEIGHT + (HORIZ_CREW_ENERGY_SIZE >> 1)) -+#define GOOD_GUY_HORIZ_CREW_YOFFS (GOOD_GUY_YOFFS - HORIZ_CREW_ENERGY_SIZE + (1 << RESOLUTION_FACTOR)) -+#define BAD_GUY_HORIZ_ENERGY_YOFFS (BAD_GUY_YOFFS + SHIP_STATUS_HEIGHT) -+#define GOOD_GUY_HORIZ_ENERGY_YOFFS (GOOD_GUY_YOFFS - (HORIZ_CREW_ENERGY_SIZE >> 1) + (1 << RESOLUTION_FACTOR)) - #define STARCON_TEXT_HEIGHT (7 << RESOLUTION_FACTOR) // JMS_GFX - #define TINY_TEXT_HEIGHT (9 << RESOLUTION_FACTOR) // JMS_GFX - #define BATTLE_CREW_X RES_STAT_SCALE(10) // JMS_GFX -@@ -54,7 +60,7 @@ - extern void InitShipStatus (SHIP_INFO *ShipInfoPtr, STARSHIP *StarShipPtr, RECT *pClipRect, BOOLEAN inMeleeMenu); - // StarShipPtr or pClipRect can be NULL - extern void DeltaStatistics (SHIP_INFO *ShipInfoPtr, COORD y_offs, -- SIZE crew_delta, SIZE energy_delta); -+ SIZE crew_delta, SIZE energy_delta, SIZE player_num); - extern void DrawBattleCrewAmount (SHIP_INFO *ShipInfoPtr, COORD y_offs); - - extern void DrawCaptainsWindow (STARSHIP *StarShipPtr); -Index: src/uqm/sis.c -=================================================================== ---- src/uqm/sis.c (revision 1330) -+++ src/uqm/sis.c (working copy) -@@ -1810,7 +1810,7 @@ - GetContextClipRect (&clip_r); - pRect = &temp_r; - temp_r.corner.x = RADAR_X - clip_r.corner.x; -- temp_r.corner.y = RADAR_Y - clip_r.corner.y; -+ temp_r.corner.y = RADAR_Y_LIFTED_UP - clip_r.corner.y; - temp_r.extent.width = RADAR_WIDTH; - temp_r.extent.height = RADAR_HEIGHT; - SetContext (ScreenContext); -Index: src/options.c -=================================================================== ---- src/options.c (revision 1330) -+++ src/options.c (working copy) -@@ -67,6 +67,7 @@ - BOOLEAN optRotatingIpPlanets; - BOOLEAN optTexturedIpPlanets; - BOOLEAN optCheatMode; -+BOOLEAN optDirectionalJoystick; - - BOOLEAN opt3doMusic; - BOOLEAN optRemixMusic; -@@ -480,6 +481,7 @@ - - for (i = 0; i < dirList->numNames; i++) - { -+ log_add (log_Info, "Mounting ZIP '%s'", dirList->names[i]); - if (uio_mountDir (repository, mountPoint, uio_FSTYPE_ZIP, - dirHandle, dirList->names[i], "/", autoMount, - relativeFlags | uio_MOUNT_RDONLY, -Index: src/options.h -=================================================================== ---- src/options.h (revision 1330) -+++ src/options.h (working copy) -@@ -54,6 +54,7 @@ - extern BOOLEAN optRotatingIpPlanets; - extern BOOLEAN optTexturedIpPlanets; - extern BOOLEAN optCheatMode; -+extern BOOLEAN optDirectionalJoystick; - - extern BOOLEAN opt3doMusic; - extern BOOLEAN optRemixMusic; -Index: src/uqm.c -=================================================================== ---- src/uqm.c (revision 1330) -+++ src/uqm.c (working copy) -@@ -63,6 +63,22 @@ - // Including this is actually necessary on OSX. +--- uqm/setupmenu.c (revision 1351) ++++ uqm/setupmenu.c (working copy) +@@ -83,7 +83,7 @@ #endif -+#if defined (ANDROID) -+# include -+static void AndroidAppPutToBackgroundCallback (void) -+{ -+ SDL_ANDROID_PauseAudioPlayback (); -+ GameActive = FALSE; -+ //GamePaused = TRUE; -+} -+static void SDLCALL AndroidAppRestoredCallback (void) -+{ -+ SDL_ANDROID_ResumeAudioPlayback (); -+ GameActive = TRUE; -+ //GamePaused = FALSE; -+} -+#endif -+ - struct bool_option - { - bool value; -@@ -138,6 +154,7 @@ - DECL_CONFIG_OPTION(bool, rotatingIpPlanets); // JMS - DECL_CONFIG_OPTION(bool, texturedIpPlanets); // JMS - DECL_CONFIG_OPTION(bool, cheatMode); // JMS -+ DECL_CONFIG_OPTION(bool, directionalJoystick); + #define MENU_COUNT 8 +-#define CHOICE_COUNT 29 // JMS: New options added. ++#define CHOICE_COUNT 30 // JMS: New options added. + #define SLIDER_COUNT 3 + #define BUTTON_COUNT 10 + #define LABEL_COUNT 4 +@@ -106,7 +106,7 @@ + static int choice_widths[CHOICE_COUNT] = { + 3, 2, 3, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 3, 3, 2, 3, 3, +- 3, 2, 3, 2, 2, 2, 2, 2, 2 }; ++ 3, 2, 3, 2, 2, 2, 2, 2, 2, 2 }; - #define INIT_CONFIG_OPTION(name, val) \ - { val, false } -@@ -256,8 +273,8 @@ - INIT_CONFIG_OPTION( gamma, 0.0f ), - INIT_CONFIG_OPTION( soundDriver, audio_DRIVER_MIXSDL ), - INIT_CONFIG_OPTION( soundQuality, audio_QUALITY_MEDIUM ), -- INIT_CONFIG_OPTION( use3doMusic, true ), -- INIT_CONFIG_OPTION( useRemixMusic, false ), -+ INIT_CONFIG_OPTION( use3doMusic, false ), -+ INIT_CONFIG_OPTION( useRemixMusic, true ), - INIT_CONFIG_OPTION( whichCoarseScan, OPT_PC ), - INIT_CONFIG_OPTION( whichMenu, OPT_PC ), - INIT_CONFIG_OPTION( whichFonts, OPT_PC ), -@@ -271,15 +288,16 @@ - INIT_CONFIG_OPTION( sfxVolumeScale, 1.0f ), - INIT_CONFIG_OPTION( speechVolumeScale, 0.3f ), - INIT_CONFIG_OPTION( safeMode, false ), -- INIT_CONFIG_OPTION( resolutionFactor, 2 ), -+ INIT_CONFIG_OPTION( resolutionFactor, 1 ), - INIT_CONFIG_OPTION( forceAspectRatio, false ), - INIT_CONFIG_OPTION( loresBlowupScale, 0 ), - INIT_CONFIG_OPTION( mainmenuMusic, true ), -- INIT_CONFIG_OPTION( mineralSubmenu, true ), -+ INIT_CONFIG_OPTION( mineralSubmenu, false ), - INIT_CONFIG_OPTION( nebulae, true ), - INIT_CONFIG_OPTION( rotatingIpPlanets, true), - INIT_CONFIG_OPTION( texturedIpPlanets, true), - INIT_CONFIG_OPTION( cheatMode, false ), -+ INIT_CONFIG_OPTION( directionalJoystick, true ), - }; - struct options_struct defaults = options; - int optionsResult; -@@ -346,6 +364,14 @@ - return optionsResult; - } - -+#if defined (ANDROID) -+ SDL_ANDROID_SetApplicationPutToBackgroundCallback (AndroidAppPutToBackgroundCallback, AndroidAppRestoredCallback); -+ if( !fileExists("config/save") ) { -+ // Copy savegames from UQM non-HD, I'm too lazy to do that properly. -+ system("SAVEDIR=`pwd`/config/save ; mkdir -p $SAVEDIR ; cd ../../../../app-data/com.sourceforge.sc2/config/save || exit 1 ; for f in * ; do cat $f > $SAVEDIR/$f ; done"); -+ } -+#endif -+ - TFB_PreInit (); - mem_init (); - InitThreadSystem (); -@@ -413,6 +439,7 @@ - optRotatingIpPlanets = options.rotatingIpPlanets.value; // JMS - optTexturedIpPlanets = options.texturedIpPlanets.value || optRotatingIpPlanets; // JMS - optCheatMode = options.cheatMode.value; // JMS -+ optDirectionalJoystick = options.directionalJoystick.value; + static HANDLER button_handlers[BUTTON_COUNT] = { + quit_main_menu, quit_sub_menu, do_graphics, do_engine, +@@ -117,7 +117,7 @@ + // JMS: The first 8 was 7 (sound options.) Added mainmenumusic on/off. + // JMS: The HAVE_OPENGL options were 5 and 4. Added cheatMode, mineralSubmenu, nebulae and planet options. + static int menu_sizes[MENU_COUNT] = { +- 7, 6, 8, 8, 2, 5, ++ 7, 6, 8, 8, 2, 6, + #ifdef HAVE_OPENGL + 10, + #else +@@ -185,6 +185,7 @@ + static WIDGET *keyconfig_widgets[] = { + (WIDGET *)(&choices[18]), + (WIDGET *)(&choices[19]), ++ (WIDGET *)(&choices[29]), // Directional joystick + (WIDGET *)(&labels[1]), + (WIDGET *)(&buttons[8]), + (WIDGET *)(&buttons[1]) }; +@@ -414,6 +415,7 @@ + choices[26].selected = opts.rotatingIpPlanets; // JMS + choices[27].selected = opts.texturedIpPlanets || opts.rotatingIpPlanets; // JMS + choices[28].selected = opts.cheatMode; // JMS ++ choices[29].selected = opts.directionalJoystick; - prepareContentDir (options.contentDir, options.addonDir, argv[0]); - prepareMeleeDir (); -@@ -696,6 +723,7 @@ - getBoolConfigValue (&options->rotatingIpPlanets, "config.rotatingIpPlanets"); - getBoolConfigValue (&options->texturedIpPlanets, "config.texturedIpPlanets"); - getBoolConfigValue (&options->cheatMode, "config.cheatMode"); -+ getBoolConfigValue (&options->directionalJoystick, "config.directionaljoystick"); + sliders[0].value = opts.musicvol; + sliders[1].value = opts.sfxvol; +@@ -452,6 +454,7 @@ + opts.rotatingIpPlanets = choices[26].selected; // JMS + opts.texturedIpPlanets = choices[27].selected || opts.rotatingIpPlanets; // JMS + opts.cheatMode = choices[28].selected; // JMS ++ opts.directionalJoystick = choices[29].selected; - if (res_IsInteger ("config.player1control")) + opts.musicvol = sliders[0].value; + opts.sfxvol = sliders[1].value; +@@ -1164,6 +1167,7 @@ + opts->rotatingIpPlanets = optRotatingIpPlanets ? OPTVAL_ENABLED : OPTVAL_DISABLED; + opts->texturedIpPlanets = (optTexturedIpPlanets ? OPTVAL_ENABLED : OPTVAL_DISABLED) || opts->rotatingIpPlanets; + opts->cheatMode = optCheatMode ? OPTVAL_ENABLED : OPTVAL_DISABLED; ++ opts->directionalJoystick = optDirectionalJoystick ? OPTVAL_ENABLED : OPTVAL_DISABLED; + + /* Work out resolution. On the way, try to guess a good default + * for config.alwaysgl, then overwrite it if it was set previously. */ +@@ -1376,6 +1380,9 @@ + res_PutBoolean ("config.cheatMode", opts->cheatMode == OPTVAL_ENABLED); + optCheatMode = opts->cheatMode == OPTVAL_ENABLED; + ++ res_PutBoolean ("config.directionaljoystick", opts->directionalJoystick == OPTVAL_ENABLED); ++ optDirectionalJoystick = (opts->directionalJoystick == OPTVAL_ENABLED) ? TRUE : FALSE; ++ + if (NewWidth == 320 && NewHeight == 240) { + switch (opts->scaler) diff --git a/todo.txt b/todo.txt index 482a8f6c9..8fed219ab 100644 --- a/todo.txt +++ b/todo.txt @@ -26,8 +26,6 @@ TODO, which will get actually done - UQM: On-screen buttons are re-appearing when using gamepad and switching between game screens. -- UQM: Redesign gamepad controls. - - UQM: Arrow keys do not steer the ship. - OpenArena: move 3-rd person camera to the side, above shoulder.