removed support for 'real' (non-desktop) fullscreen mode for all targets
authorHolger Schemel <info@artsoft.org>
Thu, 31 Mar 2016 22:35:59 +0000 (00:35 +0200)
committerHolger Schemel <info@artsoft.org>
Thu, 31 Mar 2016 22:36:32 +0000 (00:36 +0200)
src/files.c
src/init.c
src/libgame/misc.c
src/libgame/misc.h
src/libgame/sdl.c
src/libgame/system.h
src/main.h
src/screens.c
src/tools.c

index d428ae99ef19ae1b39c96a97c0eea46a41395089..e5ca6168c5a3c5e4612d2460fad557ae3f0ce5a7 100644 (file)
@@ -7909,32 +7909,31 @@ void SaveScore(int nr)
 #define SETUP_TOKEN_SKIP_LEVELS                        15
 #define SETUP_TOKEN_TIME_LIMIT                 16
 #define SETUP_TOKEN_FULLSCREEN                 17
-#define SETUP_TOKEN_FULLSCREEN_MODE            18
-#define SETUP_TOKEN_WINDOW_SCALING_PERCENT     19
-#define SETUP_TOKEN_WINDOW_SCALING_QUALITY     20
-#define SETUP_TOKEN_ASK_ON_ESCAPE              21
-#define SETUP_TOKEN_ASK_ON_ESCAPE_EDITOR       22
-#define SETUP_TOKEN_QUICK_SWITCH               23
-#define SETUP_TOKEN_INPUT_ON_FOCUS             24
-#define SETUP_TOKEN_PREFER_AGA_GRAPHICS                25
-#define SETUP_TOKEN_GAME_FRAME_DELAY           26
-#define SETUP_TOKEN_SP_SHOW_BORDER_ELEMENTS    27
-#define SETUP_TOKEN_SMALL_GAME_GRAPHICS                28
-#define SETUP_TOKEN_SHOW_SNAPSHOT_BUTTONS      29
-#define SETUP_TOKEN_GRAPHICS_SET               30
-#define SETUP_TOKEN_SOUNDS_SET                 31
-#define SETUP_TOKEN_MUSIC_SET                  32
-#define SETUP_TOKEN_OVERRIDE_LEVEL_GRAPHICS    33
-#define SETUP_TOKEN_OVERRIDE_LEVEL_SOUNDS      34
-#define SETUP_TOKEN_OVERRIDE_LEVEL_MUSIC       35
-#define SETUP_TOKEN_VOLUME_SIMPLE              36
-#define SETUP_TOKEN_VOLUME_LOOPS               37
-#define SETUP_TOKEN_VOLUME_MUSIC               38
-#define SETUP_TOKEN_TOUCH_CONTROL_TYPE         39
-#define SETUP_TOKEN_TOUCH_MOVE_DISTANCE                40
-#define SETUP_TOKEN_TOUCH_DROP_DISTANCE                41
-
-#define NUM_GLOBAL_SETUP_TOKENS                        42
+#define SETUP_TOKEN_WINDOW_SCALING_PERCENT     18
+#define SETUP_TOKEN_WINDOW_SCALING_QUALITY     19
+#define SETUP_TOKEN_ASK_ON_ESCAPE              20
+#define SETUP_TOKEN_ASK_ON_ESCAPE_EDITOR       21
+#define SETUP_TOKEN_QUICK_SWITCH               22
+#define SETUP_TOKEN_INPUT_ON_FOCUS             23
+#define SETUP_TOKEN_PREFER_AGA_GRAPHICS                24
+#define SETUP_TOKEN_GAME_FRAME_DELAY           25
+#define SETUP_TOKEN_SP_SHOW_BORDER_ELEMENTS    26
+#define SETUP_TOKEN_SMALL_GAME_GRAPHICS                27
+#define SETUP_TOKEN_SHOW_SNAPSHOT_BUTTONS      28
+#define SETUP_TOKEN_GRAPHICS_SET               29
+#define SETUP_TOKEN_SOUNDS_SET                 30
+#define SETUP_TOKEN_MUSIC_SET                  31
+#define SETUP_TOKEN_OVERRIDE_LEVEL_GRAPHICS    32
+#define SETUP_TOKEN_OVERRIDE_LEVEL_SOUNDS      33
+#define SETUP_TOKEN_OVERRIDE_LEVEL_MUSIC       34
+#define SETUP_TOKEN_VOLUME_SIMPLE              35
+#define SETUP_TOKEN_VOLUME_LOOPS               36
+#define SETUP_TOKEN_VOLUME_MUSIC               37
+#define SETUP_TOKEN_TOUCH_CONTROL_TYPE         38
+#define SETUP_TOKEN_TOUCH_MOVE_DISTANCE                39
+#define SETUP_TOKEN_TOUCH_DROP_DISTANCE                40
+
+#define NUM_GLOBAL_SETUP_TOKENS                        41
 
 /* editor setup */
 #define SETUP_TOKEN_EDITOR_EL_BOULDERDASH      0
@@ -8084,7 +8083,6 @@ static struct TokenInfo global_setup_tokens[] =
   { TYPE_SWITCH, &si.skip_levels,             "skip_levels"            },
   { TYPE_SWITCH, &si.time_limit,              "time_limit"             },
   { TYPE_SWITCH, &si.fullscreen,              "fullscreen"             },
-  { TYPE_STRING, &si.fullscreen_mode,         "fullscreen_mode"                },
   { TYPE_INTEGER,&si.window_scaling_percent,  "window_scaling_percent" },
   { TYPE_STRING, &si.window_scaling_quality,  "window_scaling_quality" },
   { TYPE_SWITCH, &si.ask_on_escape,           "ask_on_escape"          },
@@ -8266,7 +8264,6 @@ static void setSetupInfoToDefaults(struct SetupInfo *si)
   si->skip_levels = TRUE;
   si->time_limit = TRUE;
   si->fullscreen = FALSE;
-  si->fullscreen_mode = getStringCopy(DEFAULT_FULLSCREEN_MODE);
   si->window_scaling_percent = STD_WINDOW_SCALING_PERCENT;
   si->window_scaling_quality = getStringCopy(SCALING_QUALITY_DEFAULT);
   si->ask_on_escape = TRUE;
index 922fc11afb2cd0d70f112d3fd8a6b5a37754f38e..434deb4fe1bef873a44535c5a53d3dc29fed337a 100644 (file)
@@ -4863,94 +4863,6 @@ void Execute_Command(char *command)
 
     exit(0);
   }
-
-#if DEBUG
-#if defined(TARGET_SDL2)
-  else if (strEqual(command, "SDL_ListModes"))
-  {
-    SDL_Init(SDL_INIT_VIDEO);
-
-    int num_displays = SDL_GetNumVideoDisplays();
-
-    // check if there are any displays available
-    if (num_displays < 0)
-    {
-      Print("No displays available: %s\n", SDL_GetError());
-
-      exit(-1);
-    }
-
-    for (i = 0; i < num_displays; i++)
-    {
-      int num_modes = SDL_GetNumDisplayModes(i);
-      int j;
-
-      Print("Available display modes for display %d:\n", i);
-
-      // check if there are any display modes available for this display
-      if (num_modes < 0)
-      {
-       Print("No display modes available for display %d: %s\n",
-             i, SDL_GetError());
-
-       exit(-1);
-      }
-
-      for (j = 0; j < num_modes; j++)
-      {
-       SDL_DisplayMode mode;
-
-       if (SDL_GetDisplayMode(i, j, &mode) < 0)
-       {
-         Print("Cannot get display mode %d for display %d: %s\n",
-               j, i, SDL_GetError());
-
-         exit(-1);
-       }
-
-       Print("- %d x %d\n", mode.w, mode.h);
-      }
-    }
-
-    exit(0);
-  }
-#elif defined(TARGET_SDL)
-  else if (strEqual(command, "SDL_ListModes"))
-  {
-    SDL_Rect **modes;
-    int i;
-
-    SDL_Init(SDL_INIT_VIDEO);
-
-    /* get available fullscreen/hardware modes */
-    modes = SDL_ListModes(NULL, SDL_FULLSCREEN | SDL_HWSURFACE);
-
-    /* check if there are any modes available */
-    if (modes == NULL)
-    {
-      Print("No modes available!\n");
-
-      exit(-1);
-    }
-
-    /* check if our resolution is restricted */
-    if (modes == (SDL_Rect **)-1)
-    {
-      Print("All resolutions available.\n");
-    }
-    else
-    {
-      Print("Available display modes:\n");
-
-      for (i = 0; modes[i]; i++)
-       Print("- %d x %d\n", modes[i]->w, modes[i]->h);
-    }
-
-    exit(0);
-  }
-#endif
-#endif
-
   else
   {
     Error(ERR_EXIT_HELP, "unrecognized command '%s'", command);
index 297d5dce7870e747d9c05666f4528d7631c2ceb6..3be57faf78ea796d4bd4e638bd56b4bd72f2f829 100644 (file)
@@ -2748,48 +2748,6 @@ int get_parameter_value(char *value_raw, char *suffix, int type)
   return result;
 }
 
-struct ScreenModeInfo *get_screen_mode_from_string(char *screen_mode_string)
-{
-  static struct ScreenModeInfo screen_mode;
-  char *screen_mode_string_x = strchr(screen_mode_string, 'x');
-  char *screen_mode_string_copy;
-  char *screen_mode_string_pos_w;
-  char *screen_mode_string_pos_h;
-
-  if (screen_mode_string_x == NULL)    /* invalid screen mode format */
-    return NULL;
-
-  screen_mode_string_copy = getStringCopy(screen_mode_string);
-
-  screen_mode_string_pos_w = screen_mode_string_copy;
-  screen_mode_string_pos_h = strchr(screen_mode_string_copy, 'x');
-  *screen_mode_string_pos_h++ = '\0';
-
-  screen_mode.width  = atoi(screen_mode_string_pos_w);
-  screen_mode.height = atoi(screen_mode_string_pos_h);
-
-  return &screen_mode;
-}
-
-void get_aspect_ratio_from_screen_mode(struct ScreenModeInfo *screen_mode,
-                                      int *x, int *y)
-{
-  float aspect_ratio = (float)screen_mode->width / (float)screen_mode->height;
-  float aspect_ratio_new;
-  int i = 1;
-
-  do
-  {
-    *x = i * aspect_ratio + 0.000001;
-    *y = i;
-
-    aspect_ratio_new = (float)*x / (float)*y;
-
-    i++;
-  }
-  while (aspect_ratio_new != aspect_ratio && *y < screen_mode->height);
-}
-
 static void FreeCustomArtworkList(struct ArtworkListInfo *,
                                  struct ListNodeInfo ***, int *);
 
index 36e1dfc4e1dcf4cb40cfa6cfce3b6dd1247d243b..1e8f039d3274cc9e6e7472fa6ae1b317c8a63ec2 100644 (file)
@@ -265,9 +265,6 @@ char *get_mapped_token(char *);
 
 int get_parameter_value(char *, char *, int);
 
-struct ScreenModeInfo *get_screen_mode_from_string(char *);
-void get_aspect_ratio_from_screen_mode(struct ScreenModeInfo *, int *x, int *y);
-
 struct FileInfo *getFileListFromConfigList(struct ConfigInfo *,
                                           struct ConfigTypeInfo *,
                                           char **, int);
index 5a8277a555663e66e9993d58990cc65b517623ae..1d93b5a0782d3addac82a2ce20f3adbe1d69b671 100644 (file)
@@ -38,13 +38,6 @@ static SDL_Texture *sdl_texture = NULL;
 static boolean fullscreen_enabled = FALSE;
 #endif
 
-/* stuff needed to work around SDL/Windows fullscreen drawing bug */
-static int fullscreen_width;
-static int fullscreen_height;
-static int fullscreen_xoffset;
-static int fullscreen_yoffset;
-static int video_xoffset;
-static int video_yoffset;
 static boolean limit_screen_updates = FALSE;
 
 
@@ -128,9 +121,6 @@ static void UpdateScreen(SDL_Rect *rect)
     int bytes_x = screen->pitch / video.width;
     int bytes_y = screen->pitch;
 
-    if (video.fullscreen_enabled)
-      bytes_x = screen->pitch / fullscreen_width;
-
     SDL_UpdateTexture(sdl_texture, rect,
                      screen->pixels + rect->x * bytes_x + rect->y * bytes_y,
                      screen->pitch);
@@ -184,41 +174,6 @@ static void UpdateScreen(SDL_Rect *rect)
 #endif
 }
 
-static void setFullscreenParameters(char *fullscreen_mode_string)
-{
-#if defined(TARGET_SDL2)
-  fullscreen_width = video.width;
-  fullscreen_height = video.height;
-  fullscreen_xoffset = 0;
-  fullscreen_yoffset = 0;  
-
-#else
-
-  struct ScreenModeInfo *fullscreen_mode;
-  int i;
-
-  fullscreen_mode = get_screen_mode_from_string(fullscreen_mode_string);
-
-  if (fullscreen_mode == NULL)
-    return;
-
-  for (i = 0; video.fullscreen_modes[i].width != -1; i++)
-  {
-    if (fullscreen_mode->width  == video.fullscreen_modes[i].width &&
-       fullscreen_mode->height == video.fullscreen_modes[i].height)
-    {
-      fullscreen_width  = fullscreen_mode->width;
-      fullscreen_height = fullscreen_mode->height;
-
-      fullscreen_xoffset = (fullscreen_width  - video.width)  / 2;
-      fullscreen_yoffset = (fullscreen_height - video.height) / 2;
-
-      break;
-    }
-  }
-#endif
-}
-
 static void SDLSetWindowIcon(char *basename)
 {
   /* (setting the window icon on Mac OS X would replace the high-quality
@@ -431,160 +386,15 @@ void SDLInitVideoDisplay(void)
 void SDLInitVideoBuffer(DrawBuffer **backbuffer, DrawWindow **window,
                        boolean fullscreen)
 {
-#if !defined(TARGET_SDL2)
-  static int screen_xy[][2] =
-  {
-    {  640, 480 },
-    {  800, 600 },
-    { 1024, 768 },
-    {   -1,  -1 }
-  };
-#endif
-  SDL_Rect **modes = NULL;
-  boolean hardware_fullscreen_available = TRUE;
-  int i, j;
-
-  /* default: normal game window size */
-  fullscreen_width = video.width;
-  fullscreen_height = video.height;
-  fullscreen_xoffset = 0;
-  fullscreen_yoffset = 0;
-
-#if !defined(TARGET_SDL2)
-  /* determine required standard fullscreen mode for game screen size */
-  for (i = 0; screen_xy[i][0] != -1; i++)
-  {
-    if (screen_xy[i][0] >= video.width && screen_xy[i][1] >= video.height)
-    {
-      fullscreen_width  = screen_xy[i][0];
-      fullscreen_height = screen_xy[i][1];
-
-      break;
-    }
-  }
-
-  fullscreen_xoffset = (fullscreen_width  - video.width)  / 2;
-  fullscreen_yoffset = (fullscreen_height - video.height) / 2;
-#endif
-
-  checked_free(video.fullscreen_modes);
-
-  video.fullscreen_modes = NULL;
-  video.fullscreen_mode_current = NULL;
-
   video.window_scaling_percent = setup.window_scaling_percent;
   video.window_scaling_quality = setup.window_scaling_quality;
 
 #if defined(TARGET_SDL2)
-  int num_displays = SDL_GetNumVideoDisplays();
-
-  if (num_displays > 0)
-  {
-    // currently only display modes of first display supported
-    int num_modes = SDL_GetNumDisplayModes(0);
-
-    if (num_modes > 0)
-    {
-      modes = checked_calloc((num_modes + 1) * sizeof(SDL_Rect *));
-
-      for (i = 0; i < num_modes; i++)
-      {
-       SDL_DisplayMode mode;
-
-       if (SDL_GetDisplayMode(0, i, &mode) < 0)
-         break;
-
-       modes[i] = checked_calloc(sizeof(SDL_Rect));
-
-       modes[i]->w = mode.w;
-       modes[i]->h = mode.h;
-      }
-    }
-  }
-#else
-  /* get available hardware supported fullscreen modes */
-  modes = SDL_ListModes(NULL, SDL_FULLSCREEN | SDL_HWSURFACE);
-#endif
-
-  if (modes == NULL)
-  {
-    /* no hardware screen modes available => no fullscreen mode support */
-    // video.fullscreen_available = FALSE;
-    hardware_fullscreen_available = FALSE;
-  }
-  else if (modes == (SDL_Rect **)-1)
-  {
-    /* fullscreen resolution is not restricted -- all resolutions available */
-    video.fullscreen_modes = checked_calloc(2 * sizeof(struct ScreenModeInfo));
-
-    /* use native video buffer size for fullscreen mode */
-    video.fullscreen_modes[0].width  = video.width;
-    video.fullscreen_modes[0].height = video.height;
-
-    video.fullscreen_modes[1].width  = -1;
-    video.fullscreen_modes[1].height = -1;
-  }
-  else
-  {
-    /* in this case, a certain number of screen modes is available */
-    int num_modes = 0;
-
-    for (i = 0; modes[i] != NULL; i++)
-    {
-      boolean found_mode = FALSE;
-
-      /* screen mode is smaller than video buffer size -- skip it */
-      if (modes[i]->w < video.width || modes[i]->h < video.height)
-       continue;
-
-      if (video.fullscreen_modes != NULL)
-       for (j = 0; video.fullscreen_modes[j].width != -1; j++)
-         if (modes[i]->w == video.fullscreen_modes[j].width &&
-             modes[i]->h == video.fullscreen_modes[j].height)
-           found_mode = TRUE;
-
-      if (found_mode)          /* screen mode already stored -- skip it */
-       continue;
-
-      /* new mode found; add it to list of available fullscreen modes */
-
-      num_modes++;
-
-      video.fullscreen_modes = checked_realloc(video.fullscreen_modes,
-                                              (num_modes + 1) *
-                                              sizeof(struct ScreenModeInfo));
-
-      video.fullscreen_modes[num_modes - 1].width  = modes[i]->w;
-      video.fullscreen_modes[num_modes - 1].height = modes[i]->h;
-
-      video.fullscreen_modes[num_modes].width  = -1;
-      video.fullscreen_modes[num_modes].height = -1;
-    }
-
-    if (num_modes == 0)
-    {
-      /* no appropriate screen modes available => no fullscreen mode support */
-      // video.fullscreen_available = FALSE;
-      hardware_fullscreen_available = FALSE;
-    }
-  }
-
-  video.fullscreen_available = hardware_fullscreen_available;
-
-#if defined(TARGET_SDL2)
-  // in SDL 2.0, there is always support for desktop fullscreen mode
-  // (in SDL 1.2, there is only support for "real" fullscreen mode)
+  // SDL 2.0: support for (desktop) fullscreen mode available
   video.fullscreen_available = TRUE;
-#endif
-
-#if defined(TARGET_SDL2)
-  if (modes)
-  {
-    for (i = 0; modes[i] != NULL; i++)
-      checked_free(modes[i]);
-
-    checked_free(modes);
-  }
+#else
+  // SDL 1.2: no support for fullscreen mode in R'n'D anymore
+  video.fullscreen_available = FALSE;
 #endif
 
   /* open SDL video output device (window or fullscreen mode) */
@@ -625,15 +435,15 @@ static SDL_Surface *SDLCreateScreen(DrawBuffer **backbuffer,
   SDL_Surface *new_surface = NULL;
 
 #if defined(TARGET_SDL2)
-  int surface_flags_window = SURFACE_FLAGS | SDL_WINDOW_RESIZABLE;
+  int surface_flags_window     = SURFACE_FLAGS | SDL_WINDOW_RESIZABLE;
   int surface_flags_fullscreen = SURFACE_FLAGS | SDL_WINDOW_FULLSCREEN_DESKTOP;
 #else
-  int surface_flags_window = SURFACE_FLAGS;
-  int surface_flags_fullscreen = SURFACE_FLAGS | SDL_FULLSCREEN;
+  int surface_flags_window     = SURFACE_FLAGS;
+  int surface_flags_fullscreen = SURFACE_FLAGS;        // (no fullscreen in SDL 1.2)
 #endif
 
-  int width  = (fullscreen ? fullscreen_width  : video.width);
-  int height = (fullscreen ? fullscreen_height : video.height);
+  int width  = video.width;
+  int height = video.height;
   int surface_flags = (fullscreen ? surface_flags_fullscreen :
                       surface_flags_window);
 
@@ -795,11 +605,6 @@ boolean SDLSetVideoMode(DrawBuffer **backbuffer, boolean fullscreen)
 
   if (fullscreen && !video.fullscreen_enabled && video.fullscreen_available)
   {
-    setFullscreenParameters(setup.fullscreen_mode);
-
-    video_xoffset = fullscreen_xoffset;
-    video_yoffset = fullscreen_yoffset;
-
     /* switch display to fullscreen mode, if available */
     new_surface = SDLCreateScreen(backbuffer, TRUE);
 
@@ -818,7 +623,6 @@ boolean SDLSetVideoMode(DrawBuffer **backbuffer, boolean fullscreen)
       (*backbuffer)->surface = new_surface;
 
       video.fullscreen_enabled = TRUE;
-      video.fullscreen_mode_current = setup.fullscreen_mode;
 
       success = TRUE;
     }
@@ -826,9 +630,6 @@ boolean SDLSetVideoMode(DrawBuffer **backbuffer, boolean fullscreen)
 
   if ((!fullscreen && video.fullscreen_enabled) || new_surface == NULL)
   {
-    video_xoffset = 0;
-    video_yoffset = 0;
-
     /* switch display to window mode */
     new_surface = SDLCreateScreen(backbuffer, FALSE);
 
@@ -1049,23 +850,11 @@ void SDLCopyArea(Bitmap *src_bitmap, Bitmap *dst_bitmap,
   Bitmap *real_dst_bitmap = (dst_bitmap == window ? backbuffer : dst_bitmap);
   SDL_Rect src_rect, dst_rect;
 
-  if (src_bitmap == backbuffer)
-  {
-    src_x += video_xoffset;
-    src_y += video_yoffset;
-  }
-
   src_rect.x = src_x;
   src_rect.y = src_y;
   src_rect.w = width;
   src_rect.h = height;
 
-  if (dst_bitmap == backbuffer || dst_bitmap == window)
-  {
-    dst_x += video_xoffset;
-    dst_y += video_yoffset;
-  }
-
   dst_rect.x = dst_x;
   dst_rect.y = dst_y;
   dst_rect.w = width;
@@ -1128,12 +917,6 @@ void SDLFillRectangle(Bitmap *dst_bitmap, int x, int y, int width, int height,
   Bitmap *real_dst_bitmap = (dst_bitmap == window ? backbuffer : dst_bitmap);
   SDL_Rect rect;
 
-  if (dst_bitmap == backbuffer || dst_bitmap == window)
-  {
-    x += video_xoffset;
-    y += video_yoffset;
-  }
-
   rect.x = x;
   rect.y = y;
   rect.w = width;
@@ -1184,9 +967,6 @@ void SDLFadeRectangle(Bitmap *bitmap_cross, int x, int y, int width, int height,
   src_rect.w = width;
   src_rect.h = height;
 
-  dst_x += video_xoffset;
-  dst_y += video_yoffset;
-
   dst_rect.x = dst_x;
   dst_rect.y = dst_y;
   dst_rect.w = width;          /* (ignored) */
@@ -1472,26 +1252,12 @@ void SDLDrawSimpleLine(Bitmap *dst_bitmap, int from_x, int from_y,
   rect.w = (to_x - from_x + 1);
   rect.h = (to_y - from_y + 1);
 
-  if (dst_bitmap == backbuffer || dst_bitmap == window)
-  {
-    rect.x += video_xoffset;
-    rect.y += video_yoffset;
-  }
-
   SDL_FillRect(surface, &rect, color);
 }
 
 void SDLDrawLine(Bitmap *dst_bitmap, int from_x, int from_y,
                 int to_x, int to_y, Uint32 color)
 {
-  if (dst_bitmap == backbuffer || dst_bitmap == window)
-  {
-    from_x += video_xoffset;
-    from_y += video_yoffset;
-    to_x += video_xoffset;
-    to_y += video_yoffset;
-  }
-
   sge_Line(dst_bitmap->surface, from_x, from_y, to_x, to_y, color);
 }
 
@@ -1529,12 +1295,6 @@ Pixel SDLGetPixel(Bitmap *src_bitmap, int x, int y)
 {
   SDL_Surface *surface = src_bitmap->surface;
 
-  if (src_bitmap == backbuffer || src_bitmap == window)
-  {
-    x += video_xoffset;
-    y += video_yoffset;
-  }
-
   switch (surface->format->BytesPerPixel)
   {
     case 1:            /* assuming 8-bpp */
@@ -2026,12 +1786,6 @@ void sge_LineRGB(SDL_Surface *Surface, Sint16 x1, Sint16 y1, Sint16 x2,
 
 void SDLPutPixel(Bitmap *dst_bitmap, int x, int y, Pixel pixel)
 {
-  if (dst_bitmap == backbuffer || dst_bitmap == window)
-  {
-    x += video_xoffset;
-    y += video_yoffset;
-  }
-
   sge_PutPixel(dst_bitmap->surface, x, y, pixel);
 }
 
@@ -2578,30 +2332,6 @@ void SDLCloseAudio(void)
 void SDLNextEvent(Event *event)
 {
   SDL_WaitEvent(event);
-
-  if (event->type == EVENT_BUTTONPRESS ||
-      event->type == EVENT_BUTTONRELEASE)
-  {
-    if (((ButtonEvent *)event)->x > video_xoffset)
-      ((ButtonEvent *)event)->x -= video_xoffset;
-    else
-      ((ButtonEvent *)event)->x = 0;
-    if (((ButtonEvent *)event)->y > video_yoffset)
-      ((ButtonEvent *)event)->y -= video_yoffset;
-    else
-      ((ButtonEvent *)event)->y = 0;
-  }
-  else if (event->type == EVENT_MOTIONNOTIFY)
-  {
-    if (((MotionEvent *)event)->x > video_xoffset)
-      ((MotionEvent *)event)->x -= video_xoffset;
-    else
-      ((MotionEvent *)event)->x = 0;
-    if (((MotionEvent *)event)->y > video_yoffset)
-      ((MotionEvent *)event)->y -= video_yoffset;
-    else
-      ((MotionEvent *)event)->y = 0;
-  }
 }
 
 void SDLHandleWindowManagerEvent(Event *event)
index 11e28ad6f93e28c250d4d32e42e55d5bc1a16106..593b245010806f0224515685d3cfd9ba135845f9 100644 (file)
@@ -730,11 +730,6 @@ struct OptionInfo
   boolean debug;
 };
 
-struct ScreenModeInfo
-{
-  int width, height;
-};
-
 struct VideoSystemInfo
 {
   int default_depth;
@@ -744,8 +739,6 @@ struct VideoSystemInfo
   boolean fullscreen_available;
   boolean fullscreen_enabled;
   boolean fullscreen_initial;
-  struct ScreenModeInfo *fullscreen_modes;
-  char *fullscreen_mode_current;
 
   boolean window_scaling_available;
   int window_scaling_percent;
@@ -1011,7 +1004,6 @@ struct SetupInfo
   boolean skip_levels;
   boolean time_limit;
   boolean fullscreen;
-  char *fullscreen_mode;
   int window_scaling_percent;
   char *window_scaling_quality;
   boolean ask_on_escape;
index eb7e563babb5095e91f73dc45d6edbd5fbb3b6b7..75399360ece932e2a5cd8df4e0b09837baa59fd9 100644 (file)
@@ -41,8 +41,6 @@
 #define SND_UNDEFINED                  (-1)
 #define MUS_UNDEFINED                  (-1)
 
-#define DEFAULT_FULLSCREEN_MODE                "800x600"
-
 #define WIN_XSIZE_DEFAULT              672
 #define WIN_YSIZE_DEFAULT              560
 
index 5af8723245945092535ebe445d6be87fd9763555..2c19101321ecd273e24d0fe475a1c15ac51f525d 100644 (file)
 #define SETUP_MODE_CHOOSE_GAME_SPEED   16
 #define SETUP_MODE_CHOOSE_SCROLL_DELAY 17
 #define SETUP_MODE_CHOOSE_SNAPSHOT_MODE        18
-#define SETUP_MODE_CHOOSE_SCREEN_MODE  19
-#define SETUP_MODE_CHOOSE_WINDOW_SIZE  20
-#define SETUP_MODE_CHOOSE_SCALING_TYPE 21
-#define SETUP_MODE_CHOOSE_GRAPHICS     22
-#define SETUP_MODE_CHOOSE_SOUNDS       23
-#define SETUP_MODE_CHOOSE_MUSIC                24
-#define SETUP_MODE_CHOOSE_VOLUME_SIMPLE        25
-#define SETUP_MODE_CHOOSE_VOLUME_LOOPS 26
-#define SETUP_MODE_CHOOSE_VOLUME_MUSIC 27
-#define SETUP_MODE_CHOOSE_TOUCH_CONTROL        28
-#define SETUP_MODE_CHOOSE_MOVE_DISTANCE        29
-#define SETUP_MODE_CHOOSE_DROP_DISTANCE        30
-
-#define MAX_SETUP_MODES                        31
+#define SETUP_MODE_CHOOSE_WINDOW_SIZE  19
+#define SETUP_MODE_CHOOSE_SCALING_TYPE 20
+#define SETUP_MODE_CHOOSE_GRAPHICS     21
+#define SETUP_MODE_CHOOSE_SOUNDS       22
+#define SETUP_MODE_CHOOSE_MUSIC                23
+#define SETUP_MODE_CHOOSE_VOLUME_SIMPLE        24
+#define SETUP_MODE_CHOOSE_VOLUME_LOOPS 25
+#define SETUP_MODE_CHOOSE_VOLUME_MUSIC 26
+#define SETUP_MODE_CHOOSE_TOUCH_CONTROL        27
+#define SETUP_MODE_CHOOSE_MOVE_DISTANCE        28
+#define SETUP_MODE_CHOOSE_DROP_DISTANCE        29
+
+#define MAX_SETUP_MODES                        30
 
 #define MAX_MENU_MODES                 MAX(MAX_INFO_MODES, MAX_SETUP_MODES)
 
@@ -196,9 +195,6 @@ static struct GadgetInfo *screen_gadget[NUM_SCREEN_GADGETS];
 static int info_mode = INFO_MODE_MAIN;
 static int setup_mode = SETUP_MODE_MAIN;
 
-static TreeInfo *screen_modes = NULL;
-static TreeInfo *screen_mode_current = NULL;
-
 static TreeInfo *window_sizes = NULL;
 static TreeInfo *window_size_current = NULL;
 
@@ -2091,7 +2087,6 @@ static void DrawCursorAndText_Setup(int screen_pos, int menu_info_pos_raw,
   DrawCursorAndText_Menu_Ext(setup_info, screen_pos, menu_info_pos_raw, active);
 }
 
-static char *screen_mode_text;
 static char *window_size_text;
 static char *scaling_type_text;
 
@@ -2118,7 +2113,6 @@ static void drawMenuInfoList(int first_entry, int num_page_entries,
        (value_ptr == &setup.sound_loops  && !audio.loops_available) ||
        (value_ptr == &setup.sound_music  && !audio.music_available) ||
        (value_ptr == &setup.fullscreen   && !video.fullscreen_available) ||
-       (value_ptr == &screen_mode_text   && !video.fullscreen_available) ||
        (value_ptr == &window_size_text   && !video.window_scaling_available) ||
        (value_ptr == &scaling_type_text  && !video.window_scaling_available))
       si->type |= TYPE_GHOSTED;
@@ -3832,8 +3826,7 @@ static void HandleChooseTree(int mx, int my, int dx, int dy, int button,
          setup_mode == SETUP_MODE_CHOOSE_SCROLL_DELAY ||
          setup_mode == SETUP_MODE_CHOOSE_SNAPSHOT_MODE)
        execSetupGame();
-      else if (setup_mode == SETUP_MODE_CHOOSE_SCREEN_MODE ||
-              setup_mode == SETUP_MODE_CHOOSE_WINDOW_SIZE ||
+      else if (setup_mode == SETUP_MODE_CHOOSE_WINDOW_SIZE ||
               setup_mode == SETUP_MODE_CHOOSE_SCALING_TYPE)
        execSetupGraphics();
       else if (setup_mode == SETUP_MODE_CHOOSE_VOLUME_SIMPLE ||
@@ -4030,8 +4023,7 @@ static void HandleChooseTree(int mx, int my, int dx, int dy, int button,
              setup_mode == SETUP_MODE_CHOOSE_SCROLL_DELAY ||
              setup_mode == SETUP_MODE_CHOOSE_SNAPSHOT_MODE)
            execSetupGame();
-         else if (setup_mode == SETUP_MODE_CHOOSE_SCREEN_MODE ||
-                  setup_mode == SETUP_MODE_CHOOSE_WINDOW_SIZE ||
+         else if (setup_mode == SETUP_MODE_CHOOSE_WINDOW_SIZE ||
                   setup_mode == SETUP_MODE_CHOOSE_SCALING_TYPE)
            execSetupGraphics();
          else if (setup_mode == SETUP_MODE_CHOOSE_VOLUME_SIMPLE ||
@@ -4295,7 +4287,6 @@ static struct TokenInfo *setup_info;
 static int num_setup_info;     /* number of setup entries shown on screen */
 static int max_setup_info;     /* total number of setup entries in list */
 
-static char *screen_mode_text;
 static char *window_size_text;
 static char *scaling_type_text;
 static char *scroll_delay_text;
@@ -4642,67 +4633,6 @@ static void execSetupGraphics_setScalingTypes()
   scaling_type_text = scaling_type_current->name;
 }
 
-static void execSetupGraphics_setScreenModes()
-{
-  // if (screen_modes == NULL && video.fullscreen_available)
-  if (screen_modes == NULL && video.fullscreen_modes != NULL)
-  {
-    int i;
-
-    for (i = 0; video.fullscreen_modes[i].width != -1; i++)
-    {
-      TreeInfo *ti = newTreeInfo_setDefaults(TREE_TYPE_UNDEFINED);
-      char identifier[32], name[32];
-      int x = video.fullscreen_modes[i].width;
-      int y = video.fullscreen_modes[i].height;
-      int xx, yy;
-
-      get_aspect_ratio_from_screen_mode(&video.fullscreen_modes[i], &xx, &yy);
-
-      ti->node_top = &screen_modes;
-      ti->sort_priority = x * 10000 + y;
-
-      sprintf(identifier, "%dx%d", x, y);
-      sprintf(name, "%d x %d [%d:%d]", x, y, xx, yy);
-
-      setString(&ti->identifier, identifier);
-      setString(&ti->name, name);
-      setString(&ti->name_sorting, name);
-      setString(&ti->infotext, "Fullscreen Mode");
-
-      pushTreeInfo(&screen_modes, ti);
-    }
-
-    /* sort fullscreen modes to start with lowest available screen resolution */
-    sortTreeInfo(&screen_modes);
-
-    /* set current screen mode for fullscreen mode to configured setup value */
-    screen_mode_current = getTreeInfoFromIdentifier(screen_modes,
-                                                   setup.fullscreen_mode);
-
-    /* if that fails, set current screen mode to reliable default value */
-    if (screen_mode_current == NULL)
-      screen_mode_current = getTreeInfoFromIdentifier(screen_modes,
-                                                     DEFAULT_FULLSCREEN_MODE);
-
-    /* if that also fails, set current screen mode to first available mode */
-    if (screen_mode_current == NULL)
-      screen_mode_current = screen_modes;
-
-    if (screen_mode_current == NULL)
-      video.fullscreen_available = FALSE;
-  }
-
-  // if (video.fullscreen_available)
-  if (screen_mode_current != NULL)
-  {
-    setup.fullscreen_mode = screen_mode_current->identifier;
-
-    /* needed for displaying screen mode name instead of identifier */
-    screen_mode_text = screen_mode_current->name;
-  }
-}
-
 static void execSetupGraphics()
 {
   if (setup_mode == SETUP_MODE_CHOOSE_WINDOW_SIZE)
@@ -4717,7 +4647,6 @@ static void execSetupGraphics()
   }
 
   execSetupGraphics_setScalingTypes();
-  execSetupGraphics_setScreenModes();
 
   setup_mode = SETUP_MODE_GRAPHICS;
 
@@ -4733,8 +4662,7 @@ static void execSetupGraphics()
 #endif
 }
 
-#if !defined(PLATFORM_ANDROID)
-#if defined(TARGET_SDL2)
+#if defined(TARGET_SDL2) && !defined(PLATFORM_ANDROID)
 static void execSetupChooseWindowSize()
 {
   setup_mode = SETUP_MODE_CHOOSE_WINDOW_SIZE;
@@ -4748,17 +4676,6 @@ static void execSetupChooseScalingType()
 
   DrawSetupScreen();
 }
-#else
-static void execSetupChooseScreenMode()
-{
-  if (!video.fullscreen_available)
-    return;
-
-  setup_mode = SETUP_MODE_CHOOSE_SCREEN_MODE;
-
-  DrawSetupScreen();
-}
-#endif
 #endif
 
 static void execSetupChooseVolumeSimple()
@@ -5357,17 +5274,12 @@ static struct TokenInfo setup_info_editor[] =
 
 static struct TokenInfo setup_info_graphics[] =
 {
-#if !defined(PLATFORM_ANDROID)
+#if defined(TARGET_SDL2) && !defined(PLATFORM_ANDROID)
   { TYPE_SWITCH,       &setup.fullscreen,      "Fullscreen:"           },
-#if defined(TARGET_SDL2)
   { TYPE_ENTER_LIST,   execSetupChooseWindowSize, "Window Scaling:"    },
   { TYPE_STRING,       &window_size_text,      ""                      },
   { TYPE_ENTER_LIST,   execSetupChooseScalingType, "Anti-Aliasing:"    },
   { TYPE_STRING,       &scaling_type_text,     ""                      },
-#else
-  { TYPE_ENTER_LIST,   execSetupChooseScreenMode, "Fullscreen Mode:"   },
-  { TYPE_STRING,       &screen_mode_text,      ""                      },
-#endif
 #endif
 #if 0
   { TYPE_ENTER_LIST,   execSetupChooseScrollDelay, "Scroll Delay:"     },
@@ -6502,8 +6414,6 @@ void DrawSetupScreen()
     DrawChooseTree(&scroll_delay_current);
   else if (setup_mode == SETUP_MODE_CHOOSE_SNAPSHOT_MODE)
     DrawChooseTree(&snapshot_mode_current);
-  else if (setup_mode == SETUP_MODE_CHOOSE_SCREEN_MODE)
-    DrawChooseTree(&screen_mode_current);
   else if (setup_mode == SETUP_MODE_CHOOSE_WINDOW_SIZE)
     DrawChooseTree(&window_size_current);
   else if (setup_mode == SETUP_MODE_CHOOSE_SCALING_TYPE)
@@ -6555,8 +6465,6 @@ void HandleSetupScreen(int mx, int my, int dx, int dy, int button)
     HandleChooseTree(mx, my, dx, dy, button, &scroll_delay_current);
   else if (setup_mode == SETUP_MODE_CHOOSE_SNAPSHOT_MODE)
     HandleChooseTree(mx, my, dx, dy, button, &snapshot_mode_current);
-  else if (setup_mode == SETUP_MODE_CHOOSE_SCREEN_MODE)
-    HandleChooseTree(mx, my, dx, dy, button, &screen_mode_current);
   else if (setup_mode == SETUP_MODE_CHOOSE_WINDOW_SIZE)
     HandleChooseTree(mx, my, dx, dy, button, &window_size_current);
   else if (setup_mode == SETUP_MODE_CHOOSE_SCALING_TYPE)
index 9d97bc9e0339cbe60be42e914fea08d466e24773..211e6e01b2fda5eb3924482e70236aeaf9e22e45 100644 (file)
@@ -8211,9 +8211,6 @@ void ToggleFullscreenOrChangeWindowScalingIfNeeded()
 {
   boolean change_fullscreen = (setup.fullscreen !=
                               video.fullscreen_enabled);
-  boolean change_fullscreen_mode = (video.fullscreen_enabled &&
-                                   !strEqual(setup.fullscreen_mode,
-                                             video.fullscreen_mode_current));
   boolean change_window_scaling_percent = (!video.fullscreen_enabled &&
                                           setup.window_scaling_percent !=
                                           video.window_scaling_percent);
@@ -8243,7 +8240,6 @@ void ToggleFullscreenOrChangeWindowScalingIfNeeded()
 #endif
 
   if (change_fullscreen ||
-      change_fullscreen_mode ||
       change_window_scaling_percent)
   {
     Bitmap *tmp_backbuffer = CreateBitmap(WIN_XSIZE, WIN_YSIZE, DEFAULT_DEPTH);
@@ -8251,12 +8247,6 @@ void ToggleFullscreenOrChangeWindowScalingIfNeeded()
     /* save backbuffer content which gets lost when toggling fullscreen mode */
     BlitBitmap(backbuffer, tmp_backbuffer, 0, 0, WIN_XSIZE, WIN_YSIZE, 0, 0);
 
-    if (change_fullscreen_mode)
-    {
-      /* keep fullscreen, but change fullscreen mode (screen resolution) */
-      video.fullscreen_enabled = FALSE;                /* force new fullscreen mode */
-    }
-
     if (change_window_scaling_percent)
     {
       /* keep window mode, but change window scaling */