Removed unreferenced variable
authorSam Lantinga <slouken@libsdl.org>
Sun, 13 Mar 2011 11:17:11 -0700
changeset 5483ccec742c9b7d
parent 5482 2c0477323626
child 5484 e20c93bc9122
Removed unreferenced variable
src/video/windows/SDL_windowswindow.c
     1.1 --- a/src/video/windows/SDL_windowswindow.c	Sat Mar 12 13:28:56 2011 -0800
     1.2 +++ b/src/video/windows/SDL_windowswindow.c	Sun Mar 13 11:17:11 2011 -0700
     1.3 @@ -345,7 +345,6 @@
     1.4      SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
     1.5      HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
     1.6      RECT rect;
     1.7 -    SDL_Rect bounds;
     1.8      DWORD style;
     1.9      HWND top;
    1.10      BOOL menu;
    1.11 @@ -371,8 +370,18 @@
    1.12      AdjustWindowRectEx(&rect, style, menu, 0);
    1.13      w = (rect.right - rect.left);
    1.14      h = (rect.bottom - rect.top);
    1.15 -    x = window->x + rect.left;
    1.16 -    y = window->y + rect.top;
    1.17 +
    1.18 +    WIN_GetDisplayBounds(_this, display, &bounds);
    1.19 +    if (SDL_WINDOWPOS_ISCENTERED(window->x)) {
    1.20 +        x = bounds.x + (bounds.w - w) / 2;
    1.21 +    } else {
    1.22 +        x = window->x + rect.left;
    1.23 +    }
    1.24 +    if (SDL_WINDOWPOS_ISCENTERED(window->y)) {
    1.25 +        y = bounds.y + (bounds.h - h) / 2;
    1.26 +    } else {
    1.27 +        y = window->y + rect.top;
    1.28 +    }
    1.29  
    1.30      SetWindowPos(hwnd, top, x, y, 0, 0, (SWP_NOCOPYBITS | SWP_NOSIZE));
    1.31  }