[Scummvm-git-logs] scummvm master -> b593fe2f451a7242cc4926fe7bdc927e3676a9aa
bluegr
bluegr at gmail.com
Sun Nov 10 06:08:26 CET 2019
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
b593fe2f45 SDL: Fix Windows screenshots with unicode paths
Commit: b593fe2f451a7242cc4926fe7bdc927e3676a9aa
https://github.com/scummvm/scummvm/commit/b593fe2f451a7242cc4926fe7bdc927e3676a9aa
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2019-11-10T07:08:22+02:00
Commit Message:
SDL: Fix Windows screenshots with unicode paths
Use Common::FSNode to test for screenshot existence instead of
SDL_RWFromFile(). SDL does different character encoding conversions
which fail on Windows when a unicode character is in the path.
Fixes bug #11118
Changed paths:
backends/graphics/sdl/sdl-graphics.cpp
diff --git a/backends/graphics/sdl/sdl-graphics.cpp b/backends/graphics/sdl/sdl-graphics.cpp
index 0d310a417..e5a49ce 100644
--- a/backends/graphics/sdl/sdl-graphics.cpp
+++ b/backends/graphics/sdl/sdl-graphics.cpp
@@ -25,6 +25,7 @@
#include "backends/platform/sdl/sdl.h"
#include "backends/events/sdl/sdl-events.h"
#include "common/config-manager.h"
+#include "common/fs.h"
#include "common/textconsole.h"
#include "graphics/scaler/aspect.h"
#ifdef USE_OSD
@@ -279,19 +280,16 @@ void SdlGraphicsManager::saveScreenshot() {
screenshotsPath = sdl_g_system->getScreenshotsPath();
for (int n = 0;; n++) {
- SDL_RWops *file;
-
#ifdef USE_PNG
filename = Common::String::format("scummvm%05d.png", n);
#else
filename = Common::String::format("scummvm%05d.bmp", n);
#endif
- file = SDL_RWFromFile((screenshotsPath + filename).c_str(), "r");
-
- if (!file)
+ Common::FSNode file = Common::FSNode(screenshotsPath + filename);
+ if (!file.exists()) {
break;
- SDL_RWclose(file);
+ }
}
if (saveScreenshot(screenshotsPath + filename)) {
More information about the Scummvm-git-logs
mailing list