From b2291fb62a37357bc280f32e33f78d07999ecbe5 Mon Sep 17 00:00:00 2001 From: T-Bone Date: Thu, 7 Apr 2016 22:56:03 +0200 Subject: [PATCH 01/15] =?UTF-8?q?Fixes=20to=20make=20L=C3=B6ve=20compile?= =?UTF-8?q?=20on=20Windows=2010=20UWP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/config.h | 7 +++++++ src/modules/filesystem/physfs/Filesystem.cpp | 4 +++- src/modules/filesystem/physfs/Filesystem.h | 2 +- src/modules/love/love.cpp | 4 +++- 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 | 18 ++++++++++++------ src/modules/window/sdl/Window.cpp | 11 +++++++++-- 9 files changed, 49 insertions(+), 17 deletions(-) diff --git a/src/common/config.h b/src/common/config.h index fae5daf25..d520331bd 100644 --- a/src/common/config.h +++ b/src/common/config.h @@ -24,6 +24,11 @@ // Platform stuff. #if defined(WIN32) || defined(_WIN32) # define LOVE_WINDOWS 1 +#if WINAPI_FAMILY==WINAPI_FAMILY_APP +# define LOVE_WINDOWS_UWP 1 +# define LOVE_NO_MODPLUG 1 +# define LOVE_NO_MPG123 1 +#endif #endif #if defined(linux) || defined(__linux) || defined(__linux__) # define LOVE_LINUX 1 @@ -76,7 +81,9 @@ #endif #if defined(LOVE_WINDOWS) +#ifndef LOVE_WINDOWS_UWP # define LOVE_LEGENDARY_CONSOLE_IO_HACK +#endif // LOVE_WINDOWS_UWP # define NOMINMAX #endif diff --git a/src/modules/filesystem/physfs/Filesystem.cpp b/src/modules/filesystem/physfs/Filesystem.cpp index 85dfc274d..9c4a1edff 100644 --- a/src/modules/filesystem/physfs/Filesystem.cpp +++ b/src/modules/filesystem/physfs/Filesystem.cpp @@ -519,7 +519,9 @@ std::string Filesystem::getAppdataDirectory() { if (appdata.empty()) { -#ifdef LOVE_WINDOWS +#ifdef LOVE_WINDOWS_UWP + appdata = getUserDirectory(); +#elif LOVE_WINDOWS wchar_t *w_appdata = _wgetenv(L"APPDATA"); appdata = to_utf8(w_appdata); replace_char(appdata, '\\', '/'); diff --git a/src/modules/filesystem/physfs/Filesystem.h b/src/modules/filesystem/physfs/Filesystem.h index 5d279da49..fcb207d1e 100644 --- a/src/modules/filesystem/physfs/Filesystem.h +++ b/src/modules/filesystem/physfs/Filesystem.h @@ -62,7 +62,7 @@ public: bool mount(const char *archive, const char *mountpoint, bool appendToPath = false); bool unmount(const char *archive); - File *newFile(const char *filename) const; + love::filesystem::File *newFile(const char *filename) const; FileData *newFileData(void *data, unsigned int size, const char *filename) const; FileData *newFileData(const char *b64, const char *filename) const; diff --git a/src/modules/love/love.cpp b/src/modules/love/love.cpp index 5aef38064..f18b944b5 100644 --- a/src/modules/love/love.cpp +++ b/src/modules/love/love.cpp @@ -307,7 +307,9 @@ int luaopen_love(lua_State *L) lua_pushcfunction(L, w_love_isVersionCompatible); lua_setfield(L, -2, "isVersionCompatible"); -#ifdef LOVE_WINDOWS +#ifdef LOVE_WINDOWS_UWP + lua_pushstring(L, "Universal Windows Platform"); +#elif LOVE_WINDOWS lua_pushstring(L, "Windows"); #elif defined(LOVE_MACOSX) lua_pushstring(L, "OS X"); diff --git a/src/modules/sound/lullaby/Mpg123Decoder.cpp b/src/modules/sound/lullaby/Mpg123Decoder.cpp index 96f5d2ef1..5a6845ddd 100644 --- a/src/modules/sound/lullaby/Mpg123Decoder.cpp +++ b/src/modules/sound/lullaby/Mpg123Decoder.cpp @@ -24,6 +24,8 @@ #include +#ifndef LOVE_NO_MPG123 + namespace love { namespace sound @@ -286,3 +288,5 @@ double Mpg123Decoder::getDuration() } // lullaby } // sound } // love + +#endif // LOVE_NO_MPG123 \ No newline at end of file diff --git a/src/modules/sound/lullaby/Mpg123Decoder.h b/src/modules/sound/lullaby/Mpg123Decoder.h index 81fa1d24c..c30b1f203 100644 --- a/src/modules/sound/lullaby/Mpg123Decoder.h +++ b/src/modules/sound/lullaby/Mpg123Decoder.h @@ -25,6 +25,8 @@ #include "common/Data.h" #include "Decoder.h" +#ifndef LOVE_NO_MPG123 + // libmpg123 #ifdef LOVE_APPLE_USE_FRAMEWORKS #include @@ -88,4 +90,6 @@ private: } // sound } // love +#endif // LOVE_NO_MPG123 + #endif // LOVE_SOUND_LULLABY_LIBMPG123_DECODER_H diff --git a/src/modules/sound/lullaby/Sound.cpp b/src/modules/sound/lullaby/Sound.cpp index e2a8866d8..b161cbe31 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_NOMPG123 +#ifndef LOVE_NO_MPG123 # include "Mpg123Decoder.h" -#endif // LOVE_NOMPG123 +#endif // LOVE_NO_MPG123 #ifdef LOVE_SUPPORT_COREAUDIO # include "CoreAudioDecoder.h" @@ -51,9 +51,9 @@ Sound::Sound() Sound::~Sound() { -#ifndef LOVE_NOMPG123 +#ifndef LOVE_NO_MPG123 Mpg123Decoder::quit(); -#endif // LOVE_NOMPG123 +#endif // LOVE_NO_MPG123 } 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_NOMPG123 +#ifndef LOVE_NO_MPG123 else if (Mpg123Decoder::accepts(ext)) decoder = new Mpg123Decoder(data, ext, bufferSize); -#endif // LOVE_NOMPG123 +#endif // LOVE_NO_MPG123 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 aa15571ea..00c5ff1b6 100755 --- a/src/modules/system/System.cpp +++ b/src/modules/system/System.cpp @@ -147,12 +147,18 @@ bool System::openURL(const std::string &url) const // Unicode-aware WinAPI functions don't accept UTF-8, so we need to convert. std::wstring wurl = to_widestr(url); - HINSTANCE result = ShellExecuteW(nullptr, - L"open", - wurl.c_str(), - nullptr, - nullptr, - SW_SHOW); + HINSTANCE result = 0; + + #if !defined(LOVE_WINDOWS_UWP) + + result = ShellExecuteW(nullptr, + L"open", + wurl.c_str(), + nullptr, + nullptr, + SW_SHOW); + + #endif // LOVE_WINDOWS_UWP return (int) result > 32; diff --git a/src/modules/window/sdl/Window.cpp b/src/modules/window/sdl/Window.cpp index 2b66608ee..dca71fd18 100644 --- a/src/modules/window/sdl/Window.cpp +++ b/src/modules/window/sdl/Window.cpp @@ -229,7 +229,14 @@ bool Window::createWindowAndContext(int x, int y, int w, int h, Uint32 windowfla }; // OpenGL ES 3+ contexts are only properly supported in SDL 2.0.4+. - if (hasSDL203orEarlier) + bool removeES3 = hasSDL203orEarlier; + + // While UWP SDL is above 2.0.4, it still doesn't support OpenGL ES 3+ +#ifdef LOVE_WINDOWS_UWP + removeES3 = true; +#endif + + if (removeES3) { auto it = attribslist.begin(); while (it != attribslist.end()) @@ -1019,7 +1026,7 @@ int Window::showMessageBox(const MessageBoxData &data) void Window::requestAttention(bool continuous) { -#if defined(LOVE_WINDOWS) +#if defined(LOVE_WINDOWS) && !defined(LOVE_WINDOWS_UWP) if (hasFocus()) return; From 4ef7504c05cd2dd355f3ae278a24fd186e20d643 Mon Sep 17 00:00:00 2001 From: T-Bone Date: Sat, 9 Apr 2016 07:28:03 +0200 Subject: [PATCH 02/15] 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; From c12005b4bb20fe6652dc4ed11acbc0a72bc6e0b9 Mon Sep 17 00:00:00 2001 From: T-Bone Date: Sun, 10 Apr 2016 06:29:58 +0200 Subject: [PATCH 03/15] Forgot one LOVE_NOMPG123. --- src/common/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/config.h b/src/common/config.h index d520331bd..1dfa5ffe8 100644 --- a/src/common/config.h +++ b/src/common/config.h @@ -27,7 +27,7 @@ #if WINAPI_FAMILY==WINAPI_FAMILY_APP # define LOVE_WINDOWS_UWP 1 # define LOVE_NO_MODPLUG 1 -# define LOVE_NO_MPG123 1 +# define LOVE_NOMPG123 1 #endif #endif #if defined(linux) || defined(__linux) || defined(__linux__) From 08671ae48e0e122d47787d6c2f9e8803b4a0d43c Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Sun, 10 Apr 2016 15:51:50 +0000 Subject: [PATCH 04/15] Fix building for Windows desktop --- src/common/config.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/common/config.h b/src/common/config.h index 1dfa5ffe8..049a09f66 100644 --- a/src/common/config.h +++ b/src/common/config.h @@ -24,6 +24,7 @@ // Platform stuff. #if defined(WIN32) || defined(_WIN32) # define LOVE_WINDOWS 1 +# include #if WINAPI_FAMILY==WINAPI_FAMILY_APP # define LOVE_WINDOWS_UWP 1 # define LOVE_NO_MODPLUG 1 From 2cbaa7b3ae4fb5e8b736e6094bcd5f9c4978a027 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Sun, 10 Apr 2016 15:59:03 +0000 Subject: [PATCH 05/15] Better fix, hopefully --- src/common/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/config.h b/src/common/config.h index 049a09f66..e08da2709 100644 --- a/src/common/config.h +++ b/src/common/config.h @@ -25,7 +25,7 @@ #if defined(WIN32) || defined(_WIN32) # define LOVE_WINDOWS 1 # include -#if WINAPI_FAMILY==WINAPI_FAMILY_APP +#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) # define LOVE_WINDOWS_UWP 1 # define LOVE_NO_MODPLUG 1 # define LOVE_NOMPG123 1 From ef5411e8eec117287fcec6a45e5ed16408ebd6eb Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Sun, 10 Apr 2016 21:58:03 +0000 Subject: [PATCH 06/15] Fix building for Windows XP. --- src/common/config.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/common/config.h b/src/common/config.h index e08da2709..8bb43bab3 100644 --- a/src/common/config.h +++ b/src/common/config.h @@ -24,18 +24,21 @@ // Platform stuff. #if defined(WIN32) || defined(_WIN32) # define LOVE_WINDOWS 1 + // If _USING_V110_SDK71_ is defined it means we are using the xp toolset. +# if defined(_MSC_VER) && (_MSC_VER >= 1700) && !_USING_V110_SDK71_ # include -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) -# define LOVE_WINDOWS_UWP 1 -# define LOVE_NO_MODPLUG 1 -# define LOVE_NOMPG123 1 -#endif +# if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) +# define LOVE_WINDOWS_UWP 1 +# define LOVE_NO_MODPLUG 1 +# define LOVE_NOMPG123 1 +# endif +# endif #endif #if defined(linux) || defined(__linux) || defined(__linux__) -# define LOVE_LINUX 1 +# define LOVE_LINUX 1 #endif #if defined(__ANDROID__) -# define LOVE_ANDROID 1 +# define LOVE_ANDROID 1 #endif #if defined(__APPLE__) # include From 9701e2a26252bbdbbae5885cc177b9a24410eac2 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Sun, 10 Apr 2016 21:52:16 -0300 Subject: [PATCH 07/15] Fixed love on iOS 6 crashing on launch due to GameController.framework being missing (see issue #1155). Some further issues remain, for now. --- platform/xcode/love.xcodeproj/project.pbxproj | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/platform/xcode/love.xcodeproj/project.pbxproj b/platform/xcode/love.xcodeproj/project.pbxproj index a1cfe0367..3c46db730 100644 --- a/platform/xcode/love.xcodeproj/project.pbxproj +++ b/platform/xcode/love.xcodeproj/project.pbxproj @@ -17,7 +17,7 @@ A9D307F2106635D3004FEDF8 /* physfs.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = A9D307E9106635C3004FEDF8 /* physfs.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; A9F169AC109E825000FC83D1 /* mpg123.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = A9F169A6109E824900FC83D1 /* mpg123.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; A9F169AD109E825000FC83D1 /* libmodplug.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = A9F16926109E7BAD00FC83D1 /* libmodplug.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - FA0797991BF480A200034B7C /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA0797981BF480A200034B7C /* GameController.framework */; }; + FA0797991BF480A200034B7C /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA0797981BF480A200034B7C /* GameController.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; FA08F69616C766E000F007B5 /* love.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA08F69116C765A200F007B5 /* love.framework */; }; FA08F69716C766E700F007B5 /* love.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = FA08F69116C765A200F007B5 /* love.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; FA0B7F301A95AC7D000E1D17 /* love.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A93E6A3410420AC0007D418B /* love.cpp */; }; @@ -604,6 +604,7 @@ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; ENABLE_BITCODE = NO; @@ -631,6 +632,7 @@ MTL_ENABLE_DEBUG_INFO = YES; PRODUCT_BUNDLE_IDENTIFIER = org.love2d.love; PRODUCT_NAME = love; + PROVISIONING_PROFILE = ""; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -650,6 +652,7 @@ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; ENABLE_BITCODE = NO; @@ -672,6 +675,7 @@ MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_BUNDLE_IDENTIFIER = org.love2d.love; PRODUCT_NAME = love; + PROVISIONING_PROFILE = ""; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; @@ -692,6 +696,7 @@ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; ENABLE_BITCODE = NO; @@ -714,6 +719,7 @@ MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_BUNDLE_IDENTIFIER = org.love2d.love; PRODUCT_NAME = love; + PROVISIONING_PROFILE = ""; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; From aab6dbda5fdaba0fef7da25290ea0840fffa22bb Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Sun, 10 Apr 2016 22:11:28 -0300 Subject: [PATCH 08/15] Fixed love.event.quit on un-fused iOS games to properly exit to the game list instead of just restarting the current game. --- src/love.cpp | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/love.cpp b/src/love.cpp index 90543acc1..40213b404 100644 --- a/src/love.cpp +++ b/src/love.cpp @@ -174,6 +174,21 @@ static int l_print_sdl_log(lua_State *L) static int runlove(int argc, char **argv) { +#ifdef LOVE_LEGENDARY_APP_ARGV_HACK + int hack_argc = 0; + char **hack_argv = 0; + get_app_arguments(argc, argv, hack_argc, hack_argv); + argc = hack_argc; + argv = hack_argv; +#endif // LOVE_LEGENDARY_APP_ARGV_HACK + + // Oh, you just want the version? Okay! + if (argc > 1 && strcmp(argv[1], "--version") == 0) + { + printf("LOVE %s (%s)\n", love_version(), love_codename()); + return 0; + } + // Create the virtual machine. lua_State *L = luaL_newstate(); luaL_openlibs(L); @@ -238,6 +253,15 @@ static int runlove(int argc, char **argv) lua_close(L); +#if defined(LOVE_LEGENDARY_APP_ARGV_HACK) && !defined(LOVE_IOS) + if (hack_argv) + { + for (int i = 0; i 1 && strcmp(argv[1], "--version") == 0) - { - printf("LOVE %s (%s)\n", love_version(), love_codename()); - return 0; - } - #ifdef LOVE_IOS // on iOS we should never programmatically exit the app, so we'll just // "restart" when that is attempted. Games which use threads might cause @@ -277,15 +286,6 @@ int main(int argc, char **argv) retval = runlove(argc, argv); } -#if defined(LOVE_LEGENDARY_APP_ARGV_HACK) && !defined(LOVE_IOS) - if (hack_argv) - { - for (int i = 0; i Date: Thu, 14 Apr 2016 18:32:39 -0400 Subject: [PATCH 09/15] Exposed getTextureDimensions on Quad --- src/modules/graphics/wrap_Quad.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/modules/graphics/wrap_Quad.cpp b/src/modules/graphics/wrap_Quad.cpp index 2552bc4f2..d6464b950 100644 --- a/src/modules/graphics/wrap_Quad.cpp +++ b/src/modules/graphics/wrap_Quad.cpp @@ -64,10 +64,21 @@ int w_Quad_getViewport(lua_State *L) return 4; } +int w_Quad_getTextureDimensions(lua_State *L) +{ + Quad *quad = luax_checkquad(L, 1); + double sw = quad->getTextureWidth(); + double sh = quad->getTextureHeight(); + lua_pushnumber(L, sw); + lua_pushnumber(L, sh); + return 2; +} + static const luaL_Reg w_Quad_functions[] = { { "setViewport", w_Quad_setViewport }, { "getViewport", w_Quad_getViewport }, + { "getTextureDimensions", w_Quad_getTextureDimensions }, { 0, 0 } }; From 67c5eb77ae43a1581650d35d1be6e982b04c98cb Mon Sep 17 00:00:00 2001 From: EntranceJew Date: Thu, 14 Apr 2016 18:36:47 -0400 Subject: [PATCH 10/15] Put methods for getTexture* on Quad --- src/modules/graphics/Quad.cpp | 10 ++++++++++ src/modules/graphics/Quad.h | 3 +++ 2 files changed, 13 insertions(+) diff --git a/src/modules/graphics/Quad.cpp b/src/modules/graphics/Quad.cpp index 9a0ebf851..2bc656c94 100644 --- a/src/modules/graphics/Quad.cpp +++ b/src/modules/graphics/Quad.cpp @@ -79,6 +79,16 @@ Quad::Viewport Quad::getViewport() const return viewport; } +double Quad::getTextureWidth() const +{ + return sw; +} + +double Quad::getTextureHeight() const +{ + return sh; +} + const Vertex *Quad::getVertices() const { return vertices; diff --git a/src/modules/graphics/Quad.h b/src/modules/graphics/Quad.h index 15220e498..26e06f3d8 100644 --- a/src/modules/graphics/Quad.h +++ b/src/modules/graphics/Quad.h @@ -47,6 +47,9 @@ public: void setViewport(const Viewport &v); Viewport getViewport() const; + double getTextureWidth() const; + double getTextureHeight() const; + const Vertex *getVertices() const; private: From 4befa01f4a18002d0b4261f47fa7920a16848fc3 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Fri, 15 Apr 2016 22:45:34 +0000 Subject: [PATCH 11/15] Testing using an older version of NSIS in appveyor builds again --- extra/appveyor/appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/appveyor/appveyor.yml b/extra/appveyor/appveyor.yml index 03599d1e6..283dc3842 100644 --- a/extra/appveyor/appveyor.yml +++ b/extra/appveyor/appveyor.yml @@ -11,7 +11,7 @@ init: install: # We need to install NSIS to create the packaged installer executable. -- choco install nsis -pre -y +- choco install nsis -y # Move all woking directory items except `appveyor.yml` to `love` subdirectory. - md love From d28bc1f42ea946a293647e9e5f6300ff65bd680c Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Sun, 1 May 2016 21:04:01 -0300 Subject: [PATCH 12/15] Fixed a warning about a missing newline at the end of a file. --- src/modules/sound/lullaby/Mpg123Decoder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/sound/lullaby/Mpg123Decoder.cpp b/src/modules/sound/lullaby/Mpg123Decoder.cpp index 9f622d848..af4d22e5e 100644 --- a/src/modules/sound/lullaby/Mpg123Decoder.cpp +++ b/src/modules/sound/lullaby/Mpg123Decoder.cpp @@ -289,4 +289,4 @@ double Mpg123Decoder::getDuration() } // sound } // love -#endif // LOVE_NOMPG123 \ No newline at end of file +#endif // LOVE_NOMPG123 From 9bebe9e4e8899a7fc98a3500d005ff53da4b686d Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Mon, 2 May 2016 18:03:57 -0300 Subject: [PATCH 13/15] Updated the version. --- extra/windows/love.rc | Bin 3636 -> 3636 bytes platform/xcode/ios/love-ios.plist | 2 +- platform/xcode/macosx/love-macosx.plist | 2 +- src/common/version.h | 6 +++--- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/extra/windows/love.rc b/extra/windows/love.rc index 39a49950f767ba29b8514b69266c82a04947ebb4..72ed26617d73e883d8879ecb7b3d2bb3e319a2d2 100644 GIT binary patch delta 26 icmdlYvqffu1`D$hgVN+iR?*20EM<&Fo42#nasmKnK?imK delta 26 icmdlYvqffu1`D$xgVN+iR?*20EM<&_o42#nasmKnDF<`_ diff --git a/platform/xcode/ios/love-ios.plist b/platform/xcode/ios/love-ios.plist index ca19c382d..1fc317e53 100644 --- a/platform/xcode/ios/love-ios.plist +++ b/platform/xcode/ios/love-ios.plist @@ -40,7 +40,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.10.1 + 0.10.2 CFBundleSignature ???? CFBundleVersion diff --git a/platform/xcode/macosx/love-macosx.plist b/platform/xcode/macosx/love-macosx.plist index b5a9adf0e..191bbf1ab 100644 --- a/platform/xcode/macosx/love-macosx.plist +++ b/platform/xcode/macosx/love-macosx.plist @@ -56,7 +56,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.10.1 + 0.10.2 CFBundleSignature LoVe LSApplicationCategoryType diff --git a/src/common/version.h b/src/common/version.h index be23de43a..783445e4e 100644 --- a/src/common/version.h +++ b/src/common/version.h @@ -25,12 +25,12 @@ namespace love { // Version stuff. -#define LOVE_VERSION_STRING "0.10.1" +#define LOVE_VERSION_STRING "0.10.2" static const int VERSION_MAJOR = 0; static const int VERSION_MINOR = 10; -static const int VERSION_REV = 1; +static const int VERSION_REV = 2; static const char *VERSION = LOVE_VERSION_STRING; -static const char *VERSION_COMPATIBILITY[] = { VERSION, "0.10.0", 0 }; +static const char *VERSION_COMPATIBILITY[] = { VERSION, "0.10.1", "0.10.0", 0 }; static const char *VERSION_CODENAME = "Super Toast"; } // love From d6310ca87ff5cd1bc91679261335157f4f0f39a7 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Wed, 11 May 2016 21:38:12 -0300 Subject: [PATCH 14/15] Fixed glyphs being added to partially out-of-bounds positions in Font texture atlases in rare cases (resolves issue #1162). --- src/modules/graphics/opengl/Font.cpp | 29 ++++++++++------------------ 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/src/modules/graphics/opengl/Font.cpp b/src/modules/graphics/opengl/Font.cpp index 5abee2c0f..9831fff39 100644 --- a/src/modules/graphics/opengl/Font.cpp +++ b/src/modules/graphics/opengl/Font.cpp @@ -252,7 +252,7 @@ love::font::GlyphData *Font::getRasterizerGlyphData(uint32 glyph) const Font::Glyph &Font::addGlyph(uint32 glyph) { - love::font::GlyphData *gd = getRasterizerGlyphData(glyph); + StrongRef gd(getRasterizerGlyphData(glyph), Acquire::NORETAIN); int w = gd->getWidth(); int h = gd->getHeight(); @@ -264,18 +264,15 @@ const Font::Glyph &Font::addGlyph(uint32 glyph) textureY += rowHeight; rowHeight = TEXTURE_PADDING; } + if (textureY + h + TEXTURE_PADDING > textureHeight) { // totally out of space - new texture! - try - { - createTexture(); - } - catch (love::Exception &) - { - gd->release(); - throw; - } + createTexture(); + + // Makes sure the above code for checking if the glyph can fit at + // the current position in the texture is run again for this glyph. + return addGlyph(glyph); } Glyph g; @@ -318,18 +315,12 @@ const Font::Glyph &Font::addGlyph(uint32 glyph) g.vertices[i].x += gd->getBearingX(); g.vertices[i].y -= gd->getBearingY(); } + + textureX += w + TEXTURE_PADDING; + rowHeight = std::max(rowHeight, h + TEXTURE_PADDING); } - if (w > 0) - textureX += (w + TEXTURE_PADDING); - - if (h > 0) - rowHeight = std::max(rowHeight, h + TEXTURE_PADDING); - - gd->release(); - const auto p = glyphs.insert(std::make_pair(glyph, g)); - return p.first->second; } From a5334f80171abc44cc4270a2040fd67fb8ec7f5f Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Thu, 12 May 2016 18:14:36 -0300 Subject: [PATCH 15/15] Updated the changelog. --- changes.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/changes.txt b/changes.txt index 593b190f6..c092f5efc 100644 --- a/changes.txt +++ b/changes.txt @@ -4,15 +4,23 @@ LOVE 0.10.2 [Super Toast] Released: N/A * Added lovec.exe in Windows. It is the same as love.exe but built with the Console subsystem, so it always uses or provides a console. + * Added 'shaderswitches' field to the table returned by love.graphics.getStats. + * Added Quad:getTextureDimensions. + * Fixed love on iOS 6. * Fixed os.execute always returning -1 on Linux. + * Fixed a hang at the end of video playback with some video files. * Fixed the video decoding thread to not do any work when there are no videos to decode. + * Fixed a rare bug in Source:play for streaming Sources if the associated OpenAL source object was previously used for a static Source. + * Fixed corrupted Font glyphs in rare cases. * Fixed stencils inside Canvases on some OpenGL ES 2 devices. * Fixed love.window.setMode crashing when called with a Canvas active. * Fixed gamma correction of ImageFonts and BMFonts with colored images. * Fixed the default shader improperly applying gamma correction to per-vertex colors when gamma correction is requested but not supported on OpenGL ES. * Improved performance of Channel methods by roughly 2x in many cases. + + * Updated love.filesystem.mount to accept a DroppedFile as the first parameter. LOVE 0.10.1 [Super Toast]