Commit Graph

400 Commits

Author SHA1 Message Date
Alex Szpakowski df1bd42dec Implemented efficient FFI versions of ImageData methods.
Note that ImageData:mapPixel (with its optional sub-rectangle parameters) is often many times faster than a loop of ImageData:setPixel and/or getPixel, for anything more than a few pixels.
2015-06-15 00:50:01 -03:00
Alex Szpakowski 532c61c6c2 Implemented efficient FFI versions of SoundData methods, which are used when the LuaJIT FFI and JIT compiler are present. 2015-06-14 18:41:34 -03:00
Alex Szpakowski 16ebe92176 Added a flag to the Mac info.plist which allows high-dpi windows to be created in all situations when requested and supported. 2015-06-12 16:53:05 -03:00
Alex Szpakowski 59e4b1b8d6 Removed some debug prints on iOS. 2015-06-11 21:16:28 -03:00
Alex Szpakowski 9e2dd384cb Removed the "LÖVE" text label from the default iOS launch screen. 2015-06-09 00:03:55 -03:00
Alex Szpakowski 17fe6bd30a Hopfully fixed some Xcode syntax highlighting and in-line error detection issues. 2015-05-18 21:46:04 -03:00
Alex Szpakowski 3704595189 Enabled OpenGL ES 3 support for Windows/Linux/Android when SDL 2.0.4+ is used, since that SDL version fixed its EGL code for GLES 3+. 2015-05-11 21:14:10 -03:00
Alex Szpakowski 60e8cc24bf Removed iOS-specific code to decode and encode images using the ImageIO framework (it's now redundant.) 2015-05-03 20:49:06 -03:00
Alex Szpakowski 5dbf589d47 Removed libjpeg-turbo as a dependency (closes issue #1031.) Removed jpeg support for ImageData:encode. stb_image now handles jpeg image loading. 2015-05-03 17:52:20 -03:00
Alex Szpakowski 8e42f591ce Updated the iOS xcode project search paths for the luajit headers and static library. 2015-04-25 12:00:07 -03:00
Alex Szpakowski 97806f87c0 Replaced Simplex noise with Perlin noise for the 3D and 4D variants of love.math.noise, to avoid patent-infringement issues (resolves issue #997.) 2015-04-17 17:01:41 -03:00
Alex Szpakowski 2844499ef7 Added the ability to have custom vertex attributes in Meshes (resolves issue #768.)
Added new love.graphics.newMesh variants: newMesh(vertexformat, vertices [, drawmode, meshusage]) and newMesh(vertexformat, numvertices [, drawmode, meshusage]).

Replaced the regular love.graphics.newMesh variants with newMesh(vertices [, drawmode, meshusage]) and newMesh(numvertices [, drawmode, meshusage]). To use an image or canvas with a mesh, use Mesh:setTexture.

vertexformat is a table with the following prototype:
{
  {attributename, datatype, components},
  {attributename, datatype, components},
  ...
}

Where attributename is the name of the vertex attribute (can be the built-in names 'VertexPosition', 'VertexTexCoord', or 'VertexColor', or a custom name for use in a vertex shader), datatype is the type of values used for the attribute ('float' or 'byte'), and components is the number of components in the vertex attribute (between 1 and 4.)

The vertex format is used to determine the layout of the vertices in the mesh, for example the 'regular' newMesh variants use this vertex format:
format = {
  {"VertexPosition", "float", 2},
  {"VertexTexCoord", "float", 2},
  {"VertexColor", "byte", 4},
}

The mesh usage parameter accepts the same constants as the spritebatch usage hint in love.graphics.newSpriteBatch - "dynamic", "static", and "stream".

Mesh:setVertex now sets *all* vertex attributes for a specific vertex in the Mesh.

Added Mesh:setVertexAttribute(vertexindex, attributeindex, attributevalue1, ...), which sets the values for a specific vertex attribute in a specific vertex in the Mesh (resolves issue #784.)

Added Mesh:getVertexFormat and Mesh:flush.

Added Mesh:setAttributeEnabled(attributename, enable) and Mesh:isAttributeEnabled(attributename), to enable or disable the use of a specific attribute when drawing the Mesh.

Added Mesh:attachAttribute(attributename, mesh), which makes the Mesh use a vertex attribute from another mesh when drawing the Mesh. This can be used to separate out vertex attributes which are updated at different rates into different meshes, and to share vertex data between multiple meshes.

Removed Mesh:setVertices, Mesh:getVertices, and Mesh:setVertexColors.
2015-04-08 22:24:17 -03:00
Alex Szpakowski 86d41620dd Replaced the mouse button constants ("l", "r", "m", etc.) with button numbers. 1 is the primary button, 2 is the secondary button, 3 is middle-mouse, etc. Resolves issue #1019. 2015-03-25 00:31:16 -03:00
Alex Szpakowski a29b349014 Added love.math.compress(data, format [, level]) and love.math.decompress(compresseddata) / love.math.decompress(compressedstring, format).
Renamed the love.image CompressedData type to CompressedImageData.

love.math.compress returns a love.math CompressedData object which holds the newly compressed data. Currently supported formats are "lz4" and "zlib". Note that the formats are not file formats and don't compress filesystem hierarchies.
2015-03-23 11:28:14 -03:00
Bart van Strien 95d9dfa801 Explicitly search for pkg-config in configure script 2015-03-21 21:49:17 +01:00
Alex Szpakowski 163d059305 Moved most of the love.timer code out of the sdl implementation folder. 2015-03-20 00:55:14 -03:00
djcj 9d2a2832ab Disable static libraries by default in linux build 2015-03-18 11:28:01 +00:00
Bart van Strien bd271ce5cb Remove OpenGL as compile-time dependency on linux, SDL loads it at runtime (and also GLES, if applicable) 2015-03-15 21:37:04 +01:00
Bart van Strien b049dd0387 Also add *.hpp files to autotools sources lists 2015-03-15 21:36:35 +01:00
Alex Szpakowski 4ef0d257e9 Added an optional font hinting argument to love.graphics.newFont / love.font.newRasterizer when loading TrueType fonts. Resolves issue #963.
Accepted values are "normal", "light", "mono", and "none".
2015-03-07 22:05:37 -04:00
Alex Szpakowski 8277eb9abd Renamed the internal OpenGL buffer class from VertexBuffer to GLBuffer. 2015-03-03 02:21:28 -04:00
Alex Szpakowski 2f419c1c83 Replaced most cases of type bits and type name strings in love's Lua wrapper code with type id's.
--HG--
branch : minor
2015-03-01 18:32:41 -04:00
Alex Szpakowski 3830a0969c Moved the Texture and Quad Lua wrapper files out of the opengl graphics implementation folder.
--HG--
branch : minor
2015-03-01 03:51:44 -04:00
Alex Szpakowski c572b1af19 Moved the Lua wrapper code for love.event out of the sdl implementation folder.
--HG--
branch : minor
2015-03-01 02:55:50 -04:00
Alex Szpakowski c4dd3df799 Added a placeholder default launch screen nib for iOS so the app always uses the device's native resolution (in iOS 8+, at least.)
--HG--
branch : minor
2015-02-24 03:54:29 -04:00
Alex Szpakowski 182792de85 Enabled CoreAudio sound decoder support on iOS
--HG--
branch : minor
2015-02-22 22:17:17 -04:00
Alex Szpakowski aac4b3487a Replace deprecated PHYSFS_addToSearchPath calls with PHYSFS_mount.
--HG--
branch : minor
2015-02-22 17:48:32 -04:00
Alex Szpakowski 3faa3c7645 Removed some unnecessary xcode project config files
--HG--
branch : minor
2015-02-20 20:12:44 -04:00
Alex Szpakowski ebc68023a7 Fix many warnings about implicit integer conversions when compiling for 64 bits.
--HG--
branch : minor
2015-02-20 01:20:08 -04:00
Alex Szpakowski 85de3c41fb Initial iOS implementation.
--HG--
branch : minor
2015-02-20 00:21:21 -04:00
Alex Szpakowski 24c7539182 Updated some Xcode project settings
--HG--
branch : minor
2015-02-18 23:04:01 -04:00
Alex Szpakowski df0fab1b67 Moved the xcode project files and related data from platform/macosx to platform/xcode.
--HG--
branch : minor
2015-02-18 22:47:04 -04:00
Alex Szpakowski 482b61187f Added a new backend for loading and saving images using Apple's ImageIO framework. It's not enabled on any platform yet.
--HG--
branch : minor
2015-02-17 17:56:40 -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 e8286de1f3 Pulled some Font module code out of the freetype implementation files, since it's not freetype-specific.
--HG--
branch : minor
2015-02-16 01:47:20 -04:00
Alex Szpakowski 606f077e5d Moved Mac-specific code from platform/macosx/ to src/common/
--HG--
branch : minor
2015-02-15 23:44:35 -04:00
Alex Szpakowski 976deb0b74 Added a Sound Decoder using Apple's CoreAudio framework.
--HG--
branch : minor
2015-02-15 21:57:43 -04:00
Alex Szpakowski 10cf501979 Merged default into minor
--HG--
branch : minor
2015-02-14 18:53:31 -04:00
Bart van Strien 902a7cb68b Update debian package files to the 0.9.2~rc1 version 2015-02-14 20:19:47 +01:00
Alex Szpakowski 67aede6bc0 Merged default into minor
--HG--
branch : minor
2015-02-02 01:13:21 -04:00
Alex Szpakowski 665cdc4ae7 Moved the default Font logic from the graphics.lua script to the Graphics and Font module C++ code. Moved love.graphics.setNewFont from the graphics.lua script to the Graphics module Lua wrapper code. Moved the Vera.ttf data from the graphics.lua script to its own file inside the Font module. 2015-01-31 01:10:38 -04:00
Alex Szpakowski 970704c2b7 Added Text objects via love.graphics.newText(font [, textstring]). Reworked the internal code of Font objects to use fewer individual textures and less VRAM per object, and to be compatible with OpenGL ES. Slightly improved the performance of love.graphics.print and love.graphics.printf.
Text objects are Drawable objects that represent text on the screen. They decouple text drawing from text parsing and vertex uploading, in a similar manner to SpriteBatches. They also optionally allow efficient batching of text from the same Font in different relative coordinate transformations, without having many draw calls.

Text objects currently have the following methods:

Text:set(textstring) -- replaces any existing text in the object with the new string.
Text:setf(textstring, wraplimit, alignmode) -- replaces any existing text with formatted text using the new string.

Text:getFont() -- gets the Font object used for this Text object.
Text:getWidth() -- gets the width in pixels of the most recently added text in the Text object.
Text:getHeight() -- gets the height in pixels of the most recently added text in the Text object.

Text:add(textstring, x, y, angle, sx, sy, ox, oy, kx, ky) -- adds a new string to the text object using the specified relative coordinate transformation, without replacing existing text. This behaves much like SpriteBatch:add.
Text:addf(textstring, wraplimit, alignmode, x, y, angle, sx, sy, ox, oy, kx, ky) -- adds a new formatted string to the text object using the specified relative coordinate transformation.
Text:clear() -- clears all text from the object.

--HG--
branch : minor
2015-01-23 00:47:28 -04:00
Alex Szpakowski 5b98083e01 Merged default into minor
--HG--
branch : minor
2015-01-22 02:18:56 -04:00
Alex Szpakowski be8b7dd504 glLoadIdentity isn't part of GLES2+ or core GL3+.
--HG--
branch : minor
2015-01-21 21:42:24 -04:00
Alex Szpakowski e82d1dfe54 Added Lua 5.3's UTF-8 module to LÖVE. Resolves issue #951.
The module must be required before use, i.e. utf8 = require("utf8").  API documentation can be found here: http://www.lua.org/manual/5.3/manual.html#6.5

Removing the last unicode character in a string (for proper backspace support in text boxes, for example) can be done using utf8.offset, e.g. text = text:sub(1, utf8.offset(text, -1) - 1).
2015-01-21 16:52:56 -04:00
Alex Szpakowski dfdd52e499 Added support for ETC1 and PVR1 compressed textures contained in KTX, PKM, and PVR files.
Most desktop graphics drivers don't support those formats.

--HG--
branch : minor
2015-01-20 03:18:28 -04:00
Alex Szpakowski 1253e3aae1 Updated version to 0.10.0.
--HG--
branch : minor
2015-01-16 15:54:18 -04:00
Alex Szpakowski a7e4148869 Merged default into minor
--HG--
branch : minor
2015-01-16 15:47:26 -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