Commit Graph

181 Commits

Author SHA1 Message Date
Alex Szpakowski 40c6821048 Removed some dead code and fixed luax_pushtype when the object argument is null. 2014-08-28 00:48:32 -03:00
Alex Szpakowski 52b62e8620 Fixed a case of using new[]/delete[] when malloc/free should have been used.
--HG--
branch : minor
2014-08-27 21:53:33 -03:00
Alex Szpakowski df5e48a082 Merged default into minor
--HG--
branch : minor
2014-08-13 01:50:52 -03:00
Alex Szpakowski 9e93d854b8 love.image.isCompressed should return true if the file contains a compressed texture, even if the file's extension isn't 'dds'. 2014-08-12 18:09:07 -03:00
Alex Szpakowski fcf8329369 Fixed detection of TGA and BMP images and updated stb_image to the latest version.
--HG--
branch : minor
2014-08-11 03:11:51 -03:00
Alex Szpakowski 43a148ce3e Fixed detection of PNG images.
--HG--
branch : minor
2014-08-11 02:42:12 -03:00
Alex Szpakowski 9b1f7d7a6e Merged default into minor
--HG--
branch : minor
2014-08-09 19:55:29 -03:00
Alex Szpakowski da7cd267ea Changed luax_pushtype to retain the pushed object itself, but only if the object isn't in the Lua state already.
Previously, calling e.g. love.graphics.getFont() 10,000 times would retain the object 10,000 times (and release it 10,000 times when the Font object was garbage-collected in the Lua state.) Now it will only retain it once and release it once.
2014-08-09 16:04:59 -03:00
Alex Szpakowski a757315006 Removed runtime support for Mac OS 10.6 and switched from libstdc++ to libc++ in OS X. Now we can use C++11's standard library!
--HG--
branch : minor
2014-08-08 18:54:12 -03:00
Alex Szpakowski aa05664d4c Merged default into minor
--HG--
branch : minor
2014-07-30 01:32:10 -03:00
Alex Szpakowski d52bab4221 Updated the new module changes to use more compile/link-time checking rather than runtime checking. 2014-07-21 15:12:01 -03:00
Alex Szpakowski 014b9a46e5 Updated the Lua wrapper code for modules to account for cases where the module's instance is removed from memory completely and recreated during the program's lifetime. 2014-07-21 14:52:01 -03:00
Alex Szpakowski bfa3ec9369 Merged default into minor
--HG--
branch : minor
2014-06-05 03:02:50 -03:00
Alex Szpakowski 79b453653a Added love.joystick.loadGamepadMappings (resolves issue #842), and Joystick:saveGamepadMapping.
The latter returns a mapping string, and the former loads a newline-separated list of mapping strings.
2014-06-04 15:50:06 -03:00
Alex Szpakowski dfa319e01a Replaced the EXCEPT_GUARD macro for converting love exceptions into Lua errors with the new luax_catchexcept function, which takes lambda function arguments. 2014-06-03 19:27:00 -03:00
Alex Szpakowski 724bdbd296 love.graphics.newImage, love.image.newImageData, etc. no longer leave Lua-owned FileData objects floating around waiting to be GC'd when called with filename arguments, resulting in less memory use on startup (resolves issue #890.)
Moved love.filesystem Lua wrapper code from src/modules/filesystem/physfs/ to src/modules/filesystem/.
2014-06-02 00:22:41 -03:00
Alex Szpakowski 51d1f2a7a9 Added support for loading TGA and BMP images (via stb_image.) Added support for encoding ImageData to TGA.
--HG--
branch : minor
2014-05-29 13:20:10 -03:00
Alex Szpakowski f3701dc0e1 Fixed ImageData:encode
--HG--
branch : minor
2014-05-29 00:27:40 -03:00
Alex Szpakowski 53b20b63a5 Merged default into minor
--HG--
branch : minor
2014-05-21 21:16:37 -03:00
Alex Szpakowski fd5b5aad65 Minor code cleanup 2014-05-21 21:14:08 -03:00
rude 6da3105fe2 Fix some pointer type conversion errors in MSVC.
--HG--
branch : minor
2014-04-23 22:31:56 +02:00
Alex Szpakowski eca8c17a69 Removed the DevIL backend from love.image. Replaced it with PNG and JPEG encoders/decoders via LodePNG, zlib, and libjpeg-turbo.
PNG and JPEG are now the only two supported image formats, aside from compressed DDS (DXT, etc.)

--HG--
branch : minor
2014-04-22 17:11:59 -03:00
Alex Szpakowski 50916825d0 Data::getSize now uses size_t instead of int 2014-03-18 03:50:00 -03:00
Alex Szpakowski a3afb1a9ca Refactored the ImageData decoding/encoding backends a bit 2014-03-02 03:17:47 -04:00
Alex Szpakowski 55514720a6 Fixed some minor compiler warnings 2014-03-01 21:16:01 -04:00
Alex Szpakowski 3120a0e650 Goodbye 2013, hello 2014! 2014-01-03 17:28:58 -04:00
Alex Szpakowski 2ee869b0e8 Fixed some compiler warnings 2013-12-07 05:07:54 -04:00
Alex Szpakowski e068aab6ea The function passed to ImageData:mapPixel must return at least r,g,b. Alpha component defaults to 255 (resolves issue #603) 2013-10-12 00:40:18 -03:00
Alex Szpakowski 8d5ddb9e34 Fixed some internal documentation (thanks to clang's -Wdocumentation) 2013-09-23 21:52:28 -03:00
Alex Szpakowski 06f80d5c08 Fixed undefined behaviour when love exceptions are converted into Lua errors (resolves issue #729) 2013-09-05 23:17:29 -03:00
Alex Szpakowski c15fc4453b Re-added Data:getPointer (can be used with LuaJIT's FFI) 2013-08-29 17:16:21 -03:00
Alex Szpakowski 4c4a385ce6 Updated CompressedData to store its data in a single block of memory, like other Data objects 2013-08-29 16:24:13 -03:00
Alex Szpakowski ec9dec6b80 Replaced luax_newtype with luax_pushtype (and added luax_rawnewtype for the old functionality of luax_newtype.)
luax_pushtype keeps the object in a weak table and checks the table before creating a new userdata, so it re-uses the object's existing wrapper userdata if it can, whenever the object is pushed to Lua.

This fixes some subtle issues with love objects, where using them as keys in tables would not always work as expected (https://love2d.org/forums/viewtopic.php?f=4&t=39398&p=112388#p112415). It also decreases the amount of new Lua objects created, saving the garbage collector some work.
2013-08-29 00:40:06 -03:00
Alex Szpakowski 96a668ecf3 Renamed CompressedData:getType to CompressedData:getFormat 2013-08-17 14:30:23 -03:00
Alex Szpakowski e19ade38ab Added support for BC4 (aka 3Dc+) compressed textures 2013-07-28 17:20:24 -03:00
Alex Szpakowski bcc85f884e ImageData:mapPixel can now take optional x,y,w,h parameters to constrain it to a rectangle in the ImageData 2013-07-11 01:10:19 -03:00
Alex Szpakowski 01666f6c29 love.image.isCompressed now compares file extensions in a case-insensitive manner 2013-06-30 15:48:47 -03:00
Alex Szpakowski b04a2fee87 Improved performance when using ImageData methods in multiple threads when ImageData:encode is called 2013-06-26 03:42:42 -03:00
Alex Szpakowski b8efa6372b oops 2013-06-25 05:37:44 -03:00
Alex Szpakowski 6e3a7288dd Improved performance of ImageData:mapPixel (now up to 2x as fast as in 0.8.0!); love.graphics.newImage, Image:refresh, love.window.setIcon, and ImageRasterizers now prevent other threads from modifying the ImageData used in those functions until they're done accessing it 2013-06-25 05:28:20 -03:00
Alex Szpakowski f25efcc8af Improved performance and reduced temporary memory usage of love.graphics.newScreenshot and Canvas:getImageData 2013-06-15 22:07:16 -03:00
Alex Szpakowski 03f5bd9a5a Improved the performance of dds data loading (love.image.newCompressedData / love.graphics.newImage("myfile.dds")) 2013-06-14 08:43:07 -03:00
Alex Szpakowski 0a36c41ba0 Removed support for BC7-compressed DDS images (only *very* modern systems support it right now); updated the ddsparse library 2013-06-09 16:31:02 -03:00
Bart van Strien 402ae4638a Make ImageData:setPixel accept a table (issue #582) 2013-05-10 17:28:55 +02:00
Alex Szpakowski 7ab3809165 Fixed Object:typeOf for love.physics objects new to 0.8.0, removed vestigial ColorMode code 2013-05-07 15:23:26 -03:00
Alex Szpakowski 3bf43dadd8 Renamed CompressedData:getNumMipmaps to CompressedData:getMipmapCount; Improved type-checking error messages for some functions which expect function arguments 2013-05-02 17:26:50 -04:00
Alex Szpakowski fb9f8d2962 Added the getString method to all Data objects (issue #608) 2013-04-26 22:35:01 -07:00
Alex Szpakowski 16f3a93f28 Removed vestigial internal code for Data:getPointer 2013-04-26 22:05:58 -07:00
Alex Szpakowski e9ff803c42 alpha values for ImageData:mapPixel default to 255 (issue #603) 2013-04-19 14:20:11 -03:00
Alex Szpakowski ce59756463 Fixed a case-sensitivity typo 2013-04-18 04:57:50 -03:00