fixed ignoring clicks on global animations after executing event actions
[rocksndiamonds.git] / src / tools.c
index 76b40a291272a7c899ca1fba7c003f69ccfcf72b..24fecfb31d478829d2f89bf2e59fa93a93a8e812 100644 (file)
@@ -1574,6 +1574,10 @@ void getSizedGraphicSourceExt(int graphic, int frame, int tilesize,
 {
   struct GraphicInfo *g = &graphic_info[graphic];
 
+  // if no graphics defined at all, use fallback graphics
+  if (g->bitmaps == NULL)
+    *g = graphic_info[IMG_CHAR_EXCLAM];
+
   // if no in-game graphics defined, always use standard graphic size
   if (g->bitmaps[IMG_BITMAP_GAME] == NULL)
     tilesize = TILESIZE;
@@ -4182,8 +4186,8 @@ static int RequestHandleEvents(unsigned int req_state)
 
              case KSYM_Return:
              case KSYM_y:
-             case KSYM_Y:
 #if defined(TARGET_SDL2)
+             case KSYM_Y:
              case KSYM_Select:
              case KSYM_Menu:
 #if defined(KSYM_Rewind)
@@ -4195,8 +4199,8 @@ static int RequestHandleEvents(unsigned int req_state)
 
              case KSYM_Escape:
              case KSYM_n:
-             case KSYM_N:
 #if defined(TARGET_SDL2)
+             case KSYM_N:
              case KSYM_Back:
 #if defined(KSYM_FastForward)
              case KSYM_FastForward:    /* for Amazon Fire TV remote */
@@ -5300,7 +5304,8 @@ void CreateToolButtons()
 
   for (i = 0; i < NUM_TOOL_BUTTONS; i++)
   {
-    struct GraphicInfo *gfx = &graphic_info[toolbutton_info[i].graphic];
+    int graphic = toolbutton_info[i].graphic;
+    struct GraphicInfo *gfx = &graphic_info[graphic];
     struct TextPosInfo *pos = toolbutton_info[i].pos;
     struct GadgetInfo *gi;
     Bitmap *deco_bitmap = None;
@@ -5366,6 +5371,7 @@ void CreateToolButtons()
     }
 
     gi = CreateGadget(GDI_CUSTOM_ID, id,
+                     GDI_IMAGE_ID, graphic,
                      GDI_INFO_TEXT, toolbutton_info[i].infotext,
                      GDI_X, dx + x,
                      GDI_Y, dy + y,