Minor fixes to floating joystick

This commit is contained in:
pelya
2014-06-22 02:24:25 +03:00
parent ed8e3457d0
commit 09fcc1728d
5 changed files with 304 additions and 109 deletions

View File

@@ -36,9 +36,6 @@ LibSdlVersion=1.2
# Specify screen orientation: (v)ertical/(p)ortrait or (h)orizontal/(l)andscape
ScreenOrientation=h
# Do not allow device to sleep when the application is in foreground, set this for video players or apps which use accelerometer
InhibitSuspend=n
# 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)
VideoDepthBpp=16
@@ -63,9 +60,19 @@ SdlVideoResize=y
# Application resizing will keep 4:3 aspect ratio, with black bars at sides (y)/(n)
SdlVideoResizeKeepAspect=n
# Do not allow device to sleep when the application is in foreground, set this for video players or apps which use accelerometer
InhibitSuspend=n
# Create Android service, so the app is less likely to be killed while in background
CreateService=
# Application does not call SDL_Flip() or SDL_UpdateRects() appropriately, or draws from non-main thread -
# enabling the compatibility mode will force screen update every 100 milliseconds, which is laggy and inefficient (y) or (n)
CompatibilityHacks=n
CompatibilityHacksForceScreenUpdate=n
# Application does not call SDL_Flip() or SDL_UpdateRects() after mouse click (ScummVM and all Amiga emulators do that) -
# force screen update by moving mouse cursor a little after each click (y) or (n)
CompatibilityHacksForceScreenUpdateMouseClick=y
# Application initializes SDL audio/video inside static constructors (which is bad, you won't be able to run ndk-gdb) (y)/(n)
CompatibilityHacksStaticInit=n
@@ -99,6 +106,10 @@ AppUsesMouse=n
# Application needs two-button mouse, will also enable advanced point-and-click features (y) or (n)
AppNeedsTwoButtonMouse=n
# Right mouse button can do long-press/drag&drop action, necessary for some games (y) or (n)
# If you disable it, swiping with two fingers will send mouse wheel events
RightMouseButtonLongPress=
# Show SDL mouse cursor, for applications that do not draw cursor at all (y) or (n)
ShowMouseCursor=n
@@ -108,24 +119,35 @@ GenerateSubframeTouchEvents=
# Force relative (laptop) mouse movement mode, useful when both on-screen keyboard and mouse are needed (y) or (n)
ForceRelativeMouseMode=n
# Application needs arrow keys (y) or (n), will show on-screen dpad/joystick (y) or (n)
# Show on-screen dpad/joystick, that will act as arrow keys (y) or (n)
AppNeedsArrowKeys=y
# On-screen dpad/joystick will appear under finger when it touches the screen (y) or (n)
# Joystick always follows finger, so moving mouse requires touching the screen with other finger
FloatingScreenJoystick=y
# Application needs text input (y) or (n), enables button for text input on screen
AppNeedsTextInput=n
# Application uses joystick (y) or (n), the on-screen DPAD will be used as joystick 0 axes 0-1
# This will disable AppNeedsArrowKeys option
AppUsesJoystick=n
# Application uses second on-screen joystick, as SDL joystick 0 axes 2-3 (y)/(n)
AppUsesSecondJoystick=n
# Application uses third on-screen joystick, as SDL joystick 0 axes 20-21 (y)/(n)
AppUsesThirdJoystick=
# Application uses accelerometer (y) or (n), the accelerometer will be used as joystick 1 axes 0-1 and 5-7
AppUsesAccelerometer=n
# Application uses gyroscope (y) or (n), the gyroscope will be used as joystick 1 axes 2-4
AppUsesGyroscope=n
# Use gyroscope to move mouse cursor (y) or (n), it eats battery, and can be disabled in settings, do not use with AppUsesGyroscope setting
MoveMouseWithGyroscope=
# Application uses multitouch (y) or (n), multitouch events are passed as SDL_JOYBALLMOTION events for the joystick 0
AppUsesMultitouch=n
@@ -137,6 +159,9 @@ AppRecordsAudio=n
# Application needs to access SD card. If your data files are bigger than 5 Mb, enable it. (y) / (n)
AccessSdCard=
# Application needs Internet access. If you disable it, you'll have to bundle all your data files inside .apk (y) / (n)
AccessInternet=
# Immersive mode - Android will hide on-screen Home/Back keys. Looks bad if you invoke Android keyboard. (y) / (n)
ImmersiveMode=
@@ -156,9 +181,6 @@ RedefinedKeys="SPACE SPACE NO_REMAP NO_REMAP SPACE ESCAPE"
# Number of virtual keyboard keys (currently 6 is maximum)
AppTouchscreenKeyboardKeysAmount=1
# Number of virtual keyboard keys that support autofire (currently 2 is maximum)
AppTouchscreenKeyboardKeysAmountAutoFire=0
# Redefine on-screen keyboard keys to SDL keysyms - 6 keyboard keys + 4 multitouch gestures (zoom in/out and rotate left/right)
RedefinedKeysScreenKb="SPACE"
@@ -189,9 +211,9 @@ HiddenMenuOptions='SettingsMenuMisc.OptionalDownloadConfig'
# 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,
# but .apk size is 2x bigger (y) / (n) / (x86) / (all)
MultiABI=all
# Specify architectures to compile, 'all' or 'y' to compile for all architectures.
# Available architectures: armeabi armeabi-v7a armeabi-v7a-hard x86 mips
MultiABI='armeabi-v7a'
# Minimum amount of RAM application requires, in Mb, SDL will print warning to user if it's lower
AppMinimumRAM=0
@@ -205,7 +227,7 @@ CompiledLibraries="sdl_image sdl_mixer"
CustomBuildScript=n
# Aditional CFLAGS for application
AppCflags='-O3 -DDSI_DATA_DIR=\\"data\\" -DDSI_DIR=\\".\\" -DDSI_SCORE_DIR=\\".\\" -DDSI_PIXMAP_DIR=\\".\\" -include ../../android_debug.h'
AppCflags='-O3 -DDSI_DATA_DIR=\"data\" -DDSI_DIR=\".\" -DDSI_SCORE_DIR=\".\" -DDSI_PIXMAP_DIR=\".\" -include ../../android_debug.h'
# Additional LDFLAGS for application
AppLdflags=''
@@ -232,6 +254,6 @@ AdmobPublisherId=n
# Your AdMob test device ID, to receive a test ad
AdmobTestDeviceId=
# Your AdMob banner size (BANNER/IAB_BANNER/IAB_LEADERBOARD/IAB_MRECT/IAB_WIDE_SKYSCRAPER/SMART_BANNER)
# Your AdMob banner size (BANNER/FULL_BANNER/LEADERBOARD/MEDIUM_RECTANGLE/SMART_BANNER/WIDE_SKYSCRAPER/FULL_WIDTH:Height/Width:AUTO_HEIGHT/Width:Height)
AdmobBannerSize=

View File

@@ -6,8 +6,6 @@ if [ -e dspaceinvadors ] ; then
else
echo "Downloading sources..."
svn checkout svn://svn.code.sf.net/p/dspaceinvadors/code/ dspaceinvadors || exit 1
echo "Patching..."
patch -p0 -d dspaceinvadors < android.diff || exit 1
fi
if [ -e dspaceinvadors/config.h ] ; then

View File

@@ -1,49 +0,0 @@
Index: dsi/hi_score.c
===================================================================
--- dsi/hi_score.c (revision 218)
+++ dsi/hi_score.c (working copy)
@@ -193,7 +193,7 @@
key = SDL_GetKeyState(NULL);
if (key[SDLK_b] == SDL_PRESSED)
leave_state = RUN_INTRO;
- else if (key[SDLK_s] == SDL_PRESSED)
+ else if (key[SDLK_SPACE] == SDL_PRESSED)
leave_state = RUN_GAME;
WaitFrame();
}
Index: dsi/main.c
===================================================================
--- dsi/main.c (revision 218)
+++ dsi/main.c (working copy)
@@ -186,7 +186,7 @@
}
//Open the audio device
- if ( Mix_OpenAudio(11025, AUDIO_U8, 1, 512) < 0 )
+ if ( Mix_OpenAudio(11025, AUDIO_S16, 1, 1024) < 0 )
{
fprintf(stderr,
"Warning: Couldn't set 11025 Hz 8-bit audio\n- Reason: %s\n",
Index: dsi/intro.c
===================================================================
--- dsi/intro.c (revision 218)
+++ dsi/intro.c (working copy)
@@ -75,7 +75,7 @@
leave_state = RUN_QUIT;
}
key = SDL_GetKeyState(NULL);
- if (key[SDLK_s] == SDL_PRESSED)
+ if (key[SDLK_SPACE] == SDL_PRESSED)
leave_state = RUN_GAME;
else if (key[SDLK_v] == SDL_PRESSED)
leave_state = RUN_SCORE;
Index: dsi/sprite.c
===================================================================
--- dsi/sprite.c (revision 218)
+++ dsi/sprite.c (working copy)
@@ -119,4 +119,5 @@
SDL_Delay(next_tick-this_tick);
}
next_tick = this_tick + (1000/FRAMES_PER_SEC);
+ UpdateScreen(); // If we don't update screen on Android, we will not receive any input events
}