reverted order of processing game modes for global animations clicks
[rocksndiamonds.git] / src / anim.c
index 82cb8dd248fc461b09ed6d081119c984ebced894..dcd66e330f2862decf9856ccabd6c3ba97860a8b 100644 (file)
@@ -360,10 +360,8 @@ static int compareGlobalAnimPartControlInfo(const void *obj1, const void *obj2)
     (struct GlobalAnimPartControlInfo *)obj2;
   int compare_result;
 
-  if (o1->control_info.draw_order != o2->control_info.draw_order)
-    compare_result = o1->control_info.draw_order - o2->control_info.draw_order;
-  else
-    compare_result = o1->nr - o2->nr;
+  // do not sort animations parts by draw order (as it would be confusing)
+  compare_result = o1->nr - o2->nr;
 
   return compare_result;
 }
@@ -2122,7 +2120,8 @@ static boolean InitGlobalAnim_Clicked(int mx, int my, int clicked_event)
   int mode_nr;
   int i;
 
-  for (mode_nr = 0; mode_nr < NUM_GAME_MODES; mode_nr++)
+  // check game modes in reverse draw order (to stop when clicked)
+  for (mode_nr = NUM_GAME_MODES - 1; mode_nr >= 0; mode_nr--)
   {
     struct GlobalAnimControlInfo *ctrl = &global_anim_ctrl[mode_nr];
     int anim_nr;