Commit Graph

2999 Commits

Author SHA1 Message Date
Alex Szpakowski 0a8c6f3ee6 Cleaned up some love.graphics code.
--HG--
branch : minor
2016-12-10 23:46:00 -04:00
Alex Szpakowski 1e24a19bea Fix compilation..
--HG--
branch : minor
2016-12-10 16:25:09 -04:00
Alex Szpakowski d7feb20df9 Remove love.timer SDL implementation files, since they don’t do anything.
--HG--
branch : minor
2016-12-10 16:21:48 -04:00
Alex Szpakowski b620f32200 Work around SDL issues in Joystick:getGamepadMapping with XInput controllers (issue #1239).
This doesn’t fix the underlying issues in SDL so there may be other aspects of love.joystick which are still affected.

--HG--
branch : minor
2016-12-10 16:14:14 -04:00
Alex Szpakowski 8e2d9c5138 Minor code style cleanup. Fix a couple compiler warnings.
--HG--
branch : minor
2016-12-03 17:23:46 -04:00
Alex Szpakowski 7d68a72d5f Add audio Filter files to the Xcode project
--HG--
branch : minor
2016-12-03 16:35:12 -04:00
Raidho 332ba76e62 Implement audio filters
Use Source:setFilter(type, params...) to set a filter.
Use Source:setFilter() to detach the current filter.
Use Source:getFilter() to get the currently set filter (or nil).

Squashed from pull request 27, and the clean-pr27 branch in love-experiments.

--HG--
branch : minor
2016-12-03 20:54:48 +01:00
Bart van Strien e5aad03f2d Update changelog
--HG--
branch : minor
2016-12-02 23:53:10 +01:00
Bart van Strien cac5a3519a Fix automatically pausing and resuming audio on android (resolves #1237)
--HG--
branch : minor
2016-12-02 13:59:21 +01:00
Bart van Strien 67d3146229 Fix love.audio.play{sources...} so it can resume paused sources
--HG--
branch : minor
2016-12-02 13:57:20 +01:00
Alex Szpakowski 0126f7986a Add missing files to the Xcode project
--HG--
branch : minor
2016-11-30 18:04:10 -04:00
Bart van Strien 7bd3581a52 Merge dynamiccore2 into minor
Instead of a global type enum and bitfield, all types now have their own
love::Type static member. This means they automatically assign their ids, build
their bitsets, etc. As a bonus, it simplifies wrapper code since most functions
already know which type they're pushing to or getting from lua, so they can
directly get the static member (if it's called 'type').

--HG--
branch : minor
2016-11-30 22:38:30 +01:00
Bart van Strien 9aa921ef4c Add new files to cmakelists
--HG--
branch : dynamiccore2
2016-11-30 13:24:11 +01:00
Bart van Strien 06f4d6363e Move all love::Type initialisation to their respective (new) files
Previously Data, Stream, Drawable and Image (and for some reason Filesystem) had types in types.cpp

--HG--
branch : dynamiccore2
2016-11-30 12:55:08 +01:00
Alex Szpakowski cc1ea70272 Fix indentation
--HG--
branch : minor
2016-11-27 22:57:23 -04:00
Alex Szpakowski 0a3adc0839 Unify pixel format enums for ImageData, CompressedImageData, and Canvas into a single PixelFormat enum.
Replace love.graphics.getRawImageFormats and love.graphics.getCompressedImageFormats with love.graphics.getImageFormats.

--HG--
branch : minor
2016-11-27 22:53:23 -04:00
Bart van Strien 24a7a3d367 Merge minor into dynamiccore2
--HG--
branch : dynamiccore2
2016-11-26 22:19:12 +01:00
Alex Szpakowski cbba8c40a6 Split Mesh:attachAttribute(name, nil) out into Mesh:detachAttribute. Fix attachAttribute.
Don’t let me push commits on a friday night…

--HG--
branch : minor
2016-11-26 01:50:36 -04:00
Alex Szpakowski 100404c917 Revert a dumb change that caused a crash due to reading from invalid memory
--HG--
branch : minor
2016-11-26 00:36:59 -04:00
Alex Szpakowski 82f66e3026 Hopefully fix a couple potential issues with restoring Shader texture units after a setMode.
--HG--
branch : minor
2016-11-25 23:50:37 -04:00
Alex Szpakowski 5bf25007da Fix building for iOS
--HG--
branch : minor
2016-11-25 23:21:08 -04:00
Alex Szpakowski 9930b81f94 The Xcode project now recognizes frameworks placed in love/platform/Xcode/macosx/Frameworks/ when building for macOS (closes issue #1230).
--HG--
branch : minor
2016-11-25 23:10:29 -04:00
Alex Szpakowski 2c28eef74a Added 2 new variants of Mesh:attachAttribute (resolves issue #1233). Thanks xenthral!
- Added Mesh:attachAttribute(name, mesh, nameInMesh) which retargets the attribute name in the specified Mesh (3rd argument) to a new name for this mesh (1st argument).
- Added Mesh:attachAttribute(name) which detaches any attached attributes from other meshes for that attribute name.

--HG--
branch : minor
2016-11-25 22:51:31 -04:00
Alex Szpakowski 050ca413be Fix a missing reciprocal..
--HG--
branch : minor
2016-11-25 20:07:30 -04:00
Alex Szpakowski 92774b759b Fix line and shape segment counts and smooth line antialiasing when love.graphics.applyTransform and replaceTransform are used.
--HG--
branch : minor
2016-11-25 19:59:48 -04:00
Alex Szpakowski f85ee6b504 Add some more graphics feature and limit queries (resolves issue #1234).
love.graphics.getSupported():
 - Added “fullnpot” field, is true everywhere except on some older mobile devices. If false, mipmapping and wrap modes other than “clamp” can’t be used on non-power-of-two sized textures.
 - Added “pixelshaderhighp” field, is true everywhere except some older mobile devices. If false, “highp” precision can’t be used in pixel shaders and love will default to “mediump” instead.

love.graphics.getSystemLimits():
- Added “anisotropy” field, gets the maximum amount of anisotropy you can specify in Texture:setFilter. love will clamp anisotropy arguments greater than this value.

--HG--
branch : minor
2016-11-25 19:35:07 -04:00
Alex Szpakowski 5d2b0a98e5 Add missing applyTransform and replaceTransform functions…
--HG--
branch : minor
2016-11-24 21:54:19 -04:00
Alex Szpakowski 5e5b247fc7 Work around buggy C++11 standard libraries (mingw)
--HG--
branch : minor
2016-11-24 21:37:13 -04:00
Alex Szpakowski 14aa6965b3 Added Transform objects to love.math (resolves issue #1228).
- Added love.math.newTransform.
- Added love.graphics.applyTransform and love.graphics.replaceTransform.
- love.graphics.draw/print/printf, Text:add/addf, and SpriteBatch:add can accept a Transform argument.
- love.graphics.push can accept an optional Transform as a second argument, which will apply the Transform after pushing the matrix stack,
- Shader:send can accept Transform objects when sending to a mat4 uniform variable.

--HG--
branch : minor
2016-11-24 21:30:45 -04:00
Alex Szpakowski 9d2ee6d909 Shader uniforms keep their values after love.window.setMode (resolves issue #1174).
Also allow arrays of images/samplers in shaders, although driver support is iffy and you have to index into the array using a compile-time constant (which might exclude loop indexing).

--HG--
branch : minor
2016-11-21 18:28:16 -04:00
Alex Szpakowski 639c229bd7 Rename RecordingDevice:startRecording and RecordingDevice:stopRecording to RecordingDevice:start and RecordingDevice:stop.
--HG--
branch : minor
2016-11-20 10:08:07 -04:00
Alex Szpakowski a245819ae1 Fix compilation on macOS and iOS. Minor cleanup.
--HG--
branch : minor
2016-11-20 10:04:08 -04:00
Alex Szpakowski 99a3653d10 Merged in rcoaxil/love-patches/minor-mic-input (pull request #68)
Microphone input implemented.

--HG--
branch : minor
2016-11-20 13:51:49 +00:00
Alex Szpakowski f118befeba Potentially fix a random error in setMode
--HG--
branch : minor
2016-11-19 23:47:33 -04:00
Alex Szpakowski bed9bc1bae We don’t need a list of projection matrices..
--HG--
branch : minor
2016-11-19 20:12:12 -04:00
Alex Szpakowski 247e1b6af0 Merge default into minor
--HG--
branch : minor
2016-11-19 19:19:14 -04:00
Alex Szpakowski 3e80ec2257 Render pass API. Replaces love.graphics.setCanvas and friends.
- Removed love.graphics.set/getCanvas, Canvas:renderTo, Canvas:newImageData, love.graphics.clear, love.graphics.discard, and love.graphics.newScreenshot.

- Added love.graphics.beginPass and love.graphics.endPass. All rendering must happen within a pass. love.draw is now called while a render pass to the main screen is active.
- Added love.graphics.renderPass, which is a wrapper for begin/endPass which calls the supplied function argument in between a begin/end. This is similar to the old Canvas:renderTo.
- Added love.graphics.isPassActive, getPassCanvases, getPassWidth, getPassHeight, and getPassDimensions.
- Added love.graphics.captureScreenshot.

- Added a new love.run callback love.drawpasses, which is called after love.update and before love.draw. It is the place to render to Canvases using beginPass or renderPass, since love.draw now always draws to the main screen.

- Renamed the ‘canvasswitches’ field in the table returned by love.graphics.getStats to ‘renderpasses’.

love.graphics.beginPass has the following variants (and renderPass mirrors them with an additional function argument at the end):

- love.graphics.beginPass(), begins rendering to the main screen without clearing it.
- love.graphics.beginPass(r, g, b [, a]), begins rendering to the main screen and clears the screen to the specified color.

- love.graphics.beginPass(canvas [, willstencil]), begins rendering to the specified Canvas without clearing it. love.graphics.stencil can only be used within the Canvas if ‘willstencil’ is true.
- love.graphics.beginPass(canvas, r, g, b [, a] [, willstencil]), beings rendering to the specified Canvas and clears it to the specified color. love.graphics.stencil can only be used within the Canvas if ‘willstencil’ is true.

- love.graphics.beginPass(info), where ‘info’ is a table in the following form:
{
    {canvas [, r, g, b, a]}, — A canvas and an optional color to clear the Canvas to when the pass begins.
    {canvas2, [r, g, b, a]}, — Additional Canvases and optional clear colors for multi-canvas rendering.
    …,
    stencil = false, — Optional boolean field to specify whether love.graphics.stencil is allowed within this pass. False by default.
}

The pass info table can be created once up-front and used for multiple beginPass/renderPass calls.

love.graphics.endPass can take an optional callback function argument, which causes endPass to capture the contents of the Canvas drawn to in the render pass to a new ImageData and passes it to the supplied function (this replaces Canvas:newImageData). This does not work on the main screen.

love.graphics.captureScreenshot replaces love.graphics.newScreenshot. It takes a callback function argument which causes love.graphics.present to capture the contents of the screen to a new ImageData and passes it to the supplied function. captureScreenshot can only be called before drawing to the main screen begins in the current frame (e.g. in love.keypressed, love.update, etc.)

--HG--
branch : minor
2016-11-19 19:13:26 -04:00
Alex Szpakowski aeca14a35a Merged in rcoaxil/love/minor (pull request #66)
consistified seeking to invalid location behavior, minor fixes

--HG--
branch : minor
2016-11-17 22:06:06 +00:00
Alex Szpakowski b084934311 Fix Shader:send and sendColor ignoring the last argument for shader uniform arrays. 2016-11-16 17:37:43 +00:00
Bart van Strien de29986d38 Minor performance tweaks for love::Type
On my system these tweaks restore performance to "enum" levels

--HG--
branch : dynamiccore2
2016-11-16 14:45:06 +01:00
Bart van Strien 9f6aa716fa Pass Type to luax_register_type by pointer instead of reference
Since the type is passed to va_start, and apparently that's undefined behaviour if it's a reference.

<Textmode> the best kind of behavior

--HG--
branch : dynamiccore2
2016-11-14 21:51:47 +01:00
Bart van Strien d967a755e5 Make love::Type handle type names
TODO: Fix undefined behaviour in luax_register_type, you can't use a va_list after a reference type

--HG--
branch : dynamiccore2
2016-11-14 21:06:53 +01:00
Bart van Strien 5d43c9601a Automatically deduce the type in luax_pushtype, if possible
--HG--
branch : dynamiccore2
2016-11-13 17:38:42 +01:00
Bart van Strien 7dd960619d Automatically deduce the type in luax_checktype, luax_getmodule, luax_optmodule and luax_totype
--HG--
branch : dynamiccore2
2016-11-13 17:13:40 +01:00
Bart van Strien 4a0a90e511 Include int.h to fix windows build
--HG--
branch : dynamiccore2
2016-11-13 16:51:27 +01:00
Bart van Strien 3b88c13535 Delete love::Type copy constructor
--HG--
branch : dynamiccore2
2016-11-13 16:46:26 +01: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 c647317a74 Re-generated boot.lua.h. 2016-11-05 17:33:32 -03:00
Alex Szpakowski da3e292389 Merged in xpol/love/better-parse-options (pull request #71)
Better love.arg.parse_options():
2016-11-05 20:29:50 +00:00
Xpol Wan c28a6c51c4 love.arg.parse_option just return how many extra arg the current option consumes.
--HG--
branch : better-parse-options
2016-11-04 22:27:49 +08:00