diff --git a/changes.txt b/changes.txt index 39cedd3b6..1cf21ab52 100644 --- a/changes.txt +++ b/changes.txt @@ -22,15 +22,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] diff --git a/extra/appveyor/appveyor.yml b/extra/appveyor/appveyor.yml index fdaf13b32..1f1a72e0c 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 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; diff --git a/src/common/config.h b/src/common/config.h index fae5daf25..8bb43bab3 100644 --- a/src/common/config.h +++ b/src/common/config.h @@ -24,12 +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 +# 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 @@ -76,7 +85,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/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 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; } 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 } }; diff --git a/src/modules/love/love.cpp b/src/modules/love/love.cpp index 5aef38064..64d3d4586 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, "UWP"); +#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..af4d22e5e 100644 --- a/src/modules/sound/lullaby/Mpg123Decoder.cpp +++ b/src/modules/sound/lullaby/Mpg123Decoder.cpp @@ -24,6 +24,8 @@ #include +#ifndef LOVE_NOMPG123 + namespace love { namespace sound @@ -286,3 +288,5 @@ double Mpg123Decoder::getDuration() } // lullaby } // sound } // love + +#endif // LOVE_NOMPG123 diff --git a/src/modules/sound/lullaby/Mpg123Decoder.h b/src/modules/sound/lullaby/Mpg123Decoder.h index 81fa1d24c..edb3b139d 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_NOMPG123 + // libmpg123 #ifdef LOVE_APPLE_USE_FRAMEWORKS #include @@ -88,4 +90,6 @@ private: } // sound } // love +#endif // LOVE_NOMPG123 + #endif // LOVE_SOUND_LULLABY_LIBMPG123_DECODER_H diff --git a/src/modules/system/System.cpp b/src/modules/system/System.cpp index aa15571ea..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) @@ -147,12 +149,24 @@ 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) + + 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", + wurl.c_str(), + nullptr, + nullptr, + SW_SHOW); + +#endif 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;