Commit Graph

4122 Commits

Author SHA1 Message Date
Sasha Szpakowski 343d192f10 Compressed texture formats have explicit sRGB variants 2023-10-14 15:01:01 -03:00
Sasha Szpakowski 9eec1754e7 opengl: fix clearing the depth buffer. 2023-10-14 10:30:51 -03:00
Sasha Szpakowski 983ea6c0e6 Remove explicit support for systems that don't support rgba8 canvases.
This is just a very small number of really old OpenGL ES 2 drivers.
2023-10-13 21:53:45 -03:00
Sasha Szpakowski 3865868358 Fix creating a linear rgba8 canvas when gamma correct rendering is on.
Fixes #1973
2023-10-13 21:41:32 -03:00
Sasha Szpakowski 37b9d7db11 Merge branch 'main' into 12.0-development 2023-10-11 22:05:55 -03:00
Sasha Szpakowski ba693500c4 Fix love.font.newBMFontRasterizer when it's given a single file param. 2023-10-11 22:05:33 -03:00
Sasha Szpakowski 86eb6df05c vulkan: don't hold onto ImageData references after loading an image.
Reduces CPU memory usage.
2023-10-09 20:22:04 -03:00
Sasha Szpakowski 90cd0be392 Merge pull request #1980 from nikeinikei/12.0-development
vk: correctly identify boolean uniforms
2023-10-09 16:17:16 -03:00
niki 88f6bb880e remove debug code 2023-10-09 20:16:01 +02:00
Sasha Szpakowski 5dc7b7d05b remove some redundant OpenGL API calls when clearing Canvases 2023-10-09 15:13:47 -03:00
Sasha Szpakowski 8958d155ab opengl: Fix blue component of love.graphics.setColorMask 2023-10-09 15:13:03 -03:00
niki 2749209fc7 vulkan: fix crash when using wrong uniform name 2023-10-09 20:12:13 +02:00
niki 88272c6855 vulkan: correctly identify boolean uniforms 2023-10-09 20:07:32 +02:00
Sasha Szpakowski 4787d50078 opengl: fix color mask 2023-10-09 14:10:24 -03:00
Sasha Szpakowski 06569b4fed Merge pull request #1979 from nikeinikei/12.0-development
vk: fix crash caused by love.window.close()
2023-10-09 13:37:30 -03:00
Sasha Szpakowski cf26e39d1b vulkan: potential fix for compressed textures with mipmaps 2023-10-09 13:13:37 -03:00
niki 21182d1428 vulkan: fix memory leak 2023-10-09 16:04:25 +02:00
niki 51d5b48515 vulkan: fix incorrect device extension 2023-10-09 15:32:17 +02:00
niki 8f8afe3de5 vulkan: fix crash when using love.window.close() 2023-10-09 15:31:23 +02:00
Sasha Szpakowski 2789e5eabf opengl: fix clearing integer format Canvases. 2023-10-08 21:36:10 -03:00
Sasha Szpakowski b8cbb62bc3 opengl: scissor and color mask no longer affects love.graphics.clear.
This makes it more consistent with other backends.
2023-10-08 21:08:59 -03:00
Sasha Szpakowski 27c4569697 love.physics: clean up some internal collision processing code 2023-10-08 14:06:55 -03:00
Sasha Szpakowski 112a09ceb7 Shape:setDensity no longer needs Body:resetMassData unless the Body already has custom mass data.
Add Body:hasCustomMassData.
If the Body has custom mass data, attaching a Shape to it doesn't automatically reset its mass data.
2023-10-08 12:43:27 -03:00
Sasha Szpakowski 1396e26626 auto.lua: fix consistency on Windows 2023-10-08 12:32:10 -03:00
Sasha Szpakowski 5b4758819e nogame screen uses non-deprecated APIs 2023-10-07 15:35:00 -03:00
Sasha Szpakowski de3a0c0142 Improve error checking in love.physics.new*Shape 2023-10-07 15:33:15 -03:00
Sasha Szpakowski a1e4b649ce Fix compile errors on macOS 2023-10-07 15:33: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 2702004bb2 Add Body:getFixture.
Convenience method to get the first Fixture attached to the body.
2023-10-04 20:00:44 -03:00
Sasha Szpakowski 51b439822b Add convenience functions for creating a Body+Shape+Fixture all at once.
#1130.

- Add love.physics.newCircleBody(world, bodytype, x, y, radius)
- Add love.physics.newRectangleBody(world, bodytype, x, y, w, h [, angle])
- Add love.physics.newPolygonBody(world, bodytype, coords)
- Add love.physics.newEdgeBody(world, bodytype, x1, y1, x2, y2 [, onesided])
- Add love.physics.newChainBody(world, bodytype, loop, coords)

All new functions return a Body object. The body's world position is at the center of the given coordinates, and the shape's local origin is at its center.
2023-10-04 19:56:22 -03:00
Sasha Szpakowski 03b6b9ff13 Fix return value counts... 2023-10-02 14:08:21 -03:00
Sasha Szpakowski da430d5145 World:rayCastAny and rayCastClosest also return the fixture they hit. 2023-10-02 14:05:54 -03:00
Sasha Szpakowski 6cb0287500 Add optional category bit mask to World:getFixturesInArea. 2023-10-02 12:15:26 -03:00
Sasha Szpakowski 28a898df1f Add World:rayCastAny and World:rayCastClosest.
They return hit position, normal, and ray fraction (if there is a hit), and also take an optional fixture category bitmask parameter.
2023-10-02 12:11:35 -03:00
Sasha Szpakowski c3847d5f04 Rename World:queryBoundingBox to World:queryFixturesInArea.
Matches the new World:getFixturesInArea function.
2023-10-02 11:06:15 -03:00
Sasha Szpakowski d24ccde864 World:rayCast and World:queryBoundingBox have user args passed through to the callback function.
Fixes #1194
2023-10-02 11:00:02 -03:00
Sasha Szpakowski b1609ed83b love.physics: simplify some internal bookkeeping code 2023-10-01 15:55:23 -03:00
Sasha Szpakowski dbc7d7f3ca Add love.graphics.newMesh variant to create a Mesh from existing Buffers.
This allows a Mesh to be created that doesn't have its own internal vertex buffer and purely references other vertex buffers instead.

The prototype looks like this:
mesh = love.graphics.newMesh(attributelist, drawmode)

where attributelist is an array of tables each with the following fields, similar to Mesh:attachAttribute:
{
    buffer = vertexbuffer,
    name = "VertexPosition", -- the name this vertex attribute will use in a shader
    nameinbuffer = nil, -- the name of the attribute in the vertex buffer. Defaults to the name field.
    step = nil, -- vertex attribute step ("pervertex" or "perinstance"), defaults to "pervertex".
    startindex = nil, -- 1-based array index within the given vertex buffer where the attribute data will start being pulled from during rendering. Defaults to 1.
}
2023-09-30 20:12:43 -03:00
Sasha Szpakowski 691d910c3e Improve error message when Mesh:setVertexMap is used with an empty array. 2023-09-30 17:54:09 -03:00
Miku AuahDark 2fd2930c24 Update lua-https to love2d/lua-https@0b2346f. 2023-09-28 16:53:59 +08:00
Sasha Szpakowski 96040b2b2a Fix list of data types in the error message when using an invalid vertex data type in the deprecated type+component count vertex format declaration. 2023-09-09 13:22:45 -03:00
Sasha Szpakowski 48e23a048d Improve text wrapping when multiple characters are combined into one glyph.
#1923
2023-09-08 22:38:17 -03:00
Sasha Szpakowski ddf88c64bd Update lua-https to latest commit (love2d/lua-https@6dbce69) 2023-08-30 21:47:26 -03:00
Sasha Szpakowski b0e3246ba8 Fix the Data object variant of File:write.
Fixes #1962
2023-08-21 16:50:28 -03:00
Sasha Szpakowski 6e80d85110 Merge branch 'main' into 12.0-development 2023-08-19 21:35:55 -03:00
Sasha Szpakowski 98663ec0db Merge pull request #1958 from nikeinikei/12.0-development
vk: maintenance
2023-08-07 21:08:51 -03:00
Miku AuahDark 8913ca2b23 Fix wrong function being registered for Joystick:getSensorData(). 2023-08-04 21:43:36 +08:00
niki 61cafd7dd4 adjust code styling 2023-08-01 14:23:10 +02:00
niki 8096cab5bc vulkan: use vkResetDescriptorPool 2023-07-30 15:35:20 +02:00
niki 9d9e2da763 vulkan: optimize vkUpdateDescriptorSets calls 2023-07-25 21:39:28 +02:00