changed some platform-related preprocessor definition names
[rocksndiamonds.git] / src / events.c
index b883452ce6b24582846d3690e302985a84365cdf..4a31bcd6539140624d9e8f0c25f1f7523dc40fc7 100644 (file)
@@ -585,7 +585,7 @@ void HandleWheelEvent(WheelEvent *event)
               event->y < 0 ? MB_WHEEL_DOWN :
               event->y > 0 ? MB_WHEEL_UP : 0);
 
-#if defined(PLATFORM_WIN32) || defined(PLATFORM_MACOSX)
+#if defined(PLATFORM_WINDOWS) || defined(PLATFORM_MAC)
   // accelerated mouse wheel available on Mac and Windows
   wheel_steps = (event->x ? ABS(event->x) : ABS(event->y));
 #else
@@ -1718,9 +1718,11 @@ void HandleButton(int mx, int my, int button, int button_nr)
   // when playing, only handle gadgets when using "follow finger" controls
   // or when using touch controls in combination with the MM game engine
   // or when using gadgets that do not overlap with virtual buttons
+  // or when touch controls are disabled (e.g., with mouse-only levels)
   handle_gadgets =
     (game_status != GAME_MODE_PLAYING ||
      level.game_engine_type == GAME_ENGINE_TYPE_MM ||
+     strEqual(setup.touch.control_type, TOUCH_CONTROL_OFF) ||
      strEqual(setup.touch.control_type, TOUCH_CONTROL_FOLLOW_FINGER) ||
      (strEqual(setup.touch.control_type, TOUCH_CONTROL_VIRTUAL_BUTTONS) &&
       !CheckVirtualButtonPressed(mx, my, button)));
@@ -1784,6 +1786,10 @@ void HandleButton(int mx, int my, int button, int button_nr)
       HandleHallOfFame(mx, my, 0, 0, button);
       break;
 
+    case GAME_MODE_SCOREINFO:
+      HandleScoreInfo(mx, my, 0, 0, button);
+      break;
+
     case GAME_MODE_EDITOR:
       HandleLevelEditorIdle();
       break;
@@ -2295,6 +2301,11 @@ void HandleKey(Key key, int key_status)
     HandleSoundButtonKeys(key);
   }
 
+  if (game_status == GAME_MODE_SCOREINFO)
+  {
+    HandleScreenGadgetKeys(key);
+  }
+
   if (game_status == GAME_MODE_PLAYING && !network_playing)
   {
     int centered_player_nr_next = -999;
@@ -2324,6 +2335,14 @@ void HandleKey(Key key, int key_status)
   if (HandleGadgetsKeyInput(key))
     return;            // do not handle already processed keys again
 
+  // special case: on "space" key, either continue playing or go to main menu
+  if (game_status == GAME_MODE_SCORES && key == KSYM_space)
+  {
+    HandleHallOfFame(0, 0, 0, 0, MB_MENU_CONTINUE);
+
+    return;
+  }
+
   switch (game_status)
   {
     case GAME_MODE_PSEUDO_TYPENAME:
@@ -2339,6 +2358,7 @@ void HandleKey(Key key, int key_status)
     case GAME_MODE_SETUP:
     case GAME_MODE_INFO:
     case GAME_MODE_SCORES:
+    case GAME_MODE_SCOREINFO:
 
       if (anyTextGadgetActiveOrJustFinished && key != KSYM_Escape)
        break;
@@ -2363,6 +2383,8 @@ void HandleKey(Key key, int key_status)
            HandleInfoScreen(0, 0, 0, 0, MB_MENU_CHOICE);
          else if (game_status == GAME_MODE_SCORES)
            HandleHallOfFame(0, 0, 0, 0, MB_MENU_CHOICE);
+         else if (game_status == GAME_MODE_SCOREINFO)
+           HandleScoreInfo(0, 0, 0, 0, MB_MENU_CHOICE);
          break;
 
        case KSYM_Escape:
@@ -2383,6 +2405,8 @@ void HandleKey(Key key, int key_status)
            HandleInfoScreen(0, 0, 0, 0, MB_MENU_LEAVE);
          else if (game_status == GAME_MODE_SCORES)
            HandleHallOfFame(0, 0, 0, 0, MB_MENU_LEAVE);
+         else if (game_status == GAME_MODE_SCOREINFO)
+           HandleScoreInfo(0, 0, 0, 0, MB_MENU_LEAVE);
          break;
 
         case KSYM_Page_Up:
@@ -2398,6 +2422,8 @@ void HandleKey(Key key, int key_status)
            HandleInfoScreen(0, 0, 0, -1 * SCROLL_PAGE, MB_MENU_MARK);
          else if (game_status == GAME_MODE_SCORES)
            HandleHallOfFame(0, 0, 0, -1 * SCROLL_PAGE, MB_MENU_MARK);
+         else if (game_status == GAME_MODE_SCOREINFO)
+           HandleScoreInfo(0, 0, 0, -1 * SCROLL_PAGE, MB_MENU_MARK);
          break;
 
         case KSYM_Page_Down:
@@ -2413,6 +2439,8 @@ void HandleKey(Key key, int key_status)
            HandleInfoScreen(0, 0, 0, +1 * SCROLL_PAGE, MB_MENU_MARK);
          else if (game_status == GAME_MODE_SCORES)
            HandleHallOfFame(0, 0, 0, +1 * SCROLL_PAGE, MB_MENU_MARK);
+         else if (game_status == GAME_MODE_SCOREINFO)
+           HandleScoreInfo(0, 0, 0, +1 * SCROLL_PAGE, MB_MENU_MARK);
          break;
 
        default:
@@ -2644,6 +2672,7 @@ void HandleJoystick(void)
     case GAME_MODE_SETUP:
     case GAME_MODE_INFO:
     case GAME_MODE_SCORES:
+    case GAME_MODE_SCOREINFO:
     {
       if (anyTextGadgetActive())
        break;
@@ -2664,6 +2693,8 @@ void HandleJoystick(void)
        HandleInfoScreen(0,0,dx,dy, newbutton ? MB_MENU_CHOICE : MB_MENU_MARK);
       else if (game_status == GAME_MODE_SCORES)
        HandleHallOfFame(0,0,dx,dy, newbutton ? MB_MENU_CHOICE : MB_MENU_MARK);
+      else if (game_status == GAME_MODE_SCOREINFO)
+       HandleScoreInfo(0,0,dx,dy, newbutton ? MB_MENU_CHOICE : MB_MENU_MARK);
 
       break;
     }