aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backends/graphics/surfacesdl/surfacesdl-graphics.cpp6
-rw-r--r--backends/graphics/surfacesdl/surfacesdl-graphics.h41
2 files changed, 40 insertions, 7 deletions
diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
index bd430e8171..4b4f218caf 100644
--- a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
+++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
@@ -171,8 +171,6 @@ SurfaceSdlGraphicsManager::SurfaceSdlGraphicsManager(SdlEventSource *sdlEventSou
_mouseBackup.x = _mouseBackup.y = _mouseBackup.w = _mouseBackup.h = 0;
- memset(&_mouseCurState, 0, sizeof(_mouseCurState));
-
_graphicsMutex = g_system->createMutex();
#ifdef USE_SDL_DEBUG_FOCUSRECT
@@ -180,10 +178,6 @@ SurfaceSdlGraphicsManager::SurfaceSdlGraphicsManager(SdlEventSource *sdlEventSou
_enableFocusRectDebugCode = ConfMan.getBool("use_sdl_debug_focusrect");
#endif
- memset(&_oldVideoMode, 0, sizeof(_oldVideoMode));
- memset(&_videoMode, 0, sizeof(_videoMode));
- memset(&_transactionDetails, 0, sizeof(_transactionDetails));
-
#if !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) && defined(USE_SCALERS)
_videoMode.mode = GFX_DOUBLESIZE;
_videoMode.scaleFactor = 2;
diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.h b/backends/graphics/surfacesdl/surfacesdl-graphics.h
index 3bf0dd516f..f5edd160f9 100644
--- a/backends/graphics/surfacesdl/surfacesdl-graphics.h
+++ b/backends/graphics/surfacesdl/surfacesdl-graphics.h
@@ -241,6 +241,20 @@ protected:
#ifdef USE_RGB_COLOR
bool formatChanged;
#endif
+
+ TransactionDetails() {
+ sizeChanged = false;
+ needHotswap = false;
+ needUpdatescreen = false;
+
+#if SDL_VERSION_ATLEAST(2, 0, 0)
+ needTextureUpdate = false;
+ needDisplayResize = false;
+#endif
+#ifdef USE_RGB_COLOR
+ formatChanged = false;
+#endif
+ }
};
TransactionDetails _transactionDetails;
@@ -251,7 +265,7 @@ protected:
bool aspectRatioCorrection;
AspectRatio desiredAspectRatio;
bool filtering;
-
+
#if SDL_VERSION_ATLEAST(2, 0, 0)
int stretchMode;
#endif
@@ -265,6 +279,31 @@ protected:
#ifdef USE_RGB_COLOR
Graphics::PixelFormat format;
#endif
+
+ VideoState() {
+ setup = false;
+ fullscreen = false;
+ aspectRatioCorrection = false;
+ // desiredAspectRatio set to (0, 0) by AspectRatio constructor
+ filtering = false;
+
+#if SDL_VERSION_ATLEAST(2, 0, 0)
+ stretchMode = 0;
+#endif
+
+ mode = 0;
+ scaleFactor = 0;
+
+ screenWidth = 0;
+ screenHeight = 0;
+ overlayWidth = 0;
+ overlayHeight = 0;
+ hardwareWidth = 0;
+ hardwareHeight = 0;
+#ifdef USE_RGB_COLOR
+ // format set to 0 values by Graphics::PixelFormat constructor
+#endif
+ }
};
VideoState _videoMode, _oldVideoMode;