Commit 3dc65ba6 authored by Sam Lantinga's avatar Sam Lantinga

Merged window position fix from windib code

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%402560
parent 0a9a1e25
...@@ -1018,6 +1018,7 @@ SDL_Surface *DX5_SetVideoMode(_THIS, SDL_Surface *current, ...@@ -1018,6 +1018,7 @@ SDL_Surface *DX5_SetVideoMode(_THIS, SDL_Surface *current,
int width, int height, int bpp, Uint32 flags) int width, int height, int bpp, Uint32 flags)
{ {
SDL_Surface *video; SDL_Surface *video;
int prev_w, prev_h;
HRESULT result; HRESULT result;
DWORD sharemode; DWORD sharemode;
DWORD style; DWORD style;
...@@ -1103,6 +1104,8 @@ SDL_Surface *DX5_SetVideoMode(_THIS, SDL_Surface *current, ...@@ -1103,6 +1104,8 @@ SDL_Surface *DX5_SetVideoMode(_THIS, SDL_Surface *current,
} }
/* Fill in part of the video surface */ /* Fill in part of the video surface */
prev_w = video->w;
prev_h = video->h;
video->flags = 0; /* Clear flags */ video->flags = 0; /* Clear flags */
video->w = width; video->w = width;
video->h = height; video->h = height;
...@@ -1178,7 +1181,7 @@ SDL_Surface *DX5_SetVideoMode(_THIS, SDL_Surface *current, ...@@ -1178,7 +1181,7 @@ SDL_Surface *DX5_SetVideoMode(_THIS, SDL_Surface *current,
const char *window = NULL; const char *window = NULL;
const char *center = 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"); window = SDL_getenv("SDL_VIDEO_WINDOW_POS");
center = SDL_getenv("SDL_VIDEO_CENTERED"); center = SDL_getenv("SDL_VIDEO_CENTERED");
if ( window ) { if ( window ) {
...@@ -1454,6 +1457,8 @@ SDL_Surface *DX5_SetVideoMode(_THIS, SDL_Surface *current, ...@@ -1454,6 +1457,8 @@ SDL_Surface *DX5_SetVideoMode(_THIS, SDL_Surface *current,
SDL_OutOfMemory(); SDL_OutOfMemory();
return(NULL); return(NULL);
} }
prev_w = video->w;
prev_h = video->h;
video->w = width; video->w = width;
video->h = height; video->h = height;
video->pitch = 0; video->pitch = 0;
...@@ -1581,7 +1586,7 @@ SDL_Surface *DX5_SetVideoMode(_THIS, SDL_Surface *current, ...@@ -1581,7 +1586,7 @@ SDL_Surface *DX5_SetVideoMode(_THIS, SDL_Surface *current,
const char *window = NULL; const char *window = NULL;
const char *center = 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"); window = SDL_getenv("SDL_VIDEO_WINDOW_POS");
center = SDL_getenv("SDL_VIDEO_CENTERED"); center = SDL_getenv("SDL_VIDEO_CENTERED");
if ( window ) { if ( window ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment