Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Removed unreferenced variable
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Mar 13, 2011
1 parent 6fbbe09 commit d4f488a
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/video/windows/SDL_windowswindow.c
Expand Up @@ -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;
Expand All @@ -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));
}
Expand Down

0 comments on commit d4f488a

Please sign in to comment.