Some improvements on Teeworlds port - it still crashes for no reason when I'm pressing 5-th button

This commit is contained in:
pelya
2010-09-08 12:52:26 +03:00
parent 7787b90910
commit b3571c8a67
11 changed files with 101 additions and 13 deletions

View File

@@ -67,6 +67,8 @@ extern DECLSPEC int SDLCALL SDL_ANDROID_GetScreenKeyboardAutoFireButtonsAmount()
extern DECLSPEC int SDLCALL SDL_ANDROID_SetScreenKeyboardShown(int shown);
extern DECLSPEC int SDLCALL SDL_ANDROID_GetScreenKeyboardShown();
extern DECLSPEC int SDLCALL SDL_ANDROID_GetScreenKeyboardSize();
#ifdef __cplusplus
}
#endif

View File

@@ -60,7 +60,8 @@ int SDL_ANDROID_isTouchscreenKeyboardUsed = 0;
static int touchscreenKeyboardTheme = 0;
static int touchscreenKeyboardShown = 1;
static int AutoFireButtonsNum = 0;
static int nbuttons;
static int nbuttons = 4;
static int buttonsize = 1;
static SDL_Rect arrows, buttons[MAX_BUTTONS];
static SDLKey buttonKeysyms[MAX_BUTTONS] = {
@@ -551,6 +552,7 @@ JAVA_EXPORT_NAME(Settings_nativeSetupScreenKeyboard) ( JNIEnv* env, jobject thi
if( AutoFireButtonsNum > MAX_BUTTONS_AUTOFIRE )
AutoFireButtonsNum = MAX_BUTTONS_AUTOFIRE;
// TODO: works for horizontal screen orientation only!
buttonsize = size;
if(touchscreenKeyboardTheme == 0)
{
@@ -785,3 +787,8 @@ int SDL_ANDROID_GetScreenKeyboardShown()
{
return touchscreenKeyboardShown;
};
int SDL_ANDROID_GetScreenKeyboardSize()
{
return buttonsize;
};