Revert "SDL: Move detection of the desktop resolution into the SdlWindow class"

This commit is contained in:
Paweł Kołodziejski 2020-04-17 17:58:45 +02:00
parent d195f77c40
commit b5d73d4c22
6 changed files with 55 additions and 35 deletions

View file

@ -38,15 +38,6 @@ SdlWindow::SdlWindow()
_lastFlags(0), _lastX(SDL_WINDOWPOS_UNDEFINED), _lastY(SDL_WINDOWPOS_UNDEFINED)
#endif
{
#if !SDL_VERSION_ATLEAST(2, 0, 0)
// Query the desktop resolution. We simply hope nothing tried to change
// the resolution so far.
const SDL_VideoInfo *videoInfo = SDL_GetVideoInfo();
if (videoInfo && videoInfo->current_w > 0 && videoInfo->current_h > 0) {
_desktopRes = Common::Rect(videoInfo->current_w, videoInfo->current_h);
}
#endif
}
SdlWindow::~SdlWindow() {
@ -201,19 +192,6 @@ bool SdlWindow::getSDLWMInformation(SDL_SysWMinfo *info) const {
#endif
}
Common::Rect SdlWindow::getDesktopResolution() {
#if SDL_VERSION_ATLEAST(2, 0, 0)
int displayIndex = _window ? SDL_GetWindowDisplayIndex(_window) : 0;
SDL_DisplayMode displayMode;
if (!SDL_GetDesktopDisplayMode(displayIndex, &displayMode)) {
_desktopRes = Common::Rect(displayMode.w, displayMode.h);
}
#endif
return _desktopRes;
}
#if SDL_VERSION_ATLEAST(2, 0, 0)
SDL_Surface *copySDLSurface(SDL_Surface *src) {
const bool locked = SDL_MUSTLOCK(src) == SDL_TRUE;