diff --git a/AndroidManifest.xml b/AndroidManifest.xml index a5faf9a5..a6637b86 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,7 +1,7 @@ @@ -11,7 +11,7 @@ diff --git a/README.md b/README.md index ffbe8fba..788f88f3 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,14 @@ Bugs and feature requests should be reported to the issue tracker at [https://bi Changelog: ---------- +0.10.1: +This release contains all bugfixes of the desktor 0.10.1 release. Android +specific fixes are: +* Added a new love.conf flag t.externalstorage, which determines whether files are saved in internal or external storage on Android devices. +* Fixed audio on Android to pause when the app is inactive, and resume when the app becomes active again. +* Fixed a driver bug on some Android devices which caused all objects to show up as black. +* New icons + 0.10.0: * first official release! * Disabled JIT by default as it can cause performance problems. To enable JIT call jit.on() diff --git a/jni/love/CMakeLists.txt b/jni/love/CMakeLists.txt index 2602595d..ea8ea07f 100644 --- a/jni/love/CMakeLists.txt +++ b/jni/love/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (c) 2006-2014 LOVE Development Team +# Copyright (c) 2006-2016 LOVE Development Team # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages @@ -46,6 +46,7 @@ else() endif() option(LOVE_JIT "Use LuaJIT" TRUE) +option(LOVE_MPG123 "Use mpg123" TRUE) if(LOVE_JIT) message(STATUS "LuaJIT: Enabled") @@ -53,6 +54,10 @@ else() message(STATUS "LuaJIT: Disabled") endif() +if(NOT LOVE_MPG123) + add_definitions(-DLOVE_NOMPG123) +endif() + message(STATUS "Target platform: ${LOVE_TARGET_PLATFORM}") find_package(OpenGL) @@ -97,6 +102,7 @@ set(LOVE_SRC_COMMON src/common/runtime.cpp src/common/runtime.h src/common/StringMap.h + src/common/types.cpp src/common/types.h src/common/utf8.cpp src/common/utf8.h @@ -159,13 +165,13 @@ source_group("modules\\audio\\openal" FILES ${LOVE_SRC_MODULE_AUDIO_OPENAL}) set(LOVE_SRC_MODULE_EVENT_ROOT src/modules/event/Event.cpp src/modules/event/Event.h + src/modules/event/wrap_Event.cpp + src/modules/event/wrap_Event.h ) set(LOVE_SRC_MODULE_EVENT_SDL src/modules/event/sdl/Event.cpp src/modules/event/sdl/Event.h - src/modules/event/sdl/wrap_Event.cpp - src/modules/event/sdl/wrap_Event.h ) set(LOVE_SRC_MODULE_EVENT @@ -181,10 +187,16 @@ source_group("modules\\event\\sdl" FILES ${LOVE_SRC_MODULE_EVENT_SDL}) # set(LOVE_SRC_MODULE_FILESYSTEM_ROOT + src/modules/filesystem/DroppedFile.cpp + src/modules/filesystem/DroppedFile.h src/modules/filesystem/File.cpp src/modules/filesystem/File.h src/modules/filesystem/FileData.cpp src/modules/filesystem/FileData.h + src/modules/filesystem/Filesystem.cpp + src/modules/filesystem/Filesystem.h + src/modules/filesystem/wrap_DroppedFile.cpp + src/modules/filesystem/wrap_DroppedFile.h src/modules/filesystem/wrap_File.cpp src/modules/filesystem/wrap_File.h src/modules/filesystem/wrap_FileData.cpp @@ -213,6 +225,9 @@ source_group("modules\\filesystem\\physfs" FILES ${LOVE_SRC_MODULE_FILESYSTEM_PH # set(LOVE_SRC_MODULE_FONT_ROOT + src/modules/font/BMFontRasterizer.cpp + src/modules/font/BMFontRasterizer.h + src/modules/font/Font.cpp src/modules/font/Font.h src/modules/font/GlyphData.cpp src/modules/font/GlyphData.h @@ -220,6 +235,10 @@ set(LOVE_SRC_MODULE_FONT_ROOT src/modules/font/ImageRasterizer.h src/modules/font/Rasterizer.cpp src/modules/font/Rasterizer.h + src/modules/font/TrueTypeRasterizer.cpp + src/modules/font/TrueTypeRasterizer.h + src/modules/font/wrap_Font.cpp + src/modules/font/wrap_Font.h src/modules/font/wrap_GlyphData.cpp src/modules/font/wrap_GlyphData.h src/modules/font/wrap_Rasterizer.cpp @@ -231,8 +250,6 @@ set(LOVE_SRC_MODULE_FONT_FREETYPE src/modules/font/freetype/Font.h src/modules/font/freetype/TrueTypeRasterizer.cpp src/modules/font/freetype/TrueTypeRasterizer.h - src/modules/font/freetype/wrap_Font.cpp - src/modules/font/freetype/wrap_Font.h ) set(LOVE_SRC_MODULE_FONT @@ -252,12 +269,18 @@ set(LOVE_SRC_MODULE_GRAPHICS_ROOT src/modules/graphics/Drawable.h src/modules/graphics/Graphics.cpp src/modules/graphics/Graphics.h + src/modules/graphics/ParticleSystem.cpp + src/modules/graphics/ParticleSystem.h src/modules/graphics/Quad.cpp src/modules/graphics/Quad.h src/modules/graphics/Texture.cpp src/modules/graphics/Texture.h src/modules/graphics/Volatile.cpp src/modules/graphics/Volatile.h + src/modules/graphics/wrap_Quad.cpp + src/modules/graphics/wrap_Quad.h + src/modules/graphics/wrap_Texture.cpp + src/modules/graphics/wrap_Texture.h ) set(LOVE_SRC_MODULE_GRAPHICS_OPENGL @@ -265,8 +288,8 @@ set(LOVE_SRC_MODULE_GRAPHICS_OPENGL src/modules/graphics/opengl/Canvas.h src/modules/graphics/opengl/Font.cpp src/modules/graphics/opengl/Font.h - src/modules/graphics/opengl/GLee.c - src/modules/graphics/opengl/GLee.h + src/modules/graphics/opengl/GLBuffer.cpp + src/modules/graphics/opengl/GLBuffer.h src/modules/graphics/opengl/Graphics.cpp src/modules/graphics/opengl/Graphics.h src/modules/graphics/opengl/Image.cpp @@ -283,9 +306,10 @@ set(LOVE_SRC_MODULE_GRAPHICS_OPENGL src/modules/graphics/opengl/Shader.h src/modules/graphics/opengl/SpriteBatch.cpp src/modules/graphics/opengl/SpriteBatch.h - src/modules/graphics/opengl/Texture.h - src/modules/graphics/opengl/VertexBuffer.cpp - src/modules/graphics/opengl/VertexBuffer.h + src/modules/graphics/opengl/Text.cpp + src/modules/graphics/opengl/Text.h + src/modules/graphics/opengl/Video.cpp + src/modules/graphics/opengl/Video.h src/modules/graphics/opengl/wrap_Canvas.cpp src/modules/graphics/opengl/wrap_Canvas.h src/modules/graphics/opengl/wrap_Font.cpp @@ -298,14 +322,14 @@ set(LOVE_SRC_MODULE_GRAPHICS_OPENGL src/modules/graphics/opengl/wrap_Mesh.h src/modules/graphics/opengl/wrap_ParticleSystem.cpp src/modules/graphics/opengl/wrap_ParticleSystem.h - src/modules/graphics/opengl/wrap_Quad.cpp - src/modules/graphics/opengl/wrap_Quad.h src/modules/graphics/opengl/wrap_Shader.cpp src/modules/graphics/opengl/wrap_Shader.h src/modules/graphics/opengl/wrap_SpriteBatch.cpp src/modules/graphics/opengl/wrap_SpriteBatch.h - src/modules/graphics/opengl/wrap_Texture.cpp - src/modules/graphics/opengl/wrap_Texture.h + src/modules/graphics/opengl/wrap_Text.cpp + src/modules/graphics/opengl/wrap_Text.h + src/modules/graphics/opengl/wrap_Video.cpp + src/modules/graphics/opengl/wrap_Video.h ) set(LOVE_SRC_MODULE_GRAPHICS @@ -321,13 +345,13 @@ source_group("modules\\graphics\\opengl" FILES ${LOVE_SRC_MODULE_GRAPHICS_OPENGL # set(LOVE_SRC_MODULE_IMAGE_ROOT - src/modules/image/CompressedData.cpp - src/modules/image/CompressedData.h + src/modules/image/CompressedImageData.cpp + src/modules/image/CompressedImageData.h src/modules/image/Image.h src/modules/image/ImageData.cpp src/modules/image/ImageData.h - src/modules/image/wrap_CompressedData.cpp - src/modules/image/wrap_CompressedData.h + src/modules/image/wrap_CompressedImageData.cpp + src/modules/image/wrap_CompressedImageData.h src/modules/image/wrap_Image.cpp src/modules/image/wrap_Image.h src/modules/image/wrap_ImageData.cpp @@ -335,29 +359,27 @@ set(LOVE_SRC_MODULE_IMAGE_ROOT ) set(LOVE_SRC_MODULE_IMAGE_MAGPIE - src/modules/image/magpie/CompressedData.cpp - src/modules/image/magpie/CompressedData.h + src/modules/image/magpie/ASTCHandler.cpp + src/modules/image/magpie/ASTCHandler.h + src/modules/image/magpie/CompressedImageData.cpp + src/modules/image/magpie/CompressedImageData.h src/modules/image/magpie/CompressedFormatHandler.h src/modules/image/magpie/ddsHandler.cpp src/modules/image/magpie/ddsHandler.h - src/modules/image/magpie/DevilHandler.cpp - src/modules/image/magpie/DevilHandler.h src/modules/image/magpie/FormatHandler.cpp src/modules/image/magpie/FormatHandler.h src/modules/image/magpie/Image.cpp src/modules/image/magpie/Image.h src/modules/image/magpie/ImageData.cpp src/modules/image/magpie/ImageData.h - src/modules/image/magpie/JPEGHandler.cpp - src/modules/image/magpie/JPEGHandler.h src/modules/image/magpie/KTXHandler.cpp src/modules/image/magpie/KTXHandler.h src/modules/image/magpie/PKMHandler.cpp src/modules/image/magpie/PKMHandler.h - src/modules/image/magpie/PVRHandler.cpp - src/modules/image/magpie/PVRHandler.h src/modules/image/magpie/PNGHandler.cpp src/modules/image/magpie/PNGHandler.h + src/modules/image/magpie/PVRHandler.cpp + src/modules/image/magpie/PVRHandler.h src/modules/image/magpie/STBHandler.cpp src/modules/image/magpie/STBHandler.h ) @@ -430,12 +452,18 @@ source_group("modules\\keyboard\\sdl" FILES ${LOVE_SRC_MODULE_KEYBOARD_SDL}) set(LOVE_SRC_MODULE_MATH src/modules/math/BezierCurve.cpp src/modules/math/BezierCurve.h + src/modules/math/CompressedData.cpp + src/modules/math/CompressedData.h + src/modules/math/Compressor.cpp + src/modules/math/Compressor.h src/modules/math/MathModule.cpp src/modules/math/MathModule.h src/modules/math/RandomGenerator.cpp src/modules/math/RandomGenerator.h src/modules/math/wrap_BezierCurve.cpp src/modules/math/wrap_BezierCurve.h + src/modules/math/wrap_CompressedData.cpp + src/modules/math/wrap_CompressedData.h src/modules/math/wrap_Math.cpp src/modules/math/wrap_Math.h src/modules/math/wrap_RandomGenerator.cpp @@ -461,7 +489,6 @@ source_group("modules\\love" FILES ${LOVE_SRC_MODULE_LOVE}) set(LOVE_SRC_MODULE_MOUSE_ROOT src/modules/mouse/Cursor.cpp src/modules/mouse/Cursor.h - src/modules/mouse/Mouse.cpp src/modules/mouse/Mouse.h src/modules/mouse/wrap_Cursor.cpp src/modules/mouse/wrap_Cursor.h @@ -623,8 +650,6 @@ set(LOVE_SRC_MODULE_SOUND_LULLABY src/modules/sound/lullaby/GmeDecoder.h src/modules/sound/lullaby/ModPlugDecoder.cpp src/modules/sound/lullaby/ModPlugDecoder.h - src/modules/sound/lullaby/Mpg123Decoder.cpp - src/modules/sound/lullaby/Mpg123Decoder.h src/modules/sound/lullaby/Sound.cpp src/modules/sound/lullaby/Sound.h src/modules/sound/lullaby/VorbisDecoder.cpp @@ -633,6 +658,14 @@ set(LOVE_SRC_MODULE_SOUND_LULLABY src/modules/sound/lullaby/WaveDecoder.h ) +if(LOVE_MPG123) + set(LOVE_SRC_MODULE_SOUND_LULLABY + ${LOVE_SRC_MODULE_SOUND_LULLABY} + src/modules/sound/lullaby/Mpg123Decoder.cpp + src/modules/sound/lullaby/Mpg123Decoder.h + ) +endif() + set(LOVE_SRC_MODULE_SOUND ${LOVE_SRC_MODULE_SOUND_ROOT} ${LOVE_SRC_MODULE_SOUND_LULLABY} @@ -707,6 +740,7 @@ source_group("modules\\thread\\sdl" FILES ${LOVE_SRC_MODULE_THREAD_SDL}) # set(LOVE_SRC_MODULE_TIMER_ROOT + src/modules/timer/Timer.cpp src/modules/timer/Timer.h src/modules/timer/wrap_Timer.cpp src/modules/timer/wrap_Timer.h @@ -748,6 +782,35 @@ set(LOVE_SRC_MODULE_TOUCH source_group("modules\\touch" FILES ${LOVE_SRC_MODULE_TOUCH_ROOT}) source_group("modules\\touch\\sdl" FILES ${LOVE_SRC_MODULE_TOUCH_SDL}) +# +# love.video +# + +set(LOVE_SRC_MODULE_VIDEO_ROOT + src/modules/video/Video.h + src/modules/video/VideoStream.cpp + src/modules/video/VideoStream.h + src/modules/video/wrap_Video.cpp + src/modules/video/wrap_Video.h + src/modules/video/wrap_VideoStream.cpp + src/modules/video/wrap_VideoStream.h +) + +set(LOVE_SRC_MODULE_VIDEO_THEORA + src/modules/video/theora/Video.cpp + src/modules/video/theora/Video.h + src/modules/video/theora/VideoStream.cpp + src/modules/video/theora/VideoStream.h +) + +set(LOVE_SRC_MODULE_VIDEO + ${LOVE_SRC_MODULE_VIDEO_ROOT} + ${LOVE_SRC_MODULE_VIDEO_THEORA} +) + +source_group("modules\\video" FILES ${LOVE_SRC_MODULE_VIDEO_ROOT}) +source_group("modules\\video\\theora" FILES ${LOVE_SRC_MODULE_VIDEO_THEORA}) + # # love.window # @@ -964,6 +1027,18 @@ add_library(love_3p_enet ${LOVE_SRC_3P_ENET}) target_link_libraries(love_3p_enet ${MEGA_LUA}) target_include_directories(love_3p_enet PUBLIC src/libraries/enet/libenet/include) +# +# GLAD +# + +set(LOVE_SRC_3P_GLAD + src/libraries/glad/glad.cpp + src/libraries/glad/glad.hpp + src/libraries/glad/gladfuncs.hpp +) + +add_library(love_3p_glad ${LOVE_SRC_3P_GLAD}) + # # LodePNG # @@ -1037,11 +1112,39 @@ set(LOVE_SRC_3P_LUASOCKET add_library(love_3p_luasocket ${LOVE_SRC_3P_LUASOCKET}) target_link_libraries(love_3p_luasocket ${MEGA_LUA}) +# +# Lua 5.3's UTF-8 library +# + +set(LOVE_SRC_3P_LUAUTF8 + src/libraries/luautf8/lprefix.h + src/libraries/luautf8/lutf8lib.c + src/libraries/luautf8/lutf8lib.h +) + +add_library(love_3p_luautf8 ${LOVE_SRC_3P_LUAUTF8}) +target_link_libraries(love_3p_luautf8 ${MEGA_LUA}) + +# +# lz4 +# + +set(LOVE_SRC_3P_LZ4 + src/libraries/lz4/lz4.c + src/libraries/lz4/lz4.h + src/libraries/lz4/lz4hc.c + src/libraries/lz4/lz4hc.h +) + +add_library(love_3p_lz4 ${LOVE_SRC_3P_LZ4}) + # # noise1234 # set(LOVE_SRC_3P_NOISE1234 + src/libraries/noise1234/noise1234.cpp + src/libraries/noise1234/noise1234.h src/libraries/noise1234/simplexnoise1234.cpp src/libraries/noise1234/simplexnoise1234.h ) @@ -1056,7 +1159,7 @@ set(LOVE_SRC_3P_STB src/libraries/stb/stb_image.h ) -add_library(love_3p_stb ${LOVE_SRC_3P_STB}) +# stb_image has no implementation files of its own. # # utf8 @@ -1099,10 +1202,12 @@ set(LOVE_3P love_3p_box2d love_3p_ddsparse love_3p_enet + love_3p_glad love_3p_lodepng love_3p_luasocket + love_3p_luautf8 + love_3p_lz4 love_3p_noise1234 - love_3p_stb love_3p_wuff ) @@ -1130,7 +1235,8 @@ set(LOVE_LIB_SRC ${LOVE_SRC_MODULE_SYSTEM} ${LOVE_SRC_MODULE_THREAD} ${LOVE_SRC_MODULE_TIMER} - #{LOVE_SRC_MODULE_TOUCH} + ${LOVE_SRC_MODULE_TOUCH} + ${LOVE_SRC_MODULE_VIDEO} ${LOVE_SRC_MODULE_WINDOW} ) @@ -1146,25 +1252,28 @@ include_directories( link_directories(${SDL_LINK_DIR}) set(LOVE_MEGA_3P - ${MEGA_DEVIL} ${MEGA_FREETYPE} - ${MEGA_JASPER} - ${MEGA_JPEG} ${MEGA_LIBOGG} - ${MEGA_LIBPNG} ${MEGA_LIBVORBISFILE} ${MEGA_LIBVORBIS} + ${MEGA_LIBTHEORA} ${MEGA_LUA} ${MEGA_MODPLUG} - ${MEGA_MPEG123} ${MEGA_OPENAL} ${MEGA_PHYSFS} ${MEGA_SDL2MAIN} ${MEGA_SDL2} - ${MEGA_TIFF} ${MEGA_ZLIB} ) +if(LOVE_MPG123) + set(LOVE_MEGA_3P + ${LOVE_MEGA_3P} + ${MEGA_MPEG123} + ) +endif() + + set(LOVE_LINK_LIBRARIES ${OPENGL_gl_LIBRARY} ${LOVE_MEGA_3P} @@ -1192,8 +1301,8 @@ if(MEGA_EXTRA_DEPENDECIES) endif() if(MSVC) - set_target_properties(${LOVE_LIB_NAME} PROPERTIES RELEASE_OUTPUT_NAME "love" PDB_NAME "liblove") - set_target_properties(${LOVE_LIB_NAME} PROPERTIES DEBUG_OUTPUT_NAME "love" PDB_NAME "liblove") + set_target_properties(${LOVE_LIB_NAME} PROPERTIES RELEASE_OUTPUT_NAME "love" PDB_NAME "liblove" IMPORT_PREFIX "lib") + set_target_properties(${LOVE_LIB_NAME} PROPERTIES DEBUG_OUTPUT_NAME "love" PDB_NAME "liblove" IMPORT_PREFIX "lib") endif() # @@ -1204,10 +1313,12 @@ target_link_libraries(love liblove) # Add post build steps to move the DLLs next to the binary. Otherwise # running/debugging the binary will not work from inside VS. -add_move_dll(love ${MEGA_MPEG123}) +if(LOVE_MPG123) + add_move_dll(love ${MEGA_MPEG123}) +endif() + add_move_dll(love ${MEGA_SDL2}) add_move_dll(love ${MEGA_OPENAL}) -add_move_dll(love ${MEGA_DEVIL}) if(LOVE_JIT) add_move_file(love ${MEGA_LUAJIT_DLL}) @@ -1299,7 +1410,7 @@ set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/license.txt") set(CPACK_NSIS_EXECUTABLES_DIRECTORY .) set(CPACK_NSIS_PACKAGE_NAME "LOVE") -set(CPACK_NSIS_DISPLAY_NAME "LÖVE ${LOVE_VERSION_STR}") +set(CPACK_NSIS_DISPLAY_NAME "LOVE ${LOVE_VERSION_STR}") set(CPACK_NSIS_MODIFY_PATH OFF) if(LOVE_X64) @@ -1319,7 +1430,7 @@ set(NSIS_MUI_ICON "${CMAKE_CURRENT_SOURCE_DIR}/extra/nsis\\\\love.ico") set(NSIS_MUI_UNICON "${CMAKE_CURRENT_SOURCE_DIR}/extra/nsis\\\\love.ico") set(CPACK_NSIS_INSTALLER_MUI_ICON_CODE " - !define MUI_WELCOMEPAGE_TITLE \\\"LÖVE ${LOVE_VERSION_STR} Setup\\\" + !define MUI_WELCOMEPAGE_TITLE \\\"LOVE ${LOVE_VERSION_STR} Setup\\\" !define MUI_WELCOMEFINISHPAGE_BITMAP \\\"${NSIS_LEFT_BMP}\\\" !define MUI_HEADERIMAGE_BITMAP \\\"${NSIS_TOP_BMP}\\\" !define MUI_ICON \\\"${NSIS_MUI_ICON}\\\" diff --git a/jni/love/changes.txt b/jni/love/changes.txt index 7b188a8b..f7204c1c 100644 --- a/jni/love/changes.txt +++ b/jni/love/changes.txt @@ -1,60 +1,296 @@ +LOVE 0.10.1 [Super Toast] +------------------------- + +Released: N/A + + * Added a new love.conf flag t.externalstorage, which determines whether files are saved in internal or external storage on Android devices. + * Added a new variant of love.graphics.arc which can draw different types of arcs ("pie", "open", or "closed"). + * Added "lighten" and "darken" BlendModes. They can only be used with the "premultiplied" BlendAlphaMode. + * Added the "lighten" GraphicsFeature constant. + * Added the ability to avoid clearing specific Canvases when calling love.graphics.clear, if multiple Canvases are active at once via love.graphics.setCanvas. + * Added Text:getDimensions. + * Added optional "collideconnected" argument to love.physics.newMotorJoint. + + * Fixed a Lua error in the no-game screen if the window's height is too small. + * Fixed the default error handler to reset the mouse Cursor. + * Fixed love.filesystem functions crashing when called if liblove is used directly without calling love.filesystem.init. + * Fixed audio on Android to pause when the app is inactive, and resume when the app becomes active again. + * Fixed the Video decoding thread hanging after Video:seek or when a Video finishes. + * Fixed Video:isPlaying to always return false after it finishes playing. + * Fixed RandomGenerator:random crashing if a nil 'self' is used. + * Fixed loading BMFont files which have characters with 0 width or height (a space character, for example). + * Fixed love.graphics.newFont causing crashes if FileData is passed in. + * Fixed a driver bug on some Android devices which caused all objects to show up as black. + * Fixed a driver bug on Windows with AMD graphics cards where love.graphics.clear would not always work. + * Fixed Shader:sendColor incorrectly converting alpha values from sRGB to linear RGB when gamma-correct rendering is enabled. + * Fixed love.graphics.newMesh(vertices) double-converting colors from sRGB to linear RGB when gamma-correct rendering is enabled. + * Fixed love.graphics.new* crashing when there is no graphics context/window. + + * Updated the Windows executable to prefer the high-powered AMD graphics card on systems which have switchable Intel+AMD GPUs. + * Updated love.touch.getTouches to return the list of IDs in the relative order that the touches initially happened, instead of being in a random order. + * Updated the error messages caused by invalid or bad arguments to ImageData and SoundData methods to be more descriptive. + + +LOVE 0.10.0 [Super Toast] +------------------------- + +Released: 2015-12-22 + + * Added an iOS port. + * Added an Android port. + * Added the flag t.accelerometerjoystick to love.conf. Disables accelerometer-as-joystick functionality on mobile devices when false. + * Added the flag t.gammacorrect to love.conf (replaces t.window.srgb.) Enabling it globally enables gamma-correct rendering, when supported. + * Added video playback support for Ogg Theora videos, via love.graphics.newVideo and Video objects. + * Added love.video module. It is not used for displaying videos on-screen, only decoding them. + * Added love.touch module. Note that it has important differences from the touch implementation in the LÖVE 0.9 Android and iOS ports. + * Added love.touchpressed, love.touchreleased, and love.touchmoved. + * Added love.system.vibrate. + * Added love.filesystem.setRequirePath and love.filesystem.getRequirePath. + * Added an optional program exit argument to love.event.quit. + * Added love.filedropped and love.directorydropped event callback functions. + * Added love.lowmemory event callback function, called when the app is running out of memory on mobile operating systems. + * Added love.textedited event callback function, called when the user is compositing text (e.g. via an IME.) + * Added love.wheelmoved event callback function (replaces "wu" and "wd" constants for love.mousepressed.) + * Added love.mouse.hasCursor. + * Added a boolean argument to love.mousepressed and love.mousereleased indicating whether the button event originated from a touch press. + * Added optional x/y/width/height arguments to love.keyboard.setTextInput. They tell the system where text will show up so on-screen keyboards can avoid that area. + * Added Source:getType (replaces Source:isStatic.) + * Added Source:getDuration and Decoder:getDuration. + * Added an optional string argument containing raw pixel byte data to the width/height variant of love.image.newImageData. + * Added love.graphics.ellipse. + * Added rounded-rectangle support to love.graphics.rectangle. + * Added love.graphics.points (replaces love.graphics.point.) + * Added love.graphics.intersectScissor. + * Added an optional argument to love.graphics.setBlendMode which indicates whether to treat the colors of drawn objects as having pre-multiplied alpha. + * Added love.graphics.getSupported (replaces love.graphics.isSupported.) + * Added love.graphics.getSystemLimits (replaces love.graphics.getSystemLimit.) + * Added love.graphics.stencil and love.graphics.set/getStencilTest (replaces love.graphics.setStencil.) + * Added love.graphics.isActive. + * Added color arguments to love.graphics.clear. It no longer always uses the background color value. + * Added love.graphics.discard. + * Added love.graphics.isGammaCorrect. + * Added the "clampzero" WrapMode. + * Added the ability to specify custom mipmaps when creating an image, via love.graphics.newImage(filename, {mipmaps={mip1, mip2, ...}}) + * Added optional x/y/width/height arguments to Image:refresh and Canvas:newImageData. + * Added Image:getFlags. + * Added one- and two-channel Canvas formats: r8, rg8, r16f, rg16f, r32f, and rg32f. + * Added support for different formats in each Canvas when using multi-canvas rendering. Added the "multicanvasformats" Graphics Feature constant. + * Added support for OpenGL ES 2 and 3. + * Added support for loading ETC, EAC, PVRTC, and ASTC compressed textures on systems that support them. + * Added custom vertex attribute support for Meshes via new variants of love.graphics.newMesh. + * Added Mesh:setVertexAttribute and Mesh:getVertexAttribute. + * Added Mesh:getVertexFormat. + * Added Mesh:flush. + * Added an optional 'startvertex' argument to Mesh:setVertices. + * Added the ability for love.graphics.newMesh and Mesh:setVertices to accept a Data object. + * Added Mesh:setAttributeEnabled and Mesh:isAttributeEnabled. + * Added Mesh:attachAttribute. + * Added SpriteBatch:attachAttribute. + * Added Shader:sendColor. + * Added new shader functions: gammaCorrectColor, gammaToLinear, and linearToGamma. The functions also have 'precise' and 'fast' variants. + * Added Text objects and love.graphics.newText. + * Added per-character color support to love.graphics.print/printf and to Text objects. + * Added BMFont bitmap font file support to love.graphics.newFont and love.font. + * Added kerning support for TrueType/OpenType and BMFont Fonts. + * Added an optional font hinting argument to love.graphics.newFont when loading TrueType fonts. + * Added an optional spacing argument to love.graphics.newImageFont, which applies additional spacing to all rendered glyphs. + * Added Font:setFallbacks. + * Added love.window.maximize. + * Added love.window.close. + * Added love.window.requestAttention. + * Added love.window.setDisplaySleepEnabled and love.window.isDisplaySleepEnabled. + * Added BezierCurve:renderSegment and BezierCurve:removeControlPoint. + * Added BezierCurve:getSegment. + * Added love.math.compress and love.math.decompress. + * Added Channel:performAtomic. + + * Changed love.mousepressed, love.mousereleased, and love.mouse.isDown to use button numbers instead of named button constants. + * Changed love.keypressed to be love.keypressed(key, scancode, isrepeat). + * Changed love.keyreleased to be love.keyreleased(key, scancode). + * Changed Font:getWrap's second return value to be a table containing the text split into lines. + * Changed love.graphics.newImage's optional second argument to be a table of flags (flags are "mipmaps" and "linear".) + * Changed the arguments for the standard variants of love.graphics.newMesh to newMesh(vertices [, drawmode, usage]) and newMesh(vertexcount [, drawmode, usage]). + * Changed ImageData:encode to return a FileData object. ImageData:encode's first parameter is now the format to encode to, and the second parameter is an optional filename to write to. + + * Renamed the "normal" Fullscreen Type to "exclusive". + * Renamed the DistanceModel constants "inverse clamped", "linear clamped", and "exponent clamped" to "inverseclamped", "linearclamped", and "exponentclamped". + * Renamed the "additive", "subtractive", and "multiplicative" BlendModes to "add", "subtract", and "multiply". + * Renamed the KeyConstant and Scancode representing the spacebar from " " to "space". + * Renamed File:eof to File:isEOF. + * Renamed Canvas:getImageData to Canvas:newImageData. + * Renamed love.image's CompressedData type to CompressedImageData. + + * Removed callback variant of love.filesystem.getDirectoryItems. + * Removed the "wu" and "wd" constants for love.mousepressed (replaced by love.wheelmoved.) + * Removed the named mouse button constants (replaced by button numbers.) + * Removed Source:isStatic (replaced by Source:getType.) + * Removed image loading support for all (non-compressed texture) file formats except for PNG, JPEG, TGA, and BMP. + * Removed JPEG encoding support from ImageData:encode. + * Removed love.graphics.point (replaced by love.graphics.points.) + * Removed love.graphics.setPointStyle and love.graphics.getPointStyle. + * Removed love.graphics.isSupported (replaced by love.graphics.getSupported.) + * Removed love.graphics.getSystemLimit (replaced by love.graphics.getSystemLimits.) + * Removed love.graphics.setStencil (replaced by love.graphics.stencil and love.graphics.setStencilTest.) + * Removed the "canvas", "shader", "npot", "subtractive", and "mipmap" Graphics Feature constants (the features always have guaranteed support now.) + * Removed the "multicanvas" Graphics Feature constant (use love.graphics.getSystemLimits instead.) + * Removed the "srgb" Graphics Feature constant (use love.graphics.isGammaCorrect() or love.graphics.getCanvasFormats().srgb instead.) + * Removed the "srgb" flag in love.window.setMode and in the t.window table in love.conf (Replaced by t.gammacorrect.) + * Removed the "premultiplied" blend mode (love.graphics.setBlendMode("alpha", "premultiplied") now does the same thing.) + * Removed Canvas:getPixel (use Canvas:newImageData instead.) + * Removed Canvas:clear (use love.graphics.clear instead.) + * Removed Mesh:getVertices. + * Removed Mesh:setVertexColors and Mesh:hasVertexColors (use Mesh:setAttributeEnabled("VertexColor", enable) instead.) + * Removed functions deprecated in LOVE 0.9.1 and 0.9.2: + * Removed love.graphics.getMaxImageSize and love.graphics.getMaxPointSize (replaced by love.graphics.getSystemLimits.) + * Removed Mesh:set/getImage, SpriteBatch:set/getImage, and ParticleSystem:set/getImage (replaced by set/getTexture.) + * Removed SpriteBatch:bind/unbind. + * Removed Canvas:getFSAA and the "fsaa" flag in love.conf and love.window.setMode (replaced by Canvas:getMSAA and "msaa".) + * Removed the "dxt" and "bc5" Graphics Feature constant (replaced by love.graphics.getCompressedImageFormats.) + * Removed the "hdrcanvas" Graphics Feature constant (replaced by love.graphics.getCanvasFormats.) + * Removed love.window.getWidth/getHeight/getDimensions (use love.graphics.getWidth/getHeight/getDimensions or love.window.getMode instead.) + + * Fixed utf8.char. + * Fixed detection of fused love games. + * Fixed World:getCallbacks and World:getContactFilter when used in coroutines. + * Fixed crashes when objects which store Lua callback functions are garbage collected after being used in coroutines. + * Fixed memory leaks in love.physics if World:destroy is never called. When a World is GCed it now destroys all objects it owns. + * Fixed love.keyboard.getKeyFromScancode crashing when an invalid scancode is given. + * Fixed decoding of 8-bit WAV files. + * Fixed a crash issue when rewinding streaming ogg Sources, when certain versions of libvorbis are used. + * Fixed love.audio.stop() not rewinding streaming Sources. + * Fixed the stencil buffer in Canvases when an unsupported MSAA value is used to create the Canvas. + * Fixed Canvas:renderTo to restore the previous Canvas if an error occurs in the passed function. + * Fixed love.graphics.draw(canvas) to cause an error if that Canvas is the active one. + * Fixed Mesh:getVertexMap to return nil rather than an empty table, if no vertex map has been set. + * Fixed love.graphics.getColorMask. + * Fixed the default offset for particles when ParticleSystem:setQuads or ParticleSystem:setTexture is used. + * Fixed love.graphics.shear resetting all love.graphics transformations. + * Fixed the "add" and "subtract" blend modes to no longer modify the alpha of the Canvas / screen. + + * Improved the performance of World:rayCast and World:queryBoundingBox. + * Improved the performance of love.graphics.line and other line drawing functions, when the "smooth" LineStyle is used. + * Improved the performance of Shader:send when matrices are used. + * Improved the performance of ImageData and SoundData methods when LuaJIT's JIT compiler is enabled, by using efficient FFI code. + * Improved the performance of love.math.noise, love.math.gammaToLinear, love.math.linearToGamma, love.math.random, and RandomGenerator:random when LuaJIT's JIT compiler is enabled. + + * Updated the compatibility warning notice to use a message box and to show the version specified in love.conf. + * Updated the compatibility warning notice to display before main.lua is loaded. + * Updated the __tostring metamethod of love objects to output the pointer value, similar to tostring(table). + * Updated World:setCallbacks, World:setContactFilter, World:queryBoundingBox, and World:rayCast to have improved argument type checking. + * Updated threads to load love.filesystem automatically. + * Updated love.filesystem to enable symlinks by default. + * Updated love.math.setRandomSeed and RandomGenerator:setSeed to produce better results for the first few random() calls. + * Updated love.math.random and RandomGenerator:random to produce slightly better results in general. + * Updated Source methods that deal with spatial audio to error rather than failing silently if the Source isn't mono. + * Updated the 3D and 4D variants of love.math.noise to use Perlin noise rather than Simplex noise, to avoid patent issues. + * Updated ImageFonts to no longer treat separator pixels as spacing. + * Updated the default font to use less memory. + * Updated the behavior of text wrapping with love.graphics.printf and Font:getWrap to work better. + * Updated love.graphics.print and love.graphics.printf to no longer automatically round the x and y position arguments. + * Updated some error messages for love.graphics.newImage to be more descriptive. + * Updated love.graphics color functions to automatically apply love.math.gammaToLinear to color values when gamma-correct rendering is enabled. + * Updated the 'normal' Canvas format to internally use 'srgb' rather than 'rgba8' when gamma-correct rendering is enabled. + * Updated love.graphics.setColor to affect all drawn objects, including ParticleSystems, SpriteBatches, and Meshes. + * Updated the default fullscreen type to be "desktop" rather than "exclusive". + * Updated the minimum runtime system requirements of LOVE to require OpenGL 2.1 or OpenGL ES 2 support. + * Updated the pixel shader effect function so screen_coords.y is 0 at the top of the screen instead of the bottom. + * Updated Images to require setting the mipmaps flag to true on creation in order to use mipmaps. + * Updated Images to allow mipmaps for non-power-of-two sizes. + LOVE 0.9.2 [Baby Inspector] --------------------------- - Released: N/A + Released: 2015-02-14 + * Added Lua 5.3's UTF-8 module (via utf8 = require("utf8")). * Added Shader:getExternVariable. * Added several new canvas texture formats. * Added love.graphics.getCanvasFormats. * Added love.graphics.getCompressedImageFormats. * Added ParticleSystem:setQuads. + * Added ParticleSystem:setLinearDamping. * Added SpriteBatch:flush. * Added love.graphics.getStats. + * Added "mirroredrepeat" wrap mode. + * Added love.audio.setDopplerScale and love.audio.getDopplerScale. * Added optional duration argument to Joystick:setVibration. * Added love.joystick.loadGamepadMappings and love.joystick.saveGamepadMappings. * Added Joint:setUserData and Joint:getUserData. + * Added Joint:getBodies. + * Added GearJoint:getJoints. * Added Contact:getFixtures and Body:getContactList. * Added Body:getWorld. + * Added Body:getJointList. + * Added Body/Contact/Fixture/Joint/World:isDestroyed. + * Added love.mousemoved event callback. + * Added love.mouse.setRelativeMode and love.mouse.getRelativeMode. + * Added Scancode enums, love.keyboard.getKeyFromScancode, and love.keyboard.getScancodeFromKey. * Added love.window.getDisplayName. * Added love.window.minimize. * Added love.window.showMessageBox. - * Added love.filesystem.isSymlink, love.filesystem.setSymlinksEnabled, and love.filesystem.areSymlinksEnabled. * Added 'refreshrate' field to the table returned by love.window.getMode. + * Added love.window.toPixels and love.window.fromPixels. + * Added love.window.setPosition and love.window.getPosition, and 'x' and 'y' fields to love.window.setMode and t.window in love.conf. + * Added love.filesystem.isSymlink, love.filesystem.setSymlinksEnabled, and love.filesystem.areSymlinksEnabled. + * Added love.filesystem.getRealDirectory. * Deprecated SpriteBatch:bind and SpriteBatch:unbind. * Deprecated all uses of the name 'FSAA' in favor of 'MSAA'. * Deprecated the 'hdrcanvas' graphics feature enum in favor of getCanvasFormats. * Deprecated the 'dxt' and 'bc5' graphics feature enums in favor of getCompressedImageFormats. + * Fixed crashes when love objects are used in multiple threads. * Fixed love.filesystem.setIdentity breaking in some situations when called multiple times. + * Fixed the default love.filesystem identity when in Fused mode in Windows. * Fixed love.system.openURL sometimes blocking indefinitely on Linux. + * Fixed love.joystick.setGamepadMapping. + * Fixed the order of vertices in ChainShapes. + * Fixed love.mouse.getPosition returning outdated values if love.mouse.setPosition is used in the same frame. + * Fixed love.graphics.newFont to error when given an invalid size argument. + * Fixed the filename and backtrace given when love.graphics.print errors. + * Fixed a small memory leak if love.graphics.newCanvas errors. * Fixed shader:getWarnings returning unnecessary information. + * Fixed some cases of noncompliant shader code not properly erroring on some nvidia drivers. * Fixed a potential crash when Shader objects are garbage collected. + * Fixed a potential small memory leak triggered when love.graphics.newShader errors. * Fixed love.graphics.newMesh(vertexcount, ...) causing the Mesh to do instanced rendering. * Fixed Mesh:getVertexMap. * Fixed Image:refresh generating mipmaps multiple times if mipmap filtering is enabled. + * Fixed Image:setMipmapFilter to not keep bad state around if it errors. * Fixed Mesh:setDrawRange when the Mesh has a vertex map set. * Fixed internal detection of the 'position' and 'effect' shader functions. * Fixed Texture memory leak when Meshes are garbage collected. * Fixed the default line join mode to be 'miter' instead of an undefined value. * Fixed the default error handler text size when highdpi mode is enabled on a Retina monitor. - * Fixed love.window.setMode to fall back to the largest available mode if a width or height greater than the largest supported is specified and fullscreen=true. + * Fixed the default error handler background color when sRGB mode is enabled for the window. + * Fixed love.window.setMode to fall back to the largest available mode if a width or height greater than the largest supported is specified and fullscreen is used. * Fixed the state of wireframe mode when love.window.setMode is called. * Fixed Canvas:getPixel to error if the coordinates are not within the Canvas' size. * Fixed detection of compressed textures to work regardless of the file's extension. * Renamed all cases of FSAA to MSAA. The FSAA names still exist for backward-compatibility. + * Updated the Windows executable to automatically prefer the higher performance GPU on nvidia Optimus systems. + * Updated the --console command-line argument in Windows to open the console before conf.lua is loaded. + * Updated t.console and the --console command-line argument in Windows to use the existing Console window, if love was launched from one. + * Updated the love executable to verify that the love library's version matches. * Updated the Lua wrapper code for modules to avoid crashes when the module's instance is created, deleted, and recreated. * Updated internal code for handling garbage collection of love objects to be more efficient. + * Updated love's initialization code to trigger a Lua error if love.conf has an error in it. * Updated the paths returned by love.filesystem.getSaveDirectory and friends to strip double-slashes from the string. * Updated the error message when love.filesystem.write or File:open fails because the directory doesn't exist. * Updated the error message when love.math.setRandomseed(0) is attempted. + * Updated the error message when invalid UTF-8 strings are used in love functions that expect UTF-8. + * Updated love.physics.newPolygonShape and love.physics.newChainShape to accept a table of vertices. * Updated love.physics.newChainShape to error if the number of arguments is invalid. + * Updated love.thread.newThread to accept a literal string of code directly. * Updated love-created threads to use names visible in external debuggers. * Updated SpriteBatch:unbind to use less VRAM if the SpriteBatch has the static usage hint. * Updated love.graphics.newImage, love.image.newImageData, etc. to leave less Lua-owned memory around. * Updated love.graphics.push to accept different stack types to push. Current types are "transform" and "all". + * Updated love shaders to accept GLSL ES precision qualifiers on variables, although they do nothing. + * Updated the error message for love.graphics.newShader to be less cryptic if an invalid filename is given. + * Updated compressed texture loading code to allow BC6 and BC7 compressed textures (if the graphics driver supports them.) LOVE 0.9.1 [Baby Inspector] --------------------------- @@ -202,7 +438,7 @@ LOVE 0.9.0 [Baby Inspector] * Added love.window.getIcon. * Added t.window.icon to love.conf. * Added love.mousefocus and love.window.hasMouseFocus. - * Added custom hardware cursors via love.mouse.newCursor. + * Added custom hardware cursors via love.mouse.newCursor. * Added love.mouse.setX/setY. * Added Joystick objects. * Added love.joystick.getJoystick. diff --git a/jni/love/license.txt b/jni/love/license.txt index 9be483bb..2e935e9f 100644 --- a/jni/love/license.txt +++ b/jni/love/license.txt @@ -1,4 +1,6 @@ -Copyright (c) 2006-2014 LOVE Development Team +This software uses LOVE: + +LOVE is Copyright (c) 2006-2016 LOVE Development Team This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,11 +21,110 @@ misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. +--------- +This software uses LuaJIT: -------- +LuaJIT is Copyright (c) 2005-2015 Mike Pall -LÖVE uses the following LGPL libraries on most platforms: +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +--------- + +This software uses ENet: + +Copyright (c) 2002-2014 Lee Salzman + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +--------- + +This software uses lua-enet: + +Copyright (C) 2011 by Leaf Corcoran + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +--------- + +This software uses UTF8-CPP: + +Copyright 2006 Nemanja Trifunovic + +Permission is hereby granted, free of charge, to any person or organization +obtaining a copy of the software and accompanying documentation covered by +this license (the "Software") to use, reproduce, display, distribute, +execute, and transmit the Software, and to prepare derivative works of the +Software, and to permit third-parties to whom the Software is furnished to +do so, all subject to the following: + +The copyright notices in the Software and this entire statement, including +the above license grant, this restriction and the following disclaimer, +must be included in all copies of the Software, in whole or in part, and +all derivative works of the Software, unless such copies or derivative +works are solely in the form of machine-executable object code generated by +a source language processor. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +--------- + +This software uses the following LGPL libraries on Windows, Mac OS X, Linux, +and Android: - libmpg123 Website: http://www.mpg123.de/ @@ -31,9 +132,6 @@ LÖVE uses the following LGPL libraries on most platforms: - OpenAL Soft Website: http://kcat.strangesoft.net/openal.html Source download: http://kcat.strangesoft.net/openal.html#download - - DevIL - Website: http://openil.sourceforge.net/ - Source download: http://downloads.sourceforge.net/openil/DevIL-1.7.8.tar.gz Following are the LGPL and GPL license texts: diff --git a/jni/love/readme-iOS.rtf b/jni/love/readme-iOS.rtf new file mode 100644 index 00000000..935f60b0 --- /dev/null +++ b/jni/love/readme-iOS.rtf @@ -0,0 +1,67 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1404\cocoasubrtf340 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fnil\fcharset0 Monaco;\f2\fnil\fcharset0 LucidaGrande; +} +{\colortbl;\red255\green255\blue255;} +{\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid1\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid1} +{\list\listtemplateid2\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid101\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid2} +{\list\listtemplateid3\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid201\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid3} +{\list\listtemplateid4\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid301\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid4} +{\list\listtemplateid5\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid401\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid5} +{\list\listtemplateid6\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid501\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid6}} +{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}{\listoverride\listid3\listoverridecount0\ls3}{\listoverride\listid4\listoverridecount0\ls4}{\listoverride\listid5\listoverridecount0\ls5}{\listoverride\listid6\listoverridecount0\ls6}} +\margl1440\margr1440\vieww14040\viewh10200\viewkind0 +\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0 + +\f0\b\fs36 \cf0 Building L\'d6VE for iOS +\b0\fs24 \ +\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0 +\cf0 \ +In order to run L\'d6VE for iOS, it must first be compiled and installed. To do that, you\'92ll need Mac OS X and {\field{\*\fldinst{HYPERLINK "https://developer.apple.com/xcode/"}}{\fldrslt Xcode 7 or newer}}.\ +\ +\pard\tx220\tx720\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\li720\fi-720\pardirnatural\partightenfactor0 +\ls1\ilvl0\cf0 {\listtext \'95 }If the +\f1\fs22 include +\f0\fs24 and +\f1\fs22 libraries +\f0\fs24 folders are not present in the +\f1\fs22 love/platform/xcode/ios +\f0\fs24 folder, {\field{\*\fldinst{HYPERLINK "https://bitbucket.org/rude/love/downloads/love-0.10.0-ios-libraries.zip"}}{\fldrslt download them}} and place them there. They contain the third-party library dependencies used by L\'d6VE.\ +\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0 +\cf0 \ +\pard\tx220\tx720\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\li720\fi-720\pardirnatural\partightenfactor0 +\ls2\ilvl0\cf0 {\listtext \'95 }Open the Xcode project found at +\f1\fs22 love/platform/xcode/love.xcodeproj +\f0\fs24 , and select the \'93love-ios\'94 target in the dropdown menu at the top of the window.\ +\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0 +\cf0 \ +\pard\tx220\tx720\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\li720\fi-720\pardirnatural\partightenfactor0 +\ls3\ilvl0\cf0 {\listtext \'95 }You may want to change the Build Configuration from Debug to Release mode for better runtime performance, by opening the \'93Edit Scheme\'85\'94 menu from the same dropdown selection.\ +\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0 +\cf0 \ +\pard\tx220\tx720\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\li720\fi-720\pardirnatural\partightenfactor0 +\ls4\ilvl0\cf0 {\listtext \'95 }Choose either an iOS Simulator device or your plugged-in iOS device from the dropdown selection to the right of the previous one, and click the Build-and-Run +\f2 \uc0\u9654 \u65038 +\f0 button to the left, which will install and run L\'d6VE on the target device after compiling it.\ +\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0 +\cf0 \ + +\b\fs36 Running Games on iOS +\b0\fs24 \ +\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0 +\cf0 \ +L\'d6VE on iOS includes a simple list interface of games that are installed (until you {\field{\*\fldinst{HYPERLINK "https://love2d.org/wiki/Game_Distribution"}}{\fldrslt fuse}} a .love to it for distribution.)\ +\ +\pard\tx220\tx720\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\li720\fi-720\pardirnatural\partightenfactor0 +\ls5\ilvl0\cf0 {\listtext \'95 }To put a .love file on the iOS Simulator after L\'d6VE is installed, drag the file onto the iOS Simulator\'92s window while it\'92s open. L\'d6VE will launch if it\'92s not running already. If another game is currently active you may need to quit L\'d6VE for the new game to show up (press Shift-Command-H twice to open the App Switcher menu on the iOS Simulator.)\ +\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0 +\cf0 \ +\pard\tx220\tx720\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\li720\fi-720\pardirnatural\partightenfactor0 +\ls6\ilvl0\cf0 {\listtext \'95 }To put a .love file or game folder on your iOS device after L\'d6VE is installed, you can either download it with the Safari, or transfer it from your computer through iTunes when your device is connected: open iTunes, go to the iOS device which has L\'d6VE installed, go to the \'91Apps\'92 section and scroll down and find L\'d6VE, and add the .love file or game folder to L\'d6VE\'92s Documents section.\ +\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0 +\cf0 \ + +\b\fs36 Distributing a Game on iOS +\b0\fs24 \ +\ +Refer to the {\field{\*\fldinst{HYPERLINK "https://love2d.org/wiki/Game_Distribution#iOS"}}{\fldrslt Game Distribution}} L\'d6VE wiki page.\ +} \ No newline at end of file diff --git a/jni/love/readme.md b/jni/love/readme.md index 14c58188..6bdf7824 100644 --- a/jni/love/readme.md +++ b/jni/love/readme.md @@ -1,4 +1,6 @@ -LÖVE is an *awesome* framework you can use to make 2D games in Lua. It's free, open-source, and works on Windows, Mac OS X and Linux. +LÖVE is an *awesome* framework you can use to make 2D games in Lua. It's free, open-source, and works on Windows, Mac OS X, Linux, Android, and iOS. + +[![Build Status: Windows](https://ci.appveyor.com/api/projects/status/u1a69u5o5ej1pus4?svg=true)](https://ci.appveyor.com/project/AlexSzpakowski/love) Documentation ------------- @@ -22,7 +24,18 @@ Run `platform/unix/automagic` from the repository root, then run ./configure and ###Mac OS X Download the required frameworks from [here][dependencies] and place them in `/Library/Frameworks/`. -Then use the Xcode project found at `platform/macosx/love.xcodeproj`. +Then use the Xcode project found at `platform/xcode/love.xcodeproj` to build the `love-macosx` target. + +###iOS +Download the required libraries from [here][dependencies-ios] and place the `include` and `libraries` folders +into the `platform/xcode/ios` folder. + +Then use the Xcode project found at `platform/xcode/love.xcodeproj` to build the `love-ios` target. + +See `readme-iOS.rtf` for more information. + +###Android +Visit the [Android build repository][android-repository] for build instructions. Repository information ---------------------- @@ -35,6 +48,12 @@ We tag all our releases (since we started using mercurial), and have binary down Experimental changes are developed in the separate [love-experiments][love-experiments] repository. +Contributing +------------ + +The best places to contribute are through the Bitbucket issue tracker and the official IRC channel. +For code contributions, pull requests and patches are welcome. Be sure to read the [source code style guide][codestyle]. + Builds ------ @@ -51,24 +70,27 @@ Dependencies ------------ - SDL2 -- OpenGL +- OpenGL 2.1+ / OpenGL ES 2+ - OpenAL - Lua / LuaJIT / LLVM-lua -- DevIL with MNG and TIFF - FreeType - PhysicsFS - ModPlug - mpg123 - Vorbisfile +- Theora [site]: http://love2d.org [wiki]: http://love2d.org/wiki [forums]: http://love2d.org/forums [irc]: irc://irc.oftc.net/love [dependencies]: http://love2d.org/sdk +[dependencies-ios]: https://bitbucket.org/rude/love/downloads/love-0.10.0-ios-libraries.zip [megasource]: https://bitbucket.org/rude/megasource [builds]: http://love2d.org/builds [stableppa]: https://launchpad.net/~bartbes/+archive/love-stable [unstableppa]: https://launchpad.net/~bartbes/+archive/love-unstable -[aur]: http://aur.archlinux.org/packages.php?ID=35279 +[aur]: http://aur.archlinux.org/packages/love-hg [love-experiments]: https://bitbucket.org/bartbes/love-experiments +[codestyle]: https://love2d.org/wiki/Code_Style +[android-repository]: https://bitbucket.org/MartinFelis/love-android-sdl2 diff --git a/jni/love/src/common/config.h b/jni/love/src/common/config.h index 8e9674a4..61d08cf7 100644 --- a/jni/love/src/common/config.h +++ b/jni/love/src/common/config.h @@ -76,7 +76,6 @@ #endif #if defined(LOVE_WINDOWS) -# define LOVE_LEGENDARY_UTF8_ARGV_HACK # define LOVE_LEGENDARY_CONSOLE_IO_HACK # define NOMINMAX #endif diff --git a/jni/love/src/love.cpp b/jni/love/src/love.cpp index 07c00523..1ee6f6c0 100644 --- a/jni/love/src/love.cpp +++ b/jni/love/src/love.cpp @@ -59,47 +59,14 @@ extern "C" // http://developer.download.nvidia.com/devzone/devcenter/gamegraphics/files/OptimusRenderingPolicies.pdf // TODO: Re-evaluate in the future when the average integrated GPU in Optimus // systems is less mediocre? -LOVE_EXPORT DWORD NvOptimusEnablement = 0x00000001; +LOVE_EXPORT DWORD NvOptimusEnablement = 1; + +// Same with AMD GPUs. +// https://community.amd.com/thread/169965 +LOVE_EXPORT DWORD AmdPowerXpressRequestHighPerformance = 1; } #endif // LOVE_WINDOWS -#ifdef LOVE_LEGENDARY_UTF8_ARGV_HACK - -void get_utf8_arguments(int &argc, char **&argv) -{ - LPWSTR cmd = GetCommandLineW(); - - if (!cmd) - return; - - LPWSTR *argv_w = CommandLineToArgvW(cmd, &argc); - - argv = new char *[argc]; - - for (int i = 0; i < argc; ++i) - { - // Size of wide char buffer (plus one for trailing '\0'). - size_t wide_len = wcslen(argv_w[i]) + 1; - - // Get size in UTF-8. - int utf8_size = WideCharToMultiByte(CP_UTF8, 0, argv_w[i], wide_len, argv[i], 0, 0, 0); - - argv[i] = new char[utf8_size]; - - // Convert to UTF-8. - int ok = WideCharToMultiByte(CP_UTF8, 0, argv_w[i], wide_len, argv[i], utf8_size, 0, 0); - - int len = strlen(argv[i]); - - if (!ok) - printf("Warning: could not convert to UTF8.\n"); - } - - LocalFree(argv_w); -} - -#endif // LOVE_LEGENDARY_UTF8_ARGV_HACK - #ifdef LOVE_LEGENDARY_APP_ARGV_HACK #include @@ -222,13 +189,6 @@ int main(int argc, char **argv) argv = orig_argv; #endif -#ifdef LOVE_LEGENDARY_UTF8_ARGV_HACK - int hack_argc = 0; char **hack_argv = 0; - get_utf8_arguments(hack_argc, hack_argv); - argc = hack_argc; - argv = hack_argv; -#endif // LOVE_LEGENDARY_UTF8_ARGV_HACK - #ifdef LOVE_LEGENDARY_APP_ARGV_HACK int hack_argc = 0; char **hack_argv = 0; @@ -314,14 +274,14 @@ int main(int argc, char **argv) lua_close(L); -#if defined(LOVE_LEGENDARY_UTF8_ARGV_HACK) || defined(LOVE_LEGENDARY_APP_ARGV_HACK) +#if defined(LOVE_LEGENDARY_APP_ARGV_HACK) if (hack_argv) { for (int i = 0; i(Module::M_AUDIO); - if (audio) - audio->pause(); - } - break; - case SDL_WINDOWEVENT_RESTORED: - { - auto audio = Module::getInstance(Module::M_AUDIO); - if (audio) - audio->resume(); - } - break; -#endif default: break; } @@ -590,6 +574,21 @@ Message *Event::convertWindowEvent(const SDL_Event &e) const if (win) win->onSizeChanged(e.window.data1, e.window.data2); break; + case SDL_WINDOWEVENT_MINIMIZED: + case SDL_WINDOWEVENT_RESTORED: +#ifdef LOVE_ANDROID + { + auto audio = Module::getInstance(Module::M_AUDIO); + if (audio) + { + if (e.window.event == SDL_WINDOWEVENT_MINIMIZED) + audio->pause(); + else if (e.window.event == SDL_WINDOWEVENT_RESTORED) + audio->resume(); + } + } +#endif + break; } // We gave +1 refs to the StrongRef list, so we should release them. diff --git a/jni/love/src/modules/font/BMFontRasterizer.cpp b/jni/love/src/modules/font/BMFontRasterizer.cpp index b1121937..bda538d3 100644 --- a/jni/love/src/modules/font/BMFontRasterizer.cpp +++ b/jni/love/src/modules/font/BMFontRasterizer.cpp @@ -245,6 +245,8 @@ void BMFontRasterizer::parseConfig(const std::string &configtext) for (const auto &cpair : characters) { const BMFontCharacter &c = cpair.second; + int width = c.metrics.width; + int height = c.metrics.height; if (!unicode && cpair.first > 127) throw love::Exception("Invalid BMFont character id (only unicode and ASCII are supported)"); @@ -254,8 +256,14 @@ void BMFontRasterizer::parseConfig(const std::string &configtext) const image::ImageData *id = images[c.page].get(); - if (!id->inside(c.x, c.y) || !id->inside(c.x + c.metrics.width - 1, c.y + c.metrics.height - 1)) - throw love::Exception("Invalid BMFont character coordinates."); + if (!id->inside(c.x, c.y)) + throw love::Exception("Invalid coordinates for BMFont character %u.", cpair.first); + + if (width > 0 && !id->inside(c.x + width - 1, c.y)) + throw love::Exception("Invalid width %d for BMFont character %u.", width, cpair.first); + + if (height > 0 && !id->inside(c.x, c.y + height - 1)) + throw love::Exception("Invalid height %d for BMFont character %u.", height, cpair.first); if (guessheight) lineHeight = std::max(lineHeight, c.metrics.height); diff --git a/jni/love/src/modules/graphics/opengl/Canvas.h b/jni/love/src/modules/graphics/opengl/Canvas.h index 69cd22e7..7f7a9ec8 100644 --- a/jni/love/src/modules/graphics/opengl/Canvas.h +++ b/jni/love/src/modules/graphics/opengl/Canvas.h @@ -117,6 +117,7 @@ public: return actual_samples; } + static Format getSizedFormat(Format format); static bool isSupported(); static bool isMultiFormatMultiCanvasSupported(); static bool isFormatSupported(Format format); @@ -143,7 +144,6 @@ private: void drawv(const Matrix4 &t, const Vertex *v); - static Format getSizedFormat(Format format); static void convertFormat(Format format, GLenum &internalformat, GLenum &externalformat, GLenum &type); static size_t getFormatBitsPerPixel(Format format); diff --git a/jni/love/src/modules/graphics/opengl/Graphics.cpp b/jni/love/src/modules/graphics/opengl/Graphics.cpp index ec30c743..d4c3088f 100644 --- a/jni/love/src/modules/graphics/opengl/Graphics.cpp +++ b/jni/love/src/modules/graphics/opengl/Graphics.cpp @@ -842,11 +842,14 @@ ParticleSystem *Graphics::newParticleSystem(Texture *texture, int size) Canvas *Graphics::newCanvas(int width, int height, Canvas::Format format, int msaa) { + if (!Canvas::isSupported()) + throw love::Exception("Canvases are not supported by your OpenGL drivers!"); + if (!Canvas::isFormatSupported(format)) { const char *fstr = "rgba8"; - Canvas::getConstant(format, fstr); - throw love::Exception("The %s canvas format is not supported by your OpenGL implementation.", fstr); + Canvas::getConstant(Canvas::getSizedFormat(format), fstr); + throw love::Exception("The %s canvas format is not supported by your OpenGL drivers.", fstr); } if (width > gl.getMaxTextureSize()) @@ -870,7 +873,7 @@ Canvas *Graphics::newCanvas(int width, int height, Canvas::Format format, int ms switch (err) { case GL_FRAMEBUFFER_UNSUPPORTED: - error_string << "Not supported by your OpenGL implementation."; + error_string << "Not supported by your OpenGL drivers."; break; case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT: error_string << "Texture format cannot be rendered to on this system."; @@ -881,14 +884,14 @@ Canvas *Graphics::newCanvas(int width, int height, Canvas::Format format, int ms case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER: case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER: case GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: - error_string << "Error in implementation."; + error_string << "Error in graphics driver."; break; default: // my intel hda card wrongly returns 0 to glCheckFramebufferStatus() but sets // no error flag. I think it meant to return GL_FRAMEBUFFER_UNSUPPORTED, but who // knows. if (glGetError() == GL_NO_ERROR) - error_string << "May not be supported by your OpenGL implementation."; + error_string << "May not be supported by your OpenGL drivers."; // the remaining error is an indication of a serious fuckup since it should // only be returned if glCheckFramebufferStatus() was called with the wrong // arguments. diff --git a/jni/love/src/modules/graphics/opengl/wrap_Graphics.cpp b/jni/love/src/modules/graphics/opengl/wrap_Graphics.cpp index 31ff5f35..30097a50 100644 --- a/jni/love/src/modules/graphics/opengl/wrap_Graphics.cpp +++ b/jni/love/src/modules/graphics/opengl/wrap_Graphics.cpp @@ -47,6 +47,13 @@ namespace opengl #define instance() (Module::getInstance(Module::M_GRAPHICS)) +static int luax_checkgraphicscreated(lua_State *L) +{ + if (!instance()->isCreated()) + return luaL_error(L, "love.graphics cannot function without a window!"); + return 0; +} + int w_reset(lua_State *) { instance()->reset(); @@ -290,6 +297,8 @@ static const char *imageFlagName(Image::FlagType flagtype) int w_newImage(lua_State *L) { + luax_checkgraphicscreated(L); + std::vector data; std::vector cdata; @@ -400,6 +409,8 @@ int w_newImage(lua_State *L) int w_newQuad(lua_State *L) { + luax_checkgraphicscreated(L); + Quad::Viewport v; v.x = luaL_checknumber(L, 1); v.y = luaL_checknumber(L, 2); @@ -417,6 +428,8 @@ int w_newQuad(lua_State *L) int w_newFont(lua_State *L) { + luax_checkgraphicscreated(L); + Font *font = nullptr; // Convert to Rasterizer, if necessary. @@ -443,6 +456,8 @@ int w_newFont(lua_State *L) int w_newImageFont(lua_State *L) { + luax_checkgraphicscreated(L); + // filter for glyphs Texture::Filter filter = instance()->getDefaultFilter(); @@ -483,6 +498,8 @@ int w_newImageFont(lua_State *L) int w_newSpriteBatch(lua_State *L) { + luax_checkgraphicscreated(L); + Texture *texture = luax_checktexture(L, 1); int size = (int) luaL_optnumber(L, 2, 1000); Mesh::Usage usage = Mesh::USAGE_DYNAMIC; @@ -505,6 +522,8 @@ int w_newSpriteBatch(lua_State *L) int w_newParticleSystem(lua_State *L) { + luax_checkgraphicscreated(L); + Texture *texture = luax_checktexture(L, 1); lua_Number size = luaL_optnumber(L, 2, 1000); ParticleSystem *t = 0; @@ -522,6 +541,8 @@ int w_newParticleSystem(lua_State *L) int w_newCanvas(lua_State *L) { + luax_checkgraphicscreated(L); + // check if width and height are given. else default to screen dimensions. int width = (int) luaL_optnumber(L, 1, instance()->getWidth()); int height = (int) luaL_optnumber(L, 2, instance()->getHeight()); @@ -547,6 +568,8 @@ int w_newCanvas(lua_State *L) int w_newShader(lua_State *L) { + luax_checkgraphicscreated(L); + // clamp stack to 2 elements lua_settop(L, 2); @@ -848,6 +871,8 @@ static Mesh *newCustomMesh(lua_State *L) int w_newMesh(lua_State *L) { + luax_checkgraphicscreated(L); + // Check first argument: table or number of vertices. int arg1type = lua_type(L, 1); if (arg1type != LUA_TTABLE && arg1type != LUA_TNUMBER) @@ -868,6 +893,8 @@ int w_newMesh(lua_State *L) int w_newText(lua_State *L) { + luax_checkgraphicscreated(L); + Font *font = luax_checkfont(L, 1); Text *t = nullptr; @@ -888,6 +915,8 @@ int w_newText(lua_State *L) int w_newVideo(lua_State *L) { + luax_checkgraphicscreated(L); + if (!luax_istype(L, 1, VIDEO_VIDEO_STREAM_ID)) luax_convobj(L, 1, "video", "newVideoStream"); diff --git a/jni/love/src/modules/image/wrap_ImageData.lua b/jni/love/src/modules/image/wrap_ImageData.lua index 21ecafb8..22fbc451 100644 --- a/jni/love/src/modules/image/wrap_ImageData.lua +++ b/jni/love/src/modules/image/wrap_ImageData.lua @@ -42,12 +42,12 @@ function ImageData:mapPixel(func, ix, iy, iw, ih) iw = iw or idw ih = ih or idh - if type(ix) ~= "number" then error("Invalid argument #2 to ImageData:mapPixel (expected number)", 2) end - if type(iy) ~= "number" then error("Invalid argument #3 to ImageData:mapPixel (expected number)", 2) end - if type(iw) ~= "number" then error("Invalid argument #4 to ImageData:mapPixel (expected number)", 2) end - if type(ih) ~= "number" then error("Invalid argument #5 to ImageData:mapPixel (expected number)", 2) end + if type(ix) ~= "number" then error("bad argument #2 to ImageData:mapPixel (expected number)", 2) end + if type(iy) ~= "number" then error("bad argument #3 to ImageData:mapPixel (expected number)", 2) end + if type(iw) ~= "number" then error("bad argument #4 to ImageData:mapPixel (expected number)", 2) end + if type(ih) ~= "number" then error("bad argument #5 to ImageData:mapPixel (expected number)", 2) end - if type(func) ~= "function" then error("Invalid argument #1 to ImageData:mapPixel (expected function)", 2) end + if type(func) ~= "function" then error("bad argument #1 to ImageData:mapPixel (expected function)", 2) end if not (inside(ix, iy, idw, idh) and inside(ix+iw-1, iy+ih-1, idw, idh)) then error("Invalid rectangle dimensions", 2) end -- performAtomic and mapPixelUnsafe have Lua-C API and FFI versions. @@ -141,6 +141,9 @@ function ImageData:_mapPixelUnsafe(func, ix, iy, iw, ih) end function ImageData:getPixel(x, y) + if type(x) ~= "number" then error("bad argument #1 to ImageData:getPixel (expected number)", 2) end + if type(y) ~= "number" then error("bad argument #2 to ImageData:getPixel (expected number)", 2) end + local p = objectcache[self] if not inside(x, y, p.width, p.height) then error("Attempt to get out-of-range pixel!", 2) end @@ -154,15 +157,23 @@ end local temppixel = ffi.new("ImageData_Pixel") -function ImageData:setPixel(x, y, r, g, b, a) - local p = objectcache[self] - if not inside(x, y, p.width, p.height) then error("Attempt to set out-of-range pixel!", 2) end +function ImageData:setPixel(x, y, r, g, b, a) + if type(x) ~= "number" then error("bad argument #1 to ImageData:setPixel (expected number)", 2) end + if type(y) ~= "number" then error("bad argument #2 to ImageData:setPixel (expected number)", 2) end if type(r) == "table" then local t = r r, g, b, a = t[1], t[2], t[3], t[4] end + if type(r) ~= "number" then error("bad red color component argument to ImageData:setPixel (expected number)", 2) end + if type(g) ~= "number" then error("bad green color component argument to ImageData:setPixel (expected number)", 2) end + if type(b) ~= "number" then error("bad blue color component argument to ImageData:setPixel (expected number)", 2) end + if a ~= nil and type(a) ~= "number" then error("bad alpha color component argument to ImageData:setPixel (expected number)", 2) end + + local p = objectcache[self] + if not inside(x, y, p.width, p.height) then error("Attempt to set out-of-range pixel!", 2) end + temppixel.r = r temppixel.g = g temppixel.b = b diff --git a/jni/love/src/modules/keyboard/sdl/Keyboard.cpp b/jni/love/src/modules/keyboard/sdl/Keyboard.cpp index 9cb27c91..84219a0b 100644 --- a/jni/love/src/modules/keyboard/sdl/Keyboard.cpp +++ b/jni/love/src/modules/keyboard/sdl/Keyboard.cpp @@ -55,6 +55,7 @@ bool Keyboard::isDown(const std::vector &keylist) const for (Key key : keylist) { SDL_Scancode scancode = SDL_GetScancodeFromKey(keymap[key]); + if (state[scancode]) return true; } @@ -68,11 +69,9 @@ bool Keyboard::isScancodeDown(const std::vector &scancodelist) const for (Scancode scancode : scancodelist) { - SDL_Scancode sdlscancode = SDL_SCANCODE_UNKNOWN; - if (!scancodes.find(scancode, sdlscancode)) - continue; + SDL_Scancode sdlcode = SDL_SCANCODE_UNKNOWN; - if (state[sdlscancode]) + if (scancodes.find(scancode, sdlcode) && state[sdlcode]) return true; } diff --git a/jni/love/src/modules/physics/box2d/MotorJoint.cpp b/jni/love/src/modules/physics/box2d/MotorJoint.cpp index 15250268..3902fe38 100644 --- a/jni/love/src/modules/physics/box2d/MotorJoint.cpp +++ b/jni/love/src/modules/physics/box2d/MotorJoint.cpp @@ -42,7 +42,7 @@ MotorJoint::MotorJoint(Body *body1, Body *body2) joint = (b2MotorJoint *) createJoint(&def); } -MotorJoint::MotorJoint(Body *body1, Body *body2, float correctionFactor) +MotorJoint::MotorJoint(Body *body1, Body *body2, float correctionFactor, bool collideConnected) : Joint(body1, body2) , joint(NULL) { @@ -50,6 +50,7 @@ MotorJoint::MotorJoint(Body *body1, Body *body2, float correctionFactor) def.Initialize(body1->body, body2->body); def.correctionFactor = correctionFactor; + def.collideConnected = collideConnected; joint = (b2MotorJoint *) createJoint(&def); } diff --git a/jni/love/src/modules/physics/box2d/MotorJoint.h b/jni/love/src/modules/physics/box2d/MotorJoint.h index ac4ad65f..69d9432e 100644 --- a/jni/love/src/modules/physics/box2d/MotorJoint.h +++ b/jni/love/src/modules/physics/box2d/MotorJoint.h @@ -41,7 +41,7 @@ class MotorJoint : public Joint public: MotorJoint(Body *body1, Body* body2); - MotorJoint(Body *body1, Body* body2, float correctionFactor); + MotorJoint(Body *body1, Body* body2, float correctionFactor, bool collideConnected); virtual ~MotorJoint(); /// Set/get the target linear offset, in frame A, in meters. diff --git a/jni/love/src/modules/physics/box2d/Physics.cpp b/jni/love/src/modules/physics/box2d/Physics.cpp index 99c1c912..8673c1ad 100644 --- a/jni/love/src/modules/physics/box2d/Physics.cpp +++ b/jni/love/src/modules/physics/box2d/Physics.cpp @@ -268,9 +268,9 @@ MotorJoint *Physics::newMotorJoint(Body *body1, Body *body2) return new MotorJoint(body1, body2); } -MotorJoint *Physics::newMotorJoint(Body *body1, Body *body2, float correctionFactor) +MotorJoint *Physics::newMotorJoint(Body *body1, Body *body2, float correctionFactor, bool collideConnected) { - return new MotorJoint(body1, body2, correctionFactor); + return new MotorJoint(body1, body2, correctionFactor, collideConnected); } diff --git a/jni/love/src/modules/physics/box2d/Physics.h b/jni/love/src/modules/physics/box2d/Physics.h index 92db477a..11350637 100644 --- a/jni/love/src/modules/physics/box2d/Physics.h +++ b/jni/love/src/modules/physics/box2d/Physics.h @@ -257,7 +257,7 @@ public: * and body2. **/ MotorJoint *newMotorJoint(Body *body1, Body *body2); - MotorJoint *newMotorJoint(Body *body1, Body *body2, float correctionFactor); + MotorJoint *newMotorJoint(Body *body1, Body *body2, float correctionFactor, bool collideConnected); /** * Creates a new Fixture attaching shape to body. diff --git a/jni/love/src/modules/physics/box2d/wrap_Physics.cpp b/jni/love/src/modules/physics/box2d/wrap_Physics.cpp index 18fc49ee..ef6327c6 100644 --- a/jni/love/src/modules/physics/box2d/wrap_Physics.cpp +++ b/jni/love/src/modules/physics/box2d/wrap_Physics.cpp @@ -419,8 +419,9 @@ int w_newMotorJoint(lua_State *L) if (!lua_isnoneornil(L, 3)) { float correctionFactor = (float)luaL_checknumber(L, 3); + bool collideConnected = luax_optboolean(L, 4, false); luax_catchexcept(L, [&]() { - j = instance()->newMotorJoint(body1, body2, correctionFactor); + j = instance()->newMotorJoint(body1, body2, correctionFactor, collideConnected); }); } else diff --git a/jni/love/src/modules/sound/wrap_SoundData.lua b/jni/love/src/modules/sound/wrap_SoundData.lua index 0a9d0500..803a9a2d 100644 --- a/jni/love/src/modules/sound/wrap_SoundData.lua +++ b/jni/love/src/modules/sound/wrap_SoundData.lua @@ -75,6 +75,8 @@ local objectcache = setmetatable({}, { -- Overwrite existing functions with new FFI versions. function SoundData:getSample(i) + if type(i) ~= "number" then error("bad argument #1 to SoundData:getSample (expected number)", 2) end + local p = objectcache[self] if not (i >= 0 and i < p.size/p.bytedepth) then @@ -91,6 +93,9 @@ function SoundData:getSample(i) end function SoundData:setSample(i, sample) + if type(i) ~= "number" then error("bad argument #1 to SoundData:setSample (expected number)", 2) end + if type(sample) ~= "number" then error("bad argument #2 to SoundData:setSample (expected number)", 2) end + local p = objectcache[self] if not (i >= 0 and i < p.size/p.bytedepth) then diff --git a/jni/love/src/modules/touch/Touch.h b/jni/love/src/modules/touch/Touch.h index 08c7557b..d4012190 100644 --- a/jni/love/src/modules/touch/Touch.h +++ b/jni/love/src/modules/touch/Touch.h @@ -55,19 +55,14 @@ public: virtual ModuleType getModuleType() const { return M_TOUCH; } /** - * Gets a list of the IDs of all currently active touches. + * Gets all currently active touches. **/ - virtual std::vector getTouches() const = 0; + virtual const std::vector &getTouches() const = 0; /** - * Gets the position in pixels of a specific touch, using its ID. + * Gets a specific touch, using its ID. **/ - virtual void getPosition(int64 id, double &x, double &y) const = 0; - - /** - * Gets the pressure of a specific touch, using its ID. - **/ - virtual double getPressure(int64 id) const = 0; + virtual const TouchInfo &getTouch(int64 id) const = 0; }; // Touch diff --git a/jni/love/src/modules/touch/sdl/Touch.cpp b/jni/love/src/modules/touch/sdl/Touch.cpp index 9f888564..8409e8ac 100644 --- a/jni/love/src/modules/touch/sdl/Touch.cpp +++ b/jni/love/src/modules/touch/sdl/Touch.cpp @@ -23,6 +23,9 @@ #include "common/Exception.h" #include "Touch.h" +// C++ +#include + namespace love { namespace touch @@ -30,34 +33,20 @@ namespace touch namespace sdl { -std::vector Touch::getTouches() const +const std::vector &Touch::getTouches() const { - std::vector ids; - ids.reserve(touches.size()); + return touches; +} +const Touch::TouchInfo &Touch::getTouch(int64 id) const +{ for (const auto &touch : touches) - ids.push_back(touch.first); + { + if (touch.id == id) + return touch; + } - return ids; -} - -void Touch::getPosition(int64 id, double &x, double &y) const -{ - const auto it = touches.find(id); - if (it == touches.end()) - throw love::Exception("Invalid active touch ID: %d", id); - - x = it->second.x; - y = it->second.y; -} - -double Touch::getPressure(int64 id) const -{ - const auto it = touches.find(id); - if (it == touches.end()) - throw love::Exception("Invalid active touch ID: %d", id); - - return it->second.pressure; + throw love::Exception("Invalid active touch ID: %d", id); } const char *Touch::getName() const @@ -67,14 +56,28 @@ const char *Touch::getName() const void Touch::onEvent(Uint32 eventtype, const TouchInfo &info) { + auto compare = [&](const TouchInfo &touch) -> bool + { + return touch.id == info.id; + }; + switch (eventtype) { case SDL_FINGERDOWN: - case SDL_FINGERMOTION: - touches[info.id] = info; + touches.erase(std::remove_if(touches.begin(), touches.end(), compare), touches.end()); + touches.push_back(info); break; + case SDL_FINGERMOTION: + { + for (TouchInfo &touch : touches) + { + if (touch.id == info.id) + touch = info; + } + break; + } case SDL_FINGERUP: - touches.erase(info.id); + touches.erase(std::remove_if(touches.begin(), touches.end(), compare), touches.end()); break; default: break; diff --git a/jni/love/src/modules/touch/sdl/Touch.h b/jni/love/src/modules/touch/sdl/Touch.h index 20730320..1d2d09f7 100644 --- a/jni/love/src/modules/touch/sdl/Touch.h +++ b/jni/love/src/modules/touch/sdl/Touch.h @@ -24,9 +24,6 @@ // LOVE #include "touch/Touch.h" -// C++ -#include - // SDL #include @@ -43,9 +40,8 @@ public: virtual ~Touch() {} - std::vector getTouches() const override; - void getPosition(int64 id, double &x, double &y) const override; - double getPressure(int64 id) const override; + const std::vector &getTouches() const override; + const TouchInfo &getTouch(int64 id) const override; // Implements Module. const char *getName() const override; @@ -59,8 +55,8 @@ public: private: - // All current touches, indexed by their IDs. - std::map touches; + // All current touches. + std::vector touches; }; // Touch diff --git a/jni/love/src/modules/touch/wrap_Touch.cpp b/jni/love/src/modules/touch/wrap_Touch.cpp index 95d51aaf..7967f314 100644 --- a/jni/love/src/modules/touch/wrap_Touch.cpp +++ b/jni/love/src/modules/touch/wrap_Touch.cpp @@ -42,18 +42,18 @@ int64 luax_checktouchid(lua_State *L, int idx) int w_getTouches(lua_State *L) { - std::vector ids = instance()->getTouches(); + const std::vector &touches = instance()->getTouches(); - lua_createtable(L, (int) ids.size(), 0); + lua_createtable(L, (int) touches.size(), 0); - for (size_t i = 0; i < ids.size(); i++) + for (size_t i = 0; i < touches.size(); i++) { // This is a bit hackish and we lose the higher 32 bits of the id on // 32-bit systems, but SDL only ever gives id's that at most use as many // bits as can fit in a pointer (for now.) // We use lightuserdata instead of a lua_Number (double) because doubles // can't represent all possible id values on 64-bit systems. - lua_pushlightuserdata(L, (void *) (intptr_t) ids[i]); + lua_pushlightuserdata(L, (void *) (intptr_t) touches[i].id); lua_rawseti(L, -2, (int) i + 1); } @@ -64,12 +64,11 @@ int w_getPosition(lua_State *L) { int64 id = luax_checktouchid(L, 1); - double x = 0; - double y = 0; - luax_catchexcept(L, [&]() { instance()->getPosition(id, x, y); }); + Touch::TouchInfo touch = {}; + luax_catchexcept(L, [&]() { touch = instance()->getTouch(id); }); - lua_pushnumber(L, x); - lua_pushnumber(L, y); + lua_pushnumber(L, touch.x); + lua_pushnumber(L, touch.y); return 2; } @@ -77,9 +76,11 @@ int w_getPosition(lua_State *L) int w_getPressure(lua_State *L) { int64 id = luax_checktouchid(L, 1); - double pressure = 0.0; - luax_catchexcept(L, [&](){ pressure = instance()->getPressure(id); }); - lua_pushnumber(L, pressure); + + Touch::TouchInfo touch = {}; + luax_catchexcept(L, [&](){ touch = instance()->getTouch(id); }); + + lua_pushnumber(L, touch.pressure); return 1; } diff --git a/res/drawable-hdpi/ic_launcher.png b/res/drawable-hdpi/ic_launcher.png deleted file mode 100644 index 03192023..00000000 Binary files a/res/drawable-hdpi/ic_launcher.png and /dev/null differ diff --git a/res/drawable-hdpi/love.png b/res/drawable-hdpi/love.png new file mode 100755 index 00000000..b47e8c28 Binary files /dev/null and b/res/drawable-hdpi/love.png differ diff --git a/res/drawable-mdpi/ic_launcher.png b/res/drawable-mdpi/ic_launcher.png deleted file mode 100644 index 1e65f25a..00000000 Binary files a/res/drawable-mdpi/ic_launcher.png and /dev/null differ diff --git a/res/drawable-mdpi/love.png b/res/drawable-mdpi/love.png new file mode 100755 index 00000000..de670813 Binary files /dev/null and b/res/drawable-mdpi/love.png differ diff --git a/res/drawable-xhdpi/ic_launcher.png b/res/drawable-xhdpi/ic_launcher.png deleted file mode 100644 index 658f0229..00000000 Binary files a/res/drawable-xhdpi/ic_launcher.png and /dev/null differ diff --git a/res/drawable-xhdpi/love.png b/res/drawable-xhdpi/love.png new file mode 100755 index 00000000..6e6ca481 Binary files /dev/null and b/res/drawable-xhdpi/love.png differ diff --git a/res/drawable-xxhdpi/ic_launcher.png b/res/drawable-xxhdpi/ic_launcher.png deleted file mode 100644 index db42d3bb..00000000 Binary files a/res/drawable-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/res/drawable-xxhdpi/love.png b/res/drawable-xxhdpi/love.png new file mode 100755 index 00000000..c07cb053 Binary files /dev/null and b/res/drawable-xxhdpi/love.png differ diff --git a/res/drawable-xxxhdpi/love.png b/res/drawable-xxxhdpi/love.png new file mode 100755 index 00000000..7e0efdc3 Binary files /dev/null and b/res/drawable-xxxhdpi/love.png differ