changeset 4086:7cd5a59480a4 SDL-1.2

Merged window position fix from windib code
author Sam Lantinga <slouken@libsdl.org>
date Fri, 20 Jul 2007 03:30:41 +0000
parents 51486c979189
children 4867f7f7dd34
files src/video/windx5/SDL_dx5video.c
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/video/windx5/SDL_dx5video.c	Fri Jul 20 03:25:40 2007 +0000
+++ b/src/video/windx5/SDL_dx5video.c	Fri Jul 20 03:30:41 2007 +0000
@@ -1018,6 +1018,7 @@
 				int width, int height, int bpp, Uint32 flags)
 {
 	SDL_Surface *video;
+	int prev_w, prev_h;
 	HRESULT result;
 	DWORD sharemode;
 	DWORD style;
@@ -1103,6 +1104,8 @@
 		}
 
 		/* Fill in part of the video surface */
+		prev_w = video->w;
+		prev_h = video->h;
 		video->flags = 0;	/* Clear flags */
 		video->w = width;
 		video->h = height;
@@ -1178,7 +1181,7 @@
 			const char *window = NULL;
 			const char *center = NULL;
 
-			if ( !SDL_windowX && !SDL_windowY ) {
+			if ( video->w != prev_w || video->h != prev_h ) {
 				window = SDL_getenv("SDL_VIDEO_WINDOW_POS");
 				center = SDL_getenv("SDL_VIDEO_CENTERED");
 				if ( window ) {
@@ -1454,6 +1457,8 @@
 			SDL_OutOfMemory();
 			return(NULL);
 		}
+		prev_w = video->w;
+		prev_h = video->h;
 		video->w = width;
 		video->h = height;
 		video->pitch = 0;
@@ -1581,7 +1586,7 @@
 			const char *window = NULL;
 			const char *center = NULL;
 
-			if ( !SDL_windowX && !SDL_windowY ) {
+			if ( video->w != prev_w || video->h != prev_h ) {
 				window = SDL_getenv("SDL_VIDEO_WINDOW_POS");
 				center = SDL_getenv("SDL_VIDEO_CENTERED");
 				if ( window ) {