Commit 0543b444 authored by Sam Lantinga's avatar Sam Lantinga

Date: Thu, 05 Feb 2009 17:27:54 +0100

From: Stefan Klug
Subject: [SDL] SDL_SetVideoMode compatibility fix

SDL_SetVideoMode(0,0,0,flags) used to be valid in SDL 1.2
Attached is a patch to replicate this behaviour in SDL 1.3

Cheers Stefan

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403565
parent d2d2e1c3
......@@ -494,6 +494,15 @@ SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags)
return NULL;
}
}
SDL_GetDesktopDisplayMode(&desktop_mode);
if (width == 0) {
width = desktop_mode.w;
}
if (height == 0) {
height = desktop_mode.h;
}
/* See if we can simply resize the existing window and surface */
if (SDL_ResizeVideoMode(width, height, bpp, flags) == 0) {
......@@ -567,7 +576,6 @@ SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags)
}
/* Set up the desired display mode */
SDL_GetDesktopDisplayMode(&desktop_mode);
desktop_format = desktop_mode.format;
if (desktop_format && ((flags & SDL_ANYFORMAT)
|| (bpp == SDL_BITSPERPIXEL(desktop_format)))) {
......
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