Commit Graph

33 Commits

Author SHA1 Message Date
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
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 92df39181d Error for invalid constants passed to love.keyboard.isDown/isScancodeDown. Resolves issue #1313.
--HG--
branch : minor
2017-08-10 21:06:04 -03:00
Alex Szpakowski abb72cb813 Happy new year! 🥂
--HG--
branch : minor
2017-01-02 01:28:29 -04: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 327682d07f Add support for passing a table to love.mouse.isDown, love.keyboard.isDown, love.keyboard.isScancodeDown, Joystick:isDown, and Joystick:isGamepadDown. 2016-09-19 22:43:47 -03:00
Alex Szpakowski 46a2e7b85c Happy new year! 🎉 2016-01-01 00:05:06 -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 52c4f2c119 Improved the performance of love.window.getPixelScale / toPixels / fromPixels by caching some values. Made some coordinate space-sensitive code use the proper conversions to get to the correct coordinate space.
--HG--
branch : minor
2015-02-23 17:55:30 -04:00
Alex Szpakowski 44d10be928 Added a love.keyboard.setTextInput variant (setTextInput(enable, x, y, width, height)) to specify a rectangle where text is expected to be displayed on the screen. This is used as a hint so on-screen keyboards won't cover the text area.
Added love.keyboard.hasScreenKeyboard.

--HG--
branch : minor
2015-02-17 00:35:01 -04:00
Alex Szpakowski 5c1e6014cc Changed the love.keypressed and love.keyreleased event callbacks to be love.keypressed(key, scancode, isrepeat) and love.keyreleased(key, scancode). Added love.keyboard.isScancodeDown. Resolves issue #993.
--HG--
branch : minor
2015-02-16 17:10:03 -04:00
Alex Szpakowski ed4c364171 Fixed a potential crash when an invalid Scancode constant argument is used in love.keyboard.getKeyFromScancode. 2015-02-14 17:54:25 -04:00
Alex Szpakowski a314b18515 Added love.keyboard.getKeyFromScancode and love.keyboard.getScancodeFromKey. Resolves issue #982.
Scancodes represent a physical key independent of the keyboard's current layout. For example, pressing the key located where 'q' is on a U.S. keyboard will produce the key 'q' and the scancode 'q' when using a U.S. keyboard layout, but when using a French keyboard layout it will produce the key 'a' and the scancode 'q'.

Scancodes are useful for creating default controls that have the same physical locations on on all keyboards.
2015-02-01 03:13:14 -04:00
Alex Szpakowski c7b45b3505 Updated copyright for the new year 2014-12-31 19:32:43 -04: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 0c4116468c And some more. 2014-06-09 18:37:47 -03:00
Alex Szpakowski 787ba6b650 Removed some stowaway test code... 2014-06-09 18:32:02 -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 e4dc533bb2 Minor code cleanup 2014-05-01 14:12:21 -03:00
Alex Szpakowski 3120a0e650 Goodbye 2013, hello 2014! 2014-01-03 17:28:58 -04: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 389e99bf2c Added love.keyboard.setTextInput to enable/disable text input events (enabled by default.)
This fixes the issue of receiving an unwanted text input event if a key is used to bring a game's textbox into focus, since textinput events can be triggered after keypress events if the keypress generates text.
2013-09-05 18:55:44 -03:00
Alex Szpakowski eb052d99e8 Added love.keyboard.setKeyRepeat and love.keyboard.hasKeyRepeat (resolves issue #717) 2013-08-29 03:20:27 -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 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 362a7835b4 Make keyboard repeat better.. or something 2011-12-11 19:08:01 +01:00
Bart van Strien 1503533ee6 Key repeat gets seconds too 2011-12-06 21:30:31 +01:00
Bart van Strien 0aae9684b3 Automated formatting fix 2011-11-16 11:32:41 +01:00
rude 2753c62985 Abstractify some modules completely: timer, keyboard and mouse.
If this commit breaks some project file(s), well ...
I AM RUDE AND I WILL BREAK EVERYTHING, AHAHAHAHAHAHAHHAHAHAHAHA!
2011-10-28 10:47:16 +02:00