mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-13 23:43:34 +00:00
SDL: Use dynamic cast instead of C cast to get screenshot path
This commit is contained in:
parent
3849a3e90e
commit
438f23f272
@ -625,7 +625,10 @@ bool OpenGLSdlGraphicsManager::notifyEvent(const Common::Event &event) {
|
||||
if (event.kbd.keycode == Common::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;
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user