Removed unreferenced variable
This commit is contained in:
parent
a9d41506c3
commit
fbc49beee3
1 changed files with 12 additions and 3 deletions
|
@ -345,7 +345,6 @@ WIN_SetWindowPosition(_THIS, SDL_Window * window)
|
||||||
SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
|
SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
|
||||||
HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
|
HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
|
||||||
RECT rect;
|
RECT rect;
|
||||||
SDL_Rect bounds;
|
|
||||||
DWORD style;
|
DWORD style;
|
||||||
HWND top;
|
HWND top;
|
||||||
BOOL menu;
|
BOOL menu;
|
||||||
|
@ -371,8 +370,18 @@ WIN_SetWindowPosition(_THIS, SDL_Window * window)
|
||||||
AdjustWindowRectEx(&rect, style, menu, 0);
|
AdjustWindowRectEx(&rect, style, menu, 0);
|
||||||
w = (rect.right - rect.left);
|
w = (rect.right - rect.left);
|
||||||
h = (rect.bottom - rect.top);
|
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));
|
SetWindowPos(hwnd, top, x, y, 0, 0, (SWP_NOCOPYBITS | SWP_NOSIZE));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue