diff --git a/love/build.gradle b/love/build.gradle index fcb9b78f..5190119b 100644 --- a/love/build.gradle +++ b/love/build.gradle @@ -54,4 +54,5 @@ dependencies { repositories { google() + jcenter() } diff --git a/love/src/jni/love/.hg_archival.txt b/love/src/jni/love/.hg_archival.txt index 6cd43b02..99118211 100644 --- a/love/src/jni/love/.hg_archival.txt +++ b/love/src/jni/love/.hg_archival.txt @@ -1,4 +1,4 @@ repo: d362ae6ab7f5005b8dbc7cba9ce592637de60f99 -node: 0ab246b5045d2e697a516fcc0f8b12496a2d5c78 +node: 55dc225ee239c15eff5751d35ca40252588abd92 branch: default -tag: 11.1 +tag: 11.2 diff --git a/love/src/jni/love/.hgtags b/love/src/jni/love/.hgtags index f13b2da1..5c3c1f98 100644 --- a/love/src/jni/love/.hgtags +++ b/love/src/jni/love/.hgtags @@ -12,3 +12,4 @@ a5e405cdf14d030b71d09a105086797942ae91a9 0.9.2 3cb3559eebb89803c0b7fa83d51d8e48a2b20b7a 0.10.1 afc69c4f714534c64e6f8c8660b724b5b736d7f3 0.10.2 bf8892ecbd07a10453c4bb36aa538b90a2830d2b 11.0 +0ab246b5045d2e697a516fcc0f8b12496a2d5c78 11.1 diff --git a/love/src/jni/love/CMakeLists.txt b/love/src/jni/love/CMakeLists.txt index fbe61b2e..5a447bc6 100755 --- a/love/src/jni/love/CMakeLists.txt +++ b/love/src/jni/love/CMakeLists.txt @@ -66,6 +66,10 @@ endif() message(STATUS "Target platform: ${LOVE_TARGET_PLATFORM}") +if(POLICY CMP0072) + cmake_policy(SET CMP0072 NEW) +endif() + find_package(OpenGL) if(MEGA) @@ -174,6 +178,8 @@ Please see http://bitbucket.org/rude/megasource find_package(SDL2 REQUIRED) find_package(Theora REQUIRED) find_package(Vorbis REQUIRED) + find_package(ZLIB REQUIRED) + find_package(Ogg REQUIRED) # required for enet add_definitions(-D HAS_SOCKLEN_T) @@ -182,6 +188,11 @@ Please see http://bitbucket.org/rude/megasource ${SDL2_INCLUDE_DIR} ${FREETYPE_INCLUDE_DIRS} ${VORBIS_INCLUDE_DIR} + ${OPENAL_INCLUDE_DIR} + ${ZLIB_INCLUDE_DIRS} + ${MODPLUG_INCLUDE_DIR} + ${OGG_INCLUDE_DIR} + ${THEORA_INCLUDE_DIR} ) set(LOVE_LINK_LIBRARIES @@ -194,14 +205,20 @@ Please see http://bitbucket.org/rude/megasource ${THEORADEC_LIBRARY} ${VORBISFILE_LIBRARY} ${LOVE_LUA_LIBRARY} + ${OGG_LIBRARY} + ${ZLIB_LIBRARY} ) - + if(LOVE_MPG123) find_package(MPG123 REQUIRED) set(LOVE_LINK_LIBRARIES ${LOVE_LINK_LIBRARIES} ${MPG123_LIBRARY} ) + set(LOVE_INCLUDE_DIRS + ${LOVE_INCLUDE_DIRS} + ${MPG123_INCLUDE_DIR} + ) endif() if(LOVE_JIT) diff --git a/love/src/jni/love/changes.txt b/love/src/jni/love/changes.txt index 22074210..95a96e0d 100644 --- a/love/src/jni/love/changes.txt +++ b/love/src/jni/love/changes.txt @@ -1,3 +1,21 @@ +LOVE 11.2 [Mysterious Mysteries] +-------------------------------- + +Released: 2018-11-25 + +* Added Source:setAirAbsorption and Source:getAirAbsorption. +* Added Body:setTransform and Body:getTransform. + +* Improved performance of love.graphics.draw slightly on iOS and Android. + +* Fixed filesystem initialization on Windows 10 update 1809. +* Fixed compatibility with Lua 5.2 and 5.3. +* Fixed the explicit format + Data argument variant of love.data.decompress. +* Fixed love.joystick.setGamepadMapping not being able to change existing mappings. +* Fixed a crash on quit on Linux if a custom cursor is active when quitting. +* Fixed a crash in the Data variant of Shader:send when it's called after love.window.setMode. +* Fixed a love.graphics.setCanvas error message to be less confusing. + LOVE 11.1 [Mysterious Mysteries] -------------------------------- diff --git a/love/src/jni/love/extra/appveyor/appveyor.yml b/love/src/jni/love/extra/appveyor/appveyor.yml index 5f659f78..e731ca61 100644 --- a/love/src/jni/love/extra/appveyor/appveyor.yml +++ b/love/src/jni/love/extra/appveyor/appveyor.yml @@ -1,4 +1,4 @@ -version: 11.1.{build} +version: 11.2.{build} image: Visual Studio 2013 diff --git a/love/src/jni/love/extra/cmake/FindLuaJIT.cmake b/love/src/jni/love/extra/cmake/FindLuaJIT.cmake index a4841019..14b03b6c 100644 --- a/love/src/jni/love/extra/cmake/FindLuaJIT.cmake +++ b/love/src/jni/love/extra/cmake/FindLuaJIT.cmake @@ -11,7 +11,7 @@ set(LUAJIT_SEARCH_PATHS find_path(LUAJIT_INCLUDE_DIR NAMES luajit.h - PATH_SUFFIXES include include/luajit-2.0 + PATH_SUFFIXES include include/luajit-2.0 include/luajit-2.1 PATHS ${LUAJIT_SEARCH_PATHS}) find_library(LUAJIT_LIBRARY diff --git a/love/src/jni/love/extra/windows/love.rc b/love/src/jni/love/extra/windows/love.rc index 91482de6..66a57118 100644 Binary files a/love/src/jni/love/extra/windows/love.rc and b/love/src/jni/love/extra/windows/love.rc differ diff --git a/love/src/jni/love/platform/unix/configure.ac b/love/src/jni/love/platform/unix/configure.ac index d08119fd..781680c4 100644 --- a/love/src/jni/love/platform/unix/configure.ac +++ b/love/src/jni/love/platform/unix/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([love], [11.1]) +AC_INIT([love], [11.2]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_AUX_DIR([platform/unix]) AC_CONFIG_MACRO_DIR([platform/unix/m4]) @@ -63,6 +63,7 @@ ACLOVE_DEP_LUA ACLOVE_DEP_SDL2 ACLOVE_DEP_LIBM ACLOVE_DEP_ZLIB +ACLOVE_DEP_PTHREAD # Conditional dependencies AS_VAR_IF([enable_module_audio], [yes], [ACLOVE_DEP_OPENAL], []) diff --git a/love/src/jni/love/platform/unix/debian/changelog.in b/love/src/jni/love/platform/unix/debian/changelog.in index a3837ad0..1d528841 100644 --- a/love/src/jni/love/platform/unix/debian/changelog.in +++ b/love/src/jni/love/platform/unix/debian/changelog.in @@ -1,5 +1,5 @@ -love@LOVE_SUFFIX@ (0.11.0~pre3420ppa3) trusty; urgency=medium +love@LOVE_SUFFIX@ (11.2~pre3458ppa1) trusty; urgency=medium * Upstream testing release - -- Bart van Strien Sat, 31 Mar 2018 13:50:30 +0200 + -- Bart van Strien Tue, 10 Jul 2018 19:22:30 +0200 diff --git a/love/src/jni/love/platform/unix/debian/control.in b/love/src/jni/love/platform/unix/debian/control.in index 5ac5178c..1f65c293 100644 --- a/love/src/jni/love/platform/unix/debian/control.in +++ b/love/src/jni/love/platform/unix/debian/control.in @@ -35,7 +35,8 @@ Description: 2D game engine - runtime Package: love@LOVE_SUFFIX@ Architecture: any Depends: ${misc:Depends}, - ${shlibs:Depends} + ${shlibs:Depends}, + liblove@LOVE_SUFFIX@0 (= ${binary:Version}) Description: 2D game engine LOVE is a free 2D game engine which enables easy game creation in Lua. diff --git a/love/src/jni/love/platform/unix/deps.m4 b/love/src/jni/love/platform/unix/deps.m4 index 0a108bc6..42938d96 100644 --- a/love/src/jni/love/platform/unix/deps.m4 +++ b/love/src/jni/love/platform/unix/deps.m4 @@ -22,6 +22,9 @@ AC_DEFUN([ACLOVE_DEP_LIBM], [ AC_DEFUN([ACLOVE_DEP_SDL2], [ AM_PATH_SDL2([], [], [LOVE_MSG_ERROR([SDL 2])])]) +AC_DEFUN([ACLOVE_DEP_PTHREAD], [ + AC_SEARCH_LIBS([pthread_create], [pthread], [], [LOVE_MSG_ERROR([the POSIX threads library])])]) + # does not use pkg-config because of the FILE_OFFSET_BITS.. bit AC_DEFUN([ACLOVE_DEP_MPG123], [ AC_SEARCH_LIBS([mpg123_open_feed], [mpg123], [], diff --git a/love/src/jni/love/platform/unix/love.6 b/love/src/jni/love/platform/unix/love.6 index 2123c37a..bc029c92 100644 --- a/love/src/jni/love/platform/unix/love.6 +++ b/love/src/jni/love/platform/unix/love.6 @@ -12,7 +12,7 @@ .\" 3. This notice may not be removed or altered from any source distribution. .Dd March 31, 2018 .Dt LOVE 6 -.Os LÖVE 11.1 +.Os LÖVE 11.2 .Sh NAME .Nm love .Nd 2D game development framework diff --git a/love/src/jni/love/platform/xcode/ios/love-ios.plist b/love/src/jni/love/platform/xcode/ios/love-ios.plist index 0c57052c..3aabf729 100644 --- a/love/src/jni/love/platform/xcode/ios/love-ios.plist +++ b/love/src/jni/love/platform/xcode/ios/love-ios.plist @@ -40,7 +40,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 11.1 + 11.2 CFBundleSignature ???? CFBundleVersion diff --git a/love/src/jni/love/platform/xcode/liblove.xcodeproj/project.pbxproj b/love/src/jni/love/platform/xcode/liblove.xcodeproj/project.pbxproj index bc8125ff..663a17ed 100644 --- a/love/src/jni/love/platform/xcode/liblove.xcodeproj/project.pbxproj +++ b/love/src/jni/love/platform/xcode/liblove.xcodeproj/project.pbxproj @@ -1081,7 +1081,6 @@ FADF543D1E3DAFF700012CC0 /* wrap_Graphics.h in Headers */ = {isa = PBXBuildFile; fileRef = FADF543A1E3DAFF700012CC0 /* wrap_Graphics.h */; }; FAE272521C05A15B00A67640 /* ParticleSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAE272501C05A15B00A67640 /* ParticleSystem.cpp */; }; FAE272531C05A15B00A67640 /* ParticleSystem.h in Headers */ = {isa = PBXBuildFile; fileRef = FAE272511C05A15B00A67640 /* ParticleSystem.h */; }; - FAE64A7E2071359C00BC7981 /* libfreetype.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FAE64A7D2071359C00BC7981 /* libfreetype.a */; }; FAE64A7F207135AD00BC7981 /* libfreetype.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FAE64A7D2071359C00BC7981 /* libfreetype.a */; }; FAE64A802071362A00BC7981 /* physfs_archiver_7z.c in Sources */ = {isa = PBXBuildFile; fileRef = FAC7CD5D1FE35E95006A60C7 /* physfs_archiver_7z.c */; }; FAE64A812071363100BC7981 /* physfs_archiver_dir.c in Sources */ = {isa = PBXBuildFile; fileRef = FAC7CD6C1FE35E95006A60C7 /* physfs_archiver_dir.c */; }; @@ -2079,7 +2078,6 @@ FA9B4A0816E1578300074F42 /* SDL2.framework in Frameworks */, FAAFF04416CB11C700CCDE45 /* OpenAL-Soft.framework in Frameworks */, FAD43ECC1FF312D800831BB8 /* freetype.framework in Frameworks */, - FAE64A7E2071359C00BC7981 /* libfreetype.a in Frameworks */, FA577AB016C7507900860150 /* Cocoa.framework in Frameworks */, FA577AC516C7513400860150 /* libmodplug.framework in Frameworks */, FA577AC716C7513A00860150 /* mpg123.framework in Frameworks */, @@ -4125,7 +4123,7 @@ 08FB7793FE84155DC02AAC07 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0920; + LastUpgradeCheck = 1000; TargetAttributes = { FA0B78DC1A958B90000E1D17 = { CreatedOnToolsVersion = 6.1.1; @@ -4966,12 +4964,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = NO; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -5026,12 +5026,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = NO; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -5214,12 +5216,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = NO; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; diff --git a/love/src/jni/love/platform/xcode/love.xcodeproj/project.pbxproj b/love/src/jni/love/platform/xcode/love.xcodeproj/project.pbxproj index e7d27316..b1721a5c 100644 --- a/love/src/jni/love/platform/xcode/love.xcodeproj/project.pbxproj +++ b/love/src/jni/love/platform/xcode/love.xcodeproj/project.pbxproj @@ -326,7 +326,7 @@ 29B97313FDCFA39411CA2CEA /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0920; + LastUpgradeCheck = 1000; TargetAttributes = { FA0B7F051A95AAF3000E1D17 = { CreatedOnToolsVersion = 6.1.1; @@ -503,11 +503,13 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; @@ -580,11 +582,13 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; @@ -806,11 +810,13 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; diff --git a/love/src/jni/love/platform/xcode/macosx/liblove-macosx.plist b/love/src/jni/love/platform/xcode/macosx/liblove-macosx.plist index 94af9b3c..45d74da4 100644 --- a/love/src/jni/love/platform/xcode/macosx/liblove-macosx.plist +++ b/love/src/jni/love/platform/xcode/macosx/liblove-macosx.plist @@ -17,7 +17,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 11.1 + 11.2 CFBundleSignature LoVe NSPrincipalClass diff --git a/love/src/jni/love/platform/xcode/macosx/love-macosx.plist b/love/src/jni/love/platform/xcode/macosx/love-macosx.plist index 1ad5f9f8..8a6a7720 100644 --- a/love/src/jni/love/platform/xcode/macosx/love-macosx.plist +++ b/love/src/jni/love/platform/xcode/macosx/love-macosx.plist @@ -62,7 +62,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 11.1 + 11.2 CFBundleSignature LoVe LSApplicationCategoryType diff --git a/love/src/jni/love/src/common/Matrix.cpp b/love/src/jni/love/src/common/Matrix.cpp index 8af267ca..8e3940e3 100644 --- a/love/src/jni/love/src/common/Matrix.cpp +++ b/love/src/jni/love/src/common/Matrix.cpp @@ -29,6 +29,10 @@ #include #endif +#if defined(LOVE_SIMD_NEON) +#include +#endif + namespace love { @@ -43,9 +47,6 @@ namespace love void Matrix4::multiply(const Matrix4 &a, const Matrix4 &b, float t[16]) { - // NOTE: in my testing with ARM NEON instructions (on an iPhone 6 with arm64) - // it performed slightly worse than the regular add/multiply code. Further - // investigation would be useful. #if defined(LOVE_SIMD_SSE) // We can't guarantee 16-bit alignment (e.g. for heap-allocated Matrix4 @@ -70,6 +71,38 @@ void Matrix4::multiply(const Matrix4 &a, const Matrix4 &b, float t[16]) _mm_storeu_ps(&t[4*i], col); } +#elif defined(LOVE_SIMD_NEON) + + float32x4_t cola1 = vld1q_f32(&a.e[0]); + float32x4_t cola2 = vld1q_f32(&a.e[4]); + float32x4_t cola3 = vld1q_f32(&a.e[8]); + float32x4_t cola4 = vld1q_f32(&a.e[12]); + + float32x4_t col1 = vmulq_n_f32(cola1, b.e[0]); + col1 = vmlaq_n_f32(col1, cola2, b.e[1]); + col1 = vmlaq_n_f32(col1, cola3, b.e[2]); + col1 = vmlaq_n_f32(col1, cola4, b.e[3]); + + float32x4_t col2 = vmulq_n_f32(cola1, b.e[4]); + col2 = vmlaq_n_f32(col2, cola2, b.e[5]); + col2 = vmlaq_n_f32(col2, cola3, b.e[6]); + col2 = vmlaq_n_f32(col2, cola4, b.e[7]); + + float32x4_t col3 = vmulq_n_f32(cola1, b.e[8]); + col3 = vmlaq_n_f32(col3, cola2, b.e[9]); + col3 = vmlaq_n_f32(col3, cola3, b.e[10]); + col3 = vmlaq_n_f32(col3, cola4, b.e[11]); + + float32x4_t col4 = vmulq_n_f32(cola1, b.e[12]); + col4 = vmlaq_n_f32(col4, cola2, b.e[13]); + col4 = vmlaq_n_f32(col4, cola3, b.e[14]); + col4 = vmlaq_n_f32(col4, cola4, b.e[15]); + + vst1q_f32(&t[0], col1); + vst1q_f32(&t[4], col2); + vst1q_f32(&t[8], col3); + vst1q_f32(&t[12], col4); + #else t[0] = (a.e[0]*b.e[0]) + (a.e[4]*b.e[1]) + (a.e[8]*b.e[2]) + (a.e[12]*b.e[3]); diff --git a/love/src/jni/love/src/common/StringMap.cpp b/love/src/jni/love/src/common/StringMap.cpp index 520ef08d..97d1e98a 100644 --- a/love/src/jni/love/src/common/StringMap.cpp +++ b/love/src/jni/love/src/common/StringMap.cpp @@ -22,4 +22,3 @@ // See the header template class std::vector; -template decltype(std::vector().emplace_back("")) std::vector::emplace_back(const char *const&); diff --git a/love/src/jni/love/src/common/StringMap.h b/love/src/jni/love/src/common/StringMap.h index c9cbc24e..31ef640c 100644 --- a/love/src/jni/love/src/common/StringMap.h +++ b/love/src/jni/love/src/common/StringMap.h @@ -30,7 +30,6 @@ // getNames(), we end up with multiple copies in the object files. This // declaration means we only emit it once (in StringMap.cpp). extern template class std::vector; -extern template decltype(std::vector().emplace_back("")) std::vector::emplace_back(const char *const&); namespace love { diff --git a/love/src/jni/love/src/common/android.cpp b/love/src/jni/love/src/common/android.cpp index 8e758852..022ed0e6 100644 --- a/love/src/jni/love/src/common/android.cpp +++ b/love/src/jni/love/src/common/android.cpp @@ -123,14 +123,14 @@ bool openURL(const std::string &url) JNIEnv *env = (JNIEnv*) SDL_AndroidGetJNIEnv(); jclass activity = env->FindClass("org/love2d/android/GameActivity"); - jmethodID openURL= env->GetStaticMethodID(activity, "openURL", "(Ljava/lang/String;)V"); + jmethodID openURL = env->GetStaticMethodID(activity, "openURL", "(Ljava/lang/String;)Z"); jstring url_jstring = (jstring) env->NewStringUTF(url.c_str()); - env->CallStaticVoidMethod(activity, openURL, url_jstring); + jboolean result = env->CallStaticBooleanMethod(activity, openURL, url_jstring); env->DeleteLocalRef(url_jstring); env->DeleteLocalRef(activity); - return true; + return result; } void vibrate(double seconds) diff --git a/love/src/jni/love/src/common/runtime.cpp b/love/src/jni/love/src/common/runtime.cpp index 23d0e986..e3415e1c 100644 --- a/love/src/jni/love/src/common/runtime.cpp +++ b/love/src/jni/love/src/common/runtime.cpp @@ -879,4 +879,13 @@ Type *luax_type(lua_State *L, int idx) return Type::byName(luaL_checkstring(L, idx)); } +int luax_resume(lua_State *L, int nargs) +{ +#if LUA_VERSION_NUM >= 502 + return lua_resume(L, nullptr, nargs); +#else + return lua_resume(L, nargs); +#endif +} + } // love diff --git a/love/src/jni/love/src/common/runtime.h b/love/src/jni/love/src/common/runtime.h index eee50cc1..90cacbb9 100644 --- a/love/src/jni/love/src/common/runtime.h +++ b/love/src/jni/love/src/common/runtime.h @@ -676,6 +676,12 @@ int luax_catchexcept(lua_State *L, const T& func, const F& finallyfunc) return 0; } +/** + * Compatibility shim for lua_resume + * Exported because it's used in the launcher + **/ +LOVE_EXPORT int luax_resume(lua_State *L, int nargs); + } // love #endif // LOVE_RUNTIME_H diff --git a/love/src/jni/love/src/common/version.h b/love/src/jni/love/src/common/version.h index 23e5f777..14f913f4 100644 --- a/love/src/jni/love/src/common/version.h +++ b/love/src/jni/love/src/common/version.h @@ -25,12 +25,12 @@ namespace love { // Version stuff. -#define LOVE_VERSION_STRING "11.1" +#define LOVE_VERSION_STRING "11.2" static const int VERSION_MAJOR = 11; -static const int VERSION_MINOR = 1; +static const int VERSION_MINOR = 2; static const int VERSION_REV = 0; static const char *VERSION = LOVE_VERSION_STRING; -static const char *VERSION_COMPATIBILITY[] = { VERSION, "11.0", 0 }; +static const char *VERSION_COMPATIBILITY[] = { VERSION, "11.0", "11.1", 0 }; static const char *VERSION_CODENAME = "Mysterious Mysteries"; } // love diff --git a/love/src/jni/love/src/libraries/physfs/physfs_platform_windows.c b/love/src/jni/love/src/libraries/physfs/physfs_platform_windows.c index e777235d..4f8c99a6 100644 --- a/love/src/jni/love/src/libraries/physfs/physfs_platform_windows.c +++ b/love/src/jni/love/src/libraries/physfs/physfs_platform_windows.c @@ -566,7 +566,6 @@ char *__PHYSFS_platformCalcUserDir(void) else { DWORD psize = 0; - WCHAR dummy = 0; LPWSTR wstr = NULL; BOOL rc = 0; @@ -575,7 +574,14 @@ char *__PHYSFS_platformCalcUserDir(void) * psize. Also note that the second parameter can't be * NULL or the function fails. */ - rc = pGetDir(accessToken, &dummy, &psize); + /* + * EDIT: (03.10.2018) after Windows 10 Update 1809 psize will be zero + * if something other than NULL is passed for the second argument. + * Passing NULL now makes GetUserProfileDirectoryW fail (rc == 0) + * and psize receives the correct user directory length. + * It seems to work fine on Windows 7 and Windows 10 Update 1803 too + */ + rc = pGetDir(accessToken, NULL, &psize); GOTO_IF(rc, PHYSFS_ERR_OS_ERROR, done); /* should have failed! */ /* Allocate memory for the profile directory */ diff --git a/love/src/jni/love/src/love.cpp b/love/src/jni/love/src/love.cpp index a4a2444c..913d8b13 100644 --- a/love/src/jni/love/src/love.cpp +++ b/love/src/jni/love/src/love.cpp @@ -19,6 +19,7 @@ **/ #include "common/version.h" +#include "common/runtime.h" #include "modules/love/love.h" #include @@ -214,7 +215,7 @@ static DoneAction runlove(int argc, char **argv, int &retval) lua_newthread(L); lua_pushvalue(L, -2); int stackpos = lua_gettop(L); - while (lua_resume(L, 0) == LUA_YIELD) + while (love::luax_resume(L, 0) == LUA_YIELD) lua_pop(L, lua_gettop(L) - stackpos); retval = 0; diff --git a/love/src/jni/love/src/modules/audio/wrap_Source.cpp b/love/src/jni/love/src/modules/audio/wrap_Source.cpp index 273b48f0..e9b1b1e9 100644 --- a/love/src/jni/love/src/modules/audio/wrap_Source.cpp +++ b/love/src/jni/love/src/modules/audio/wrap_Source.cpp @@ -338,6 +338,13 @@ int w_Source_setAirAbsorption(lua_State *L) return 0; } +int w_Source_getAirAbsorption(lua_State *L) +{ + Source *t = luax_checksource(L, 1); + luax_catchexcept(L, [&](){ lua_pushnumber(L, t->getAirAbsorptionFactor()); }); + return 1; +} + int w_Source_getChannelCount(lua_State *L) { Source *t = luax_checksource(L, 1); @@ -628,6 +635,8 @@ static const luaL_Reg w_Source_functions[] = { "getAttenuationDistances", w_Source_getAttenuationDistances }, { "setRolloff", w_Source_setRolloff }, { "getRolloff", w_Source_getRolloff }, + { "setAirAbsorption", w_Source_setAirAbsorption }, + { "getAirAbsorption", w_Source_getAirAbsorption }, { "getChannelCount", w_Source_getChannelCount }, diff --git a/love/src/jni/love/src/modules/data/wrap_DataModule.cpp b/love/src/jni/love/src/modules/data/wrap_DataModule.cpp index f9e6e936..770a0b0a 100644 --- a/love/src/jni/love/src/modules/data/wrap_DataModule.cpp +++ b/love/src/jni/love/src/modules/data/wrap_DataModule.cpp @@ -171,7 +171,7 @@ int w_decompress(lua_State *L) if (luax_istype(L, 3, Data::type)) { - Data *data = luax_checktype(L, 2); + Data *data = luax_checktype(L, 3); cbytes = (const char *) data->getData(); compressedsize = data->getSize(); } diff --git a/love/src/jni/love/src/modules/graphics/StreamBuffer.cpp b/love/src/jni/love/src/modules/graphics/StreamBuffer.cpp index 2564c7cb..a9889764 100644 --- a/love/src/jni/love/src/modules/graphics/StreamBuffer.cpp +++ b/love/src/jni/love/src/modules/graphics/StreamBuffer.cpp @@ -28,6 +28,7 @@ namespace graphics StreamBuffer::StreamBuffer(BufferType mode, size_t size) : bufferSize(size) + , frameGPUReadOffset(0) , mode(mode) { } diff --git a/love/src/jni/love/src/modules/graphics/StreamBuffer.h b/love/src/jni/love/src/modules/graphics/StreamBuffer.h index 5157d2ab..461f02a2 100644 --- a/love/src/jni/love/src/modules/graphics/StreamBuffer.h +++ b/love/src/jni/love/src/modules/graphics/StreamBuffer.h @@ -54,8 +54,8 @@ public: size_t getSize() const { return bufferSize; } BufferType getMode() const { return mode; } + size_t getUsableSize() const { return bufferSize - frameGPUReadOffset; } - virtual size_t getUsableSize() const = 0; virtual MapInfo map(size_t minsize) = 0; virtual size_t unmap(size_t usedsize) = 0; virtual void markUsed(size_t usedsize) = 0; @@ -67,6 +67,7 @@ protected: StreamBuffer(BufferType mode, size_t size); size_t bufferSize; + size_t frameGPUReadOffset; BufferType mode; }; // StreamBuffer diff --git a/love/src/jni/love/src/modules/graphics/opengl/FenceSync.h b/love/src/jni/love/src/modules/graphics/opengl/FenceSync.h index ae5bab78..7e3de34e 100644 --- a/love/src/jni/love/src/modules/graphics/opengl/FenceSync.h +++ b/love/src/jni/love/src/modules/graphics/opengl/FenceSync.h @@ -38,7 +38,7 @@ class FenceSync { public: - FenceSync() {} + FenceSync() : sync(0) {} ~FenceSync(); bool fence(); diff --git a/love/src/jni/love/src/modules/graphics/opengl/Shader.cpp b/love/src/jni/love/src/modules/graphics/opengl/Shader.cpp index 8972d97c..4445fa30 100644 --- a/love/src/jni/love/src/modules/graphics/opengl/Shader.cpp +++ b/love/src/jni/love/src/modules/graphics/opengl/Shader.cpp @@ -148,6 +148,7 @@ void Shader::mapActiveUniforms() if (oldu != olduniforms.end()) { u.data = oldu->second.data; + u.dataSize = oldu->second.dataSize; u.textures = oldu->second.textures; updateUniform(&u, u.count, true); diff --git a/love/src/jni/love/src/modules/graphics/opengl/StreamBuffer.cpp b/love/src/jni/love/src/modules/graphics/opengl/StreamBuffer.cpp index 4a3a8e7e..b425be3a 100644 --- a/love/src/jni/love/src/modules/graphics/opengl/StreamBuffer.cpp +++ b/love/src/jni/love/src/modules/graphics/opengl/StreamBuffer.cpp @@ -62,11 +62,6 @@ public: delete[] data; } - size_t getUsableSize() const override - { - return bufferSize; - } - MapInfo map(size_t /*minsize*/) override { return MapInfo(data, bufferSize); @@ -96,7 +91,6 @@ public: , glMode(OpenGL::getGLBufferType(mode)) , data(nullptr) , offset(0) - , frameOffset(0) { try { @@ -116,17 +110,12 @@ public: delete[] data; } - size_t getUsableSize() const override - { - return bufferSize - frameOffset; - } - MapInfo map(size_t minsize) override { if (offset + minsize > bufferSize) { offset = 0; - frameOffset = 0; + frameGPUReadOffset = 0; gl.bindBuffer(mode, vbo); glBufferData(glMode, bufferSize, nullptr, GL_STREAM_DRAW); } @@ -144,12 +133,12 @@ public: void markUsed(size_t usedsize) override { offset += usedsize; - frameOffset += usedsize; + frameGPUReadOffset += usedsize; } void nextFrame() override { - frameOffset = 0; + frameGPUReadOffset = 0; } ptrdiff_t getHandle() const override { return vbo; } @@ -164,7 +153,7 @@ public: glBufferData(glMode, bufferSize, nullptr, GL_STREAM_DRAW); offset = 0; - frameOffset = 0; + frameGPUReadOffset = 0; return true; } @@ -186,7 +175,6 @@ protected: uint8 *data; size_t offset; - size_t frameOffset; }; // StreamBufferSubDataOrphan @@ -198,7 +186,6 @@ public: : love::graphics::StreamBuffer(type, size) , syncSize((size + MAX_SYNCS_PER_FRAME - 1) / MAX_SYNCS_PER_FRAME) , frameIndex(0) - , frameGPUReadOffset(0) , syncs() {} @@ -231,7 +218,6 @@ protected: const size_t syncSize; int frameIndex; - size_t frameGPUReadOffset; FenceSync syncs[MAX_SYNCS_PER_FRAME * BUFFER_FRAMES]; @@ -259,11 +245,6 @@ public: unloadVolatile(); } - size_t getUsableSize() const override - { - return bufferSize - frameGPUReadOffset; - } - MapInfo map(size_t /*minsize*/) override { gl.bindBuffer(mode, vbo); @@ -351,11 +332,6 @@ public: unloadVolatile(); } - size_t getUsableSize() const override - { - return bufferSize - frameGPUReadOffset; - } - MapInfo map(size_t /*minsize*/) override { MapInfo info; @@ -454,11 +430,6 @@ public: alignedFree(data); } - size_t getUsableSize() const override - { - return bufferSize - frameGPUReadOffset; - } - MapInfo map(size_t /*minsize*/) override { MapInfo info; diff --git a/love/src/jni/love/src/modules/graphics/wrap_Graphics.cpp b/love/src/jni/love/src/modules/graphics/wrap_Graphics.cpp index eb4367b6..4f5f7828 100644 --- a/love/src/jni/love/src/modules/graphics/wrap_Graphics.cpp +++ b/love/src/jni/love/src/modules/graphics/wrap_Graphics.cpp @@ -290,7 +290,7 @@ int w_setCanvas(lua_State *L) targets.colors.emplace_back(luax_checkcanvas(L, -1), 0); if (targets.colors.back().canvas->getTextureType() != TEXTURE_2D) - return luaL_error(L, "The table-of-tables variant of setCanvas must be used with non-2D Canvases."); + return luaL_error(L, "Non-2D canvases must use the table-of-tables variant of setCanvas."); } lua_pop(L, 1); diff --git a/love/src/jni/love/src/modules/joystick/sdl/JoystickModule.cpp b/love/src/jni/love/src/modules/joystick/sdl/JoystickModule.cpp index 393d6032..3a4a9ae0 100644 --- a/love/src/jni/love/src/modules/joystick/sdl/JoystickModule.cpp +++ b/love/src/jni/love/src/modules/joystick/sdl/JoystickModule.cpp @@ -356,7 +356,7 @@ void JoystickModule::checkGamepads(const std::string &guid) const for (auto stick : activeSticks) { - if (stick->isGamepad() || guid.compare(stick->getGUID()) != 0) + if (guid.compare(stick->getGUID()) != 0) continue; // Big hack time: open the index as a game controller and compare @@ -365,12 +365,15 @@ void JoystickModule::checkGamepads(const std::string &guid) const if (controller == nullptr) continue; + // GameController objects are reference-counted in SDL, so we don't want to + // have a joystick open when trying to re-initialize it SDL_Joystick *sdlstick = SDL_GameControllerGetJoystick(controller); - if (sdlstick == (SDL_Joystick *) stick->getHandle()) - stick->openGamepad(d_index); - - // GameController objects are reference-counted in SDL. + bool open_gamepad = (sdlstick == (SDL_Joystick *) stick->getHandle()); SDL_GameControllerClose(controller); + + // open as gamepad if necessary + if (open_gamepad) + stick->openGamepad(d_index); } } } diff --git a/love/src/jni/love/src/modules/mouse/sdl/Mouse.cpp b/love/src/jni/love/src/modules/mouse/sdl/Mouse.cpp index cc026ce6..802cdaa0 100644 --- a/love/src/jni/love/src/modules/mouse/sdl/Mouse.cpp +++ b/love/src/jni/love/src/modules/mouse/sdl/Mouse.cpp @@ -57,6 +57,9 @@ const char *Mouse::getName() const Mouse::Mouse() : curCursor(nullptr) { + // SDL may need the video subsystem in order to clean up the cursor when + // quitting. Subsystems are reference-counted. + SDL_InitSubSystem(SDL_INIT_VIDEO); } Mouse::~Mouse() @@ -66,6 +69,8 @@ Mouse::~Mouse() for (auto &c : systemCursors) c.second->release(); + + SDL_QuitSubSystem(SDL_INIT_VIDEO); } love::mouse::Cursor *Mouse::newCursor(love::image::ImageData *data, int hotx, int hoty) diff --git a/love/src/jni/love/src/modules/physics/box2d/wrap_Body.cpp b/love/src/jni/love/src/modules/physics/box2d/wrap_Body.cpp index c2bdcfec..16787c59 100644 --- a/love/src/jni/love/src/modules/physics/box2d/wrap_Body.cpp +++ b/love/src/jni/love/src/modules/physics/box2d/wrap_Body.cpp @@ -69,6 +69,19 @@ int w_Body_getPosition(lua_State *L) return 2; } +int w_Body_getTransform(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + + float x_o, y_o; + t->getPosition(x_o, y_o); + lua_pushnumber(L, x_o); + lua_pushnumber(L, y_o); + lua_pushnumber(L, t->getAngle()); + + return 3; +} + int w_Body_getLinearVelocity(lua_State *L) { Body *t = luax_checkbody(L, 1); @@ -253,6 +266,19 @@ int w_Body_setY(lua_State *L) return 0; } +int w_Body_setTransform(lua_State *L) +{ + Body *t = luax_checkbody(L, 1); + float x = (float)luaL_checknumber(L, 2); + float y = (float)luaL_checknumber(L, 3); + float angle = (float)luaL_checknumber(L, 4); + luax_catchexcept(L, [&](){ + t->setPosition(x, y); + t->setAngle(angle); + }); + return 0; +} + int w_Body_setLinearVelocity(lua_State *L) { Body *t = luax_checkbody(L, 1); @@ -617,6 +643,8 @@ static const luaL_Reg w_Body_functions[] = { "getY", w_Body_getY }, { "getAngle", w_Body_getAngle }, { "getPosition", w_Body_getPosition }, + { "getTransform", w_Body_getTransform }, + { "setTransform", w_Body_setTransform }, { "getLinearVelocity", w_Body_getLinearVelocity }, { "getWorldCenter", w_Body_getWorldCenter }, { "getLocalCenter", w_Body_getLocalCenter },