Alex Szpakowski
a29b349014
Added love.math.compress(data, format [, level]) and love.math.decompress(compresseddata) / love.math.decompress(compressedstring, format).
...
Renamed the love.image CompressedData type to CompressedImageData.
love.math.compress returns a love.math CompressedData object which holds the newly compressed data. Currently supported formats are "lz4" and "zlib". Note that the formats are not file formats and don't compress filesystem hierarchies.
2015-03-23 11:28:14 -03:00
vrld
f32d770cf6
Add BezierCurve:getSegment(t1, t2)
...
Returns a BezierCurve that corresponds to the curve-segment between t1 and t2
on the original curve.
2015-03-22 19:22:18 +01:00
muddmaker
8ee2db3420
Fix typos
2015-03-22 10:16:12 -07:00
muddmaker
3a54d4599a
fix conflicts
2015-03-21 18:15:41 -07: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
ebc68023a7
Fix many warnings about implicit integer conversions when compiling for 64 bits.
...
--HG--
branch : minor
2015-02-20 01:20:08 -04:00
Alex Szpakowski
83e0efb5b4
Fixed indentation.
...
--HG--
branch : minor
2015-01-26 14:42:53 -04:00
Alex Szpakowski
a69f722f0f
love.math.setRandomSeed / RandomGenerator:setSeed now hashes the seed value before using it, which gives a much better distribution when comparing the results of different but similar seeds.
...
Cleaned up RandomGenerator:setState/getState, now that love is using the C++11 standard library.
--HG--
branch : minor
2015-01-26 14:13:42 -04:00
Alex Szpakowski
a7e4148869
Merged default into minor
...
--HG--
branch : minor
2015-01-16 15:47:26 -04:00
Alex Szpakowski
811f574ef6
Reference counting for love objects in 0.9.2 is now atomic (using SDL's atomic operation functions.)
2015-01-14 15:52:05 -04:00
muddmaker
47a4cc34a5
universal indexing rules in BezierCurve
2014-12-31 23:19:07 -08:00
Alex Szpakowski
c7b45b3505
Updated copyright for the new year
2014-12-31 19:32:43 -04:00
muddmaker
2c5f7dc896
add removeControlPoint; improve exception handling
2014-12-22 17:57:44 -08:00
muddmaker
637908ab43
Improve renderSegment
2014-12-22 14:50:44 -08:00
muddmaker
ccd856255d
fix last commit
2014-10-02 18:22:54 -07:00
muddmaker
238656ecc1
Added BezierCurve:renderSegment
2014-09-30 17:36:10 -07:00
Alex Szpakowski
d4ad571780
Un-reverted commit 14ca947 (love.math.setRandomSeed internally calling random() a few times) for the minor branch.
...
--HG--
branch : minor
2014-09-28 16:05:17 -03:00
Alex Szpakowski
e8009bb4cb
Reverted commit 14ca947 (love.math.setRandomSeed internally calling random() a few times.) The change can break existing 0.9.x games so it will be pushed back to the minor branch.
2014-09-28 15:28:14 -03: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
d52bab4221
Updated the new module changes to use more compile/link-time checking rather than runtime checking.
2014-07-21 15:12:01 -03:00
Alex Szpakowski
014b9a46e5
Updated the Lua wrapper code for modules to account for cases where the module's instance is removed from memory completely and recreated during the program's lifetime.
2014-07-21 14:52:01 -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
3cf2a8f8a2
Improved error message when love.math.setRandomSeed(0) is attempted (resolves issue #876 )
2014-04-24 15:21:53 -03:00
Alex Szpakowski
4ea18d8bbc
love.math.setRandomSeed now calls random() a couple times internally, to make similar seeds give less similar results when random() is called for the first time after setRandomSeed.
2014-04-05 18:55:05 -03:00
Alex Szpakowski
4faddcd9aa
Fixed some trivial compiler warnings
2014-03-12 17:55:19 -03:00
Alex Szpakowski
d07e31370d
Added RandomGenerator:getState and RandomGenerator:setState (resolves issue #831.)
...
getState returns an implementation-dependent string representing the current state of the RandomGenerator's PRNG. setState sets the PRNG's state to an implementation-dependent string.
2014-02-08 20:28:41 -04:00
Alex Szpakowski
e54d771be4
Added love.math.gammaToLinear and love.math.linearToGamma for converting RGB color values from the sRGB color-space to linear and vice-versa.
2014-02-04 19:45:50 -04:00
Alex Szpakowski
3120a0e650
Goodbye 2013, hello 2014!
2014-01-03 17:28:58 -04:00
Alex Szpakowski
2ee869b0e8
Fixed some compiler warnings
2013-12-07 05:07:54 -04:00
Alex Szpakowski
1c8abc74aa
Renamed love.math.g/setRandomState and rng:g/setState to love.math.g/setRandomSeed and rng:g/setSeed.
...
getRandomSeed now always returns the previously set random seed instead of the current (implementation-dependent) random state.
2013-12-01 21:25:27 -04:00
Alex Szpakowski
cded0e4a3b
Fixed a typo when love.math.triangulate errors
2013-11-05 15:17:54 -04:00
Alex Szpakowski
83d3eae1e7
Fixed error messages in Shader:send and love.math.newRandomGenerator to include the line number
2013-11-04 15:03:45 -04:00
Alex Szpakowski
e2eb99a6af
Added BezierCurve:getControlPointCount (resolves issue #759 )
2013-10-11 02:53:53 -03:00
Alex Szpakowski
bcee9a222b
Made some float/int/unsigned char conversions explicit, fixed ParticleSystem:getColors, fixed love.mouse.isDown with x1 and x2 buttons
2013-09-26 00:36:50 -03:00
Alex Szpakowski
5de43a7207
The Vertex struct is now recognized as POD by C++, also fixed the name to be consistent with other love structs
2013-09-24 11:09:18 -03:00
Alex Szpakowski
8d5ddb9e34
Fixed some internal documentation (thanks to clang's -Wdocumentation)
2013-09-23 21:52:28 -03:00
Alex Szpakowski
06f2ec8e31
Renamed BezierCurve:eval to BezierCurve:evaluate (resolves issue #722 )
2013-09-23 20:40:58 -03:00
Alex Szpakowski
ffe0485173
Removed love.window.checkMode (resolves issue #653 , invalidates issue #592 ).
...
Also fixed love.window.setMode to fail instead of bug out when trying to set a fullscreen mode which is too large for the monitor.
2013-09-19 18:13:52 -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
vrld
6b51c5aadc
Fix issue #724 : Bezier curve rendering/eval crashes with empty curves.
2013-08-29 08:31:58 +02: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
1375aaccb5
Renamed BezierCurve:move to BezierCurve:translate (resolves issue #723 )
2013-08-28 19:10:18 -03:00
vrld
983496238f
[BezierCurve] Add getDerivative(), move(), rotate() and scale().
2013-08-21 21:44:31 +02:00
Alex Szpakowski
5c0066332f
love.math.noise now returns values in the range of [0, 1] instead of [-1, 1]
2013-08-19 19:57:55 -03:00
Alex Szpakowski
50504d83a5
Missed an uncaught exception in newRandomGenerator
...
--HG--
branch : RandomGenerator-2
2013-08-04 17:20:14 -03:00
Alex Szpakowski
674ad9247a
Added some checks for invalid numbers to love.math.setRandomState
...
--HG--
branch : RandomGenerator-2
2013-08-04 17:04:52 -03:00
Alex Szpakowski
0447d1e7c5
Changed love.math.randomnormal([mean], stddev) to love.math.randomNormal(stddev, [mean]);
...
Changed love.math.randomseed(seed) to love.math.setRandomState(state) and love.math.setRandomState(low, high). Added low, high = love.math.getRandomState().
love.math.setRandomState(state) can set the random state to an integer of up to 53 bits, love.math.setRandomState(low, high) can set the random state to a 64 bit integer by using the first argument as the lower 32 bits and the second argument as the higher 32 bits.
This allows for reliable setting and saving of the state of a RNG.
--HG--
branch : RandomGenerator-2
2013-08-01 18:32:44 -03:00
Alex Szpakowski
04ca33d127
Updated Xcode project with new bezier files
2013-05-12 17:04:56 -03:00
vrld
aa4d96317f
[bezier curve] add missing files
2013-05-12 22:01:12 +02:00
vrld
19eade843c
Add support for Bezier curves of arbitrary degree.
...
New functions:
bezier = love.math.newBezierCurve(control-points)
degree = bezier:getDegree() -- degree = #control-points - 1
x,y = bezier:getControlPoint(pos) -- pos < 0 => string.sub semantics
bezier:setControlPoint(pos, x, y) -- pos < 0 => string.sub semantics
bezier:insertControlPoint(x,y, [pos = -1])
x,y = bezier:eval(t) -- 0 <= t <= 1
polyline = bezier:render([accuracy = 5]) -- returns a table of points
Example:
function love.load()
b = love.math.newBezierCurve(10,10, 80,400, 380,400, 470,10)
end
function love.draw()
if not curve then -- curve rendering is expensive-ish
curve = b:render()
end
love.graphics.line(curve)
end
2013-05-12 21:57:06 +02:00