Commit Graph

8 Commits

Author SHA1 Message Date
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 3ac0710544 Renamed Joystick:getProductGUID back to Joystick:getGUID 2013-08-30 23:50: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 4fcf47a427 Renamed Joystick:getGUID to Joystick:getProductGUID for greater clarity 2013-08-28 04:21:08 -03:00
Alex Szpakowski 390a47099e Removed some dead/useless joystick code 2013-08-26 18:18:07 -03:00
Alex Szpakowski 6ade6225df Replaced love.joystick.getJoystick with love.joystick.getJoysticks (returns a table of all connected joysticks), and renamed Joystick:getIndex to Joystick:getConnectedIndex 2013-08-26 17:37:59 -03:00
Alex Szpakowski db1e8e762a Joystick:getIndex now returns nil instead of -1 if the joystick isn't connected 2013-08-26 13:27:19 -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