Wei Mingzhi 10 years ago
parent
commit
1eeda1827a
3 changed files with 6 additions and 6 deletions
  1. 1 0
      android/AndroidManifest.xml
  2. 0 1
      common.h
  3. 5 5
      input.c

+ 1 - 0
android/AndroidManifest.xml

@@ -25,6 +25,7 @@
         <activity android:name="PalActivity"
                   android:label="@string/app_name"
                   android:configChanges="keyboardHidden|orientation"
+                  android:screenOrientation="landscape"
                   >
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />

+ 0 - 1
common.h

@@ -110,7 +110,6 @@ extern "C"
 
 #elif defined (__ANDROID__)
 
-#define PAL_HAS_JOYSTICKS     0
 #define PAL_PREFIX            "/mnt/sdcard/sdlpal/"
 #define PAL_SAVE_PREFIX       "/mnt/sdcard/sdlpal/"
 #define PAL_HAS_TOUCH         1

+ 5 - 5
input.c

@@ -809,14 +809,14 @@ PAL_TouchEventFilter(
 --*/
 {
 #ifdef PAL_HAS_TOUCH
-   static SDL_TouchID finger1 = 0, finger2 = 0;
+   static SDL_TouchID finger1 = -1, finger2 = -1;
    static int prev_touch1 = TOUCH_NONE;
    static int prev_touch2 = TOUCH_NONE;
 
    switch (lpEvent->type)
    {
    case SDL_FINGERDOWN:
-	  if (finger1 == 0)
+	  if (finger1 == -1)
 	  {
          int area = PAL_GetTouchArea(lpEvent->tfinger.x, lpEvent->tfinger.y);
 
@@ -824,7 +824,7 @@ PAL_TouchEventFilter(
          prev_touch1 = area;
          PAL_SetTouchAction(area);
 	  }
-	  else if (finger2 == 0)
+	  else if (finger2 == -1)
 	  {
          int area = PAL_GetTouchArea(lpEvent->tfinger.x, lpEvent->tfinger.y);
 
@@ -838,13 +838,13 @@ PAL_TouchEventFilter(
 	  if (lpEvent->tfinger.fingerId == finger1)
 	  {
 		 PAL_UnsetTouchAction(prev_touch1);
-		 finger1 = 0;
+		 finger1 = -1;
 		 prev_touch1 = TOUCH_NONE;
 	  }
 	  else if (lpEvent->tfinger.fingerId == finger2)
 	  {
 		 PAL_UnsetTouchAction(prev_touch2);
-		 finger2 = 0;
+		 finger2 = -1;
 		 prev_touch2 = TOUCH_NONE;
 	  }
 	  break;