Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Removed unreferenced variable

  • Loading branch information
slouken committed Mar 13, 2011
1 parent 6fbbe09 commit d4f488ac673db2979f9954912849c8812b5c6c8f
Showing with 12 additions and 3 deletions.
  1. +12 −3 src/video/windows/SDL_windowswindow.c
@@ -345,7 +345,6 @@ WIN_SetWindowPosition(_THIS, SDL_Window * window)
SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
RECT rect;
SDL_Rect bounds;
DWORD style;
HWND top;
BOOL menu;
@@ -371,8 +370,18 @@ WIN_SetWindowPosition(_THIS, SDL_Window * window)
AdjustWindowRectEx(&rect, style, menu, 0);
w = (rect.right - rect.left);
h = (rect.bottom - rect.top);
x = window->x + rect.left;
y = window->y + rect.top;

WIN_GetDisplayBounds(_this, display, &bounds);
if (SDL_WINDOWPOS_ISCENTERED(window->x)) {
x = bounds.x + (bounds.w - w) / 2;
} else {
x = window->x + rect.left;
}
if (SDL_WINDOWPOS_ISCENTERED(window->y)) {
y = bounds.y + (bounds.h - h) / 2;
} else {
y = window->y + rect.top;
}

SetWindowPos(hwnd, top, x, y, 0, 0, (SWP_NOCOPYBITS | SWP_NOSIZE));
}

0 comments on commit d4f488a

Please sign in to comment.