aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'backends/graphics/surfacesdl/surfacesdl-graphics.cpp')
-rw-r--r--backends/graphics/surfacesdl/surfacesdl-graphics.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
index 047941cb43..dd28f32bdc 100644
--- a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
+++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
@@ -2526,7 +2526,10 @@ bool SurfaceSdlGraphicsManager::notifyEvent(const Common::Event &event) {
if (event.kbd.hasFlags(Common::KBD_ALT) && event.kbd.keycode == 's') {
Common::String filename;
- Common::String screenshotsPath = ((OSystem_SDL *)g_system)->getScreenshotsPath();
+ Common::String screenshotsPath;
+ OSystem_SDL *sdl_g_system = dynamic_cast<OSystem_SDL*>(g_system);
+ if (sdl_g_system)
+ screenshotsPath = sdl_g_system->getScreenshotsPath();
for (int n = 0;; n++) {
SDL_RWops *file;