Commit Graph

2466 Commits

Author SHA1 Message Date
Alex Szpakowski 0b9ca3e344 Fix love.window.isMaximized. Add love.window.restore and love.window.isMinimized (resolves issue #1354).
--HG--
branch : minor
2017-11-20 22:20:39 -04:00
Alex Szpakowski b8c4b07edf Clean up unused temporary Canvases after a few frames.
--HG--
branch : minor
2017-11-13 19:45:18 -04:00
Alex Szpakowski 8672ff2272 Use a more efficient method of streaming automatically batched vertices on AMD Windows and Linux systems.
--HG--
branch : minor
2017-11-11 20:48:02 -04:00
Bart van Strien 19ddc27069 Use a seekless implementation of File:lines/love.filesystem.lines
The previous algorithm would seek every time. This meant that although reading
from a filesystem would be quick (especially with disk caching), but reading
from a zip would be extremely slow.

The new version is rouhgly as fast on a filesystem, but appears not to slow
down on zips at all. Not in my tests, at least.

--HG--
branch : minor
2017-11-11 21:42:52 +01:00
Alex Szpakowski 7f88037d94 Move the implementation for Graphics::flushStreamDraws out of the opengl backend
--HG--
branch : minor
2017-10-26 21:05:15 -03:00
Alex Szpakowski e3fd489373 Abstracted lower level drawing code, moved all type-specific drawing code out of opengl backend, deleted obsolete files
--HG--
branch : minor
2017-10-26 20:58:19 -03:00
Alex Szpakowski 7ffb04f019 Fix windows build
--HG--
branch : minor
2017-10-25 23:23:41 -03:00
Alex Szpakowski 15cc540e4c Make internal vertex attribute code less OpenGL-specific.
--HG--
branch : minor
2017-10-25 23:12:39 -03:00
Alex Szpakowski b0c5bf2156 Fix build?
--HG--
branch : minor
2017-10-22 12:37:30 -03:00
Alex Szpakowski 7a2e52b12d Cleaned up some vertex data-related code.
--HG--
branch : minor
2017-10-22 12:33:47 -03:00
Alex Szpakowski 90cb3870e7 Fix error output when a shader stage fails to compile.
--HG--
branch : minor
2017-10-21 15:18:25 -03:00
Alex Szpakowski e5b0d96b27 Restructured some Shader code. Added runtime temporary caching and sharing of shader stages. Resolves issue #1235.
--HG--
branch : minor
2017-10-21 03:08:18 -03:00
Bart van Strien f4e515edac Suppress unused variable warning on linux
--HG--
branch : minor
2017-10-16 14:46:06 +02:00
Bart van Strien 75e0caa0ff Faster video seeking
By using our current position (if known), we shrink the search area.

--HG--
branch : minor
2017-10-12 15:24:07 +02:00
Bart van Strien de945a528b Catch up on video faster
Previously every (internal) update the decoder would advance 0 or 1 frame. Now
it will advance until it catches up. Like before, if it takes too many steps
(5) before catching up, it seeks instead. This should mostly mean seeking
forwards has less latency.

--HG--
branch : minor
2017-10-12 15:20:38 +02:00
Bart van Strien 52ae68b288 Fixes for video files that do not have the video as first stream, and better EOS detection
--HG--
branch : minor
2017-10-12 15:11:15 +02:00
Bart van Strien 0e9f71b29a Split theora::VideoStream into OggDemuxer and TheoraVideoStream
This makes the internal API more modular, but the split also forces a cleaner
implementation. It also means the OggDemuxer is now responsible for the
ogg-specific stuff like seeking and (ogg-specific) type detection.

Backported from the love.video-vpx branch of love-experiments

--HG--
branch : minor
2017-10-12 14:23:58 +02:00
Alex Szpakowski 95adf7e347 Error instead of crashing when a frequency of 0 is set on a MouseJoint. Resolves issue #1197.
--HG--
branch : minor
2017-10-08 16:24:48 -03:00
Bart van Strien ba1d4dc0e9 Make VERTEX/PIXEL shader defines result in themselves
This means you can use VERTEX or PIXEL in your shader code without them
disappearing (and getting a vague error). It's still not necessarily a good
idea to use them as names, but at least it doesn't mysteriously break now.

--HG--
branch : minor
2017-10-04 14:05:09 +02:00
Bart van Strien ac12424bab Add optional channel parameter to SoundData:getSample/setSample (resolves #1346)
If omitted they work as before, if specified it handles the interleaving internally.

--HG--
branch : minor
2017-10-04 13:56:14 +02:00
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 ac84589c57 Backed out changeset 1b487edea8a8
--HG--
branch : minor
2017-09-30 17:02:16 -03:00
Alex Szpakowski 050be14547 Small graphics code cleanup
--HG--
branch : minor
2017-09-30 16:42:11 -03:00
Alex Szpakowski 8fa511aea8 Move boot.lua into src/modules/love/
--HG--
branch : minor
2017-09-30 16:41:45 -03:00
Alex Szpakowski bc980b0f20 Fix Channel:push and other functions that accept love objects and store them in Variants internally. Cleaned up Variant code a bit.
--HG--
branch : minor
2017-09-30 11:11:14 -03:00
Alex Szpakowski b838d0de54 Simplified an internal Variant constructor to be more intuitive to use.
--HG--
branch : minor
2017-09-30 10:39:24 -03:00
Alex Szpakowski 8068b0f1d4 Add variant of love.graphics.captureScreenshot which takes a Channel argument.
--HG--
branch : minor
2017-09-30 10:25:14 -03:00
Alex Szpakowski bdc6eb3b29 Fix copy/paste error in the love.filesystem.isDirectory deprecation message.
--HG--
branch : minor
2017-09-25 15:52:49 +00:00
Bart van Strien 3278ea5580 Fix compilation with lua 5.2 and 5.3
Mostly to have the lua53 "library" work with both lua 5.1 and lua 5.3.
Additionally fixes two other incompatibilities.

--HG--
branch : minor
2017-09-25 10:27:12 +02:00
Alex Szpakowski 90e86c329d Add love.data module.
- Moved love.math.compress / decompress / decode / encode / hash to love.data.
- Changed love.data.compress/decompress to take the format argument first instead of second.
- Added love.data.newDataView. Returns a read-only subsection of an existing Data object.
- Added love.data.newByteData. Mostly useful in combination with LuaJIT's FFI as it has no extra methods currently.
- Added implementations of Lua 5.3's data packing APIs: love.data.packString / packData / unpack / getPackedSize.

Resolves issue #1336.
Resolves issue #1331.

--HG--
branch : minor
2017-09-24 19:25:27 -03:00
Alex Szpakowski bdf961e174 Improve the error message when bad values are given to love.graphics.line. Resolves issue #1345.
--HG--
branch : minor
2017-09-24 16:19:39 -03:00
Alex Szpakowski 844900db39 Rename all cases of 'pixel density' to 'DPI scale' in love's APIs.
--HG--
branch : minor
2017-09-24 16:09:05 -03:00
Alex Szpakowski 1b3745b58b Fix a crash on quit if a non-default shader is active when quitting.
--HG--
branch : minor
2017-09-23 20:23:01 -03:00
Alex Szpakowski 5f64737956 Shader:send now optionally accepts a Data object (with optional byte offset and size parameters). Resolves issue #1343.
Also changed the optional 'columnMajor' argument of the matrix variant of Shader:send and Transform:setMatrix to accept enum constants instead. Valid values are "row" and "column".

--HG--
branch : minor
2017-09-23 19:47:57 -03:00
Bart van Strien 77663ed847 Replace love.graphics.pop("all") with love.graphics.getStackDepth (resolves #1248 again)
The pop("all") api was a bit awkward, especially considering there's a
push("all") that does something else. I think any use case that benefited from
pop("all") benefits from getStackDepth just as much if not more. There is also
additional functionality, like being able to find the source of a mismatched
push/pop.

--HG--
branch : minor
2017-09-23 10:56:54 +02:00
Alex Szpakowski 8ea2f09a1c Fix Fixture:getShape. Resolves issue #1319.
--HG--
branch : minor
2017-09-22 20:31:24 -03:00
Alex Szpakowski 4ee85e1793 love get* APIs which return tables with fields can optionally accept a table argument to fill in, instead of creating a new table.
--HG--
branch : minor
2017-09-22 19:47:55 -03:00
Bart van Strien a2ad1b462f Add love.graphics.pop("all"), which pops the entire stack (resolves #1248)
--HG--
branch : minor
2017-09-18 14:31:51 +02:00
Alex Szpakowski 8a77ea1007 Improve the error message when a type other than a table is given as the 3rd arg to newCanvas.
--HG--
branch : minor
2017-09-16 20:01:48 -03:00
Bart van Strien 23929cab14 Rename love.physics getObjectList functions to getObjects (resolves #1305)
World:getBodyList -> World:getBodies
World:getContactList -> World:getContacts
World:getJointList -> World:getJoints

Body:getFixtureList -> Body:getFixtures
Body:getContactList -> Body:getContacts
Body:getJointList -> Body:getJoints

Marked the old functions as deprecated

--HG--
branch : minor
2017-09-13 15:48:53 +02:00
Bart van Strien 7dae80f552 Fix return type of ParticleSystem:getAreaSpreadIsRelativeDirection, remove optional parameters from ParticleSystem:setAreaSpread (resolves #1340)
I opted to remove the optional parameters altogether since they seemed oddly
out-of-place. They used to reset the values to defaults when not supplied, and
they also weren't returned by getAreaSpread(), so
setAreaSpread(getAreaSpread()) actually changed spread parameters.

The other option was to remove the separate getters/setters for
AreaSpreadIsRelativeDirection and AreaSpreadAngle, and fully rely on
setAreaSpread for these parameters, but the rest of the ParticleSystem API
tends to keep parameters separate.

--HG--
branch : minor
2017-09-12 12:40:21 +02:00
Bart van Strien 09c1259857 Add optional timeout values to Channel:supply and Channel:demand (resolves #1344)
--HG--
branch : minor
2017-09-11 13:40:21 +02:00
Bart van Strien 7dfbfbda79 Error if ParticleSystem's particle lifetime is set to a negative value (resolves #1339)
--HG--
branch : minor
2017-09-09 13:23:49 +02:00
Alex Szpakowski bf67d7ad0e PHYSFS_enumerateFiles bug has been fixed post-2.1.0.
--HG--
branch : minor
2017-09-04 01:18:48 -03:00
Alex Szpakowski b6ecdb7c78 SpriteBatches/Text objects/ParticleSystems: use glBufferData+glBufferSubData instead of glBufferData+glBufferData for orphaning streaming vertex data, on most platforms. Apparently some Android drivers have a problem with the latter.
--HG--
branch : minor
2017-09-03 23:41:35 -03:00
Alex Szpakowski e4e4c6673e Use PhysFS_getErrorByCode instead of PhysFS_getLastError, when available.
--HG--
branch : minor
2017-09-03 19:47:46 -03:00
Alex Szpakowski 737433d157 Update love.filesystem backend to always use PhysFS 2.1+ codepaths when available.
--HG--
branch : minor
2017-09-03 19:34:46 -03:00
Alex Szpakowski 61a8ce6a66 Remove obsolete code and hopefully fix VS2013 build
--HG--
branch : minor
2017-09-03 18:46:33 -03:00
Alex Szpakowski b4f8f08b70 Enable (when available) and improve performance of persistently mapped buffer path for the vertex/index buffers used with automatic batching.
--HG--
branch : minor
2017-09-03 18:23:54 -03:00
Alex Szpakowski 9bb105711a Fix a Font texture memory leak when love.window.setMode is called (resolves issue #1338).
--HG--
branch : minor
2017-09-02 14:39:21 -03:00