Commit Graph

247 Commits

Author SHA1 Message Date
BobbyJones c283e36126 made a new boot.lua.h 2015-12-31 02:16:36 -05:00
Alex Szpakowski 925eebdaf0 Removed love.event.addListener/removeListener/clearListeners.
They take away too much control from the main game code, which makes it harder to implement things like gamestates without modifying library code.
2015-12-12 17:54:54 -04:00
Alex Szpakowski e5c0c49751 Added love.event.clearListeners. 2015-12-12 14:19:37 -04:00
Alex Szpakowski 44d4ce2c99 Show the error screen instead of just exiting after printing the error, if there's a syntax error in conf.lua (thanks Shoozza!) 2015-12-12 14:13:04 -04:00
Bart van Strien 22f2175bec Add initial video playback support for Ogg Theora videos (resolves issue #66.)
The basic APIs are:

video = love.graphics.newVideo("myvideo.ogv")

love.graphics.draw(video, ...) -- Video objects are Drawables.

video:play(), video:pause()

video:getDuration(), video:tell(), video:rewind(), video:seek(seconds)

video:getSource()

video:getWidth(), video:getHeight(), video:setFilter(min, mag)

More advanced APIs include video:setSource(source), video:getStream(), and videostream:setSync.

To use a custom pixel shader when drawing a Video, call the new TexelVideo(texcoords) function instead of Texel(texture, texcoords) in order to get the pixel colors of a video frame.
2015-12-08 22:41:19 -04:00
Alex Szpakowski 99debab3a4 Updated the readme: Xcode 7 lets you build iOS apps for your device without a registered developer account. 2015-09-14 18:50:48 -03:00
Alex Szpakowski e979455772 love.event.quit now accepts a single (optional) argument, which is used as the program's exit status number. Resolves issue #1070. 2015-08-25 17:12:59 -03:00
Alex Szpakowski 71116807e3 Fixed the default error handler to disable relative mouse mode. 2015-08-18 22:13:06 -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
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 6bce7c7cd0 Fixed love.errhand. 2015-07-30 20:33:38 -03:00
Alex Szpakowski 8656797c5c Added a message box popup asking to quit the game to the default error handler, activated when the mouse is pressed or the screen is tapped. This is mostly useful on mobile devices where users can't press 'escape'. 2015-07-02 23:15:37 -03:00
Alex Szpakowski c3612acfde Fixed the use of getRealDirectory when auto-detecting the identity name. 2015-06-25 10:00:54 -03:00
Bart van Strien 29da6b3c26 Attempt to make identity autodetection even more robust using getRealDirectory 2015-06-25 11:36:49 +02:00
Alex Szpakowski 3053278048 Moved the no-game screen code to its own file. 2015-06-09 22:38:36 -03:00
Alex Szpakowski 48a0910907 Renamed love.textedit to love.textedited. (text composition event callback) 2015-05-29 23:33:01 -03:00
Alex Szpakowski 811b2db466 The full executable path, rather than argv[0], is now used when determining whether the executable is fused (resolves issue #1043.) 2015-05-04 10:38:28 -03:00
Alex Szpakowski 78dd8bc547 Added love.touch.getPressure(touchid). Not useful on most touch-capable devices, but I do expect Apple's Force Touch to make it into iPhones in the near future. 2015-03-24 20:45:21 -03:00
Alex Szpakowski 4a8e5bd4db Avoid non-ASCII UTF-8 in message box text - SDL's X11 backend for message boxes doesn't properly support it yet (https://bugzilla.libsdl.org/show_bug.cgi?id=1658). 2015-03-17 11:54:52 -03:00
Alex Szpakowski 5bc5a2b780 Show the compatibility warning message box before creating the window and loading main.lua, so it will still display even if there are errors in main.lua.
Also snprintf is only supported in VS2015...
2015-03-15 12:34:40 -03:00
Alex Szpakowski 44b9efb43e Added love.isVersionCompatible. Returns true if the running version of love is compatible with the specified version. 2015-03-13 19:26:09 -03:00
Alex Szpakowski afcad4defc Added new flag t.accelerometerjoystick to love.conf (true by default.) When set to false on mobile, the device's accelerometer will not show up as a joystick even if the joystick module is loaded.
This can reduce CPU usage if you don't use the accelerometer but you don't want to disable the joystick module entirely.
2015-03-07 15:36:53 -04:00
Alex Szpakowski 7e99ea6839 Added a boolean argument to love.mousemoved indicating whether the event came from a touch press (love.mousepressed and love.mousereleased already have it.) 2015-03-07 00:41:18 -04:00
Alex Szpakowski b9c90e8a6f Fixed the background color for the error screen, and updated LodePNG to the latest version.
--HG--
branch : minor
2015-02-27 21:20:31 -04:00
Alex Szpakowski 3efcf3901b Removed Canvas:clear. love.graphics.clear now accepts r,g,b,a values (and defaults to 0,0,0,0 with no arguments given.) love.graphics.clear clears the content of the currently active Canvas(es.)
--HG--
branch : minor
2015-02-27 03:47:25 -04:00
Alex Szpakowski 95f87ed886 Added love.lowmemory event callback function, called when the app is close to running out of memory on iOS and Android.
--HG--
branch : minor
2015-02-26 00:45:48 -04:00
Alex Szpakowski bf8f6f8b02 Changed the default fullscreen type from 'exclusive' to 'desktop'.
--HG--
branch : minor
2015-02-21 17:27:54 -04:00
Alex Szpakowski c02c8b154d Added a boolean argument to love.mousepressed and love.mousereleased indicating whether the button event originated from a touchscreen press
--HG--
branch : minor
2015-02-17 02:33:42 -04:00
Alex Szpakowski ac2b03e8a4 Added love.graphics.isActive. love.graphics function calls (and method calls on objects created via love.graphics) are only guaranteed to work when isActive is true, otherwise bad things might happen (the program crashing, for example.)
It's usually only false when the app is inactive on iOS, and when the window hasn't been created yet.

--HG--
branch : minor
2015-02-17 02:24:09 -04:00
Alex Szpakowski 71c9943bd0 Fixed the keypressed and keyreleased handler functions.
--HG--
branch : minor
2015-02-16 17:16:47 -04:00
Alex Szpakowski cce995146f Merged default into minor
--HG--
branch : minor
2015-02-16 16:44:14 -04:00
Alex Szpakowski 7f9abc1e77 Added love.touch module and touch screen events. Resolves issue #825.
Note: this implementation is slightly different from the implementation in the love 0.9.x Android and iOS ports!

Added love.touchpressed(id, x, y), love.touchmoved(id, x, y, dx, dy), and love.touchreleased(id, x, y, dx, dy).

id is a unique identifier for the touch press that persists until love.touchreleased. After that it is no longer unique.
x and y are the coordinates of the touch event in pixels within the window.
dx and dy are the amount in pixels that the touch has moved since the last event.

Added love.touch.getTouchCount and love.touch.getTouch(index).

love.touch.getTouch takes an index (not the same as an id. indices are not stable and don't correspond to a unique touch press.)
It returns the id of the touch and its current x and y coordinates in pixels.

--HG--
branch : minor
2015-02-16 16:29:45 -04:00
Alex Szpakowski c106d9ff53 love.event can now handle any number of event arguments.
--HG--
branch : minor
2015-02-15 21:31:22 -04:00
Alex Szpakowski 672899f5c7 Use a message box for version compatibility warnings, rather than displaying a timed message before the game loads. 2015-02-15 17:38:43 -04:00
Alex Szpakowski a7e4148869 Merged default into minor
--HG--
branch : minor
2015-01-16 15:47:26 -04:00
Alex Szpakowski b4f2a9417a Added new event callback love.mousemoved(x, y, xrel, yrel), where xrel and yrel are the amount of pixels moved since the last event. Added love.mouse.setRelative(bool relative) and love.mouse.isRelative. Resolves issue #470.
Enabling relative mouse mode will hide the cursor and let the system generate relative mouse move events while preventing the mouse from getting stuck at the edges of the screen (i.e. you can keep moving the mouse in one direction forever and the relative movement events will be generated accordingly.)

The reported absolute mouse position is not updated while relative mode is enabled, even while relative movement events are generated.
2015-01-15 20:22:57 -04:00
Alex Szpakowski dff496bdb5 Passing --console to love.exe now opens the console before conf.lua is loaded. 2015-01-15 17:48:04 -04:00
Alex Szpakowski 6d3ae981ac Moved the love.audio.stop call when love is quit from love.run to the destructor of the Audio module. 2015-01-15 16:36:52 -04:00
Alex Szpakowski 1b41d546e2 Removed a Mac-specific workaround from love.run (pumping events before love.load so that love.mouse.setPosition works before love.update.)
It seems to be no longer necessary, and it was a partial workaround anyway.
2015-01-10 18:44:58 -04:00
Alex Szpakowski c7b45b3505 Updated copyright for the new year 2014-12-31 19:32:43 -04:00
Alex Szpakowski 8d0654a6a7 Added runtime drag-and-drop file and folder support via new love.filedropped and love.directorydropped event callback functions. filedropped has a single File object argument, and directorydropped has a single string argument containing the full path of the directory, which can be used with love.filesystem.mount.
--HG--
branch : minor
2014-10-18 20:30:36 -03:00
Alex Szpakowski d4ad571780 Un-reverted commit 14ca947 (love.math.setRandomSeed internally calling random() a few times) for the minor branch.
--HG--
branch : minor
2014-09-28 16:05:17 -03:00
Alex Szpakowski 34688e929e Merged default into minor
--HG--
branch : minor
2014-09-28 15:56:04 -03:00
Alex Szpakowski e8009bb4cb Reverted commit 14ca947 (love.math.setRandomSeed internally calling random() a few times.) The change can break existing 0.9.x games so it will be pushed back to the minor branch. 2014-09-28 15:28:14 -03:00
Alex Szpakowski aba33bf2e7 Merged default into minor
--HG--
branch : minor
2014-09-20 00:34:34 -03:00
Alex Szpakowski b75e1bdeaa Added love.window.setPosition(x, y [, displayindex]), love.window.getPosition, and optional x and y fields for t.window in love.conf and for the flags table in love.window.set/getMode (resolves issue #930.) 2014-09-19 16:19:55 -03:00
Alex Szpakowski fffbd3ecab Merged default into minor
--HG--
branch : minor
2014-09-18 02:15:20 -03:00
Alex Szpakowski 604bc34106 Hopefully fixed the default filesystem identity when a game is fused to the executable in Windows. 2014-09-16 14:24:04 -03:00
Alex Szpakowski 00944c5f5d Added love.window.toPixels(x [, y]) and love.window.fromPixels(x [, y]), for easier conversion between window-space and pixel-space values when highdpi mode is enabled on a retina display in OS X (and in the iOS and Android ports of LÖVE.) 2014-09-14 15:58:37 -03:00
Alex Szpakowski 6f6bf6a2bb Merged default into minor
--HG--
branch : minor
2014-08-30 22:08:10 -03:00