|
@@ -236,7 +236,7 @@ bool VideoDriver_SDL::CreateMainSurface(
|
|
|
|
|
|
GetAvailableVideoMode(&w, &h);
|
|
|
|
|
|
DEBUG(driver, 1, "SDL: using mode %ux%ux%d", w, h, bpp);
|
|
|
Debug(driver, 1, "SDL: using mode {}x{}x{}", w, h, bpp);
|
|
|
|
|
|
if (bpp == 0) usererror("Can't use a blitter that blits 0 bpp for normal visuals");
|
|
|
|
|
@@ -282,7 +282,7 @@ bool VideoDriver_SDL::CreateMainSurface(
|
|
|
want_hwpalette = _use_hwpalette;
|
|
|
}
|
|
|
|
|
|
if (want_hwpalette) DEBUG(driver, 1, "SDL: requesting hardware palette");
|
|
|
if (want_hwpalette) Debug(driver, 1, "SDL: requesting hardware palette");
|
|
|
|
|
|
/* Free any previously allocated shadow surface */
|
|
|
if (_sdl_surface != nullptr && _sdl_surface != _sdl_realscreen) SDL_FreeSurface(_sdl_surface);
|
|
@@ -297,7 +297,7 @@ bool VideoDriver_SDL::CreateMainSurface(
|
|
|
* windowed), we restart the entire video
|
|
|
* subsystem to force creating a new window.
|
|
|
*/
|
|
|
DEBUG(driver, 0, "SDL: Restarting SDL video subsystem, to force hwpalette change");
|
|
|
Debug(driver, 0, "SDL: Restarting SDL video subsystem, to force hwpalette change");
|
|
|
SDL_QuitSubSystem(SDL_INIT_VIDEO);
|
|
|
SDL_InitSubSystem(SDL_INIT_VIDEO);
|
|
|
ClaimMousePointer();
|
|
@@ -313,7 +313,7 @@ bool VideoDriver_SDL::CreateMainSurface(
|
|
|
/* DO NOT CHANGE TO HWSURFACE, IT DOES NOT WORK */
|
|
|
newscreen = SDL_SetVideoMode(w, h, bpp, SDL_SWSURFACE | (want_hwpalette ? SDL_HWPALETTE : 0) | (_fullscreen ? SDL_FULLSCREEN : SDL_RESIZABLE));
|
|
|
if (newscreen == nullptr) {
|
|
|
DEBUG(driver, 0, "SDL: Couldn't allocate a window to draw on");
|
|
|
Debug(driver, 0, "SDL: Couldn't allocate a window to draw on");
|
|
|
return false;
|
|
|
}
|
|
|
_sdl_realscreen = newscreen;
|
|
@@ -337,10 +337,10 @@ bool VideoDriver_SDL::CreateMainSurface(
|
|
|
* This shadow surface will have SDL_HWPALLETE set, so
|
|
|
* we won't create a second shadow surface in this case.
|
|
|
*/
|
|
|
DEBUG(driver, 1, "SDL: using shadow surface");
|
|
|
Debug(driver, 1, "SDL: using shadow surface");
|
|
|
newscreen = SDL_CreateRGBSurface(SDL_SWSURFACE, w, h, bpp, 0, 0, 0, 0);
|
|
|
if (newscreen == nullptr) {
|
|
|
DEBUG(driver, 0, "SDL: Couldn't allocate a shadow surface to draw on");
|
|
|
Debug(driver, 0, "SDL: Couldn't allocate a shadow surface to draw on");
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
@@ -594,7 +594,7 @@ const char *VideoDriver_SDL::Start(const
|
|
|
}
|
|
|
|
|
|
SDL_VideoDriverName(buf, sizeof buf);
|
|
|
DEBUG(driver, 1, "SDL: using driver '%s'", buf);
|
|
|
Debug(driver, 1, "SDL: using driver '{}'", buf);
|
|
|
|
|
|
MarkWholeScreenDirty();
|
|
|
SetupKeyboard();
|