rnd-20031202-1-src
authorHolger Schemel <info@artsoft.org>
Tue, 2 Dec 2003 01:47:56 +0000 (02:47 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:44:53 +0000 (10:44 +0200)
* fixed bug with wrong default impact sound for colored emeralds
* added several sub-screens for the info screen

13 files changed:
ChangeLog
src/conf_dem.c
src/conf_e2s.c
src/conf_snd.c
src/conf_snd.h
src/conftime.h
src/editor.c
src/events.c
src/libgame/setup.c
src/libgame/setup.h
src/libgame/text.c
src/libgame/text.h
src/screens.c

index 37d8c79dd46506b8643f4a46bc2a01d8d92c06cf..c1376eac2f5a0d1c65edb8787ad90648dabf2a19 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2003-12-02
+       * fixed bug with wrong default impact sound for colored emeralds
+
+2003-11-30
+       * added several sub-screens for the info screen
 
 2003-11-25
        * added configurable "bored" and "sleeping" animations for the player
index d9050854ce15b1720ce930f3829f9cb08811002d..7f844618481febbddd945a238d0526274afbf323 100644 (file)
@@ -29,7 +29,18 @@ struct ConfigInfo helpanim_config[] =
   { "player_1.pushing.right",                  "16"                    },
   { "end",                                     ""                      },
 
-  { "sand",                                    "-1"                    },
+  { "sand",                                    "50"                    },
+  { "sand.digging.left",                       "8"                     },
+  { "empty_space",                             "10"                    },
+  { "sand",                                    "50"                    },
+  { "sand.digging.right",                      "8"                     },
+  { "empty_space",                             "10"                    },
+  { "sand",                                    "50"                    },
+  { "sand.digging.up",                         "8"                     },
+  { "empty_space",                             "10"                    },
+  { "sand",                                    "50"                    },
+  { "sand.digging.down",                       "8"                     },
+  { "empty_space",                             "10"                    },
   { "end",                                     ""                      },
 
   { "empty_space",                             "-1"                    },
@@ -134,18 +145,30 @@ struct ConfigInfo helpanim_config[] =
   { "char_cursor",                             "10"                    },
   { "end",                                     ""                      },
 
-  { "emerald",                                 "-1"                    },
+  { "emerald",                                 "50"                    },
+  { "emerald.collecting",                      "8"                     },
+  { "empty_space",                             "10"                    },
   { "end",                                     ""                      },
 
-  { "diamond",                                 "-1"                    },
+  { "diamond",                                 "50"                    },
+  { "diamond.collecting",                      "8"                     },
+  { "empty_space",                             "10"                    },
   { "end",                                     ""                      },
 
-  { "bd_diamond",                              "-1"                    },
+  { "bd_diamond",                              "50"                    },
+  { "bd_diamond.collecting",                   "8"                     },
+  { "empty_space",                             "10"                    },
   { "end",                                     ""                      },
 
   { "emerald_yellow",                          "50"                    },
+  { "emerald_yellow.collecting",               "8"                     },
+  { "empty_space",                             "10"                    },
   { "emerald_red",                             "50"                    },
+  { "emerald_red.collecting",                  "8"                     },
+  { "empty_space",                             "10"                    },
   { "emerald_purple",                          "50"                    },
+  { "emerald_purple.collecting",               "8"                     },
+  { "empty_space",                             "10"                    },
   { "end",                                     ""                      },
 
   { "bd_rock",                                 "-1"                    },
index de238576bba8f77aad7634571390e9caa4aac055..9b293d5b5424e4a3389c003425e5b260f26ee29e 100644 (file)
@@ -237,12 +237,12 @@ element_to_sound[] =
     SND_SAND_DIGGING
   },
   {
-    EL_EMERALD, FALSE,                         ACTION_COLLECTING,
-    SND_EMERALD_COLLECTING
+    EL_EMERALD, TRUE,                          ACTION_COLLECTING,
+    SND_CLASS_EMERALD_COLLECTING
   },
   {
-    EL_EMERALD, FALSE,                         ACTION_IMPACT,
-    SND_EMERALD_IMPACT
+    EL_EMERALD, TRUE,                          ACTION_IMPACT,
+    SND_CLASS_EMERALD_IMPACT
   },
   {
     EL_DIAMOND, FALSE,                         ACTION_COLLECTING,
index deb105e2955c0416d43616b76822722412d067a9..cd9869b081fa9fc32e6dca45cdcdfea7d0897d94 100644 (file)
@@ -88,8 +88,8 @@ struct ConfigInfo sound_config[] =
   { "[player].moving",                 "empty.wav"                     },
   { "[player].moving.mode_loop",       "false"                         },
   { "sand.digging",                    "schlurf.wav"                   },
-  { "emerald.collecting",              "pong.wav"                      },
-  { "emerald.impact",                  "pling.wav"                     },
+  { "[emerald].collecting",            "pong.wav"                      },
+  { "[emerald].impact",                        "pling.wav"                     },
   { "diamond.collecting",              "pong.wav"                      },
   { "diamond.impact",                  "pling.wav"                     },
   { "diamond.breaking",                        "quirk.wav"                     },
index 10abc084cd9974fdac403d3f53a22a9e0c650527..280815531baa9238c241769878922d857588ed8a 100644 (file)
@@ -68,8 +68,8 @@
 #define SND_CLASS_SOKOBAN_EMPTYING                     47
 #define SND_CLASS_PLAYER_MOVING                                48
 #define SND_SAND_DIGGING                               49
-#define SND_EMERALD_COLLECTING                         50
-#define SND_EMERALD_IMPACT                             51
+#define SND_CLASS_EMERALD_COLLECTING                   50
+#define SND_CLASS_EMERALD_IMPACT                       51
 #define SND_DIAMOND_COLLECTING                         52
 #define SND_DIAMOND_IMPACT                             53
 #define SND_DIAMOND_BREAKING                           54
index 6d445a380d33c0a2e56ace9719c1227a27acc088..0380064c667b1ab979c78fb44bc3be386244eca7 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2003-11-30 15:29]"
+#define COMPILE_DATE_STRING "[2003-12-02 02:40]"
index 2a26c09f67222d1d7c26b2351796f4aaba71ba41..e7d703496190a21ce327829015cf2e7418bac395 100644 (file)
@@ -5547,6 +5547,26 @@ static boolean PrintInfoText(char *text, int font_nr, int start_line)
   return TRUE;
 }
 
+#if 1
+
+static int PrintElementDescriptionFromFile(char *filename, int start_line)
+{
+  int font_nr = FONT_TEXT_2;
+  int font_width = getFontWidth(font_nr);
+  int font_height = getFontHeight(font_nr);
+  int pad_x = ED_SETTINGS_XPOS(0);
+  int pad_y = ED_SETTINGS_YPOS(0) + ED_BORDER_SIZE;
+  int sx = SX + pad_x;
+  int sy = SY + pad_y + start_line * font_height;
+  int max_chars_per_line = (SXSIZE - 2 * pad_x) / font_width;
+  int max_lines_per_screen = (SYSIZE - pad_y) / font_height - 1;
+
+  return DrawTextFromFile(sx, sy, filename, font_nr, max_chars_per_line,
+                         max_lines_per_screen);
+}
+
+#else
+
 static int PrintElementDescriptionFromFile(char *filename, int start_line)
 {
   int font_nr = FONT_TEXT_2;
@@ -5634,6 +5654,8 @@ static int PrintElementDescriptionFromFile(char *filename, int start_line)
   return (current_line - start_line);
 }
 
+#endif
+
 static void DrawPropertiesTabulatorGadgets()
 {
   struct GadgetInfo *gd_gi = level_editor_gadget[GADGET_ID_PROPERTIES_INFO];
index 8cb7c51d81c9876ec600649928b1ebe13651c2c2..ffd028953a4a7073ca1729af01a631f96e42081c 100644 (file)
@@ -377,7 +377,7 @@ void HandleButton(int mx, int my, int button)
   if (HandleGadgets(mx, my, button))
   {
     /* do not handle this button event anymore */
-    mx = my = 0;
+    mx = my = -32;     /* force mouse event to be outside screen tiles */
   }
 
   switch(game_status)
index 05978dd4a967e86f1d2eaf8ed6e1b8397737a324..f9063d5d5726037190925b93177bb24fb42fa90b 100644 (file)
@@ -441,6 +441,34 @@ char *getHelpTextFilename()
   return filename;
 }
 
+char *getLevelSetInfoFilename()
+{
+  static char *filename = NULL;
+  char *basenames[] =
+  {
+    "readme",
+    "readme.txt",
+    "README",
+    "README.txt",
+    "README.TXT",
+
+    NULL
+  };
+  int i;
+
+  for (i = 0; basenames[i] != NULL; i++)
+  {
+    if (filename != NULL)
+      free(filename);
+
+    filename = getPath2(getCurrentLevelDir(), basenames[i]);
+    if (fileExists(filename))
+      return filename;
+  }
+
+  return NULL;
+}
+
 static char *getCorrectedArtworkBasename(char *basename)
 {
   char *basename_corrected = basename;
index 2220e714e1172b3c1318b80f8bde8355e82987b5..7d99fec3e8ea37f93f9d3676774fd1ad4976e0f7 100644 (file)
@@ -201,6 +201,7 @@ char *getSetupFilename(void);
 char *getEditorSetupFilename(void);
 char *getHelpAnimFilename(void);
 char *getHelpTextFilename(void);
+char *getLevelSetInfoFilename(void);
 char *getImageFilename(char *);
 char *getCustomImageFilename(char *);
 char *getCustomSoundFilename(char *);
index 132016de40c9d8d1e2fbd20d23640ba9d4853458..6fd437359014dad05bcacdf93216028f74cab43b 100644 (file)
@@ -367,7 +367,7 @@ void DrawTextToTextArea(int x, int y, char *text, int font_nr, int line_length,
 
 boolean RenderLineToBuffer(char **src_buffer_ptr, char *dst_buffer,
                           int *dst_buffer_len, boolean last_line_was_empty,
-                          int max_chars_per_line)
+                          int line_length)
 {
   char *text_ptr = *src_buffer_ptr;
   char *buffer = dst_buffer;
@@ -406,7 +406,7 @@ boolean RenderLineToBuffer(char **src_buffer_ptr, char *dst_buffer,
       if (buffer_len > 0 || !last_line_was_empty)
        buffer_filled = TRUE;
     }
-    else if (word_len < max_chars_per_line - buffer_len)
+    else if (word_len < line_length - buffer_len)
     {
       /* word fits into text buffer -- add word */
 
@@ -428,9 +428,9 @@ boolean RenderLineToBuffer(char **src_buffer_ptr, char *dst_buffer,
     {
       /* word does not fit at all into empty text buffer -- cut word */
 
-      strncpy(buffer, text_ptr, max_chars_per_line);
-      buffer[max_chars_per_line] = '\0';
-      text_ptr += max_chars_per_line;
+      strncpy(buffer, text_ptr, line_length);
+      buffer[line_length] = '\0';
+      text_ptr += line_length;
       buffer_filled = TRUE;
     }
 
@@ -464,3 +464,83 @@ void DrawTextWrapped(int x, int y, char *text, int font_nr, int line_length,
     current_line++;
   }
 }
+
+int DrawTextFromFile(int x, int y, char *filename, int font_nr,
+                    int line_length, int max_lines)
+{
+  int font_height = getFontHeight(font_nr);
+  char line[MAX_LINE_LEN];
+  char buffer[line_length + 1];
+  int buffer_len;
+  int current_line = 0;
+  FILE *file;
+
+  if (current_line >= max_lines)
+    return 0;
+
+  if (filename == NULL)
+    return 0;
+
+  if (!(file = fopen(filename, MODE_READ)))
+    return 0;
+
+  buffer[0] = '\0';
+  buffer_len = 0;
+
+  while (!feof(file) && current_line < max_lines)
+  {
+    char *line_ptr;
+    boolean last_line_was_empty = TRUE;
+
+    /* read next line of input file */
+    if (!fgets(line, MAX_LINE_LEN, file))
+      break;
+
+    /* skip comments (lines directly beginning with '#') */
+    if (line[0] == '#')
+      continue;
+
+    /* cut trailing newline from input line */
+    for (line_ptr = line; *line_ptr; line_ptr++)
+    {
+      if (*line_ptr == '\n' || *line_ptr == '\r')
+      {
+       *line_ptr = '\0';
+       break;
+      }
+    }
+
+    if (strlen(line) == 0)             /* special case: force empty line */
+      strcpy(line, "\n");
+
+    line_ptr = line;
+
+    while (*line_ptr && current_line < max_lines)
+    {
+      boolean buffer_filled = RenderLineToBuffer(&line_ptr,
+                                                buffer, &buffer_len,
+                                                last_line_was_empty,
+                                                line_length);
+      if (buffer_filled)
+      {
+       DrawText(x, y + current_line * font_height, buffer, font_nr);
+       current_line++;
+
+       last_line_was_empty = (buffer_len == 0);
+
+       buffer[0] = '\0';
+       buffer_len = 0;
+      }
+    }
+  }
+
+  fclose(file);
+
+  if (buffer_len > 0 && current_line < max_lines)
+  {
+    DrawText(x, y + current_line * font_height, buffer, font_nr);
+    current_line++;
+  }
+
+  return current_line;
+}
index 10c91d242c21837ee49487f50e520c0a2dc37d32..0c5c7586d5873d5cb185c112efe4a424c10f8226 100644 (file)
@@ -71,5 +71,6 @@ void DrawTextExt(DrawBuffer *, int, int, char *, int, int);
 void DrawTextToTextArea(int, int, char *, int, int, int, int, int);
 boolean RenderLineToBuffer(char **, char *, int *, boolean, int);
 void DrawTextWrapped(int, int, char *, int, int, int);
+int DrawTextFromFile(int, int, char *, int, int, int);
 
 #endif /* TEXT_H */
index 23bfc0c44b7d4027c5e94b361466338dd6d5bede..015cbd48aa4d4804936fa0b6b8f288728bc13760 100644 (file)
@@ -51,8 +51,9 @@
 #define INFO_MODE_MUSIC                        2
 #define INFO_MODE_CREDITS              3
 #define INFO_MODE_PROGRAM              4
+#define INFO_MODE_LEVELSET             5
 
-#define MAX_INFO_MODES                 5
+#define MAX_INFO_MODES                 6
 
 /* for various menu stuff  */
 #define MAX_INFO_ELEMENTS_ON_SCREEN    10
@@ -323,7 +324,8 @@ void DrawMainMenu()
   }
 
   for (i = 0; i < 8; i++)
-    initCursor(i, (i == 1 || i == 6 ? IMG_MENU_BUTTON_RIGHT :IMG_MENU_BUTTON));
+    initCursor(i, (i == 1 || i == 4 || i == 6 ? IMG_MENU_BUTTON_RIGHT :
+                  IMG_MENU_BUTTON));
 
   drawCursorXY(level_width/32 + 4, 1, IMG_MENU_BUTTON_LEFT);
   drawCursorXY(level_width/32 + 8, 1, IMG_MENU_BUTTON_RIGHT);
@@ -439,7 +441,7 @@ void HandleMainMenu(int mx, int my, int dx, int dy, int button)
       DelayReached(&level_delay, 0);   /* reset delay counter */
     }
   }
-  else if (IN_GFX_SCREEN(mx, my) &&
+  else if (IN_VIS_FIELD(x, y) &&
           y >= 0 && y <= 7 && (y != 1 || x < 10))
   {
     if (button)
@@ -561,6 +563,12 @@ static void execInfoProgram()
   DrawInfoScreen();
 }
 
+static void execInfoLevelSet()
+{
+  info_mode = INFO_MODE_LEVELSET;
+  DrawInfoScreen();
+}
+
 static void execExitInfo()
 {
   game_status = GAME_MODE_MAIN;
@@ -573,6 +581,7 @@ static struct TokenInfo info_info_main[] =
   { TYPE_ENTER_SCREEN, execInfoMusic,          "Music Info"            },
   { TYPE_ENTER_SCREEN, execInfoCredits,        "Credits"               },
   { TYPE_ENTER_SCREEN, execInfoProgram,        "Program Info"          },
+  { TYPE_ENTER_SCREEN, execInfoLevelSet,       "Level Set Info"        },
   { TYPE_EMPTY,                NULL,                   ""                      },
   { TYPE_LEAVE_MENU,   execExitInfo,           "Exit"                  },
 
@@ -678,7 +687,7 @@ void HandleInfoScreen_Main(int mx, int my, int dx, int dy, int button)
       y += dy;
   }
 
-  if (IN_GFX_SCREEN(mx, my) &&
+  if (IN_VIS_FIELD(x, y) &&
       y >= 0 && y < num_info_info && info_info[y].type & ~TYPE_SKIP_ENTRY)
   {
     if (button)
@@ -724,7 +733,7 @@ void DrawInfoScreen_HelpAnim(int start, int max_anims, boolean init)
     ClearWindow();
     DrawHeadline();
 
-    DrawTextSCentered(100, FONT_TEXT_1, "The game elements:");
+    DrawTextSCentered(100, FONT_TEXT_1, "The Game Elements:");
 
     DrawTextSCentered(SYSIZE - 20, FONT_TEXT_4,
                      "Press any key or button for next page");
@@ -811,8 +820,6 @@ void DrawInfoScreen_HelpAnim(int start, int max_anims, boolean init)
   FrameCounter++;
 }
 
-#if 1
-
 static char *getHelpText(int element, int action, int direction)
 {
   char token[MAX_LINE_LEN];
@@ -830,12 +837,18 @@ static char *getHelpText(int element, int action, int direction)
 
 void DrawInfoScreen_HelpText(int element, int action, int direction, int ypos)
 {
+#if 0
   int font_nr = FONT_TEXT_2;
-  int max_chars_per_line = 34;
-  int max_lines_per_text = 2;    
-  int sx = mSX + 56;
+#else
+  int font_nr = FONT_LEVEL_NUMBER;
+#endif
+  int font_width = getFontWidth(font_nr);
+  int sx = mSX + MINI_TILEX + TILEX + MINI_TILEX;
   int sy = mSY + 65 + 2 * 32 + 1;
   int ystep = TILEY + 4;
+  int pad_x = sx - SX;
+  int max_chars_per_line = (SXSIZE - pad_x - MINI_TILEX) / font_width;
+  int max_lines_per_text = 2;    
   char *text = NULL;
 
   if (action != -1 && direction != -1)         /* element.action.direction */
@@ -860,48 +873,6 @@ void DrawInfoScreen_HelpText(int element, int action, int direction, int ypos)
                  max_chars_per_line, max_lines_per_text);
 }
 
-#else
-
-void DrawInfoScreen_HelpText(int element, int action, int direction, int ypos)
-{
-  int font_nr = FONT_TEXT_2;
-  int max_chars_per_line = 34;
-  int max_lines_per_text = 2;    
-  int sx = mSX + 56;
-  int sy = mSY + 65 + 2 * 32 + 1;
-  int ystep = TILEY + 4;
-  char *text;
-
-  /* 1st try: get text for base element */
-  text = getHashEntry(helptext_info, element_info[element].token_name);
-
-  if (text == NULL)
-  {
-    /* 2nd try: get text for element/action/direction */
-    char token[MAX_LINE_LEN];
-
-    strcpy(token, element_info[element].token_name);
-
-    if (action != -1)
-      strcat(token, element_action_info[action].suffix);
-
-    if (direction != -1)
-      strcat(token, element_direction_info[MV_DIR_BIT(direction)].suffix);
-
-    text = getHashEntry(helptext_info, token);
-
-    if (text == NULL)
-      text = "No description available";
-  }
-
-  if (strlen(text) <= max_chars_per_line)      /* only one line of text */
-    sy += getFontHeight(font_nr) / 2;
-
-  DrawTextWrapped(sx, sy + ypos * ystep, text, font_nr,
-                 max_chars_per_line, max_lines_per_text);
-}
-#endif
-
 void DrawInfoScreen_Elements()
 {
   LoadHelpAnimInfo();
@@ -1036,7 +1007,7 @@ void HandleInfoScreen_Music(int button)
     ClearWindow();
     DrawHeadline();
 
-    DrawTextSCentered(100, FONT_TEXT_1, "The game background music:");
+    DrawTextSCentered(100, FONT_TEXT_1, "The Game Background Music:");
 
     DrawTextSCentered(ystart + 0 * ystep, FONT_TEXT_2, "Excerpt from");
     DrawTextFCentered(ystart + 1 * ystep, FONT_TEXT_3, "\"%s\"", list->title);
@@ -1110,7 +1081,7 @@ void DrawInfoScreen_Program()
   ClearWindow();
   DrawHeadline();
 
-  DrawTextSCentered(100, FONT_TEXT_1, "Program information:");
+  DrawTextSCentered(100, FONT_TEXT_1, "Program Information:");
 
   DrawTextSCentered(ystart + 0 * ystep, FONT_TEXT_2,
                    "This game is Freeware!");
@@ -1165,6 +1136,66 @@ void HandleInfoScreen_Program(int button)
   }
 }
 
+void DrawInfoScreen_LevelSet()
+{
+  int ystart = 150;
+  int ybottom = SYSIZE - 20;
+  char *filename = getLevelSetInfoFilename();
+#if 0
+  int font_nr = FONT_TEXT_2;
+#else
+  int font_nr = FONT_LEVEL_NUMBER;
+#endif
+  int font_width = getFontWidth(font_nr);
+  int font_height = getFontHeight(font_nr);
+  int pad_x = 32;
+  int pad_y = ystart;
+  int sx = SX + pad_x;
+  int sy = SY + pad_y;
+  int max_chars_per_line = (SXSIZE - 2 * pad_x) / font_width;
+  int max_lines_per_screen = (SYSIZE - pad_y) / font_height - 1;
+
+  ClearWindow();
+  DrawHeadline();
+
+  DrawTextSCentered(100, FONT_TEXT_1, "Level Set Information:");
+
+  DrawTextSCentered(ybottom, FONT_TEXT_4,
+                   "Press any key or button for info menu");
+
+  if (filename != NULL)
+    DrawTextFromFile(sx, sy, filename, font_nr, max_chars_per_line,
+                    max_lines_per_screen);
+  else
+    DrawTextSCentered(ystart, FONT_TEXT_2,
+                     "No information for this level set.");
+}
+
+void HandleInfoScreen_LevelSet(int button)
+{
+  int button_released = !button;
+
+  if (button == MB_MENU_LEAVE)
+  {
+    info_mode = INFO_MODE_MAIN;
+    DrawInfoScreen();
+
+    return;
+  }
+
+  if (button_released)
+  {
+    FadeSoundsAndMusic();
+
+    info_mode = INFO_MODE_MAIN;
+    DrawInfoScreen();
+  }
+  else
+  {
+    PlayMenuSoundIfLoop();
+  }
+}
+
 void DrawInfoScreen()
 {
   SetMainBackgroundImage(IMG_BACKGROUND_INFO);
@@ -1177,6 +1208,8 @@ void DrawInfoScreen()
     DrawInfoScreen_Credits();
   else if (info_mode == INFO_MODE_PROGRAM)
     DrawInfoScreen_Program();
+  else if (info_mode == INFO_MODE_LEVELSET)
+    DrawInfoScreen_LevelSet();
   else
     DrawInfoScreen_Main();
 
@@ -1197,6 +1230,8 @@ void HandleInfoScreen(int mx, int my, int dx, int dy, int button)
     HandleInfoScreen_Credits(button);
   else if (info_mode == INFO_MODE_PROGRAM)
     HandleInfoScreen_Program(button);
+  else if (info_mode == INFO_MODE_LEVELSET)
+    HandleInfoScreen_LevelSet(button);
   else
     HandleInfoScreen_Main(mx, my, dx, dy, button);
 
@@ -1549,7 +1584,7 @@ static void HandleChooseTree(int mx, int my, int dx, int dy, int button,
     return;
   }
 
-  if (IN_GFX_SCREEN(mx, my) &&
+  if (IN_VIS_FIELD(x, y) &&
       mx < screen_gadget[SCREEN_CTRL_ID_SCROLL_VERTICAL]->x &&
       y >= 0 && y < num_page_entries)
   {
@@ -2204,7 +2239,7 @@ void HandleSetupScreen_Generic(int mx, int my, int dx, int dy, int button)
       y += dy;
   }
 
-  if (IN_GFX_SCREEN(mx, my) &&
+  if (IN_VIS_FIELD(x, y) &&
       y >= 0 && y < num_setup_info && setup_info[y].type & ~TYPE_SKIP_ENTRY)
   {
     if (button)
@@ -2409,7 +2444,7 @@ void HandleSetupScreen_Input(int mx, int my, int dx, int dy, int button)
       y = (dy > 0 ? pos_empty2 + 1 : pos_empty1 - 1);
   }
 
-  if (IN_GFX_SCREEN(mx, my) &&
+  if (IN_VIS_FIELD(x, y) &&
       y == 0 && ((x < 10 && !button) || ((x == 10 || x == 12) && button)))
   {
     static unsigned long delay = 0;
@@ -2421,7 +2456,7 @@ void HandleSetupScreen_Input(int mx, int my, int dx, int dy, int button)
 
     drawPlayerSetupInputInfo(player_nr);
   }
-  else if (IN_GFX_SCREEN(mx, my) &&
+  else if (IN_VIS_FIELD(x, y) &&
           y >= pos_start && y <= pos_end &&
           !(y >= pos_empty1 && y <= pos_empty2))
   {