Commit Graph

3151 Commits

Author SHA1 Message Date
Alex Szpakowski 69a2da76dc Fixed BMFont y coordinates.
--HG--
branch : minor
2017-05-19 19:22:04 -03:00
Alex Szpakowski 0b3b58adb8 Hopefully fixed Font baseline calculation.
--HG--
branch : minor
2017-05-19 19:14:58 -03:00
Alex Szpakowski 7694edfd52 Auto-batched draws (except for love.graphics.print, for now) are affected by 3D transforms.
--HG--
branch : minor
2017-05-17 22:03:09 -03:00
Alex Szpakowski 955fb9b60c Fixed love.graphics.draw(particlesystem, …) to actually use the transformation parameters.
--HG--
branch : minor
2017-05-17 18:51:42 -03:00
Alex Szpakowski ac697ddb0f Clean up love’s internal Vector code a bit, and rename it to Vector2 so it’s more obvious what it is.
--HG--
branch : minor
2017-05-16 22:07:01 -03:00
Alex Szpakowski 135d928922 Fix compilation
--HG--
branch : minor
2017-05-06 23:59:15 -03:00
Alex Szpakowski b019a4a64c Cleaned up texture VRAM usage tracking.
--HG--
branch : minor
2017-05-06 23:56:10 -03:00
Alex Szpakowski b590edf27d Merge default into minor
--HG--
branch : minor
2017-04-30 00:37:26 -03:00
Alex Szpakowski 16f5557131 Move more backend-agnostic code out of the love.graphics opengl implementation files.
--HG--
branch : minor
2017-04-30 00:01:23 -03:00
Alex Szpakowski 621fb24ba1 Require stencil=true to be specified in setCanvas if stenciling is used while a Canvas is active and there is no custom stencil buffer.
--HG--
branch : minor
2017-04-29 21:29:37 -03:00
Alex Szpakowski 10d73ea1d7 Moved some backend-agnostic code out of the OpenGL backend of love.graphics.
--HG--
branch : minor
2017-04-29 18:38:23 -03:00
Alex Szpakowski fd64999748 Allow calling love.graphics.drawLayer(arraycanvas, layer) when rendering to a different layer of the same Canvas.
--HG--
branch : minor
2017-04-29 13:35:07 -03:00
Alex Szpakowski 353852ca24 Fix the default mipmap filter of mipmapped Canvases (thanks Shell32).
--HG--
branch : minor
2017-04-28 21:36:50 -03:00
Alex Szpakowski 70b32c47ce Error if a non-2D/affine matrix is used with auto-batched draws, since they perform CPU-side matrix transforms on 2-component vectors.
--HG--
branch : minor
2017-04-23 00:12:57 -03:00
Alex Szpakowski 7161d600b7 Add mipmapping support to Canvases.
- Added an optional mipmap index argument to the non-table variant of love.graphics.setCanvas, and an optional ‘mipmap’ field to the table variant.
- Canvas:setMipmapFilter now works.
- Added Canvas:generateMipmaps.
- Added Canvas:getMipmapMode.
- Added a new ‘mipmaps’ enum field to the table passed into love.graphics.newCanvas. Accepted values are “none” (default), “manual”, and “auto”.

If a Canvas has the manual mipmap mode, you will either need to render to a mipmap level or call Canvas:generateMipmaps. If it has the auto mode, mipmaps will be automatically generated after rendering to that Canvas. Generating mipmaps is not free.

--HG--
branch : minor
2017-04-15 01:58:03 -03:00
raidho36 6b7172bd40 Fix Issue #1273
Added Lua index registry clear routine to `destroy` method of classes that use it.
If this is left to GC, the abandoned userdata would stay in memory for one full extra cycle.

Prettified the code slightly. Clarified some comments. Refactored `Fixture` class `udata` name.
Removed Reference class include from `Shape` (it doesn't use it).
2017-04-14 05:53:36 +03:00
Alex Szpakowski a0ef2ac28b Add Depth compare / shadow sampler support. Officially this is only supported in glsl3 shaders.
- Add Texture:setDepthSampleMode(comparemode). Only works on textures with depth pixel formats. A texture with the depth sample mode set will only work with a depth sampler.
- Add DepthImage, DepthArrayImage, and DepthCubeImage sampler keywords to glsl3.

--HG--
branch : minor
2017-04-12 20:26:06 -03:00
Alex Szpakowski 0001b4695e Add new variants of love.graphics.clear for controlling how the depth and stencil buffers are cleared.
- Add love.graphics.clear(r, g, b, a [, stencilvalue, depthvalue]).
- Add love.graphics.clear(color1, color2, …, [, stencilvalue, depthvalue]).
- Add love.graphics.clear(false, stencilvalue, depthvalue).

stencilvalue and depthvalue are either true, false, or a number. True is the default behaviour and clears that buffer to the default value (0 for stencil, 1 for depth), false prevents clearing.

The third variant listed above only clears the depth and/or stencil buffers and not the color buffer.

--HG--
branch : minor
2017-04-11 22:32:40 -03:00
Alex Szpakowski 72c7602650 Readable depth-stencil Canvases with MSAA are not currently supported.
--HG--
branch : minor
2017-04-11 20:45:12 -03:00
Alex Szpakowski fca3d4a841 Improved the error message when a Canvas with the readable field explicitly set is not supported.
--HG--
branch : minor
2017-04-11 19:06:51 -03:00
Alex Szpakowski 43172bd3f6 Add optional ‘readable’ boolean field to the table passed into love.graphics.newCanvas. Added new variant of love.graphics.getCanvasFormats which takes a ‘readable’ boolean.
--HG--
branch : minor
2017-04-11 19:03:13 -03:00
Alex Szpakowski c36a53fdcb Add new non-readable Canvas formats: depth16, depth24, depth32f, depth24stencil8, and depth32fstencil8.
--HG--
branch : minor
2017-04-11 18:34:04 -03:00
Alex Szpakowski 018a3831cb Add a new “stencil8” pixel format for Canvases (resolves issue #1003).
Also fixed Canvas MSAA (resolves issue #1271).

stencil-formatted Canvases can’t be drawn, and can only be used as the value for a new ‘depthstencil’ field to the table-argument variant of love.graphics.setCanvas.

--HG--
branch : minor
2017-04-11 00:00:22 -03:00
Alex Szpakowski 08a377ff30 Rename love.graphics.flush to love.graphics.flushBatch.
Mesh/Spritebatch/Text:flush already exist and do something a bit different (flush vertices instead of render a pending batch).

--HG--
branch : minor
2017-04-08 18:53:48 -03:00
Bart van Strien ac00329ddd Fix wrong default reference angle for WeldJoint/PrismaticJoint/RevoluteJoint (fixes #1258)
--HG--
branch : minor
2017-04-07 12:19:29 +02:00
Bart van Strien f70ad12d3e Expose love.event.poll_i
Now love.event.poll just returns love.event.poll_i, instead of returning a new
c function every call. This means love no longer creates garbage each frame
(with an empty project).

See pull request #81 for details, and an alternative fix. Thanks @bjornbytes
for the pull request, and for finding this issue.

Note: in the pull request I also mentioned love.filesystem.lines/File:lines. I
haven't "fixed" those since they use actual closures.

--HG--
branch : minor
2017-04-07 12:04:58 +02:00
Alex Szpakowski a854602344 Fix a crash when a Source stops playing.
--HG--
branch : minor
2017-04-02 13:32:25 -03:00
Alex Szpakowski 60f898af67 Fix a crash when loading .pvr compressed texture.
--HG--
branch : minor
2017-04-01 21:20:08 -03:00
Alex Szpakowski f8c58c54c8 love.math.randomNormal can be JIT-compiled
--HG--
branch : minor
2017-04-01 21:19:19 -03:00
Bart van Strien b205b8a020 Remove references to old LOVE_ENABLE_module_implementation defines
As far as I know they are no longer used, as autotools was the primary (only)
user and it now switches entire modules.
I've also taken the opportunity to clean up the default list in
src/common/config.h.
Oh yeah, and this fixes linux builds not having graphics or audio backends.

--HG--
branch : minor
2017-03-30 19:09:15 +02:00
Alex Szpakowski 43fea45f9f Fix a memory leak when pushing love objects to threads which never load that object’s module (resolves issue #1267).
Also fix Variant assignment operator to call release() on the correct object.

--HG--
branch : minor
2017-03-12 13:20:35 -03:00
Bart van Strien 3c29c26e7a Oops, some automagic messages ended up on stderr
--HG--
branch : minor
2017-03-12 12:27:26 +01:00
Bart van Strien 4ccbe6dfec Update autotools build system
Make genmodules create a simpler Makefile.am:
Instead of generating separate rules for modules and implementations, just create rules for modules and lua libraries
Disable selection of non-lua libraries, they will now be built when needed.
Also disable selection of implementations, because that was useless anyway.

Note: inter-module dependencies aren't dealt with (yet).

--HG--
branch : minor
2017-03-12 10:47:19 +01:00
Bart van Strien cc4dea07b5 Make automagic automatically print command output in case an error occurs
--HG--
branch : minor
2017-03-12 10:39:31 +01:00
Alex Szpakowski 7fdea9a5d1 Merged in lognz/love-minor2/particle system new features (pull request #85)
Particle System New Features

--HG--
branch : minor
2017-03-11 14:52:01 +00:00
lognz 9f2ac304e3 Corrected angle not factoring setDirection() into spawn angle
--HG--
branch : particle system new features
2017-03-11 08:13:12 +00:00
lognz 0f99f261e0 Particle System new features
2 new Particle System Distribution types:

borderellipse - spawns new particles around the border of an elllipse shape defined by dx,dy
borderrectangle - spawns new particles around the border of a rectangle shape defined by dx, dy

New functions:

getAreaSpreadAngle()
getAreaSpreadIsRelativeDirection()
setAreaSpreadAngle(angle in radians)
setAreaSpreadIsRelativeDirection(boolean)

setAreaSpread(distribution, x, y, (optional)angle, (optional)isRelativeDirection)

- angle - defaults 0. In radians the angle to rotate the entire area spread distribution
- isRelativeDirection - defaults false. When false, particles will travel in the direction defined by setDirection(). When true, particles will travel away from the center of the area spread shape

Demo: http://i.imgur.com/sBQ9Xhr.png

The new angle parameter should address: https://bitbucket.org/rude/love/issues/1172

--HG--
branch : particle system new features
2017-03-11 01:54:26 -06:00
lognz 09b757f018 2 new area particle distributions: borderellipse and borderrectangle
--HG--
branch : particle system new features
2017-03-10 06:42:52 -06:00
Alex Szpakowski a8e4db8e1e Clamp color arguments to [0, 1] in cases where we don’t support values outside of that range internally.
--HG--
branch : minor
2017-03-09 21:15:56 -04:00
Alex Szpakowski 1a9262dda9 Fix compilation on iOS. Fix shader compilation on OpenGL ES. Fix (harmless) GL errors on OpenGL ES 2. Resolves issue #1266.
--HG--
branch : minor
2017-03-09 20:46:26 -04:00
Alex Szpakowski 5ce084051a Fix for gles shader profiles when validating shaders.
--HG--
branch : minor
2017-03-09 19:38:51 -04:00
Alex Szpakowski 856a4e60ae Declare VaryingTexCoords and love_ScreenSize as highp when supported.
--HG--
branch : minor
2017-03-07 21:20:44 -04:00
Alex Szpakowski ceb9cd1c0b Rename internal “GLSLES” references to “ESSL”.
--HG--
branch : minor
2017-03-07 21:03:23 -04:00
Alex Szpakowski 0fde3fde35 Add new variants of love.graphics.print/printf which accept a Font argument, rather than relying on global love.graphics state to determine the Font to use.
--HG--
branch : minor
2017-03-06 23:15:10 -04:00
Alex Szpakowski 074107b01d ImageData:paste can copy between ImageData of different formats. Resolves issue #1249.
--HG--
branch : minor
2017-03-03 22:10:10 -04:00
Alex Szpakowski cb9aa857d7 Don’t try to create the standard/default array texture shader if array textures are not supported.
--HG--
branch : minor
2017-03-01 21:19:37 -04:00
Alex Szpakowski 12ede289b4 Fix memory leak
--HG--
branch : minor
2017-02-26 20:22:03 -04:00
Alex Szpakowski b44e6b2156 love.graphics.newVolumeImage can now automatically convert a 1xN or Nx1 sheet of square images into layers.
--HG--
branch : minor
2017-02-26 20:18:06 -04:00
Alex Szpakowski a3454aa205 Use a simpler default video shader.
--HG--
branch : minor
2017-02-26 17:22:08 -04:00
Alex Szpakowski 9e94f5a375 love.graphics.drawLayer(canvas, …) now errors if the Canvas is currently active as a render target (matches behaviour of love.graphics.draw).
--HG--
branch : minor
2017-02-26 17:15:26 -04:00