Removed obsolete window positioning code.
authorSam Lantinga <slouken@libsdl.org>
Tue, 15 Mar 2011 21:44:56 -0700
changeset 5495 b3680e05286d
parent 5494 78b351c52f53
child 5496 6b7464c2b90d
Removed obsolete window positioning code.
src/video/directfb/SDL_DirectFB_window.c
src/video/windows/SDL_windowswindow.c
--- a/src/video/directfb/SDL_DirectFB_window.c	Tue Mar 15 21:40:57 2011 -0700
+++ b/src/video/directfb/SDL_DirectFB_window.c	Tue Mar 15 21:44:56 2011 -0700
@@ -62,26 +62,8 @@
 		bshaped = 1;
 	
     /* Fill the window description. */
-    if (SDL_WINDOWPOS_ISCENTERED(window->x)) {
-        x = (dispdata->cw - window->w) / 2;
-    } else if (SDL_WINDOWPOS_ISUNDEFINED(window->x)) {
-        x = 0;
-    } else {
-        x = window->x;
-    }
-    
-    if (SDL_WINDOWPOS_ISCENTERED(window->y)) {
-        y = (dispdata->ch - window->h) / 2;
-    } else if (SDL_WINDOWPOS_ISUNDEFINED(window->y)) {
-        y = 0;
-    } else {
-        y = window->y;
-    }
-    
-    if (window->flags & SDL_WINDOW_FULLSCREEN) {
-        x = 0;
-        y = 0;
-    }
+    x = window->x;
+    y = window->y;
 
     DirectFB_WM_AdjustWindowLayout(window, window->flags, window->w, window->h);
 
--- a/src/video/windows/SDL_windowswindow.c	Tue Mar 15 21:40:57 2011 -0700
+++ b/src/video/windows/SDL_windowswindow.c	Tue Mar 15 21:44:56 2011 -0700
@@ -345,7 +345,6 @@
     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,18 +370,8 @@
     AdjustWindowRectEx(&rect, style, menu, 0);
     w = (rect.right - rect.left);
     h = (rect.bottom - 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;
-    }
+    x = window->x + rect.left;
+    y = window->y + rect.top;
 
     SetWindowPos(hwnd, top, x, y, 0, 0, (SWP_NOCOPYBITS | SWP_NOSIZE));
 }