SDL: Based on PR #1624 and more sync with ScummVM

This commit is contained in:
Pawel Kolodziejski 2020-05-12 23:46:03 +02:00
parent 8538d8d5e9
commit 6e02b9d5d6
14 changed files with 852 additions and 273 deletions

View file

@ -44,18 +44,25 @@
#include "image/bmp.h"
#endif
OpenGLSdlGraphicsManager::OpenGLSdlGraphicsManager(SdlEventSource *sdlEventSource, SdlWindow *window, const Capabilities &capabilities)
:
ResVmSdlGraphicsManager(sdlEventSource, window, capabilities),
OpenGLSdlGraphicsManager::OpenGLSdlGraphicsManager(SdlEventSource *eventSource, SdlWindow *window, const Capabilities &capabilities)
: ResVmSdlGraphicsManager(eventSource, window),
#if SDL_VERSION_ATLEAST(2, 0, 0)
_glContext(nullptr),
#endif
_capabilities(capabilities),
_overlayVisible(false),
_overlayScreen(nullptr),
_overlayBackground(nullptr),
_gameRect(),
_fullscreen(false),
_lockAspectRatio(true),
_frameBuffer(nullptr),
_surfaceRenderer(nullptr) {
_surfaceRenderer(nullptr),
_engineRequestedWidth(0),
_engineRequestedHeight(0) {
ConfMan.registerDefault("antialiasing", 0);
ConfMan.registerDefault("aspect_ratio", true);
ConfMan.registerDefault("vsync", true);
_sideTextures[0] = _sideTextures[1] = nullptr;
@ -86,8 +93,12 @@ bool OpenGLSdlGraphicsManager::getFeatureState(OSystem::Feature f) const {
switch (f) {
case OSystem::kFeatureVSync:
return isVSyncEnabled();
case OSystem::kFeatureFullscreenMode:
return _fullscreen;
case OSystem::kFeatureAspectRatioCorrection:
return _lockAspectRatio;
default:
return ResVmSdlGraphicsManager::getFeatureState(f);
return false;
}
}
@ -99,8 +110,10 @@ void OpenGLSdlGraphicsManager::setFeatureState(OSystem::Feature f, bool enable)
createOrUpdateScreen();
}
break;
case OSystem::kFeatureAspectRatioCorrection:
_lockAspectRatio = enable;
break;
default:
ResVmSdlGraphicsManager::setFeatureState(f, enable);
break;
}
}