src/SDL12_compat.c
changeset 58 75a93435ce44
parent 57 9bc9f6285f0b
child 59 39067b54d1b0
     1.1 --- a/src/SDL12_compat.c	Wed Feb 13 20:51:28 2019 -0500
     1.2 +++ b/src/SDL12_compat.c	Wed Feb 13 20:53:24 2019 -0500
     1.3 @@ -537,10 +537,10 @@
     1.4  static int
     1.5  GetVideoDisplay()
     1.6  {
     1.7 -    // !!! FIXME: cache this value during SDL_Init() so it doesn't change.
     1.8 -    const char *variable = SDL_getenv("SDL_VIDEO_FULLSCREEN_DISPLAY");
     1.9 +    FIXME("cache this value during SDL_Init() so it doesn't change.");
    1.10 +    const char *variable = SDL20_getenv("SDL_VIDEO_FULLSCREEN_DISPLAY");
    1.11      if ( !variable ) {
    1.12 -        variable = SDL_getenv("SDL_VIDEO_FULLSCREEN_HEAD");
    1.13 +        variable = SDL20_getenv("SDL_VIDEO_FULLSCREEN_HEAD");
    1.14      }
    1.15      if ( variable ) {
    1.16          return SDL20_atoi(variable);
    1.17 @@ -1590,16 +1590,16 @@
    1.18  GetEnvironmentWindowPosition(int w, int h, int *x, int *y)
    1.19  {
    1.20      int display = VideoDisplayIndex;
    1.21 -    const char *window = SDL_getenv("SDL_VIDEO_WINDOW_POS");
    1.22 -    const char *center = SDL_getenv("SDL_VIDEO_CENTERED");
    1.23 +    const char *window = SDL20_getenv("SDL_VIDEO_WINDOW_POS");
    1.24 +    const char *center = SDL20_getenv("SDL_VIDEO_CENTERED");
    1.25      if (window) {
    1.26 -        if (SDL_sscanf(window, "%d,%d", x, y) == 2) {
    1.27 +        if (SDL20_strcmp(window, "center") == 0) {
    1.28 +            center = window;
    1.29 +        } else if (SDL20_sscanf(window, "%d,%d", x, y) == 2) {
    1.30              return;
    1.31          }
    1.32 -        if (SDL_strcmp(window, "center") == 0) {
    1.33 -            center = window;
    1.34 -        }
    1.35      }
    1.36 +
    1.37      if (center) {
    1.38          *x = SDL_WINDOWPOS_CENTERED_DISPLAY(display);
    1.39          *y = SDL_WINDOWPOS_CENTERED_DISPLAY(display);
    1.40 @@ -1613,7 +1613,7 @@
    1.41      SDL_bool allow_screensaver;
    1.42  
    1.43      /* Allow environment override of screensaver disable */
    1.44 -    env = SDL_getenv("SDL_VIDEO_ALLOW_SCREENSAVER");
    1.45 +    env = SDL20_getenv("SDL_VIDEO_ALLOW_SCREENSAVER");
    1.46      if (env) {
    1.47          allow_screensaver = SDL20_atoi(env) ? SDL_TRUE : SDL_FALSE;
    1.48      } else if (flags12 & SDL12_FULLSCREEN) {