Commit Graph

150 Commits

Author SHA1 Message Date
John Doe fc5eeb11a3 Fix copyright notice date 2026-01-21 18:49:11 +00:00
Sasha Szpakowski 36f368fa70 Fix accidental lua stack modification in love.event.push.
Fixes #2210.
2025-08-03 17:11:49 -03:00
John Doe 6f08eb94c6 Update copyright notice with correct year 2025-07-12 23:19:22 +01:00
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 1e97e09b28 Rework internal module registration to happen in constructors. 2024-02-24 15:21:38 -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 6e80d85110 Merge branch 'main' into 12.0-development 2023-08-19 21:35:55 -03: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 f6cdbdc868 Merge branch 'main' into 12.0-development 2022-12-31 22:46:34 -04:00
Sasha Szpakowski c823dbca96 Update copyright year for 2023 2022-12-31 22:25:49 -04: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
Alex Szpakowski 7f3538d2ba Merge branch 'main' into 12.0-development 2022-01-05 21:10:27 -04:00
Alex Szpakowski 8e7fd10b6f Update copyright year for 2022 2021-12-31 18:33:40 -04:00
Alex Szpakowski c8038f22df Merge branch 'main' into 12.0-development 2021-12-24 11:35:35 -04:00
Alex Szpakowski cee8f8ae48 Fix a compiler warning 2021-12-24 11:26:11 -04:00
Miku AuahDark 380cc1033e Change luax_runwrapper chunk name prefix. 2021-12-12 09:34:08 +08:00
Alex Szpakowski 5ef1709c02 Expose love.markDeprecated.
Arguments are (level, name, apitype, deprecationtype [, replacementname]). Call it inside a function.
2021-06-06 18:16:56 -03:00
Alex Szpakowski 21f5ba86d3 Merge branch 'master' into 12.0-development 2021-04-07 20:33:44 -03:00
Alex Szpakowski f89aabb0bb Update copyright year for 2021 2021-04-04 16:14:45 -03:00
Alex Szpakowski 04d59274ef Merge branch 'master' into 12.0-development 2021-02-14 14:45:21 -04:00
Miku AuahDark 4f491c2e61 Allow full 64-bit lightuserdata usage if the LuaJIT supports it.
Issue love2d/love-android#200

Original patch was sent by slime in Discord. Modified a bit to add
code that checks for 64-bit lightuserdata support.
2021-01-07 11:49:11 +08:00
Alex Szpakowski 26326a01e0 Merge branch 'master' into 12.0-development 2020-09-21 22:35:19 -03:00
niki 99e1c0034d make love lua 5.4 conform 2020-08-14 19:27:42 +02:00
Alex Szpakowski e71f27c65d Move Lua wrapper code for Variants out of the Variant class file. 2020-02-28 21:54:03 -04:00
Alex Szpakowski 5c06b2a860 Replace getCanvas/ImageFormats with getTextureFormats 2020-02-12 22:25:04 -04:00
Alex Szpakowski fc4847c69d Update copyright for the new year 2020-01-03 22:40:36 -04:00
Alex Szpakowski fe2c204a2c Use Data:getFFIPointer instead of Data:getPointer for internal ImageData and SoundData FFI code. 2019-10-27 19:07:58 -03:00
Alex Szpakowski 2eefa859e3 Attempt to fix VS2013 compatibility. 2019-09-25 15:52:12 -03:00
Alex Szpakowski 93802a3247 Use doubles instead of lightuserdata for keys into love's internal object registry (issue #1515). 2019-09-25 15:30:22 -03:00
Alex Szpakowski cb4b45dcf1 Add Data:getFFIPointer. Similar to Data:getPointer but returns a cdata pointer directly (or nil if the FFI isn't available).
It should be preferred instead of Data:getPointer because the latter uses lightuserdata which can't store more all possible memory addresses on some new arm64 architectures, when LuaJIT is used.
2019-07-20 10:47:58 -03:00
Alex Szpakowski 46d8b07e41 Fix non-integer dpi scale values specified in love.graphics.newCanvas. 2019-05-27 19:20:25 -03:00
Alex Szpakowski 0752f27bdf Update copyright year for 2019 2019-01-03 21:09:05 -04:00
Bart van Strien 7253118100 Make and use a vector variant of luax_convobj
Which also prevents accessing the zeroeth element of an empty vector
2018-12-03 18:19:28 +01:00
Bart van Strien fb793944e4 Restore lua 5.2/5.3 compatibility (fixes #1408) 2018-05-03 20:04:16 +02:00
Bart van Strien e80247c191 Happy new year! 2018-01-03 19:47:35 +01:00
Bart van Strien 9e4374935d Show (short) list of possible enum values when an invalid value is encountered (resolves #1318)
All enum errors have (hopefully) been changed to a luax_enumerror, which has a
fixed error message. If additionally a list of valid options is passed, it
lists that in the error message. For every enum error with few options I've
implemented this using a getConstants call.

This solution has been designed specifically to reduce the number of template
instantiations (as I've been told that was a concern). All new template code
happens in places where there already was an instantiation of the relevant
StringMap. Of course there is still std::vector<std::string>...

--HG--
branch : minor
2017-10-02 17:11:53 +02:00
Bart van Strien 3278ea5580 Fix compilation with lua 5.2 and 5.3
Mostly to have the lua53 "library" work with both lua 5.1 and lua 5.3.
Additionally fixes two other incompatibilities.

--HG--
branch : minor
2017-09-25 10:27:12 +02:00
Alex Szpakowski fcd9f1526c Use different output messages for deprecated methods versus functions.
--HG--
branch : minor
2017-08-27 16:55:33 -03:00
Alex Szpakowski de28c6e6a8 Add the ability to have formally deprecated functions.
Functions which are deprecated will print out a message and show up in a small dialog on-screen, when they're first called. Deprecation output is disabled in fused mode by default, and can be modified with love.setDeprecationOutput(enable).

--HG--
branch : minor
2017-08-27 13:46:31 -03:00
Alex Szpakowski fee157b6b9 Functions that take a boolean argument now properly type-check for it.
--HG--
branch : minor
2017-08-14 22:56:20 -03:00
Alex Szpakowski 74d9bc7faf Add traceback information to the error string generated if a thread causes a Lua error.
--HG--
branch : minor
2017-08-07 20:15:26 -03:00
Alex Szpakowski b590edf27d Merge default into minor
--HG--
branch : minor
2017-04-30 00:37:26 -03:00
raidho36 6b7172bd40 Fix Issue #1273
Added Lua index registry clear routine to `destroy` method of classes that use it.
If this is left to GC, the abandoned userdata would stay in memory for one full extra cycle.

Prettified the code slightly. Clarified some comments. Refactored `Fixture` class `udata` name.
Removed Reference class include from `Shape` (it doesn't use it).
2017-04-14 05:53:36 +03:00
Alex Szpakowski 43fea45f9f Fix a memory leak when pushing love objects to threads which never load that object’s module (resolves issue #1267).
Also fix Variant assignment operator to call release() on the correct object.

--HG--
branch : minor
2017-03-12 13:20:35 -03:00
Alex Szpakowski 73fd45558b Implement Array, Cubemap, and Volume texture types (issue #1111).
- Add love.graphics.newArrayImage, newCubeImage, and newVolumeImage.
- Add love.graphics.newCanvas(w, h, layers) and newCanvas(w, h, layers, settings). Add ‘type’ field to the settings table of newCanvas.

- Add new love.graphics.setCanvas variants: setCanvas(canvas, slice), and setCanvas(canvastable) where canvastable is in the format: {{canvas1, layer=2}, {canvas2, face=5}}

- Add Texture:getTextureType, getDepth, getLayerCount, getMipmapCount, and getFormat.

- Remove Image:getData and Image:refresh.
- Add Image:replacePixels(imagedata [, slice] [, mipmap]).

- Update Canvas:newImageData to accept a slice argument.

- Add love.image.newCubeFaces(imagedata).

--HG--
branch : minor
2017-02-20 14:58:13 -04:00