Commit Graph

1500 Commits

Author SHA1 Message Date
Alex Szpakowski b70f72acb3 Fixed a couple potential memory leaks if love.graphics.newShader causes an error, and cleaned up some shader-related code. 2014-09-27 02:26:58 -03:00
Alex Szpakowski c6b610d116 Cleaned up some code. 2014-09-21 19:50:02 -03:00
Alex Szpakowski 7948b11082 Updated love.physics.newPolygonShape and love.physics.newChainShape to accept a table of vertices, fixed a small memory leak if newChainShape errors, fixed the vertex order of newChainShape. 2014-09-21 03:31:36 -03:00
Alex Szpakowski 7f490c4c30 Added ParticleSystem:setLinearDamping and ParticleSystem:getLinearDamping (resolves issue #803.) 2014-09-19 21:00:04 -03:00
Alex Szpakowski d4c60e077d Fixed the window position in fullscreen modes. 2014-09-19 17:24:30 -03:00
Alex Szpakowski b75e1bdeaa Added love.window.setPosition(x, y [, displayindex]), love.window.getPosition, and optional x and y fields for t.window in love.conf and for the flags table in love.window.set/getMode (resolves issue #930.) 2014-09-19 16:19:55 -03:00
Alex Szpakowski 3d7a3c2c3c Improved the error message when a misspelled filename is given to love.graphics.newShader (resolves issue #928.) 2014-09-18 22:36:22 -03:00
Alex Szpakowski c6896dfc4e Consolidated some duplicate code in SpriteBatch:add. 2014-09-18 20:29:47 -03:00
Alex Szpakowski 5dda0c08eb Slightly improved the performance of SpriteBatch:setBufferSize. 2014-09-18 18:30:56 -03:00
Alex Szpakowski 00944c5f5d Added love.window.toPixels(x [, y]) and love.window.fromPixels(x [, y]), for easier conversion between window-space and pixel-space values when highdpi mode is enabled on a retina display in OS X (and in the iOS and Android ports of LÖVE.) 2014-09-14 15:58:37 -03:00
Alex Szpakowski f972c9923f Fixed love.graphics.reset reverting the current font to nil and breaking love.graphics.print. 2014-09-11 02:42:56 -03:00
Alex Szpakowski 346aa7d839 Fixed a memory leak in Sources created from SoundData. 2014-09-04 13:33:18 -03:00
Alex Szpakowski 77bec45b4a Fixed SpriteBatch:setBufferSize. 2014-08-31 01:15:58 -03:00
Alex Szpakowski 68b2c9e851 The default filter mode is now included in the state affected by love.graphics.push("all"). 2014-08-29 01:31:16 -03:00
Alex Szpakowski 40c6821048 Removed some dead code and fixed luax_pushtype when the object argument is null. 2014-08-28 00:48:32 -03:00
Alex Szpakowski e26abb417e Fixed indentation. 2014-08-27 01:04:58 -03:00
Alex Szpakowski 1e8c9e18c3 Fixed love.joystick.setGamepadMapping: the generated SDL controller mapping string is no longer invalid, and joystick hats are now properly converted to the SDL representation. 2014-08-27 00:58:42 -03:00
Alex Szpakowski 1449a81bdf Removed some dead code. 2014-08-26 22:16:01 -03:00
Alex Szpakowski d6cd2e2e7e Prettied up some code. 2014-08-26 00:05:08 -03:00
Alex Szpakowski d5e5f38e2f Fixed Source:tell crashing if the Source is static. 2014-08-25 03:46:11 -03:00
Alex Szpakowski 1978fa9910 Cleaned up a bit of unused code. 2014-08-22 17:44:52 -03:00
Alex Szpakowski 8ffe610659 Added love.graphics.getStats. It returns a table with performance-related graphics statistics. Currently it contains these fields:
drawcalls: The number of internal draw calls made so far in the current frame.

canvasswitches: The number of times the active Canvas has been changed so far in the current frame.

texturememory: The approximate amount of video memory (in bytes) used by OpenGL textures created by Images, Canvases, and Fonts.

images: The number of active Image objects.

canvases: The number of active Canvas objects.

fonts: The number of active Font objects.
2014-08-21 15:01:29 -03:00
Alex Szpakowski e1f7e4abd3 Added a 'refreshrate' field to the table returned by love.window.getMode. The value may be 0 if the refresh rate of the monitor can't be determined. It might also be 59 instead of 60 on 59.94hz monitors on some operating systems. 2014-08-20 20:22:46 -03:00
Alex Szpakowski 9e93d854b8 love.image.isCompressed should return true if the file contains a compressed texture, even if the file's extension isn't 'dds'. 2014-08-12 18:09:07 -03:00
Alex Szpakowski 1798115858 Error if the coordinates given to Canvas:getPIxel are not within [0, dimensions). 2014-08-10 03:09:16 -03:00
Alex Szpakowski d5ccdc040a Cleaned up some Proxy-related code. 2014-08-09 16:18:22 -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 191b910f23 Fixed love.graphics.newScreenshot potentially deleting any active Canvases. 2014-08-08 18:49:11 -03:00
Bart van Strien 30ff7d4659 Make openURL call on linux non-blocking, because the spawned processes are not guaranteed to fork into the background, and enable automatic zombie cleanup to deal with that change (note: the return value is now slightly less accurate) 2014-08-07 20:22:58 +02:00
Alex Szpakowski d59c76a55f Reduced the number of explicit retain/release method calls on love objects. Less chance of bugs! 2014-08-07 14:53:17 -03:00
Alex Szpakowski a0fff798aa Fixed compiling with Visual Studio. 2014-08-07 01:12:48 -03:00
Alex Szpakowski afc505e183 Added stack type enums to love.graphics.push (resolves issue #906.) Current enums are "transform" and "all". "transform" is the default (for compatibility.) When love.graphics.push("all") is used, love.graphics.pop() will restore all love.graphics module state to what it was when push was called.
Updated the graphics code to use a custom matrix stack rather than OpenGL1's APIs.
2014-08-06 22:25:29 -03:00
Alex Szpakowski 028108ea64 Improved the error message when physfs fails to open a filepath. 2014-08-06 20:16:15 -03:00
Alex Szpakowski 809ea8691f Fixed wireframe mode not being saved and restored properly on love.window.setMode. 2014-08-04 22:02:47 -03:00
Alex Szpakowski eaad102f5c Calling love.window.setMode with fullscreen=true and a width or height larger than the largest fullscreen mode now falls back to the largest fullscreen mode instead of failing and returning false. 2014-07-30 01:22:01 -03:00
Alex Szpakowski c6c32dee17 Removed a piece of code I forgot to delete 2014-07-28 16:58:51 -03:00
Alex Szpakowski 73c0f1e222 Added love.filesystem.isSymlink, love.filesystem.setSymlinksEnabled, and love.filesystem.areSymlinksEnabled. Symbolic link support is disabled by default.
love.filesystem.isSymlink will always return false when symbolic link support is disabled, even if the given filepath is actually a symlink.
2014-07-24 00:31:11 -03:00
Alex Szpakowski 3ae336dd43 Added love.window.showMessageBox.
It has two variants: showMessageBox(type, title, message [, attachtowindow=true]), and showMessageBox(type, title, message, buttons [, attachtowindow=true]). The former shows a simple message box with a single OK button, and the latter displays several buttons. The buttons argument is an array of button names.

The second variant returns the index of the pressed button, or 0 if the message box was closed some other way. showMessageBox will block until the message box is closed (and it can't be called on a separate thread.)
2014-07-21 21:28:21 -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 e87fbdcaaf Fixed the default line join mode to be 'miter' instead of an undefined value. 2014-07-15 15:49:01 -03:00
Bart van Strien 59ab602111 Normalize slashes in paths unless they are direct user input (XDG_DATA_HOME/APPDATA, specifically) 2014-07-15 13:16:37 +02:00
Alex Szpakowski a4a075dd2e Fixed crashes and instability when love.graphics.setMode is called when a vertex buffer is mapped by love. 2014-07-10 16:16:00 -03:00
Alex Szpakowski 9ab9a393d5 Added Contact:getFixtures and Body:getContactList (see issue #905).
The list of Contacts associated with bodies changes during World:update (potentially multiple times), so you might miss collisions if you don't use the World callbacks at all.
2014-07-07 15:24:24 -03:00
Alex Szpakowski dac9f4eaaa Added love.window.minimize (resolves issue #904). 2014-07-05 17:55:06 -03:00
Alex Szpakowski d11ccd0e69 Added love.graphics.getCanvasFormats and love.graphics.getCompressedImageFormats, and removed love.graphics.hasCanvasFormat.
The two new functions return tables containing the names of all relevant formats as keys, and boolean values indicating whether the formats are supported.
2014-07-05 16:22:52 -03:00
Alex Szpakowski 4c67a94ba3 Hopefully fixed issue #898, and cleaned up code for love.graphics.getRendererInfo. 2014-06-19 03:02:37 -03:00
Alex Szpakowski 2ae4e9cd5a Fixed a potential memory leak in the love.physics World callbacks. 2014-06-18 16:24:38 -03:00
Bart van Strien fb3aa060b2 Fix Texture leak in Meshes 2014-06-18 14:34:05 +02:00
Alex Szpakowski f0fa63ba47 Backported commits 145524a and 7785b4b from minor into default (Added SpriteBatch:flush, deprecated SpriteBatch:bind/unbind, SpriteBatch:flush is called implicitly when the spritebatch is drawn.) 2014-06-17 21:52:56 -03:00