Commit Graph

2527 Commits

Author SHA1 Message Date
Alex Szpakowski 780c970b99 Removed an unnecessary error message in love.graphics.newMesh. 2015-08-18 22:32:27 -03:00
Alex Szpakowski 71116807e3 Fixed the default error handler to disable relative mouse mode. 2015-08-18 22:13:06 -03:00
Bart van Strien acca06907e Extend c++11 tests in configure script
Now also checks if gcc is at least version 4.7 or clang is at least version 3.1
2015-08-17 19:01:43 +02:00
Bart van Strien 987ddcdc26 Update path to macosx.mm in autotools build 2015-08-17 17:10:20 +02:00
Alex Szpakowski 153bd6f4cb Cleaned up the Font:getWrap code a bit. 2015-08-16 01:04:51 -03:00
Alex Szpakowski 9a1c4ad565 The iOS game list screen now also displays folders that contain main.lua. 2015-08-15 23:57:04 -03:00
Alex Szpakowski e44f20fdc6 Renamed OSX.mm/OSX.h to macosx.mm/macosx.h to match love's file naming conventions. 2015-08-15 00:41:45 -03:00
Alex Szpakowski db91a73d57 Trigger a Lua error if love.graphics.draw(canvas) is called while that canvas is the active one.
This only catches a subset of the possible accidental read-while-writing situations that can happen when using Canvases, unfortunately.
2015-08-14 22:46:29 -03:00
Alex Szpakowski 9be2581e6f Implemented love.system.vibrate on iOS. Unfortunately due to API limitations the duration argument is ignored, and it always vibrates for roughly 0.5 seconds. 2015-08-14 21:30:07 -03:00
Martin Felis 2ab69094e1 Added love.system.vibrate(time), which causes the phone to vibrate on Android. love.system.getOS() now returns "Android" on Android. Implemented love.system.openURL. 2015-08-13 19:48:25 -03:00
Martin Felis 637a3a9d62 Pause OpenAL when the app is in the background, on Android. 2015-08-13 19:46:11 -03:00
Martin Felis f6448116cc Fixed OpenGL ES function loading on some Android devices. 2015-08-13 19:44:52 -03:00
Martin Felis 6e0abae688 Implemented love.window.getPixelScale for Android. Fullscreen windows now use Android's 'immersive mode'. 2015-08-13 19:44:18 -03:00
Martin Felis 19b7d1e115 Implemented love.filesystem support for Android. 2015-08-13 19:42:31 -03:00
Martin Felis 5446022660 print on Android now outputs to Logcat. 2015-08-13 19:41:35 -03:00
Martin Felis 1ea54042e3 Fixed compilation when building for Android. 2015-08-13 19:39:56 -03:00
Martin Felis f5778ed86e Added a LOVE_ANDROID define and Android-specific code that interacts with the JNI and SDL. 2015-08-13 19:38:07 -03:00
Alex Szpakowski 5bdea01559 Fixed Canvas:renderTo to restore the previous canvases if an error occurs in the passed function. 2015-08-12 23:45:44 -03:00
Alex Szpakowski 12450c9657 Don't error if a compressed texture with no mipmap information is passed into love.graphics.newImage and the mipmaps flag is true. 2015-08-12 19:33:56 -03:00
Alex Szpakowski a45c1332a7 Cleaned up some Mesh and SpriteBatch code. 2015-08-11 23:07:33 -03:00
Alex Szpakowski bfef97c48a Slightly reduced the CPU usage of SpriteBatch:add, Text:add, and love.graphics.draw(ParticleSystem). 2015-08-11 18:01:24 -03:00
Alex Szpakowski 6d9409a337 Probably fixed compilation with GCC 4.8. 2015-08-10 14:39:58 -03:00
Alex Szpakowski 0b566f3c94 Updated the changelog. 2015-08-10 09:47:40 -03:00
Alex Szpakowski d215d8a91e Reworked sRGB / gamma-correct APIs:
Gamma-correct blending and shader math can be enabled globally via the new 't.gammacorrect' boolean flag in love.conf.
The new function love.graphics.isGammaCorrect will return true if it was requested in love.conf and is supported on the system.

When gamma correct rendering is enabled, colors (including the colors of pixels from images) are automatically converted from sRGB to linear RGB before use. When drawing to the main screen or to a canvas with the 'normal' or 'srgb' format, the final output colors of pixel shaders are automatically converted from linear RGB to sRGB after blending and before the color is stored in the pixel.

This lets the rendering pipeline do math using linear RGB values for colors rather than sRGB values, so the math is correct, without making users of the APIs manually linearize their colors with the love.math.gammaToLinear function (which still exists). The final output of the screen is encoded as sRGB, which is what systems expect. Canvases (except when otherwise requested) store their contents with sRGB encoding for increased precision with darker colors.

the 'srgb' window setting flag has been removed, as well as the 'srgb' image flag. A new image flag 'linear' has been added, which when set to true will cause the colors of the image to always be treated as linear RGB rather than sRGB, when gamma-correct rendering is enabled.

A new function 'Shader:sendColor' has been added, which has the same argument structure as 'Shader:send' but expects colors in the range of [0, 255]. When gamma-correct rendering is enabled it automatically gamma-corrects the given colors (by applying gammaToLinear to them.)

New shader code functions have been added: gammaToLinear, linearToGamma, gammaCorrectColor, and unGammaCorrectColor. When gamma-correct rendering is enabled, the LOVE_GAMMA_CORRECT #define is set and gammaCorrectColor and unGammaCorrectColor are aliases for gammaToLinear and linearToGamma respectively, otherwise the functions do nothing.

The new shader functions have 'precise' and 'fast' variants. If the LOVE_PRECISE_GAMMA define is set, then the normal functions default to the precise variants, otherwise they default to the fast variants. Currently the define is set in vertex shaders and not set in pixel shaders.

The default per-vertex color is automatically gamma-corrected by LÖVE when gamma correct rendering is enabled, but any custom named per-vertex attribute specified with the new custom attribute Mesh functionality won't be, unless 'gammaCorrectColor' or similar functions are explicitly used (preferably inside the vertex shader code that has the custom attribute.)
2015-08-09 21:46:21 -03:00
Alex Szpakowski b13ba42ec4 Appveyor: create the packaged zip and exe installer files when building, rather than creating a zip with some missing files. 2015-08-06 20:49:59 -03:00
Bart van Strien 4748132853 Show indicated version in incompatibility message (resolves issue #1066)
Also fixed a typo in the message
2015-08-05 14:36:07 +02:00
Alex Szpakowski 68bb0c97bc Hopefully fixed compilation when VS2013 is used... 2015-08-05 01:51:08 -03:00
Alex Szpakowski 54f2617849 Removed some redundant internal code. 2015-08-05 01:43:34 -03:00
Alex Szpakowski 99acec83c9 Renamed some internal functions to avoid name conflicts when some third-party code is #included. 2015-08-03 20:27:46 -03:00
Alex Szpakowski f2b4438a57 Fixed love.window.getPosition in fullscreen mode when SDL 2.0.4 is used. 2015-08-01 16:01:59 -03:00
Bart van Strien c15f4b5f26 Modify __tostring so it also shows a pointer, like lua does for tables
This should make it easier to identify unique objects.
Also modified internal code relying on tostring behaviour, and it should now
call its type method instead.
2015-08-01 19:55:41 +02:00
Alex Szpakowski 2392174eb2 Rounded rectangles with radius values >= the rectangle's width and height are now clamped rather than causing an error. 2015-08-01 13:31:08 -03:00
Bart van Strien c02ba91ef4 Fix segfault loading images from compressed data without an explicit sRGB flag 2015-08-01 14:22:36 +02:00
Alex Szpakowski 66942d5f31 Added the ability to use custom mipmaps in Images, via love.graphics.newImage(filename, {mipmap1, mipmap2, ...}). Resolves issue #1064.
All mipmap levels must be present if custom mipmaps are used (and their sizes must be half the size of the previous mipmap level, rounded down.)

Image:getData now returns all custom mipmaps in an Image.
2015-07-30 20:48:36 -03:00
Alex Szpakowski 6bce7c7cd0 Fixed love.errhand. 2015-07-30 20:33:38 -03:00
Alex Szpakowski 8bf8c0cd18 Hopefully work around an issue where older Intel drivers on Windows use Microsoft's OpenGL 1.1 software renderer instead of failing to create the context, when a requested framebuffer attribute value is unsupported.
Failing to create the context is preferred in that situation because love's code will then try disabling various framebuffer settings to get a hardware-accelerated context using a supported OpenGL version.
2015-07-28 11:27:45 -03:00
Alex Szpakowski f5abedaeeb Cleaned up the love.graphics code that deals with love.window to be more consistent with the rest of the codebase. 2015-07-24 21:40:55 -03:00
Alex Szpakowski 354f83c1cb Added support for MSAA on the window on iOS.
Requires updated dependencies to compile on iOS, which can be downloaded at https://dl.dropboxusercontent.com/u/4214717/love-ios-libraries-0.10.zip
2015-07-19 22:39:02 -03:00
Alex Szpakowski 4cd725cee6 Added love.window.close (resolves issue #1059), and renamed love.window.isCreated to love.window.isOpen. 2015-07-18 13:22:55 -03:00
Alex Szpakowski 2cce18946d Fixed objects which store Lua callback functions to avoid attempting to use dead coroutines when deleting the reference to the callback function. Should fix crashes when coroutines are mixed with those objects.
Also improved the performance of World:rayCast and World:queryBoundingBox.
2015-07-18 03:26:07 -03:00
Alex Szpakowski 64b9d40f00 Fixed World:getCallbacks and World:getContactFilter to use the active coroutine's lua state. 2015-07-17 19:00:42 -03:00
djcj 4989bd76a0 Update Debian packaging files, move manpage to section 6
Modified application of pull request #43 by bartbes
 - Kept binary in /usr/bin
 - Remove postinst/postrm scripts
2015-07-13 17:32:18 +02:00
Alex Szpakowski e27400de30 The add and subtract blend modes no longer modify the destination framebuffer's alpha. 2015-07-08 14:21:22 -03:00
Bart van Strien 7e44034757 Add a MutexRef class to clean up Mutex handling code 2015-07-06 11:58:08 +02:00
Bart van Strien dd1167d736 Fix inconsistent missing override warning in BMFontRasterizer 2015-07-06 11:52:40 +02:00
Bart van Strien 3449465f1a Update hgignore 2015-07-05 17:32:45 +02:00
Alex Szpakowski 87e20ccafb Fixed the display index parameter of love.window.getFullscreenModes, getDesktopDimensions, and setPosition to be 1-based instead of 0-based (resolves issue #1056.) 2015-07-05 10:06:24 -03:00
Alex Szpakowski 2168d509b3 Reworked ImageData:encode:
- It now returns a FileData containing the encoded ImageData.

- The first argument is now the format to encode to.

- The second argument is now the filename to write to, and is optional. No file will be written if a filename is not given.
2015-07-04 22:30:09 -03:00
Alex Szpakowski 3199482c3b Fixed filesystem writing on iOS. 2015-07-03 20:34:25 -03:00
Alex Szpakowski 91e94b4662 Potentially fixed a bug in the vorbis decoder seek callback. 2015-07-03 16:50:58 -03:00