From 4ef7504c05cd2dd355f3ae278a24fd186e20d643 Mon Sep 17 00:00:00 2001 From: T-Bone Date: Sat, 9 Apr 2016 07:28:03 +0200 Subject: [PATCH] Fixed things pointed out by Alex Szpakowski and Bart von Strien --- src/modules/filesystem/physfs/Filesystem.cpp | 2 +- src/modules/love/love.cpp | 2 +- src/modules/sound/lullaby/Mpg123Decoder.cpp | 4 ++-- src/modules/sound/lullaby/Mpg123Decoder.h | 4 ++-- src/modules/sound/lullaby/Sound.cpp | 12 ++++++------ src/modules/system/System.cpp | 12 ++++++++++-- 6 files changed, 22 insertions(+), 14 deletions(-) diff --git a/src/modules/filesystem/physfs/Filesystem.cpp b/src/modules/filesystem/physfs/Filesystem.cpp index 9c4a1edff..4d19d58fd 100644 --- a/src/modules/filesystem/physfs/Filesystem.cpp +++ b/src/modules/filesystem/physfs/Filesystem.cpp @@ -521,7 +521,7 @@ std::string Filesystem::getAppdataDirectory() { #ifdef LOVE_WINDOWS_UWP appdata = getUserDirectory(); -#elif LOVE_WINDOWS +#elif defined(LOVE_WINDOWS) wchar_t *w_appdata = _wgetenv(L"APPDATA"); appdata = to_utf8(w_appdata); replace_char(appdata, '\\', '/'); diff --git a/src/modules/love/love.cpp b/src/modules/love/love.cpp index f18b944b5..64d3d4586 100644 --- a/src/modules/love/love.cpp +++ b/src/modules/love/love.cpp @@ -308,7 +308,7 @@ int luaopen_love(lua_State *L) lua_setfield(L, -2, "isVersionCompatible"); #ifdef LOVE_WINDOWS_UWP - lua_pushstring(L, "Universal Windows Platform"); + lua_pushstring(L, "UWP"); #elif LOVE_WINDOWS lua_pushstring(L, "Windows"); #elif defined(LOVE_MACOSX) diff --git a/src/modules/sound/lullaby/Mpg123Decoder.cpp b/src/modules/sound/lullaby/Mpg123Decoder.cpp index 5a6845ddd..9f622d848 100644 --- a/src/modules/sound/lullaby/Mpg123Decoder.cpp +++ b/src/modules/sound/lullaby/Mpg123Decoder.cpp @@ -24,7 +24,7 @@ #include -#ifndef LOVE_NO_MPG123 +#ifndef LOVE_NOMPG123 namespace love { @@ -289,4 +289,4 @@ double Mpg123Decoder::getDuration() } // sound } // love -#endif // LOVE_NO_MPG123 \ No newline at end of file +#endif // LOVE_NOMPG123 \ No newline at end of file diff --git a/src/modules/sound/lullaby/Mpg123Decoder.h b/src/modules/sound/lullaby/Mpg123Decoder.h index c30b1f203..edb3b139d 100644 --- a/src/modules/sound/lullaby/Mpg123Decoder.h +++ b/src/modules/sound/lullaby/Mpg123Decoder.h @@ -25,7 +25,7 @@ #include "common/Data.h" #include "Decoder.h" -#ifndef LOVE_NO_MPG123 +#ifndef LOVE_NOMPG123 // libmpg123 #ifdef LOVE_APPLE_USE_FRAMEWORKS @@ -90,6 +90,6 @@ private: } // sound } // love -#endif // LOVE_NO_MPG123 +#endif // LOVE_NOMPG123 #endif // LOVE_SOUND_LULLABY_LIBMPG123_DECODER_H diff --git a/src/modules/sound/lullaby/Sound.cpp b/src/modules/sound/lullaby/Sound.cpp index b161cbe31..e2a8866d8 100644 --- a/src/modules/sound/lullaby/Sound.cpp +++ b/src/modules/sound/lullaby/Sound.cpp @@ -30,9 +30,9 @@ #include "WaveDecoder.h" //#include "FLACDecoder.h" -#ifndef LOVE_NO_MPG123 +#ifndef LOVE_NOMPG123 # include "Mpg123Decoder.h" -#endif // LOVE_NO_MPG123 +#endif // LOVE_NOMPG123 #ifdef LOVE_SUPPORT_COREAUDIO # include "CoreAudioDecoder.h" @@ -51,9 +51,9 @@ Sound::Sound() Sound::~Sound() { -#ifndef LOVE_NO_MPG123 +#ifndef LOVE_NOMPG123 Mpg123Decoder::quit(); -#endif // LOVE_NO_MPG123 +#endif // LOVE_NOMPG123 } const char *Sound::getName() const @@ -75,10 +75,10 @@ sound::Decoder *Sound::newDecoder(love::filesystem::FileData *data, int bufferSi else if (ModPlugDecoder::accepts(ext)) decoder = new ModPlugDecoder(data, ext, bufferSize); #endif // LOVE_NO_MODPLUG -#ifndef LOVE_NO_MPG123 +#ifndef LOVE_NOMPG123 else if (Mpg123Decoder::accepts(ext)) decoder = new Mpg123Decoder(data, ext, bufferSize); -#endif // LOVE_NO_MPG123 +#endif // LOVE_NOMPG123 else if (VorbisDecoder::accepts(ext)) decoder = new VorbisDecoder(data, ext, bufferSize); #ifdef LOVE_SUPPORT_GME diff --git a/src/modules/system/System.cpp b/src/modules/system/System.cpp index 00c5ff1b6..5ad391188 100755 --- a/src/modules/system/System.cpp +++ b/src/modules/system/System.cpp @@ -83,6 +83,8 @@ std::string System::getOS() const return "OS X"; #elif defined(LOVE_IOS) return "iOS"; +#elif defined(LOVE_WINDOWS_UWP) + return "UWP"; #elif defined(LOVE_WINDOWS) return "Windows"; #elif defined(LOVE_ANDROID) @@ -149,7 +151,13 @@ bool System::openURL(const std::string &url) const HINSTANCE result = 0; - #if !defined(LOVE_WINDOWS_UWP) +#if defined(LOVE_WINDOWS_UWP) + + Platform::String^ urlString = ref new Platform::String(wurl.c_str()); + auto uwpUri = ref new Windows::Foundation::Uri(urlString); + Windows::System::Launcher::LaunchUriAsync(uwpUri); + +#else result = ShellExecuteW(nullptr, L"open", @@ -158,7 +166,7 @@ bool System::openURL(const std::string &url) const nullptr, SW_SHOW); - #endif // LOVE_WINDOWS_UWP +#endif return (int) result > 32;