Commit Graph

2814 Commits

Author SHA1 Message Date
Alex Szpakowski 54c09c910a Update glslang. 2017-12-17 21:05:40 -04:00
Alex Szpakowski 640e8f0d2e love.filesystem.mount can accept a Data object containing zipped data.
- Add mount(Data, archivename, mountpoint [, appendtopath]). 'archivename' must be a string that has not been used with mount before.
- Add mount(FileData, mountpoint [, appendtopath]). The file path of the FileData is used as the archive name.
- Add unmount(Data).
- unmount(archivename) also works.
2017-12-16 23:09:15 -04:00
Alex Szpakowski ce46fa3ebe Remove PhysFS 2.x-specific code, it's no longer needed since we always have PhysFS 3. 2017-12-16 19:56:02 -04:00
Alex Szpakowski 70bf18182d Fix Image:getMipmapCount returning greater than 1 when a compressed texture is loaded without mipmaps in its source data but with mipmaps=true set. 2017-12-15 22:18:19 -04:00
Alex Szpakowski 1d8a3326b3 Include the physfs 3.0.1 source in love. 2017-12-15 19:41:17 -04:00
rude 5950688770 Added new nogame screen (Duckloon). 2017-12-13 22:15:23 +01:00
Alex Szpakowski 3a8390ceff Fix a couple bugs with love.graphics.clear. 2017-12-10 14:40:08 -04:00
Alex Szpakowski 7354de2059 Add (low level) functionality to allow rendering 3D Meshes.
- Add love.graphics.setDepthMode(testcomparison, enablewrites).
- Add love.graphics.setMeshCullMode.
- Add love.graphics.setFrontFaceWinding.

Depth testing and depth writes require a depth buffer to work. The mesh cull mode controls whether front/back faces of a mesh are culled. The front face winding determines whether a clockwise or counterclockwise-oriented face in a mesh is considered front facing.

--HG--
branch : minor
2017-12-09 23:34:08 -04:00
Alex Szpakowski 915e6c8eec Fill-mode love.graphics.circle/ellipse draws a triangle fan from the center of the ellipse, instead of from an edge.
--HG--
branch : minor
2017-12-04 19:12:06 -04:00
Alex Szpakowski e099e57052 Cleaned up some internal love.graphics code.
--HG--
branch : minor
2017-12-03 23:04:40 -04:00
Alex Szpakowski cbcb1a8606 Allow a depth/stencil canvas to be active without a color canvas.
--HG--
branch : minor
2017-12-03 19:33:48 -04:00
Nicola Orlando a9961b7c70 Reversed alignedMalloc return value.
posix_memalign returns false on success; using == 0 instead of != 0 reverses it, allowing alignedMalloc to return true on success and false otherwise (mimicking what happens under Windows).

--HG--
branch : Nixola/reversed-alignedmalloc-return-value-posi-1512135128149
2017-12-01 13:32:51 +00:00
Alex Szpakowski fccc6fa733 Increase the love.graphics max stack depth from 64 to 128.
--HG--
branch : minor
2017-11-28 22:41:01 +00:00
Alex Szpakowski b6cb6aed47 Error if the ImageData given to love.window.setIcon is not a 32 bit RGBA format.
--HG--
branch : minor
2017-11-26 18:31:43 -04:00
Alex Szpakowski 82553d793d Clamp colors in love.graphics.newMesh. I missed this one in my previous commit.
--HG--
branch : minor
2017-11-25 10:23:29 -04:00
Alex Szpakowski 6dea2ab714 Clamp all color arguments to [0, 1] in cases where values outside that range don't make sense (fixed-point color values & sRGB colors). Closes issue #1315.
--HG--
branch : minor
2017-11-21 19:49:52 -04:00
Alex Szpakowski 1cd1a8d32e Mark SDL implementations of love.window methods with 'override'.
--HG--
branch : minor
2017-11-20 22:38:25 -04:00
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
Bart van Strien d19129de5b Regenerate boot.lua.h
Because of course that went wrong. I'm not sure whether it's the merge's fault,
or the merged in boot.lua.h was outdated. Either way, here we are.

--HG--
branch : minor
2017-11-03 13:38:04 +01:00
Bart van Strien 59fb287bd1 Merged in SoniEx2/love/minor (pull request #96)
Improve argument handling

--HG--
branch : minor
2017-11-03 12:27:10 +00:00
Bart van Strien 790625f0c4 Make love.run and love.errhand return a function for their main loop instead (resolves #1268)
This way lua code can stop every iteration (usually frame), and return to the
c++ code, so love can work in environments with co-operative multithreading
like emscripten.

It may be interesting to see if we can make this optional, so this only happens
on platforms that require it, but I doubt it's significant in the grand scheme
of things.

--HG--
branch : minor
2017-10-30 13:30:19 +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 4f8e04d391 Fix a crash on quit if a deprecated function was used.
--HG--
branch : minor
2017-10-21 22:37:51 -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 d882c6811b Make love.run's code style more consistent.
--HG--
branch : minor
2017-10-21 03:12:37 -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 bf1a9344eb Reduce template instantiations of std::vector<std::string>
The new StringMap code for luax_enumerror causes code to be generated for
std::vector. By using an extern template (an old feature standardised in c++11)
we can instantiate it once instead, in StringMap.cpp.

--HG--
branch : minor
2017-10-16 14:40:17 +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