[Scummvm-git-logs] scummvm master -> 478d7b2ee7f74c888a44ac71300893981e53dd7b
criezy
criezy at scummvm.org
Sun Jun 3 18:43:35 CEST 2018
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
e1c83f8e87 WIN32: Move Windows-specific implementation of getSystemLanguage out of OSystem_SDL
ada05fd726 WIN32: Move Windows-specific implementation of logMessage out of OSystem_SDL
478d7b2ee7 WIN32: Fix fallback in getSystemLanguage
Commit: e1c83f8e8707abb268b3536c2993bcdd9dfee25e
https://github.com/scummvm/scummvm/commit/e1c83f8e8707abb268b3536c2993bcdd9dfee25e
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2018-06-03T17:43:30+01:00
Commit Message:
WIN32: Move Windows-specific implementation of getSystemLanguage out of OSystem_SDL
Changed paths:
backends/platform/sdl/sdl.cpp
backends/platform/sdl/win32/win32.cpp
backends/platform/sdl/win32/win32.h
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index 72af6d5..f9affa0 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -436,27 +436,7 @@ void OSystem_SDL::logMessage(LogMessageType::Type type, const char *message) {
}
Common::String OSystem_SDL::getSystemLanguage() const {
-#if defined(USE_DETECTLANG) && !defined(_WIN32_WCE)
-#ifdef WIN32
- // We can not use "setlocale" (at least not for MSVC builds), since it
- // will return locales like: "English_USA.1252", thus we need a special
- // way to determine the locale string for Win32.
- char langName[9];
- char ctryName[9];
-
- const LCID languageIdentifier = GetUserDefaultUILanguage();
-
- if (GetLocaleInfo(languageIdentifier, LOCALE_SISO639LANGNAME, langName, sizeof(langName)) != 0 &&
- GetLocaleInfo(languageIdentifier, LOCALE_SISO3166CTRYNAME, ctryName, sizeof(ctryName)) != 0) {
- Common::String localeName = langName;
- localeName += "_";
- localeName += ctryName;
-
- return localeName;
- } else {
- return ModularBackend::getSystemLanguage();
- }
-#else // WIN32
+#if defined(USE_DETECTLANG) && !defined(WIN32)
// Activating current locale settings
const Common::String locale = setlocale(LC_ALL, "");
@@ -484,7 +464,6 @@ Common::String OSystem_SDL::getSystemLanguage() const {
return Common::String(locale.c_str(), length);
}
-#endif // WIN32
#else // USE_DETECTLANG
return ModularBackend::getSystemLanguage();
#endif // USE_DETECTLANG
diff --git a/backends/platform/sdl/win32/win32.cpp b/backends/platform/sdl/win32/win32.cpp
index 073ad74..f262ff0 100644
--- a/backends/platform/sdl/win32/win32.cpp
+++ b/backends/platform/sdl/win32/win32.cpp
@@ -150,6 +150,31 @@ bool OSystem_Win32::openUrl(const Common::String &url) {
return true;
}
+Common::String OSystem_Win32::getSystemLanguage() const {
+#if defined(USE_DETECTLANG) && defined(USE_TRANSLATION)
+ // We can not use "setlocale" (at least not for MSVC builds), since it
+ // will return locales like: "English_USA.1252", thus we need a special
+ // way to determine the locale string for Win32.
+ char langName[9];
+ char ctryName[9];
+
+ const LCID languageIdentifier = GetUserDefaultUILanguage();
+
+ if (GetLocaleInfo(languageIdentifier, LOCALE_SISO639LANGNAME, langName, sizeof(langName)) != 0 &&
+ GetLocaleInfo(languageIdentifier, LOCALE_SISO3166CTRYNAME, ctryName, sizeof(ctryName)) != 0) {
+ Common::String localeName = langName;
+ localeName += "_";
+ localeName += ctryName;
+
+ return localeName;
+ } else {
+ return ModularBackend::getSystemLanguage();
+ }
+#endif // USE_DETECTLANG
+ // Falback to SDL implementation
+ return OSystem_SDL::getSystemLanguage();
+}
+
Common::String OSystem_Win32::getScreenshotsPath() {
Common::String screenshotsPath = ConfMan.get("screenshotpath");
if (!screenshotsPath.empty()) {
diff --git a/backends/platform/sdl/win32/win32.h b/backends/platform/sdl/win32/win32.h
index 6764a7f..8523345 100644
--- a/backends/platform/sdl/win32/win32.h
+++ b/backends/platform/sdl/win32/win32.h
@@ -38,6 +38,8 @@ public:
virtual bool openUrl(const Common::String &url);
+ virtual Common::String getSystemLanguage() const;
+
virtual Common::String getScreenshotsPath();
protected:
Commit: ada05fd726f5e02a79f2de457241b614e33c7745
https://github.com/scummvm/scummvm/commit/ada05fd726f5e02a79f2de457241b614e33c7745
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2018-06-03T17:43:30+01:00
Commit Message:
WIN32: Move Windows-specific implementation of logMessage out of OSystem_SDL
Changed paths:
backends/platform/sdl/sdl.cpp
backends/platform/sdl/win32/win32.cpp
backends/platform/sdl/win32/win32.h
backends/platform/wince/wince-sdl.cpp
backends/platform/wince/wince-sdl.h
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index f9affa0..63f1e97 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -22,12 +22,6 @@
#define FORBIDDEN_SYMBOL_ALLOW_ALL
-#ifdef WIN32
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#undef ARRAYSIZE // winnt.h defines ARRAYSIZE, but we want our own one...
-#endif
-
#include "backends/platform/sdl/sdl.h"
#include "common/config-manager.h"
#include "gui/EventRecorder.h"
@@ -412,27 +406,6 @@ void OSystem_SDL::logMessage(LogMessageType::Type type, const char *message) {
// Then log into file (via the logger)
if (_logger)
_logger->print(message);
-
- // Finally, some Windows / WinCE specific logging code.
-#if defined( USE_WINDBG )
-#if defined( _WIN32_WCE )
- TCHAR buf_unicode[1024];
- MultiByteToWideChar(CP_ACP, 0, message, strlen(message) + 1, buf_unicode, sizeof(buf_unicode));
- OutputDebugString(buf_unicode);
-
- if (type == LogMessageType::kError) {
-#ifndef DEBUG
- drawError(message);
-#else
- int cmon_break_into_the_debugger_if_you_please = *(int *)(message + 1); // bus error
- printf("%d", cmon_break_into_the_debugger_if_you_please); // don't optimize the int out
-#endif
- }
-
-#else
- OutputDebugString(message);
-#endif
-#endif
}
Common::String OSystem_SDL::getSystemLanguage() const {
diff --git a/backends/platform/sdl/win32/win32.cpp b/backends/platform/sdl/win32/win32.cpp
index f262ff0..bcaa6e4 100644
--- a/backends/platform/sdl/win32/win32.cpp
+++ b/backends/platform/sdl/win32/win32.cpp
@@ -150,6 +150,14 @@ bool OSystem_Win32::openUrl(const Common::String &url) {
return true;
}
+void OSystem_Win32::logMessage(LogMessageType::Type type, const char *message) {
+ OSystem_SDL::logMessage(type, message);
+
+#if defined( USE_WINDBG )
+ OutputDebugString(message);
+#endif
+}
+
Common::String OSystem_Win32::getSystemLanguage() const {
#if defined(USE_DETECTLANG) && defined(USE_TRANSLATION)
// We can not use "setlocale" (at least not for MSVC builds), since it
diff --git a/backends/platform/sdl/win32/win32.h b/backends/platform/sdl/win32/win32.h
index 8523345..bee160f 100644
--- a/backends/platform/sdl/win32/win32.h
+++ b/backends/platform/sdl/win32/win32.h
@@ -38,6 +38,8 @@ public:
virtual bool openUrl(const Common::String &url);
+ virtual void logMessage(LogMessageType::Type type, const char *message);
+
virtual Common::String getSystemLanguage() const;
virtual Common::String getScreenshotsPath();
diff --git a/backends/platform/wince/wince-sdl.cpp b/backends/platform/wince/wince-sdl.cpp
index 02853b5..f03068f 100644
--- a/backends/platform/wince/wince-sdl.cpp
+++ b/backends/platform/wince/wince-sdl.cpp
@@ -623,6 +623,25 @@ void OSystem_WINCE3::getTimeAndDate(TimeDate &t) const {
t.tm_wday = systime.wDayOfWeek;
}
+void OSystem_WINCE3::logMessage(LogMessageType::Type type, const char *message) {
+ OSystem_SDL::logMessage(type, message);
+
+#if defined( USE_WINDBG )
+ TCHAR buf_unicode[1024];
+ MultiByteToWideChar(CP_ACP, 0, message, strlen(message) + 1, buf_unicode, sizeof(buf_unicode));
+ OutputDebugString(buf_unicode);
+
+ if (type == LogMessageType::kError) {
+#ifndef DEBUG
+ drawError(message);
+#else
+ int cmon_break_into_the_debugger_if_you_please = *(int *)(message + 1); // bus error
+ printf("%d", cmon_break_into_the_debugger_if_you_please); // don't optimize the int out
+#endif
+ }
+#endif
+}
+
Common::String OSystem_WINCE3::getSystemLanguage() const {
#ifdef USE_DETECTLANG
// We can not use "setlocale" (at least not for MSVC builds), since it
diff --git a/backends/platform/wince/wince-sdl.h b/backends/platform/wince/wince-sdl.h
index 2d5a02a..1fbdbde 100644
--- a/backends/platform/wince/wince-sdl.h
+++ b/backends/platform/wince/wince-sdl.h
@@ -54,6 +54,7 @@ public:
// Overloaded from SDL backend
void init();
void quit();
+ virtual void logMessage(LogMessageType::Type type, const char *message);
virtual Common::String getSystemLanguage() const;
// Overloaded from OSystem
Commit: 478d7b2ee7f74c888a44ac71300893981e53dd7b
https://github.com/scummvm/scummvm/commit/478d7b2ee7f74c888a44ac71300893981e53dd7b
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2018-06-03T17:43:30+01:00
Commit Message:
WIN32: Fix fallback in getSystemLanguage
Changed paths:
backends/platform/sdl/win32/win32.cpp
diff --git a/backends/platform/sdl/win32/win32.cpp b/backends/platform/sdl/win32/win32.cpp
index bcaa6e4..930b453 100644
--- a/backends/platform/sdl/win32/win32.cpp
+++ b/backends/platform/sdl/win32/win32.cpp
@@ -175,8 +175,6 @@ Common::String OSystem_Win32::getSystemLanguage() const {
localeName += ctryName;
return localeName;
- } else {
- return ModularBackend::getSystemLanguage();
}
#endif // USE_DETECTLANG
// Falback to SDL implementation
More information about the Scummvm-git-logs
mailing list