Commit Graph

650 Commits

Author SHA1 Message Date
Alex Szpakowski 1c7c72472a Removed unused wrap_Geometry.cpp file 2013-10-08 17:29:07 -03:00
Alex Szpakowski 206e184cde love.graphics.print's x and y arguments now default to 0 (resolves issue #638) 2013-10-07 23:52:30 -03:00
Alex Szpakowski 4fa7347e26 Reduced code duplication in love.graphics.newImage 2013-10-07 22:18:44 -03:00
Alex Szpakowski fb34f5bc9e Auto-padded NPOT images' texture coordinates are now scaled at draw time via the texture matrix (fixes auto-padded images with Meshes.) Also fixed love.graphics.newQuad.
--HG--
branch : Mesh
2013-10-06 23:25:29 -03:00
Alex Szpakowski d161d5c0fc Fixed an uncaught exception in Mesh:getVertexMap
--HG--
branch : Mesh
2013-10-01 23:52:20 -03:00
Alex Szpakowski c426998b04 Fixed Mesh:setVertexMap when the mesh has more than 2^16-1 vertices (still needs more work to make it use smaller data types when available), added Mesh:setVertices
--HG--
branch : Mesh
2013-09-30 04:30:17 -03:00
Alex Szpakowski 857296f107 Merged default into Mesh
--HG--
branch : Mesh
2013-09-30 04:00:28 -03:00
Alex Szpakowski 95eedcd1be Using auto for some iterators for less dense-looking code 2013-09-30 02:35:10 -03:00
Alex Szpakowski b59e3d9c35 Meshes now use vertex buffers for more efficient drawing.
--HG--
branch : Mesh
2013-09-29 21:24:19 -03:00
Alex Szpakowski c63e2ec624 Merged default into Mesh
--HG--
branch : Mesh
2013-09-29 04:58:26 -03:00
Alex Szpakowski 5f609c2e2b OS X: switched to -std=c++11, fixed compilation, cleaned up obsolete files in src/platform/macosx/ 2013-09-29 02:50:37 -03:00
Alex Szpakowski 1e696c4505 Added Mesh objects and love.graphics.newMesh. Mesh objects are similar to Geometry but they're drawables (the relationship between meshes and images is the opposite of geometry and images.)
Removed Geometry objects and re-added Quads.

example:
local vertices = {{0, 0, 0, 0}, {100, 0, 1, 0}, {100, 100, 1, 1}, {0, 100, 0, 1}}
mesh = love.graphics.newMesh(vertices, image, "fan")
..
love.graphics.draw(mesh, 0, 0)

--HG--
branch : Mesh
2013-09-28 18:26:47 -03:00
Alex Szpakowski 1be8ac5be4 Removed some unused functions and fixed up some wrap_ headers 2013-09-26 00:48:48 -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 b36d643570 Changed love.graphics.getRendererInfo to return all the info (resolves issue #757) 2013-09-23 18:03:10 -03:00
Alex Szpakowski 2e2ede6334 Calling ParticleSystem:setLinearAcceleration with no arguments now errors instead of defaulting to 0 (resolves issue #755) 2013-09-23 17:12:20 -03:00
Alex Szpakowski 21d1e7737c Fixed ParticleSystem:setAreaSpread("none") to not require x/y arguments (resolves issue #738) 2013-09-17 00:54:55 -03:00
Alex Szpakowski f89097ed90 Fixed the error message when only one argument is given to newImageFont (resolves issue #737) 2013-09-16 03:11:38 -03:00
Alex Szpakowski ef9f30d5c4 Fixed a typo preventing compressed textures from being loaded into images 2013-09-06 00:59:19 -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 113ed1cfe7 Merged SDL2 changes from bartbes/love-experiments/SDL2 into default.
- Added love.system module, including clipboard functions.

- Added custom hardware cursors (love.mouse.newCursor, love.mouse.setCursor.)

- Revamped love.joystick:
-- added Joystick objects and moved love.joystick functions which operated on individual joysticks to methods on the Joystick objects.
-- Added love.joystick.getJoystick and love.joystick.getJoystickCount.
-- Added events for when joysticks are connected and disconnected.
-- Added 'Gamepad' methods to Joystick objects: Joystick:isGamepad, Joystick:getGamepadAxis, and Joystick:isGamepadDown. They're a common abstraction for xbox controller-like joystick across operating systems.

- Added monitor choosing support and "fullscreen desktop" mode to love.window.

- Moved unicode text input events to their own callback function (love.textinput), removed the key repeat functions from love.keyboard and made the second argument of love.keypressed a boolean saying whether the keypress was a repeat.

- liblove now works with love.window and love.graphics in OS X
2013-08-25 16:51:42 -03:00
Alex Szpakowski 713e050b56 Removed some ParticleSystem methods which existed but did nothing since version 0.5.0 or earlier 2013-08-22 00:30:58 -03:00
Alex Szpakowski 1b5912a461 Really fixed setScissor erroring when scissoring is disabled and x,y,w,h from getScissor is used (see issue #709) 2013-08-21 19:37:26 -03:00
Alex Szpakowski 394888bd13 Fixed love.graphics.setScissor and love.graphics.setColorMask to not error if a single nil argument is given (resolves issue #709) 2013-08-21 18:52:07 -03:00
Alex Szpakowski acfce1bf47 love.graphics.printf errors if the wrap limit parameter is negative (resolves issue #706) 2013-08-18 13:17:53 -03:00
Alex Szpakowski 96a668ecf3 Renamed CompressedData:getType to CompressedData:getFormat 2013-08-17 14:30:23 -03:00
Alex Szpakowski 72068ba519 love.graphics.isSupported now errors if an invalid string is given (see issue #690) 2013-08-17 00:12:46 -03:00
Alex Szpakowski c230098642 Fixed Geometry:getVertexMap to return 1-based vertex indices and made it return the default vertex map instead of nil if no map is set. 2013-08-16 19:25:41 -03:00
Alex Szpakowski d815374a9b Renamed the 'ModelViewMatrix' and 'ModelViewProjectionMatrix' built-in shader variables to 'TransformMatrix' and 'TransformProjectionMatrix', respectively. 2013-08-16 03:17:55 -03:00
Alex Szpakowski 14ae39eec9 Images which are too large for the system they're loaded on use a checkerboard pattern instead of erroring 2013-08-15 23:40:32 -03:00
Alex Szpakowski 59712c344f Removed a potentially slow codepath in SpriteBatch:add 2013-08-14 11:07:56 -03:00
Alex Szpakowski 9834897372 Fixed Canvas:clear on GL3+ systems 2013-08-13 16:05:20 -03:00
Alex Szpakowski 7e4e5e9c0b Resolved compiler warning 2013-08-08 22:06:11 -03:00
vrld 8b53bc385e Fix line drawing artefact with nearly parallel segments. 2013-08-08 21:37:11 +02:00
Alex Szpakowski 73e9f327dc Cleaned up boot.lua a tiny bit 2013-08-08 03:19:54 -03:00
vrld 0dea115abe Add missing Polyline.{h,cpp} 2013-08-08 08:11:18 +02:00
vrld be205544b3 Issue #659: Add line joins.
Added:

love.graphics.setLineJoin(linejoin)
linejoin = love.graphics.getLineJoin()

where linjoin is one of:

- none
- miter
- bevel

Bevel and miter drawing is slightly faster than the 0.8 default (miter), while
the `none` join mode will be slower when overdraw is enabled.
2013-08-07 21:48:21 +02:00
Alex Szpakowski dc755ed375 Removed ParticleSystem:getX/getY (resolves issue #633) 2013-08-04 18:27:36 -03:00
Alex Szpakowski a60929e9b0 Merged bartbes/love-experiments/RandomGenerator-2 into default (resolves issue #692) 2013-08-04 17:28:33 -03:00
Alex Szpakowski a4ff39e0d4 Improved error checking for some enum strings (resolves issue #690).
Also moved love.audio.newSource from Lua code into C++ code
2013-08-03 21:24:43 -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 2128ba321e Fixed Geometry texture coordinates when using Geometry to draw auto-padded NPOT images (resolves issue #696) 2013-08-01 17:14:20 -03:00
Alex Szpakowski d7802b053b Removed love.graphics.setAlphaTest: incompatible with OpenGL ES 2+, core OpenGL 3+, and Direct3D 10+. Shaders can accomplish the same things and more. 2013-08-01 12:55:46 -03:00
Alex Szpakowski dfba650575 Fixed SpriteBatch:set with Geometry 2013-07-29 16:03:38 -03:00
Alex Szpakowski 45de33edb8 Removed Geometry:flip (resolves issue #670) 2013-07-29 05:50:08 -03:00
Alex Szpakowski e19ade38ab Added support for BC4 (aka 3Dc+) compressed textures 2013-07-28 17:20:24 -03:00
Alex Szpakowski fa6eaaa3a6 Improved performance of SpriteBatch:add/set in some cases when the SpriteBatch isn't bound 2013-07-28 16:51:22 -03:00