changeset 971:96671ebc50a4

Date: Mon, 25 Oct 2004 17:30:06 +0200 From: Gautier Portet Subject: [SDL] Re: Centering a window Hi, here is a patch fixing the win32 centered window bug
author Sam Lantinga <slouken@libsdl.org>
date Fri, 12 Nov 2004 23:22:08 +0000
parents fb8b91365766
children 15a7d0c44e73
files src/video/windib/SDL_dibvideo.c src/video/windx5/SDL_dx5video.c
diffstat 2 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/video/windib/SDL_dibvideo.c	Fri Nov 12 23:14:47 2004 +0000
+++ b/src/video/windib/SDL_dibvideo.c	Fri Nov 12 23:22:08 2004 +0000
@@ -703,12 +703,12 @@
 		if ( (flags & SDL_FULLSCREEN) ) {
 			x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
 			y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
+		} else if ( center ) {
+			x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
+			y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
 		} else if ( SDL_windowX || SDL_windowY || window ) {
 			x = bounds.left;
 			y = bounds.top;
-		} else if ( center ) {
-			x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
-			y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
 		} else {
 			x = y = -1;
 			swp_flags |= SWP_NOMOVE;
--- a/src/video/windx5/SDL_dx5video.c	Fri Nov 12 23:14:47 2004 +0000
+++ b/src/video/windx5/SDL_dx5video.c	Fri Nov 12 23:22:08 2004 +0000
@@ -1168,12 +1168,12 @@
 			if ( (flags & SDL_FULLSCREEN) ) {
 				x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
 				y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
+			} else if ( center ) {
+				x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
+				y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
 			} else if ( SDL_windowX || SDL_windowY || window ) {
 				x = bounds.left;
 				y = bounds.top;
-			} else if ( center ) {
-				x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
-				y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
 			} else {
 				x = y = -1;
 				swp_flags |= SWP_NOMOVE;
@@ -1574,12 +1574,12 @@
 		if ( (flags & SDL_FULLSCREEN) ) {
 			x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
 			y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
+		} else if ( center ) {
+			x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
+			y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
 		} else if ( SDL_windowX || SDL_windowY || window ) {
 			x = bounds.left;
 			y = bounds.top;
-		} else if ( center ) {
-			x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
-			y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
 		} else {
 			x = y = -1;
 			swp_flags |= SWP_NOMOVE;