Commit Graph

31 Commits

Author SHA1 Message Date
Alex Szpakowski 90e86c329d Add love.data module.
- Moved love.math.compress / decompress / decode / encode / hash to love.data.
- Changed love.data.compress/decompress to take the format argument first instead of second.
- Added love.data.newDataView. Returns a read-only subsection of an existing Data object.
- Added love.data.newByteData. Mostly useful in combination with LuaJIT's FFI as it has no extra methods currently.
- Added implementations of Lua 5.3's data packing APIs: love.data.packString / packData / unpack / getPackedSize.

Resolves issue #1336.
Resolves issue #1331.

--HG--
branch : minor
2017-09-24 19:25:27 -03:00
Alex Szpakowski abb72cb813 Happy new year! 🥂
--HG--
branch : minor
2017-01-02 01:28:29 -04:00
Bart van Strien 9f6aa716fa Pass Type to luax_register_type by pointer instead of reference
Since the type is passed to va_start, and apparently that's undefined behaviour if it's a reference.

<Textmode> the best kind of behavior

--HG--
branch : dynamiccore2
2016-11-14 21:51:47 +01:00
Bart van Strien d967a755e5 Make love::Type handle type names
TODO: Fix undefined behaviour in luax_register_type, you can't use a va_list after a reference type

--HG--
branch : dynamiccore2
2016-11-14 21:06:53 +01:00
Bart van Strien 5d43c9601a Automatically deduce the type in luax_pushtype, if possible
--HG--
branch : dynamiccore2
2016-11-13 17:38:42 +01:00
Bart van Strien 7dd960619d Automatically deduce the type in luax_checktype, luax_getmodule, luax_optmodule and luax_totype
--HG--
branch : dynamiccore2
2016-11-13 17:13:40 +01:00
Bart van Strien c761202486 Build type information on first use (load-time), instead of using a hardcoded list
--HG--
branch : dynamiccore2
2016-11-13 16:38:57 +01:00
Alex Szpakowski 46a2e7b85c Happy new year! 🎉 2016-01-01 00:05:06 -04:00
Alex Szpakowski 2c4e713114 Imported some of the dynamiccore branch from love-experiments:
- Type names for love's Lua objects are specified as an argument to luax_register_type, rather than being statically defined in an array.

- luax_register_type takes a variable number of method array arguments, for registering superclass methods without copying them into the subclass' method array.

Also removed most of the header declarations for wrapper functions.
2015-11-29 20:38:12 -04:00
Alex Szpakowski 2f419c1c83 Replaced most cases of type bits and type name strings in love's Lua wrapper code with type id's.
--HG--
branch : minor
2015-03-01 18:32:41 -04:00
Alex Szpakowski c7b45b3505 Updated copyright for the new year 2014-12-31 19:32:43 -04:00
Alex Szpakowski da7cd267ea Changed luax_pushtype to retain the pushed object itself, but only if the object isn't in the Lua state already.
Previously, calling e.g. love.graphics.getFont() 10,000 times would retain the object 10,000 times (and release it 10,000 times when the Font object was garbage-collected in the Lua state.) Now it will only retain it once and release it once.
2014-08-09 16:04:59 -03:00
Alex Szpakowski dfa319e01a Replaced the EXCEPT_GUARD macro for converting love exceptions into Lua errors with the new luax_catchexcept function, which takes lambda function arguments. 2014-06-03 19:27:00 -03:00
Alex Szpakowski 3120a0e650 Goodbye 2013, hello 2014! 2014-01-03 17:28:58 -04:00
Alex Szpakowski 4e321697d3 Renamed Font:hasGlyph to Font:hasGlyphs, and expanded it to accept multiple arguments and full strings. Resolves issue #762. 2013-10-25 21:56:32 -03:00
Alex Szpakowski 06f80d5c08 Fixed undefined behaviour when love exceptions are converted into Lua errors (resolves issue #729) 2013-09-05 23:17:29 -03:00
Alex Szpakowski ec9dec6b80 Replaced luax_newtype with luax_pushtype (and added luax_rawnewtype for the old functionality of luax_newtype.)
luax_pushtype keeps the object in a weak table and checks the table before creating a new userdata, so it re-uses the object's existing wrapper userdata if it can, whenever the object is pushed to Lua.

This fixes some subtle issues with love objects, where using them as keys in tables would not always work as expected (https://love2d.org/forums/viewtopic.php?f=4&t=39398&p=112388#p112415). It also decreases the amount of new Lua objects created, saving the garbage collector some work.
2013-08-29 00:40:06 -03:00
Alex Szpakowski 76618f0328 Cleaned up font code to always use uint32 instead of the slightly more ambiguous "unsigned int" for codepoints 2013-06-16 19:48:53 -03:00
Alex Szpakowski d48d1fd441 Exposed the internal Rasterizer and GlyphData object methods to Lua. Also added Font:hasGlyph. 2013-06-16 07:36:18 -03:00
Alex Szpakowski 96161c66f6 Updated copyright text for the new year 2013-02-05 05:32:49 -04:00
Bart van Strien 7793e7f02f CRLF to LF 2012-07-04 14:40:24 +02:00
rude 81c38e22d0 Applied the new style guidelines.
Well, sort of. Lot's more to be done, but this is a start.
2012-06-28 23:52:33 +02:00
Bill Meltsner be55579a22 Happy New Year, have an enormous diff 2012-01-09 02:41:11 -06:00
Bart van Strien c707a4ca45 Properly export all lua-facing functions and use those for initialization (love.cpp no longer explicitly mentions implementations) 2011-12-24 01:10:40 +01:00
Bart van Strien 0aae9684b3 Automated formatting fix 2011-11-16 11:32:41 +01:00
Bill Meltsner fde708160e bringing in the new year by changing every 2010 to 2011 2011-01-15 14:40:27 -06:00
Bill Meltsner e3a5aacd5a Overhauled ImageRasterizer, fixed a bunch of other crap, getting ready to poke around in love.graphics 2010-04-14 21:51:35 -04:00
rude aa01c984b9 Updated all dates to 2010. 2010-01-31 16:54:47 +01:00
rude dd420d68a3 Ok, project generation didn't really work out. Reverted. 2009-08-10 21:33:07 +02:00
rude ba1a75e547 Added many comments, and changed function names for wrapper functions. 2009-08-09 21:08:55 +02:00
rude 477d5a05b8 Updated love.font, and added Glyph object in love.graphics. 2009-07-30 21:43:00 +02:00