aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/sdl/win32
diff options
context:
space:
mode:
authorThierry Crozat2016-09-09 23:51:40 +0100
committerThierry Crozat2016-09-10 01:12:42 +0100
commit1f2a50bcd354e3aae80ce4f99e50f618a7b83e3c (patch)
tree872c1e77f3264360936c029e20a9ebc6bea6d1da /backends/platform/sdl/win32
parentdff88b105885e0ed3766f5e86c0d7f606348634a (diff)
downloadscummvm-rg350-1f2a50bcd354e3aae80ce4f99e50f618a7b83e3c.tar.gz
scummvm-rg350-1f2a50bcd354e3aae80ce4f99e50f618a7b83e3c.tar.bz2
scummvm-rg350-1f2a50bcd354e3aae80ce4f99e50f618a7b83e3c.zip
CLOUD: Move openUrl to OSystem
Diffstat (limited to 'backends/platform/sdl/win32')
-rw-r--r--backends/platform/sdl/win32/win32.cpp12
-rw-r--r--backends/platform/sdl/win32/win32.h2
2 files changed, 13 insertions, 1 deletions
diff --git a/backends/platform/sdl/win32/win32.cpp b/backends/platform/sdl/win32/win32.cpp
index fcc0849624..99c71a49e0 100644
--- a/backends/platform/sdl/win32/win32.cpp
+++ b/backends/platform/sdl/win32/win32.cpp
@@ -94,7 +94,7 @@ void OSystem_Win32::initBackend() {
bool OSystem_Win32::hasFeature(Feature f) {
- if (f == kFeatureDisplayLogFile)
+ if (f == kFeatureDisplayLogFile || f == kFeatureOpenUrl)
return true;
return OSystem_SDL::hasFeature(f);
@@ -135,6 +135,16 @@ bool OSystem_Win32::displayLogFile() {
return false;
}
+bool OSystem_Win32::openUrl(const Common::String &url) {
+ const uint64 result = (uint64)ShellExecute(0, 0, /*(wchar_t*)nativeFilePath.utf16()*/url.c_str(), 0, 0, SW_SHOWNORMAL);
+ // ShellExecute returns a value greater than 32 if successful
+ if (result <= 32) {
+ warning("ShellExecute failed: error = %u", result);
+ return false;
+ }
+ return true;
+}
+
Common::String OSystem_Win32::getDefaultConfigFileName() {
char configFile[MAXPATHLEN];
diff --git a/backends/platform/sdl/win32/win32.h b/backends/platform/sdl/win32/win32.h
index ca0843e834..636ebae88f 100644
--- a/backends/platform/sdl/win32/win32.h
+++ b/backends/platform/sdl/win32/win32.h
@@ -36,6 +36,8 @@ public:
virtual bool displayLogFile();
+ virtual bool openUrl(const Common::String &url);
+
protected:
/**
* The path of the currently open log file, if any.