Commit Graph

541 Commits

Author SHA1 Message Date
Bart van Strien 4b6756049b Add support for lua 5.4 to-be-closed variables
Automatically call object:release() when an object is used as a to-be-closed variable.

Since both release and __gc already handle multiple calls, this just works.
Theoretically extra actions could be added to some objects, like File calling File:close(), but it already does that in its destructor, so that should be unnecessary.
2024-03-30 13:16:21 +01:00
Sasha Szpakowski 2bdadf51d4 Merge branch 'main' into SDL3 2024-03-24 18:53:08 -03:00
Sasha Szpakowski 95796caa06 improve performance of love.graphics.draw's Lua binding code. 2024-03-20 18:36:59 -03:00
Miku AuahDark 9eacd483c6 Android: Fixed assets/game.love fusing not being recognized.
Fixes love2d/love-android#267.
2024-03-19 22:24:45 +08:00
Sasha Szpakowski be377601f7 vulkan: shader binding mapper works with arrays of resources 2024-03-09 13:07:23 -04:00
Sasha Szpakowski 1e97e09b28 Rework internal module registration to happen in constructors. 2024-02-24 15:21:38 -04:00
Sasha Szpakowski ae6800e0e0 Add Data:performAtomic to lock a mutex while using a Data object. 2024-02-18 17:07:24 -04:00
Sasha Szpakowski 1084d94f90 Fix missing sRGB<->Linear pixel format swaps for DXT and BC formats. 2024-02-17 13:16:10 -04:00
Sasha Szpakowski 64a30f177f Merge branch 'main' into 12.0-development 2024-02-10 12:24:48 -04:00
Sasha Szpakowski 94d5864144 update year for copyright notice 2024-02-10 12:13:22 -04:00
Sasha Szpakowski 62ac858f30 Initial source code support for SDL3. No build system support. 2024-02-04 17:02:26 -04:00
Sasha Szpakowski 8951635abc Merge branch 'main' into 12.0-development 2023-12-02 13:40:49 -04:00
Sewbacca 11d4bdd1a3 Add support for MinGW 2023-11-26 15:00:34 +01:00
Sasha Szpakowski 99e7022d2d iOS: alphabetically sort .love file list.
Fixes #1984.
2023-11-18 13:44:41 -04:00
Miku AuahDark 81393b9aed Android: Fixed invalid JNIEnv* pointer when starting up love.filesystem for 2nd time. 2023-11-15 12:19:06 +08:00
Sasha Szpakowski 5a0a6a1a27 All constructors for making a TrueType font take an optional settings table.
This supersedes the existing optional hinting and dpi scale parameters. The table's fields are:
{
  hinting = "normal",
  dpiscale = 1, -- nil will default to the current window DPI scale.
}
2023-10-20 20:19:30 -03:00
Sasha Szpakowski 8c13943f64 ImageData can track whether they're meant to be loaded into a Texture with a non-sRGB format when gamma correct rendering is enabled.
Fixes #1556.

* Add ImageData/CompressedImageData:setLinear and ImageData/CompressedImageData:isLinear.
  The flag is used as a hint when loading a texture from the data to determine if the format should not be treated as sRGB-encoded. The 'linear' flag in newImage overrides this.

* love.graphics.readbackTexture automatically sets the linear flag on ImageData it returns when the texture's format is linear.
  This allows an ImageData generated via readback to be fed back into a new Texture and the format will match the original Canvas.

* Also clean up some image decoding code.
2023-10-14 20:48:21 -03:00
Sasha Szpakowski 343d192f10 Compressed texture formats have explicit sRGB variants 2023-10-14 15:01:01 -03:00
Sasha Szpakowski ac9ae82524 love.physics: simplify Body and Shape API.
#1130

- Shapes are now directly attached to Bodies when they're created (similar to love 0.7 and older).
- Fixtures are removed.
- All methods that were in Fixtures now exist in Shapes.
- All APIs that used or returned a Fixture now do the same with a Shape.

- Add new love.physics.new*Shape variants that take a Body as the first parameter.
- Deprecate the new*Shape APIs that don't take a Body.
- Deprecate love.physics.newFixture (the deprecated function now returns a Shape).
- Replace Body:getFixture and Body:getFixtures with Body:getShape and Body:getShapes (Body:getFixtures is deprecated).
- Replace World:queryFixturesInArea and World:getFixturesInArea with World:queryShapesInArea and World:getShapesInArea (queryFixturesInArea is deprecated).
- Replace Contact:getFixtures with Contact:getShapes (Contact:getFixtures is deprecated).
- Replace all love.physics callback Fixture parameters with Shape parameters.
- Deprecate ChainShape:getChildEdge.
2023-10-07 15:17:24 -03:00
Sasha Szpakowski 6e80d85110 Merge branch 'main' into 12.0-development 2023-08-19 21:35:55 -03:00
Miku AuahDark e559fd5e68 Pass pointer of PHYSFS_AndroidInit struct in Android when initializing PhysFS. 2023-06-01 15:33:04 +08:00
Miku AuahDark e9c564e989 Use new PhysfsIo class for Android AAsset wrapper. 2023-06-01 15:10:43 +08:00
Miku AuahDark 4cd0bc0de4 Improve full-lightuserdata check on 32-bit platforms.
On 32-bit platforms, full-lightuserdata is always supported since their pointer fits entirely in 2^48 limitation that LuaJIT had in older version.

Also suppress warning about key > 0x20000000000000ULL is always false on enet.cpp when compiling on 32-bit platforms.
2023-05-23 11:12:34 +08:00
Miku AuahDark f7432bd2d4 Swap alignment workaround from processor to ternary operator. 2023-05-23 10:55:01 +08:00
Miku AuahDark c8e7d4e28a Change the usage of constexpr to const.
VS2013 doesn't support them.
2023-05-03 19:05:01 +08:00
Miku AuahDark 4ab9a1ce8c Workaround alignment issue in Linux 32-bit platforms.
Apparently geting alignment right pre-C++17 is not easy.
Well, 2^32 fits entirely in Lua "double" 2^53 so it's fine
to assume alignment of 1.

Fixes #1916.
2023-04-19 16:26:06 +08:00
Sasha Szpakowski 78e7c44424 update version 2023-04-15 09:37:22 -03:00
slime f6e9277a6d macOS: fix colors appearing oversaturated on P3 displays.
The fix only applies to macOS 11+ when using OpenGL.
2023-04-13 22:03:23 -03:00
Sasha Szpakowski 95d44c2c2d very minor compile speed improvements 2023-02-11 16:29:24 -04:00
Sasha Szpakowski f6cdbdc868 Merge branch 'main' into 12.0-development 2022-12-31 22:46:34 -04:00
Sasha Szpakowski 0b75f6cfa5 Missed some files... 2022-12-31 22:36:48 -04:00
Sasha Szpakowski c823dbca96 Update copyright year for 2023 2022-12-31 22:25:49 -04:00
Sasha Szpakowski 456f897e43 Merge branch 'main' into 12.0-development 2022-12-29 12:12:28 -04:00
Sasha Szpakowski b4e9731dfb Add LOVE_EXPORT to a couple macOS functions called from the exe. 2022-12-29 10:27:52 -04:00
Miku AuahDark c342339fee Define LOVE_EXPORT on non-Windows.
With GCC or Clang, LOVE_EXPORT is defined as __attribute__((visibility("default"))).
2022-12-28 13:51:08 +08:00
Sasha Szpakowski 5fe40be724 Fix compilation 2022-12-26 22:29:50 -04:00
Sasha Szpakowski 7137c3ffb7 Remove #ifdefs supporting old Visual Studio versions. 2022-12-26 22:22:14 -04:00
Miku AuahDark 1fa9159f04 Register love.sensor module. 2022-12-05 14:33:11 +08:00
Miku AuahDark 8f7eac4fde Initial sensor module. 2022-12-05 13:33:04 +08:00
slime 6173c1638d macOS: fix colors appearing oversaturated on P3 displays.
The fix only applies to macOS 11+ when using OpenGL.
2022-09-30 15:17:46 -03:00
niki a93d153792 vulkan: adjust code styling 2022-09-10 17:40:46 +02:00
nikeinikei deb2ea9435 Update config.h 2022-08-20 22:04:23 +02:00
niki 23666b1fde vulkan: fix android build
It compiles now, but it's not working correctly yet
2022-08-20 19:38:59 +02:00
niki 51e3cf2a9c vulkan: enable linux
Some basic testing reveals that it works
just like the windows build.
2022-08-19 23:41:04 +02:00
niki 7be9bb3ecc vulkan: implement vsync setting 2022-08-19 21:40:21 +02:00
niki f4ece69307 Merge remote-tracking branch 'origin/12.0-development' into vulkan 2022-08-15 03:43:35 +02:00
niki 9b7cfef5ef vulkan: implement setScissor 2022-07-16 23:19:24 +02:00
niki 565455c3ea proper selection of vulkan renderer 2022-07-10 03:46:12 +02:00
niki 0cea07806f use different uniform buffers for each draw call 2022-06-30 18:42:49 +02:00
Alex Szpakowski 69c4a496dd Fix a few minor compiler warnings 2022-06-18 17:59:55 -03:00