Fixes for SDL 1.3, the keycodes and invoking from background are broken

This commit is contained in:
pelya
2011-09-19 16:11:22 +03:00
parent c1ae5a0fc6
commit ede9b2fdfd
8 changed files with 144 additions and 135 deletions
+3 -3
View File
@@ -22,9 +22,9 @@ LOCAL_SRC_FILES += $(foreach F, $(APP_SUBDIRS), $(addprefix $(F)/,$(notdir $(wil
LOCAL_CFLAGS :=
LOCAL_C_INCLUDES :=
ifeq ($(CRYSTAX_TOOLCHAIN)$(NDK_R5_TOOLCHAIN),)
LOCAL_C_INCLUDES += $(LOCAL_PATH)/../stlport/stlport
endif
#ifeq ($(CRYSTAX_TOOLCHAIN)$(NDK_R5_TOOLCHAIN),)
#LOCAL_C_INCLUDES += $(LOCAL_PATH)/../stlport/stlport
#endif
ifneq ($(CRYSTAX_R5_TOOLCHAIN),)
LOCAL_C_INCLUDES += $(NDK_PATH)/sources/crystax/include
endif
@@ -16,6 +16,7 @@ SdlVideoResizeKeepAspect=n
CompatibilityHacks=
AppUsesMouse=n
AppNeedsTwoButtonMouse=n
ForceRelativeMouseMode=n
AppNeedsArrowKeys=y
AppNeedsTextInput=y
AppUsesJoystick=n
@@ -1,6 +1,6 @@
# The application settings for Android libSDL port
AppSettingVersion=17
LibSdlVersion=1.2
LibSdlVersion=1.3
AppName="Ballfield"
AppFullName=net.olofson.ballfield
ScreenOrientation=h
@@ -23,7 +23,7 @@ AppUsesJoystick=n
AppHandlesJoystickSensitivity=n
AppUsesMultitouch=n
NonBlockingSwapBuffers=y
RedefinedKeys="SPACE"
RedefinedKeys="SPACE RETURN NO_REMAP NO_REMAP SPACE ESCAPE"
AppTouchscreenKeyboardKeysAmount=0
AppTouchscreenKeyboardKeysAmountAutoFire=0
RedefinedKeysScreenKb="1 2 3 4 5 6 1 2 3 4"
@@ -593,10 +593,9 @@ int main(int argc, char* argv[])
{
if(evt.type == SDL_KEYUP || evt.type == SDL_KEYDOWN)
{
Uint8 *keys = SDL_GetKeyState(&i);
if(keys[SDLK_ESCAPE])
if(evt.key.keysym.sym == SDLK_ESCAPE)
return 0;
__android_log_print(ANDROID_LOG_INFO, "Ballfield", "SDL key event: evt %s state %s key %d RETURN %d mod %d unicode %d", evt.type == SDL_KEYUP ? "UP " : "DOWN" , evt.key.state == SDL_PRESSED ? "PRESSED " : "RELEASED", (int)evt.key.keysym.sym, int(evt.key.keysym.sym == SDLK_RETURN), (int)evt.key.keysym.mod, (int)evt.key.keysym.unicode);
__android_log_print(ANDROID_LOG_INFO, "Ballfield", "SDL key event: evt %s state %s key %d scancode %d mod %d unicode %d", evt.type == SDL_KEYUP ? "UP " : "DOWN" , evt.key.state == SDL_PRESSED ? "PRESSED " : "RELEASED", (int)evt.key.keysym.sym, (int)evt.key.keysym.scancode, (int)evt.key.keysym.mod, (int)evt.key.keysym.unicode);
}
if(evt.type == SDL_VIDEORESIZE)
__android_log_print(ANDROID_LOG_INFO, "Ballfield", "SDL resize event: %d x %d", evt.resize.w, evt.resize.h);
+1 -1
View File
@@ -1 +1 @@
sc2
ballfield