diff --git a/default.properties b/default.properties
index 9d135cb8..116a50ed 100644
--- a/default.properties
+++ b/default.properties
@@ -8,4 +8,4 @@
# project structure.
# Project target.
-target=android-7
+target=android-19
diff --git a/jni/love/Android.mk b/jni/love/Android.mk
index 718d3866..1c8392f3 100644
--- a/jni/love/Android.mk
+++ b/jni/love/Android.mk
@@ -37,6 +37,7 @@ LOCAL_C_INCLUDES := \
LOCAL_SRC_FILES := \
$(filter-out \
+ src/modules/graphics/opengl/GLee.* \
src/libraries/luasocket/libluasocket/wsocket.c \
,$(subst $(LOCAL_PATH)/,,\
$(wildcard ${LOCAL_PATH}/src/love.cpp) \
diff --git a/jni/love/CMakeLists.txt b/jni/love/CMakeLists.txt
index c2522270..c8af8367 100644
--- a/jni/love/CMakeLists.txt
+++ b/jni/love/CMakeLists.txt
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2006-2013 LOVE Development Team
+# Copyright (c) 2006-2014 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
@@ -45,10 +45,29 @@ else()
set(LOVE_TARGET_PLATFORM x86)
endif()
+option(LOVE_JIT "Use LuaJIT" TRUE)
+
+if(LOVE_JIT)
+ message(STATUS "LuaJIT: Enabled")
+else()
+ message(STATUS "LuaJIT: Disabled")
+endif()
+
message(STATUS "Target platform: ${LOVE_TARGET_PLATFORM}")
find_package(OpenGL)
+if(${LOVE_JIT})
+ set(MEGA_LUA ${MEGA_LUAJIT_LIB})
+ set(MEGA_EXTRA_INCLUDE ${MEGA_LUAJIT_INCLUDE})
+ set(MEGA_EXTRA_DLLS ${MEGA_LUAJIT_DLL})
+ set(MEGA_EXTRA_DEPENDECIES luajit)
+else()
+ set(MEGA_LUA ${MEGA_LUA51})
+ # MEGA_LUA51 is a CMake target, so includes are handled
+ # automatically.
+endif()
+
#
# common
#
@@ -230,15 +249,13 @@ source_group("modules\\font\\freetype" FILES ${LOVE_SRC_MODULE_FONT_FREETYPE})
set(LOVE_SRC_MODULE_GRAPHICS_ROOT
src/modules/graphics/Color.h
- src/modules/graphics/Drawable.cpp
src/modules/graphics/Drawable.h
- src/modules/graphics/DrawQable.h
src/modules/graphics/Graphics.cpp
src/modules/graphics/Graphics.h
- src/modules/graphics/Image.cpp
- src/modules/graphics/Image.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
)
@@ -266,6 +283,7 @@ 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/wrap_Canvas.cpp
@@ -286,6 +304,8 @@ set(LOVE_SRC_MODULE_GRAPHICS_OPENGL
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
)
set(LOVE_SRC_MODULE_GRAPHICS
@@ -904,7 +924,7 @@ set(LOVE_SRC_3P_ENET
)
add_library(love_3p_enet ${LOVE_SRC_3P_ENET})
-target_link_libraries(love_3p_enet ${MEGA_LUA51})
+target_link_libraries(love_3p_enet ${MEGA_LUA})
target_include_directories(love_3p_enet PUBLIC src/libraries/enet/libenet/include)
#
@@ -967,7 +987,7 @@ set(LOVE_SRC_3P_LUASOCKET
)
add_library(love_3p_luasocket ${LOVE_SRC_3P_LUASOCKET})
-target_link_libraries(love_3p_luasocket ${MEGA_LUA51})
+target_link_libraries(love_3p_luasocket ${MEGA_LUA})
#
# noise1234
@@ -1057,15 +1077,36 @@ include_directories(
src
src/libraries
src/modules
+ ${MEGA_EXTRA_INCLUDE}
)
# SDL2 links with some DirectX libraries, and we apparently also
# pull those libraries in for linkage because we link with SDL2.
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_LUA}
+ ${MEGA_MODPLUG}
+ ${MEGA_MPEG123}
+ ${MEGA_OPENAL}
+ ${MEGA_PHYSFS}
+ ${MEGA_SDL2MAIN}
+ ${MEGA_SDL2}
+ ${MEGA_TIFF}
+ ${MEGA_ZLIB}
+)
+
set(LOVE_LINK_LIBRARIES
${OPENGL_gl_LIBRARY}
- ${MEGA_3P}
+ ${LOVE_MEGA_3P}
)
set(LOVE_RC)
@@ -1085,9 +1126,13 @@ endif()
add_library(${LOVE_LIB_NAME} SHARED ${LOVE_LIB_SRC} ${LOVE_RC})
target_link_libraries(liblove ${LOVE_LINK_LIBRARIES} ${LOVE_3P})
+if(MEGA_EXTRA_DEPENDECIES)
+ add_dependencies(${LOVE_LIB_NAME} ${MEGA_EXTRA_DEPENDECIES})
+endif()
+
if(MSVC)
- set_target_properties(${LOVE_LIB_NAME} PROPERTIES RELEASE_OUTPUT_NAME "love")
- set_target_properties(${LOVE_LIB_NAME} PROPERTIES DEBUG_OUTPUT_NAME "love")
+ 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")
endif()
#
@@ -1102,7 +1147,12 @@ add_move_dll(love ${MEGA_MPEG123})
add_move_dll(love ${MEGA_SDL2})
add_move_dll(love ${MEGA_OPENAL})
add_move_dll(love ${MEGA_DEVIL})
-add_move_dll(love ${MEGA_LUA51})
+
+if(LOVE_JIT)
+ add_move_file(love ${MEGA_LUAJIT_DLL})
+else()
+ add_move_dll(love ${MEGA_LUA51})
+endif()
###################################
# Version
@@ -1131,6 +1181,15 @@ message(STATUS "Version: ${LOVE_VERSION_STR}")
###################################
install(TARGETS love ${LOVE_LIB_NAME} RUNTIME DESTINATION .)
+# Extra DLLs.
+if(MEGA_EXTRA_DLLS)
+ foreach(DLL ${MEGA_EXTRA_DLLS})
+ get_filename_component(DLL_NAME ${DLL} NAME)
+ message(STATUS "Extra DLL: ${DLL_NAME}")
+ endforeach()
+ install(FILES ${MEGA_EXTRA_DLLS} DESTINATION .)
+endif()
+
# Dynamic runtime libs.
if(MEGA_MSVC_DLLS)
foreach(DLL ${MEGA_MSVC_DLLS})
@@ -1158,6 +1217,12 @@ install(FILES
${CMAKE_CURRENT_BINARY_DIR}/readme.txt
DESTINATION .)
+# Icons
+install(FILES
+ ${CMAKE_CURRENT_SOURCE_DIR}/extra/nsis/love.ico
+ ${CMAKE_CURRENT_SOURCE_DIR}/extra/nsis/game.ico
+ DESTINATION .)
+
set(CPACK_GENERATOR ZIP NSIS)
set(CPACK_PACKAGE_NAME "love")
set(CPACK_PACKAGE_VENDOR "love2d.org")
@@ -1172,7 +1237,7 @@ set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/readme.md")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/license.txt")
set(CPACK_NSIS_EXECUTABLES_DIRECTORY .)
-set(CPACK_NSIS_PACKAGE_NAME "LÖVE")
+set(CPACK_NSIS_PACKAGE_NAME "LOVE")
set(CPACK_NSIS_DISPLAY_NAME "LÖVE ${LOVE_VERSION_STR}")
set(CPACK_NSIS_MODIFY_PATH OFF)
@@ -1200,4 +1265,20 @@ set(CPACK_NSIS_INSTALLER_MUI_ICON_CODE "
!define MUI_UNICON \\\"${NSIS_MUI_UNICON}\\\"
")
+set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "
+ WriteRegStr HKCR \\\".love\\\" \\\"\\\" \\\"LOVE\\\"
+ WriteRegStr HKCR \\\"LOVE\\\" \\\"\\\" \\\"LOVE Game File\\\"
+ WriteRegStr HKCR \\\"LOVE\\\\DefaultIcon\\\" \\\"\\\" \\\"$INSTDIR\\\\game.ico\\\"
+ WriteRegStr HKCR \\\"LOVE\\\\shell\\\" \\\"\\\" \\\"open\\\"
+ WriteRegStr HKCR \\\"LOVE\\\\shell\\\\open\\\" \\\"\\\" \\\"Open in LOVE\\\"
+ WriteRegStr HKCR \\\"LOVE\\\\shell\\\\open\\\\command\\\" \\\"\\\" \\\"$INSTDIR\\\\love.exe $\\\\\\\"%1$\\\\\\\"\\\"
+ System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'
+")
+
+set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "
+ DeleteRegKey HKCR \\\"LOVE\\\"
+ DeleteRegKey HKCR \\\".love\\\"
+ System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'
+")
+
include(CPack)
diff --git a/jni/love/changes.txt b/jni/love/changes.txt
index 0efd25e8..f6a84768 100644
--- a/jni/love/changes.txt
+++ b/jni/love/changes.txt
@@ -1,7 +1,24 @@
+LOVE 0.9.1 [Baby Inspector]
+---------------------------
+
+ Released: N/A
+
+ * Added Source:clone.
+ * Added ParticleSystem:clone.
+ * Added Mesh:setWireframe and Mesh:isWireframe for debugging.
+
+ * Fixed love.graphics.scale with negative values causing incorrect line widths.
+ * Fixed Joystick:isDown using 0-based button index arguments.
+ * Fixed Source:setPitch to error when infinity or NaN is given.
+ * Fixed love.graphics.setCanvas() to restore the proper viewport and scissor rectangles.
+ * Fixed TrueType font glyphs which request a monochrome bitmap pixel mode.
+
+ * Updated the error text for LÖVE’s module searchers when require fails.
+
LOVE 0.9.0 [Baby Inspector]
---------------------------
- Released: N/A
+ Released: 2013-12-13
* Added better multiplayer networking support via ENet.
* Added --fused command line argument, to simulate fusing.
diff --git a/jni/love/license.txt b/jni/love/license.txt
index 74ca232c..c087cc71 100644
--- a/jni/love/license.txt
+++ b/jni/love/license.txt
@@ -1,4 +1,4 @@
-Copyright (c) 2006-2013 LOVE Development Team
+Copyright (c) 2006-2014 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
diff --git a/jni/love/platform/macosx/OSX.h b/jni/love/platform/macosx/OSX.h
index 95847462..6a6d8b80 100644
--- a/jni/love/platform/macosx/OSX.h
+++ b/jni/love/platform/macosx/OSX.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/platform/macosx/OSX.mm b/jni/love/platform/macosx/OSX.mm
index 9e63b262..418de494 100644
--- a/jni/love/platform/macosx/OSX.mm
+++ b/jni/love/platform/macosx/OSX.mm
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/platform/macosx/love-Info.plist b/jni/love/platform/macosx/love-Info.plist
index d32983e6..b14f6022 100644
--- a/jni/love/platform/macosx/love-Info.plist
+++ b/jni/love/platform/macosx/love-Info.plist
@@ -52,7 +52,7 @@
LSApplicationCategoryType
public.app-category.games
NSHumanReadableCopyright
- © 2006-2013 LÖVE Development Team
+ © 2006-2014 LÖVE Development Team
NSPrincipalClass
NSApplication
UTExportedTypeDeclarations
diff --git a/jni/love/platform/macosx/love-framework.xcodeproj/project.pbxproj b/jni/love/platform/macosx/love-framework.xcodeproj/project.pbxproj
index d23ef1b3..1b19325c 100644
--- a/jni/love/platform/macosx/love-framework.xcodeproj/project.pbxproj
+++ b/jni/love/platform/macosx/love-framework.xcodeproj/project.pbxproj
@@ -7,6 +7,8 @@
objects = {
/* Begin PBXBuildFile section */
+ FA01BE1E1878E35B00640047 /* wrap_Texture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA01BE1C1878E35B00640047 /* wrap_Texture.cpp */; };
+ FA01BE1F1878E35B00640047 /* wrap_Texture.h in Headers */ = {isa = PBXBuildFile; fileRef = FA01BE1D1878E35B00640047 /* wrap_Texture.h */; };
FA03546C1731F3A700284828 /* simplexnoise1234.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA03546A1731F3A700284828 /* simplexnoise1234.cpp */; };
FA03546D1731F3A700284828 /* simplexnoise1234.h in Headers */ = {isa = PBXBuildFile; fileRef = FA03546B1731F3A700284828 /* simplexnoise1234.h */; };
FA08F5B016C752F900F007B5 /* Source.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2FB732687B1669402408356D /* Source.cpp */; };
@@ -109,9 +111,8 @@
FA08F61216C753E700F007B5 /* Rasterizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1B1C4E4D288A1D2F29E57B1B /* Rasterizer.cpp */; };
FA08F61316C753E700F007B5 /* wrap_GlyphData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1B4E22F1388E2B2E76E3377B /* wrap_GlyphData.cpp */; };
FA08F61416C753E700F007B5 /* wrap_Rasterizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 11745DE315E859F71E881D76 /* wrap_Rasterizer.cpp */; };
- FA08F61516C753F600F007B5 /* Drawable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 58BA2BB460AF3C591B22690E /* Drawable.cpp */; };
FA08F61716C753F600F007B5 /* Graphics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 03F17FF546D637744E263961 /* Graphics.cpp */; };
- FA08F61816C753F600F007B5 /* Image.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 58CC50E70A375FDF53EF01B6 /* Image.cpp */; };
+ FA08F61816C753F600F007B5 /* Texture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 58CC50E70A375FDF53EF01B6 /* Texture.cpp */; };
FA08F61A16C753F600F007B5 /* Volatile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B731754147B27AF73AC5358 /* Volatile.cpp */; };
FA08F61B16C7541400F007B5 /* Canvas.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4AD52074367950B735707CE1 /* Canvas.cpp */; };
FA08F61C16C7541400F007B5 /* Font.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 583037E9238A6EF00DD20B1A /* Font.cpp */; };
@@ -269,6 +270,7 @@
FA9A100C182A0D5200106F9F /* glad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA9A1009182A0D5200106F9F /* glad.cpp */; };
FA9A100D182A0D5200106F9F /* glad.hpp in Headers */ = {isa = PBXBuildFile; fileRef = FA9A100A182A0D5200106F9F /* glad.hpp */; };
FA9A100E182A0D5200106F9F /* gladfuncs.hpp in Headers */ = {isa = PBXBuildFile; fileRef = FA9A100B182A0D5200106F9F /* gladfuncs.hpp */; };
+ FA9B492A1875EFB900201DA9 /* Texture.h in Headers */ = {isa = PBXBuildFile; fileRef = FA9B49281875EFB900201DA9 /* Texture.h */; };
FA9B4A0816E1578300074F42 /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA9B4A0716E1578300074F42 /* SDL2.framework */; };
FA9FC0B0173D6E3E005027FF /* wrap_Window.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA9FC0AE173D6E3E005027FF /* wrap_Window.cpp */; };
FA9FC0B1173D6E3E005027FF /* wrap_Window.h in Headers */ = {isa = PBXBuildFile; fileRef = FA9FC0AF173D6E3E005027FF /* wrap_Window.h */; };
@@ -287,7 +289,6 @@
FAC5710317402D1100D147E4 /* wrap_BezierCurve.h in Headers */ = {isa = PBXBuildFile; fileRef = FAC570FF17402D1100D147E4 /* wrap_BezierCurve.h */; };
FAC86E631724552C00EED715 /* wrap_Quad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAC86E611724552C00EED715 /* wrap_Quad.cpp */; };
FAC86E641724552C00EED715 /* wrap_Quad.h in Headers */ = {isa = PBXBuildFile; fileRef = FAC86E621724552C00EED715 /* wrap_Quad.h */; };
- FAC86E6A1724555D00EED715 /* DrawQable.h in Headers */ = {isa = PBXBuildFile; fileRef = FAC86E661724555D00EED715 /* DrawQable.h */; };
FAC86E6B1724555D00EED715 /* Quad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAC86E671724555D00EED715 /* Quad.cpp */; };
FAC86E6C1724555D00EED715 /* Quad.h in Headers */ = {isa = PBXBuildFile; fileRef = FAC86E681724555D00EED715 /* Quad.h */; };
FAE010DB170DDE99006F29D0 /* ddsinfo.h in Headers */ = {isa = PBXBuildFile; fileRef = FAE010D8170DDE99006F29D0 /* ddsinfo.h */; };
@@ -439,7 +440,7 @@
1CAA69E00D0808BA2108238B /* wrap_ChainShape.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = wrap_ChainShape.cpp; sourceTree = ""; };
1CD02D1975803957282F28AB /* auxiliar.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = auxiliar.c; sourceTree = ""; };
1CE84F1F19BC2AA412C638B1 /* timeout.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = timeout.h; sourceTree = ""; };
- 1DA41DFF0869489411A71AFC /* Image.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Image.h; sourceTree = ""; };
+ 1DA41DFF0869489411A71AFC /* Texture.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Texture.h; sourceTree = ""; };
1E22646A710E5EFC27FE3932 /* FrictionJoint.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FrictionJoint.cpp; sourceTree = ""; };
1E27263847302FCA1F843B47 /* b2PrismaticJoint.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2PrismaticJoint.cpp; sourceTree = ""; };
1E827AE8548C52493ED95629 /* wrap_Filesystem.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = wrap_Filesystem.cpp; sourceTree = ""; };
@@ -629,8 +630,7 @@
583037E9238A6EF00DD20B1A /* Font.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Font.cpp; sourceTree = ""; };
584E16AE09E12536206C46FE /* Mouse.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Mouse.cpp; sourceTree = ""; };
58792BC1126C2917432D706B /* b2CircleContact.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2CircleContact.cpp; sourceTree = ""; };
- 58BA2BB460AF3C591B22690E /* Drawable.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Drawable.cpp; sourceTree = ""; };
- 58CC50E70A375FDF53EF01B6 /* Image.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Image.cpp; sourceTree = ""; };
+ 58CC50E70A375FDF53EF01B6 /* Texture.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Texture.cpp; sourceTree = ""; };
58CD093F254501E37CA47CA8 /* types.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = types.h; sourceTree = ""; };
597478A255B82B56488B4717 /* wrap_FileData.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = wrap_FileData.cpp; sourceTree = ""; };
59BE634A2ACE722F14B86F89 /* b2Island.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2Island.cpp; sourceTree = ""; };
@@ -751,6 +751,8 @@
7F575BE9573C654B5ED44CC1 /* wrap_Timer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = wrap_Timer.h; sourceTree = ""; };
7F796B7A3362196075C62E61 /* wrap_Fixture.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = wrap_Fixture.cpp; sourceTree = ""; };
7F911CF2107B22F44C5B2542 /* b2Collision.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2Collision.h; sourceTree = ""; };
+ FA01BE1C1878E35B00640047 /* wrap_Texture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wrap_Texture.cpp; sourceTree = ""; };
+ FA01BE1D1878E35B00640047 /* wrap_Texture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wrap_Texture.h; sourceTree = ""; };
FA03546A1731F3A700284828 /* simplexnoise1234.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = simplexnoise1234.cpp; sourceTree = ""; };
FA03546B1731F3A700284828 /* simplexnoise1234.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = simplexnoise1234.h; sourceTree = ""; };
FA08F5AE16C7525600F007B5 /* Info-Framework.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Info-Framework.plist"; sourceTree = ""; };
@@ -827,6 +829,7 @@
FA9A1009182A0D5200106F9F /* glad.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = glad.cpp; sourceTree = ""; };
FA9A100A182A0D5200106F9F /* glad.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = glad.hpp; sourceTree = ""; };
FA9A100B182A0D5200106F9F /* gladfuncs.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = gladfuncs.hpp; sourceTree = ""; };
+ FA9B49281875EFB900201DA9 /* Texture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Texture.h; sourceTree = ""; };
FA9B4A0716E1578300074F42 /* SDL2.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL2.framework; path = /Library/Frameworks/SDL2.framework; sourceTree = ""; };
FA9FC0AE173D6E3E005027FF /* wrap_Window.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wrap_Window.cpp; sourceTree = ""; };
FA9FC0AF173D6E3E005027FF /* wrap_Window.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wrap_Window.h; sourceTree = ""; };
@@ -845,7 +848,6 @@
FAC570FF17402D1100D147E4 /* wrap_BezierCurve.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wrap_BezierCurve.h; sourceTree = ""; };
FAC86E611724552C00EED715 /* wrap_Quad.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wrap_Quad.cpp; sourceTree = ""; };
FAC86E621724552C00EED715 /* wrap_Quad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wrap_Quad.h; sourceTree = ""; };
- FAC86E661724555D00EED715 /* DrawQable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DrawQable.h; sourceTree = ""; };
FAC86E671724555D00EED715 /* Quad.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Quad.cpp; sourceTree = ""; };
FAC86E681724555D00EED715 /* Quad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Quad.h; sourceTree = ""; };
FAE010D8170DDE99006F29D0 /* ddsinfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ddsinfo.h; sourceTree = ""; };
@@ -1480,16 +1482,14 @@
isa = PBXGroup;
children = (
4941079838020ECA049B5C21 /* Color.h */,
- 58BA2BB460AF3C591B22690E /* Drawable.cpp */,
5D93601669875EE06721689E /* Drawable.h */,
- FAC86E661724555D00EED715 /* DrawQable.h */,
03F17FF546D637744E263961 /* Graphics.cpp */,
777352284E262F48543E6E7F /* Graphics.h */,
- 58CC50E70A375FDF53EF01B6 /* Image.cpp */,
- 1DA41DFF0869489411A71AFC /* Image.h */,
75093EE94918576801F50993 /* opengl */,
FAC86E671724555D00EED715 /* Quad.cpp */,
FAC86E681724555D00EED715 /* Quad.h */,
+ 58CC50E70A375FDF53EF01B6 /* Texture.cpp */,
+ 1DA41DFF0869489411A71AFC /* Texture.h */,
4B731754147B27AF73AC5358 /* Volatile.cpp */,
0CFF64090F0F4F481BB80CF0 /* Volatile.h */,
);
@@ -1685,6 +1685,7 @@
FA577A8616C71CF000860150 /* Shader.h */,
4D700D182EAA46273D1E2CC4 /* SpriteBatch.cpp */,
727D23FA1CC755B902471A45 /* SpriteBatch.h */,
+ FA9B49281875EFB900201DA9 /* Texture.h */,
426B1C4475DC54505B824B7F /* VertexBuffer.cpp */,
577B66502A5360AE60733B10 /* VertexBuffer.h */,
4E3251027026699A1D4D310D /* wrap_Canvas.cpp */,
@@ -1705,6 +1706,8 @@
FA577A8816C71CF000860150 /* wrap_Shader.h */,
02C16FDB537A702F4D42534E /* wrap_SpriteBatch.cpp */,
2BE75A693BE206B22DAE1B2E /* wrap_SpriteBatch.h */,
+ FA01BE1C1878E35B00640047 /* wrap_Texture.cpp */,
+ FA01BE1D1878E35B00640047 /* wrap_Texture.h */,
);
path = opengl;
sourceTree = "";
@@ -1987,12 +1990,12 @@
FAF6704E18184FF800DBDEEA /* wuff_config.h in Headers */,
FA0CDE3D1710F9A50056E8D7 /* FormatHandler.h in Headers */,
FA7AA59317F6AC1F00704BE2 /* wrap_Mesh.h in Headers */,
+ FA01BE1F1878E35B00640047 /* wrap_Texture.h in Headers */,
FAEC808B1710FEA60057279A /* ImageData.h in Headers */,
FAEC808F1711E76C0057279A /* CompressedData.h in Headers */,
FA636D8B171B70920065623F /* RandomGenerator.h in Headers */,
FA636D8F171B72A70065623F /* wrap_RandomGenerator.h in Headers */,
FAC86E641724552C00EED715 /* wrap_Quad.h in Headers */,
- FAC86E6A1724555D00EED715 /* DrawQable.h in Headers */,
FAC86E6C1724555D00EED715 /* Quad.h in Headers */,
FA03546D1731F3A700284828 /* simplexnoise1234.h in Headers */,
FA3D9E0E16E68DE600CA6630 /* Cursor.h in Headers */,
@@ -2004,6 +2007,7 @@
FAF6705218184FF800DBDEEA /* wuff_internal.h in Headers */,
FAB007941740C28900A9664D /* Joystick.h in Headers */,
FAB007981740C87D00A9664D /* wrap_Joystick.h in Headers */,
+ FA9B492A1875EFB900201DA9 /* Texture.h in Headers */,
FAC5710117402D1100D147E4 /* BezierCurve.h in Headers */,
FAC5710317402D1100D147E4 /* wrap_BezierCurve.h in Headers */,
FA5FDC7E1788D548002F0ED2 /* callbacks.h in Headers */,
@@ -2193,9 +2197,8 @@
FA08F61216C753E700F007B5 /* Rasterizer.cpp in Sources */,
FA08F61316C753E700F007B5 /* wrap_GlyphData.cpp in Sources */,
FA08F61416C753E700F007B5 /* wrap_Rasterizer.cpp in Sources */,
- FA08F61516C753F600F007B5 /* Drawable.cpp in Sources */,
FA08F61716C753F600F007B5 /* Graphics.cpp in Sources */,
- FA08F61816C753F600F007B5 /* Image.cpp in Sources */,
+ FA08F61816C753F600F007B5 /* Texture.cpp in Sources */,
FA08F61A16C753F600F007B5 /* Volatile.cpp in Sources */,
FA08F61B16C7541400F007B5 /* Canvas.cpp in Sources */,
FA08F61C16C7541400F007B5 /* Font.cpp in Sources */,
@@ -2298,6 +2301,7 @@
FAF272A616E3D44400CC193A /* LuaThread.cpp in Sources */,
FA0A4BF0182E0C2800E1E4D2 /* b2MotorJoint.cpp in Sources */,
FAF272A816E3D44400CC193A /* ThreadModule.cpp in Sources */,
+ FA01BE1E1878E35B00640047 /* wrap_Texture.cpp in Sources */,
FAF272AA16E3D44400CC193A /* wrap_Channel.cpp in Sources */,
FAF272AC16E3D44400CC193A /* wrap_LuaThread.cpp in Sources */,
FAF272AE16E3D44400CC193A /* wrap_ThreadModule.cpp in Sources */,
@@ -2354,7 +2358,7 @@
DEAD_CODE_STRIPPING = YES;
FRAMEWORK_SEARCH_PATHS = /Library/Frameworks;
GCC_OPTIMIZATION_LEVEL = 3;
- GCC_PREPROCESSOR_DEFINITIONS = "";
+ GCC_PREPROCESSOR_DEFINITIONS = LOVE_MACOSX_USE_FRAMEWORKS;
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
@@ -2390,7 +2394,7 @@
COPY_PHASE_STRIP = NO;
FRAMEWORK_SEARCH_PATHS = /Library/Frameworks;
GCC_OPTIMIZATION_LEVEL = 0;
- GCC_PREPROCESSOR_DEFINITIONS = "";
+ GCC_PREPROCESSOR_DEFINITIONS = LOVE_MACOSX_USE_FRAMEWORKS;
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
diff --git a/jni/love/platform/macosx/love.xcodeproj/project.pbxproj b/jni/love/platform/macosx/love.xcodeproj/project.pbxproj
index 6eeca809..9c473978 100644
--- a/jni/love/platform/macosx/love.xcodeproj/project.pbxproj
+++ b/jni/love/platform/macosx/love.xcodeproj/project.pbxproj
@@ -301,6 +301,7 @@
FRAMEWORK_SEARCH_PATHS = /Library/Frameworks;
GCC_INCREASE_PRECOMPILED_HEADER_SHARING = YES;
GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = LOVE_MACOSX_USE_FRAMEWORKS;
GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = NO;
GCC_WARN_ABOUT_MISSING_NEWLINE = NO;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
@@ -354,6 +355,7 @@
FRAMEWORK_SEARCH_PATHS = /Library/Frameworks;
GCC_INPUT_FILETYPE = automatic;
GCC_OPTIMIZATION_LEVEL = 3;
+ GCC_PREPROCESSOR_DEFINITIONS = LOVE_MACOSX_USE_FRAMEWORKS;
GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = NO;
GCC_WARN_ABOUT_MISSING_NEWLINE = NO;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
diff --git a/jni/love/platform/unix/automagic b/jni/love/platform/unix/automagic
index f2d8d600..6e5c68bb 100755
--- a/jni/love/platform/unix/automagic
+++ b/jni/love/platform/unix/automagic
@@ -14,11 +14,11 @@ if [[ ! -d platform/unix ]]; then
exit 1
fi
-AUTOHEADER=$(which autoheader)
-AUTOCONF=$(which autoconf)
-LIBTOOLIZE=$(which libtoolize)
-ACLOCAL=$(which aclocal)
-AUTOMAKE=$(which automake)
+AUTOHEADER=${AUTOHEADER:-$(which autoheader)}
+AUTOCONF=${AUTOCONF:-$(which autoconf)}
+LIBTOOLIZE=${LIBTOOLIZE:-$(which libtoolize)}
+ACLOCAL=${ACLOCAL:-$(which aclocal)}
+AUTOMAKE=${AUTOMAKE:-$(which automake)}
[[ -x ${AUTOHEADER} ]] || die "Could not find autoheader. Install autoconf."
[[ -x ${AUTOCONF} ]] || die "Could not find autoconf."
@@ -27,10 +27,12 @@ AUTOMAKE=$(which automake)
[[ -x ${AUTOMAKE} ]] || die "Could not find automake."
automagic() {
+ log "Copying files..." >&2
cp platform/unix/configure.ac .
cp platform/unix/Makefile.am .
- if ! sh platform/unix/gen-makefile; then
+ log "Running genmodules..." >&2
+ if ! bash platform/unix/genmodules "$1"; then
echo "You should be doing this from the root directory of the project."
exit 1
fi
@@ -52,12 +54,15 @@ automagic() {
}
if [[ $1 == "-d" ]]; then
- automagic 2>&1
+ shift 1
+ automagic "$@" 2>&1
else
- (automagic > /dev/null) 2>&1
+ (automagic "$@" > /dev/null) 2>&1
fi
if [[ $? -eq 1 ]]; then
- log "Failed, please contact the developers."
+ log "Failed, sadface."
+ log "You can make this script more verbose running it in debug mode (-d)"
+ log "This is generally a configuration error (I'm looking at you aclocal)"
exit 1
else
log "Success, carry on configuring."
diff --git a/jni/love/platform/unix/configure.ac b/jni/love/platform/unix/configure.ac
index 8f1259f3..4347329f 100644
--- a/jni/love/platform/unix/configure.ac
+++ b/jni/love/platform/unix/configure.ac
@@ -12,6 +12,7 @@ AC_PROG_CC
AC_PROG_CXX
AC_PROG_SED
AC_PROG_MKDIR_P
+AC_PROG_OBJCXX
AC_C_BIGENDIAN
AC_LANG([C++])
@@ -26,47 +27,72 @@ AC_DEFUN([ACLOVE_CXX_FLAG_TEST], # WARNING: NOT REENTRANT
[AC_MSG_RESULT([no]); $3])
CXXFLAGS="$aclove_cxx_flag_test_save_cflags"])
+AC_DEFUN([LOVE_MSG_ERROR],
+ [AC_MSG_ERROR([LÖVE needs "$1"[,] please install "$1" with development files and try again])])
+
# C++11 support
cxx11name="no"
ACLOVE_CXX_FLAG_TEST([-std=c++0x], cxx11name="c++0x", [])
ACLOVE_CXX_FLAG_TEST([-std=c++11], cxx11name="c++11", [])
-AS_VAR_IF([cxx11name], [no], AC_MSG_ERROR([Can't LÖVE without C++11]), CXXFLAGS="$CXXFLAGS -std=$cxx11name")
+AS_VAR_IF([cxx11name], [no], AC_MSG_ERROR([LÖVE needs a C++ compiler with C++11 support]), CXXFLAGS="$CXXFLAGS -std=$cxx11name")
-# Libraries
-AC_SEARCH_LIBS([sqrt], [m], [], AC_MSG_ERROR([Can't LÖVE without C math library]))
-AC_SEARCH_LIBS([glLoadIdentity], [GL], [], AC_MSG_ERROR([Can't LÖVE without OpenGL]))
-AC_SEARCH_LIBS([alSourcePlay], [openal], [], AC_MSG_ERROR([Can't LÖVE without OpenAL]))
-AC_SEARCH_LIBS([ilInit], [IL], [], AC_MSG_ERROR([Can't LÖVE without DevIL]))
-AC_SEARCH_LIBS([FT_Load_Glyph], [freetype], [], AC_MSG_ERROR([Can't LÖVE without FreeType]))
-AC_SEARCH_LIBS([PHYSFS_init], [physfs], [], AC_MSG_ERROR([Can't LÖVE without PhysicsFS]))
-AC_SEARCH_LIBS([ModPlug_Load], [modplug], [], AC_MSG_ERROR([Can't LÖVE without ModPlug]))
-AC_SEARCH_LIBS([ov_open], [vorbisfile], [], AC_MSG_ERROR([Can't LÖVE without VorbisFile]))
+# Allow people on OSX to use autotools, they need their platform files
+AC_ARG_ENABLE([osx],
+ AC_HELP_STRING([--enable-osx], [Compile platform-specific files for OSX]), [], [enable_osx=no])
+AS_VAR_IF([enable_osx], [no], [], #else
+ ac_cv_search_glLoadIdentity="-framework OpenGL"
+ AC_SUBST([LDFLAGS], ["${LDFLAGS} -framework CoreFoundation -framework Cocoa"])
+ AC_SUBST([CPPFLAGS], ["${CPPFLAGS} -I../platform/macosx"]))
-# Includes
-AC_CHECK_HEADER([freetype2/freetype/config/ftheader.h], [includes="$includes -I/usr/include/freetype2"])
-
-# SDL 2, treated seperately because it combines setting SDL2_LIBS and SDL2_CFLAGS into one step
-AM_PATH_SDL2([], [], AC_MSG_ERROR([Can't LÖVE without SDL 2]))
-
-# Lua, treated seperately because of --with-lua
+# --with-lua and --with-luaversion
AC_ARG_WITH([lua], [AS_HELP_STRING([--with-lua], [Select the lua implementation])],
- [], [with_lua=lua])
+ [], [with_lua=luajit])
AC_ARG_WITH([luaversion], [AS_HELP_STRING([--with-luaversion], [Select the lua version])],
[], [with_luaversion=5.1])
+# pkg-config libraries
+AM_PATH_SDL2([], [], [LOVE_MSG_ERROR([SDL 2])])
+PKG_CHECK_MODULES([lua], [${with_lua}${with_luaversion}], [lua_found=yes],
+ [PKG_CHECK_MODULES([lua], [${with_lua}], [lua_found=yes], [lua_found=no])])
+PKG_CHECK_MODULES([freetype2], [freetype2], [], [LOVE_MSG_ERROR([FreeType2])])
+PKG_CHECK_MODULES([openal], [openal], [], [LOVE_MSG_ERROR([OpenAL])])
+PKG_CHECK_MODULES([devil], [IL], [], [LOVE_MSG_ERROR([DevIL])])
+PKG_CHECK_MODULES([libmodplug], [libmodplug], [], [LOVE_MSG_ERROR([libmodplug])])
+PKG_CHECK_MODULES([vorbisfile], [vorbisfile], [], [LOVE_MSG_ERROR([libvorbis and libvorbisfile])])
+
+# Other libraries
+AC_SEARCH_LIBS([sqrt], [m], [], [LOVE_MSG_ERROR([the C math library])])
+AC_SEARCH_LIBS([PHYSFS_init], [physfs], [], [LOVE_MSG_ERROR([PhysicsFS])])
+AC_SEARCH_LIBS([glLoadIdentity], [GL], [], [LOVE_MSG_ERROR([OpenGL])])
+
+# Lua, treated seperately because of --with-lua
AS_VAR_IF([with_luaversion], [5.2], [luatest=lua_version], [luatest=lua_pcall]) # use lua_version for 5.2
-AC_SEARCH_LIBS([$luatest], ["${with_lua}${with_luaversion}" "${with_lua}"], [],
- AC_MSG_ERROR([Can't LÖVE without $with_lua]))
-AC_CHECK_HEADER(["${with_lua}${with_luaversion}/lua.h"], [includes="$includes -I/usr/include/${with_lua}${with_luaversion}"], [])
-AC_CHECK_HEADER(["${with_lua}/lua.h"], [includes="$includes -I/usr/include/${with_lua}"], [])
+AS_VAR_IF([lua_found], [yes],
+ #if
+ [
+ luaheaders_found=yes
+ AC_MSG_CHECKING([for library containing ${luatest}])
+ AC_MSG_RESULT([${lua_LIBS}])],
+ #else
+ [
+ AC_MSG_WARN([Could not find pkg-config definition for ${with_lua}${with_luaversion} or ${with_lua}, falling back to manual detection])
+ AC_SEARCH_LIBS([$luatest], ["${with_lua}${with_luaversion}" "${with_lua}"], [],
+ [LOVE_MSG_ERROR([$with_lua])])
+ luaheaders_found=no
+ AC_CHECK_HEADER(["${with_lua}${with_luaversion}/lua.h"], [luaheaders_found=yes includes="$includes -I/usr/include/${with_lua}${with_luaversion}"], [])
+ AC_CHECK_HEADER(["${with_lua}/lua.h"], [luaheaders_found=yes includes="$includes -I/usr/include/${with_lua}"], [])])
+AS_VAR_IF([luaheaders_found], [yes], [], #else
+ [
+ AC_MSG_WARN([Could not locate lua headers for ${with_lua}${with_luaversion} or ${with_lua}, you probably need to specify them with CPPFLAGS])])
# mpg123, treated seperately because it can be disabled (default on)
+# also not pkg-config because of the FILE_OFFSET_BITS.. bit
AC_ARG_ENABLE([mpg123], AC_HELP_STRING([--disable-mpg123], [Disable mp3 support, for patent-free builds]), [], [enable_mpg123=yes])
AS_VAR_IF([enable_mpg123], [no],
AC_DEFINE([LOVE_NOMPG123], [], [Build without mpg123]),
# else
AC_SEARCH_LIBS([mpg123_open_feed], [mpg123], [],
- AC_MSG_ERROR([Can't LÖVE without Mpg123]))
+ [LOVE_MSG_ERROR([libmpg123])])
AC_SEARCH_LIBS([mpg123_seek_64], [mpg123],
AC_SUBST([FILE_OFFSET],[-D_FILE_OFFSET_BITS=64]),
AC_SUBST([FILE_OFFSET],[])))
@@ -74,7 +100,7 @@ AS_VAR_IF([enable_mpg123], [no],
# GME, treated seperately because it can be enabled (default off)
AC_ARG_ENABLE([gme], AC_HELP_STRING([--enable-gme], [Enable GME support, for more chiptuney goodness]), [], [enable_gme=no])
AS_VAR_IF([enable_gme], [yes],
- AC_SEARCH_LIBS([gme_open_data], [gme], [], AC_MSG_ERROR([Can't LÖVE without gme]))
+ AC_SEARCH_LIBS([gme_open_data], [gme], [], [LOVE_MSG_ERROR([gme])])
AC_DEFINE([LOVE_SUPPORT_GME], [], [Enable gme])
AC_CHECK_HEADER([gme/gme.h], [includes="$includes -I/usr/include/gme"], []))
@@ -89,16 +115,29 @@ AC_ARG_ENABLE([exe],
AC_HELP_STRING([--disable-exe], [Disable building of executable launcher]), [], [enable_exe=yes])
AS_VAR_IF([enable_exe], [no], [], #else
- AC_DEFINE([LOVE_BUILD_EXE], [], [Don't build launcher]))
+ AC_DEFINE([LOVE_BUILD_EXE], [], [Skip building launcher]))
AM_CONDITIONAL([LOVE_BUILD_EXE], [test "x$enable_exe" != xno])
AM_CONDITIONAL([LOVE_NOMPG123], [test "x$enable_mpg123" == xno])
+AM_CONDITIONAL([LOVE_TARGET_OSX], [test "x$enable_osx" != xno])
+
+# Automatic script file rebuilding
+AC_CHECK_PROGS([LUA_EXECUTABLE], ["${with_lua}${with_luaversion}" "${with_lua}" "lua"], [:])
+AS_VAR_IF([LUA_EXECUTABLE], [:],
+ [AC_MSG_WARN([Did not find a lua executable, you may need to update the scripts manually if you change them])], [])
# Set our includes as automake variable
AC_SUBST([LOVE_INCLUDES], ["$includes"])
+m4_include([configure-modules.ac])
+
AC_CONFIG_FILES([
Makefile
src/Makefile
+ platform/unix/debian/control
+ platform/unix/debian/changelog
+ platform/unix/debian/rules
])
AC_OUTPUT
+
+chmod 755 platform/unix/debian/rules
diff --git a/jni/love/platform/unix/debian/changelog.in b/jni/love/platform/unix/debian/changelog.in
new file mode 100644
index 00000000..4901a576
--- /dev/null
+++ b/jni/love/platform/unix/debian/changelog.in
@@ -0,0 +1,5 @@
+love@LOVE_SUFFIX@ (0.9.0~ppatest5) precise; urgency=medium
+
+ * Upstream testing release
+
+ -- Bart van Strien Sat, 2 Nov 2013 16:23:40 +0100
diff --git a/jni/love/platform/unix/debian/control.in b/jni/love/platform/unix/debian/control.in
new file mode 100644
index 00000000..d79d3a37
--- /dev/null
+++ b/jni/love/platform/unix/debian/control.in
@@ -0,0 +1,59 @@
+Source: love@LOVE_SUFFIX@
+Section: games
+Priority: extra
+Maintainer: Bart van Strien
+Build-Depends: debhelper (>= 9),
+ autotools-dev,
+ pkg-config,
+ libdevil-dev,
+ libfreetype6-dev,
+ libluajit-5.1-dev,
+ libphysfs-dev,
+ libsdl2-dev (>= 2.0.0),
+ libopenal-dev,
+ libogg-dev,
+ libvorbis-dev,
+ libflac-dev,
+ libflac++-dev,
+ libmodplug-dev,
+ libmpg123-dev,
+ libmng-dev
+Standards-Version: 3.9.3
+Homepage: http://love2d.org
+
+Package: liblove@LOVE_SUFFIX@
+Architecture: any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: ${misc:Depends},
+ ${shlibs:Depends},
+ libdevil1c2,
+ libmng1,
+ libfreetype6,
+ libgl1-mesa-glx,
+ libluajit-5.1-2,
+ libphysfs-1.0-0,
+ libsdl2 (>= 2.0.0),
+ libopenal1,
+ libogg0,
+ libvorbis0a,
+ libvorbisfile3,
+ libmodplug1,
+ libmpg123-0
+Description: LOVE is a free 2D game engine which enables easy game creation in Lua.
+
+Package: love@LOVE_SUFFIX@
+Architecture: any
+Multi-Arch: same
+Depends: ${misc:Depends},
+ liblove@LOVE_SUFFIX@ (= ${binary:Version})
+Description: LOVE is a free 2D game engine which enables easy game creation in Lua.
+
+Package: love@LOVE_SUFFIX@-dbg
+Priority: extra
+Section: debug
+Architecture: any
+Multi-Arch: same
+Depends: ${misc:Depends},
+ love@LOVE_SUFFIX@ (= ${binary:Version}),
+Description: LOVE is a free 2D game engine which enables easy game creation in Lua.
diff --git a/jni/love/platform/unix/debian/copyright b/jni/love/platform/unix/debian/copyright
index 1f06aed4..96a64fe6 100644
--- a/jni/love/platform/unix/debian/copyright
+++ b/jni/love/platform/unix/debian/copyright
@@ -1,4 +1,4 @@
-Copyright (c) 2006-2010 LOVE Development Team
+Copyright (c) 2006-2013 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
@@ -17,4 +17,4 @@ appreciated but is not required.
misrepresented as being the original software.
3. This notice may not be removed or altered from any source
-distribution.
\ No newline at end of file
+distribution.
diff --git a/jni/love/platform/unix/debian/liblove-unstable.install b/jni/love/platform/unix/debian/liblove-unstable.install
new file mode 100644
index 00000000..10a01ed0
--- /dev/null
+++ b/jni/love/platform/unix/debian/liblove-unstable.install
@@ -0,0 +1 @@
+usr/lib/*/liblove-unstable.so.*
diff --git a/jni/love/platform/unix/debian/love-unstable.install b/jni/love/platform/unix/debian/love-unstable.install
new file mode 100644
index 00000000..77ebbd10
--- /dev/null
+++ b/jni/love/platform/unix/debian/love-unstable.install
@@ -0,0 +1 @@
+usr/bin/love-unstable
diff --git a/jni/love/platform/unix/debian/rules.in b/jni/love/platform/unix/debian/rules.in
new file mode 100755
index 00000000..9ed42c92
--- /dev/null
+++ b/jni/love/platform/unix/debian/rules.in
@@ -0,0 +1,16 @@
+#!/usr/bin/make -f
+
+DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
+DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
+
+override_dh_auto_configure:
+ dh_auto_configure -- --with-lua=luajit
+
+override_dh_link:
+ dh_link -plove@LOVE_SUFFIX@-dev usr/lib/$(DEB_HOST_MULTIARCH)/liblove@LOVE_SUFFIX@.so.0.0.0 usr/lib/$(DEB_HOST_MULTIARCH)/liblove@LOVE_SUFFIX@.so
+
+override_dh_strip:
+ dh_strip --dbg-package=love@LOVE_SUFFIX@-dbg
+
+%:
+ dh $@ --parallel
diff --git a/jni/love/platform/unix/gen-makefile b/jni/love/platform/unix/gen-makefile
index e1791e8f..757653e2 100644
--- a/jni/love/platform/unix/gen-makefile
+++ b/jni/love/platform/unix/gen-makefile
@@ -1,11 +1,10 @@
#!/bin/bash
echo Generating src/Makefile.am ...
-cd src
inc_current='$(srcdir)'
inc_modules="$inc_current/modules"
inc_libraries="$inc_current/libraries"
-cat > Makefile.am << EOF
+cat > src/Makefile.am << EOF
AM_CPPFLAGS = -I$inc_current -I$inc_modules -I$inc_libraries -I$inc_libraries/enet/libenet/include \$(LOVE_INCLUDES) \$(FILE_OFFSET)
AM_CXXFLAGS = \$(SDL_CFLAGS)
AUTOMAKE_OPTIONS = subdir-objects
@@ -29,20 +28,11 @@ endif
# libLÖVE
lib_LTLIBRARIES = liblove.la
liblove_la_LDFLAGS = -module -export-dynamic \$(LDFLAGS) \$(SDL_LIBS)
-liblove_la_SOURCES = \\
EOF
-find . \( \( -iname "*.c" -o -iname "*.cpp" -o -iname "*.h" -o -iname "*.lch" \) \) -exec echo '{}' \\ \; \
- | grep -v -f"../platform/unix/exclude" | head -c -3 >> Makefile.am
+platform/unix/genmodules >> src/Makefile.am
-printf "\n\n" >> Makefile.am
-cat >> Makefile.am << EOF
-if !LOVE_NOMPG123
-liblove_la_SOURCES += \\
-./modules/sound/lullaby/Mpg123Decoder.cpp \\
-./modules/sound/lullaby/Mpg123Decoder.h
-endif
-EOF
+printf "\n" >> src/Makefile.am
cd ..
echo "src/Makefile.am is updated! ^.^"
diff --git a/jni/love/platform/unix/genmodules b/jni/love/platform/unix/genmodules
new file mode 100644
index 00000000..5be29fae
--- /dev/null
+++ b/jni/love/platform/unix/genmodules
@@ -0,0 +1,168 @@
+#!/bin/bash
+
+love_suffix="$1"
+love_amsuffix="$(echo "$love_suffix" | sed 's/\-/_/g' | sed 's/\./_/g')"
+
+flags=""
+upper()
+{
+ echo "$@" | tr '[:lower:]' '[:upper:]'
+}
+
+implfind()
+{
+ find "$1" -maxdepth 1 -type d -exec basename '{}' \; | grep -v "^\." | tail -n +2
+}
+
+sourcefind()
+{
+ find "$1" $2 -type f \( -iname "*.c" -o -iname "*.cpp" -o -iname "*.h" -o -iname "*.lch" \) | awk "{print \"./$prefix\"\$0\" \\\\\"}" | grep -v -f"$LOVEROOT/platform/unix/exclude"
+}
+
+handlemodule()
+{
+ module="$1"
+ DEFINENAME="LOVE_MODULE_$(upper "$module")"
+ printf "$DEFINENAME"
+}
+
+handleimpl()
+{
+ module="$1"
+ implementation="$2"
+ name="$3"
+
+ printf "if $name\n"
+ FILES="$(sourcefind "$module/$implementation" | sed "s/^/ /")"
+ if [[ "x$FILES" != "x" ]]; then
+ printf "liblove${love_amsuffix}_la_SOURCES += \\\\\n"
+ printf "${FILES:0:${#FILES}-2}\n"
+ fi
+ printf "endif\n\n"
+}
+
+genmodules()
+{
+ LOVEROOT="$(pwd)"
+ cd src
+
+ printf "liblove${love_amsuffix}_la_SOURCES = \\\\\n"
+ sourcefind "common" | sed "s/^/ /"
+ FILES="$(sourcefind "scripts" | sed "s/^/ /")"
+ printf "${FILES:0:${#FILES}-2}\n\n"
+
+ cd modules
+ prefix="modules/"
+ for module in *; do
+ NAME=$(handlemodule "$module")
+ flags="$flags module-$module"
+
+ printf "if $NAME\n"
+
+ for implementation in $(implfind "$module"); do
+ flags="$flags implementation-$module-$implementation"
+ handleimpl "$module" "$implementation" "LOVE_IMPLEMENTATION_$(upper "$module")_$(upper "$implementation")"
+ done
+
+ FILES="$(sourcefind "$module" "-maxdepth 1" | sed "s/^/ /")"
+ if [[ "x$FILES" != "x" ]]; then
+ printf "liblove${love_amsuffix}_la_SOURCES += \\\\\n"
+ printf "${FILES:0:${#FILES}-2}\n"
+ fi
+
+ printf "endif\n\n"
+ done
+
+ cd ../libraries
+ prefix="libraries/"
+ for library in *; do
+ NAME="LOVE_LIBRARY_$(upper "$library")"
+ flags="$flags library-$library"
+
+ printf "if $NAME\n"
+ printf "liblove${love_amsuffix}_la_SOURCES += \\\\\n"
+ FILES="$(sourcefind "$library" | sed "s/^/ /")"
+ printf "${FILES:0:${#FILES}-2}\nendif\n\n"
+ done
+ cd ../..
+}
+
+genflags()
+{
+ for flag in $flags; do
+ prettyflag="$(echo "$flag" | sed 's/-/ love./' | sed 's/-/./g')"
+ varflag="enable_$(echo "$flag" | sed 's/^[^-]*-//' | sed 's/[^a-zA-Z0-9]/_/')"
+ defineflag="LOVE_ENABLE_$(upper $(echo $flag | sed 's/^[^-]*-//' | sed 's/-/_/g'))"
+ amflag="$(upper $(echo love-$flag | sed 's/-/_/g'))"
+ printf "AC_ARG_ENABLE([$flag], [ --disable-$flag Turn off $prettyflag], [], [$varflag=true])\n"
+ printf "AH_TEMPLATE([$defineflag], [])\n"
+ printf "if test x\"\$$varflag\" == xtrue; then\n"
+ printf " AC_DEFINE([$defineflag], [])\n"
+ printf "fi\n"
+ printf "AM_CONDITIONAL([$amflag], [test x\$$varflag == xtrue])\n\n"
+ done
+}
+
+echo Generating src/Makefile.am ...
+inc_current='$(srcdir)'
+inc_modules="$inc_current/modules"
+inc_libraries="$inc_current/libraries"
+
+cat > src/Makefile.am << EOF
+AM_CPPFLAGS = -I$inc_current -I$inc_modules -I$inc_libraries -I$inc_libraries/enet/libenet/include \$(LOVE_INCLUDES) \$(FILE_OFFSET)\
+ \$(SDL_CFLAGS) \$(lua_CFLAGS) \$(freetype2_CFLAGS)\
+ \$(openal_CFLAGS) \$(devil_CFLAGS) \$(libmodplug_CFLAGS)\
+ \$(vorbisfile_CFLAGS)
+AUTOMAKE_OPTIONS = subdir-objects
+SUBDIRS =
+SUFFIXES = .lua .lua.h
+
+if LOVE_BUILD_EXE
+# LÖVE executable
+bin_PROGRAMS = love${love_suffix}
+#love_LDFLAGS =
+love${love_amsuffix}_LDADD = liblove${love_suffix}.la \$(lua_LIBS)
+love${love_amsuffix}_SOURCES = love.cpp
+
+if LOVE_TARGET_OSX
+love${love_amsuffix}_LIBTOOLFLAGS = --tag=OBJCXX
+love${love_amsuffix}_SOURCES += \\
+ ../platform/macosx/OSX.h \\
+ ../platform/macosx/OSX.mm
+else
+love${love_amsuffix}_LIBTOOLFLAGS = --tag=CXX
+endif
+endif
+
+# Compile scripts
+.lua.lua.h:
+ cd scripts; \
+ \$(LUA_EXECUTABLE) auto.lua \$<
+
+# libLÖVE
+lib_LTLIBRARIES = liblove${love_suffix}.la
+liblove${love_amsuffix}_la_LDFLAGS = -module -export-dynamic \$(LDFLAGS)
+liblove${love_amsuffix}_la_LIBADD = \
+ \$(SDL_LIBS) \$(freetype2_LIBS) \$(lua_LIBS)\
+ \$(openal_LIBS) \$(devil_LIBS) \$(libmodplug_LIBS)\
+ \$(vorbisfile_LIBS)
+EOF
+
+genmodules >> src/Makefile.am
+
+cat >> src/Makefile.am << EOF
+if !LOVE_NOMPG123
+liblove${love_amsuffix}_la_SOURCES += \\
+ ./modules/sound/lullaby/Mpg123Decoder.cpp \\
+ ./modules/sound/lullaby/Mpg123Decoder.h
+endif
+EOF
+
+echo "src/Makefile.am is updated! ^.^"
+
+echo "Generating configure-modules.ac"
+genflags > configure-modules.ac
+cat >> configure-modules.ac << EOF
+AC_SUBST([LOVE_SUFFIX], [${love_suffix}])
+EOF
+echo "configure-modules.ac is updated! ^.^"
diff --git a/jni/love/readme.md b/jni/love/readme.md
index 918f97ab..3405073d 100644
--- a/jni/love/readme.md
+++ b/jni/love/readme.md
@@ -10,7 +10,7 @@ Compilation
-----------
###Windows
-Use the project files for Visual Studio 2010 located in the platform dir.
+Follow the instructions at the [megasource][megasource] repository page.
###*nix
Run `platform/unix/automagic` from the repository root, then run ./configure and make.
@@ -19,10 +19,10 @@ Run `platform/unix/automagic` from the repository root, then run ./configure and
$ ./configure
$ make
-###OSX
-Use the XCode project in platform/macosx.
+###Mac OS X
+Download the required frameworks from [here][dependencies] and place them in `/Library/Frameworks/`.
-For both Windows and OSX there are dependencies available [here][dependencies].
+Then use the Xcode project found at `platform/macosx/love.xcodeproj`.
Repository information
----------------------
@@ -64,6 +64,7 @@ Dependencies
[forums]: http://love2d.org/forums
[irc]: irc://irc.oftc.net/love
[dependencies]: http://love2d.org/sdk
+[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
diff --git a/jni/love/src/common/Data.h b/jni/love/src/common/Data.h
index 89068d8b..ea31e69e 100644
--- a/jni/love/src/common/Data.h
+++ b/jni/love/src/common/Data.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/common/EnumMap.h b/jni/love/src/common/EnumMap.h
index 1b105f56..3586c35e 100644
--- a/jni/love/src/common/EnumMap.h
+++ b/jni/love/src/common/EnumMap.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/common/Exception.cpp b/jni/love/src/common/Exception.cpp
index 3a2b6d25..9f8a58b3 100644
--- a/jni/love/src/common/Exception.cpp
+++ b/jni/love/src/common/Exception.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/common/Exception.h b/jni/love/src/common/Exception.h
index 90dd3b49..49d9961d 100644
--- a/jni/love/src/common/Exception.h
+++ b/jni/love/src/common/Exception.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/common/Matrix.cpp b/jni/love/src/common/Matrix.cpp
index b1e9d8dc..d403e8b0 100644
--- a/jni/love/src/common/Matrix.cpp
+++ b/jni/love/src/common/Matrix.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/common/Matrix.h b/jni/love/src/common/Matrix.h
index cb589593..0e33b37d 100644
--- a/jni/love/src/common/Matrix.h
+++ b/jni/love/src/common/Matrix.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/common/Memoizer.cpp b/jni/love/src/common/Memoizer.cpp
index 3fc0aa5f..dcc8e5df 100644
--- a/jni/love/src/common/Memoizer.cpp
+++ b/jni/love/src/common/Memoizer.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/common/Memoizer.h b/jni/love/src/common/Memoizer.h
index 6248e5d3..a110b7af 100644
--- a/jni/love/src/common/Memoizer.h
+++ b/jni/love/src/common/Memoizer.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/common/Module.cpp b/jni/love/src/common/Module.cpp
index 4a75fe78..9f58f065 100644
--- a/jni/love/src/common/Module.cpp
+++ b/jni/love/src/common/Module.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/common/Module.h b/jni/love/src/common/Module.h
index e317b4f9..7ae1e608 100644
--- a/jni/love/src/common/Module.h
+++ b/jni/love/src/common/Module.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/common/Object.cpp b/jni/love/src/common/Object.cpp
index 9a042139..577f7dfa 100644
--- a/jni/love/src/common/Object.cpp
+++ b/jni/love/src/common/Object.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/common/Object.h b/jni/love/src/common/Object.h
index 99e64919..348da1b6 100644
--- a/jni/love/src/common/Object.h
+++ b/jni/love/src/common/Object.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/common/Reference.cpp b/jni/love/src/common/Reference.cpp
index 3fb44d6f..38e28e09 100644
--- a/jni/love/src/common/Reference.cpp
+++ b/jni/love/src/common/Reference.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/common/Reference.h b/jni/love/src/common/Reference.h
index 59cc9a72..5d7341b2 100644
--- a/jni/love/src/common/Reference.h
+++ b/jni/love/src/common/Reference.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/common/StringMap.h b/jni/love/src/common/StringMap.h
index 7fa1f9b5..116a4565 100644
--- a/jni/love/src/common/StringMap.h
+++ b/jni/love/src/common/StringMap.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/common/Variant.cpp b/jni/love/src/common/Variant.cpp
index b1aa939d..f37e5c7b 100644
--- a/jni/love/src/common/Variant.cpp
+++ b/jni/love/src/common/Variant.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/common/Variant.h b/jni/love/src/common/Variant.h
index e75c676d..4592a2fa 100644
--- a/jni/love/src/common/Variant.h
+++ b/jni/love/src/common/Variant.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/common/Vector.cpp b/jni/love/src/common/Vector.cpp
index 41c7f56c..8e0ae515 100644
--- a/jni/love/src/common/Vector.cpp
+++ b/jni/love/src/common/Vector.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/common/Vector.h b/jni/love/src/common/Vector.h
index 528fdaaa..8342af98 100644
--- a/jni/love/src/common/Vector.h
+++ b/jni/love/src/common/Vector.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/common/b64.cpp b/jni/love/src/common/b64.cpp
index 96f80596..c4009187 100644
--- a/jni/love/src/common/b64.cpp
+++ b/jni/love/src/common/b64.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
@@ -25,7 +25,7 @@ namespace love
static const char cd64[]="|$$$}rstuvwxyz{$$$$$$$>?@ABCDEFGHIJKLMNOPQRSTUVW$$$$$$XYZ[\\]^_`abcdefghijklmnopq";
-void b64_decode_block(char in[4], char out[3])
+static void b64_decode_block(char in[4], char out[3])
{
out[0] = (char)(in[0] << 2 | in[1] >> 4);
out[1] = (char)(in[1] << 4 | in[2] >> 2);
diff --git a/jni/love/src/common/b64.h b/jni/love/src/common/b64.h
index e0c82d63..99685cda 100644
--- a/jni/love/src/common/b64.h
+++ b/jni/love/src/common/b64.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/common/config.h b/jni/love/src/common/config.h
index 15e46b9e..063b9611 100644
--- a/jni/love/src/common/config.h
+++ b/jni/love/src/common/config.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
@@ -86,6 +86,47 @@
# undef LOVE_BIG_ENDIAN
# define LOVE_LITTLE_ENDIAN 1
# endif
+#else
+# define LOVE_ENABLE_AUDIO
+# define LOVE_ENABLE_AUDIO_NULL
+# define LOVE_ENABLE_AUDIO_OPENAL
+# define LOVE_ENABLE_BOX2D
+# define LOVE_ENABLE_DDSPARSE
+# define LOVE_ENABLE_ENET
+# define LOVE_ENABLE_EVENT
+# define LOVE_ENABLE_EVENT_SDL
+# define LOVE_ENABLE_FILESYSTEM
+# define LOVE_ENABLE_FILESYSTEM_PHYSFS
+# define LOVE_ENABLE_FONT
+# define LOVE_ENABLE_FONT_FREETYPE
+# define LOVE_ENABLE_GRAPHICS
+# define LOVE_ENABLE_GRAPHICS_OPENGL
+# define LOVE_ENABLE_IMAGE
+# define LOVE_ENABLE_IMAGE_MAGPIE
+# define LOVE_ENABLE_JOYSTICK
+# define LOVE_ENABLE_JOYSTICK_SDL
+# define LOVE_ENABLE_KEYBOARD
+# define LOVE_ENABLE_KEYBOARD_SDL
+# define LOVE_ENABLE_LOVE
+# define LOVE_ENABLE_LUASOCKET
+# define LOVE_ENABLE_MATH
+# define LOVE_ENABLE_MOUSE
+# define LOVE_ENABLE_MOUSE_SDL
+# define LOVE_ENABLE_NOISE1234
+# define LOVE_ENABLE_PHYSICS
+# define LOVE_ENABLE_PHYSICS_BOX2D
+# define LOVE_ENABLE_SOUND
+# define LOVE_ENABLE_SOUND_LULLABY
+# define LOVE_ENABLE_SYSTEM
+# define LOVE_ENABLE_SYSTEM_SDL
+# define LOVE_ENABLE_THREAD
+# define LOVE_ENABLE_THREAD_SDL
+# define LOVE_ENABLE_TIMER
+# define LOVE_ENABLE_TIMER_SDL
+# define LOVE_ENABLE_UTF8
+# define LOVE_ENABLE_WINDOW
+# define LOVE_ENABLE_WINDOW_SDL
+# define LOVE_ENABLE_WUFF
#endif
#endif // LOVE_CONFIG_H
diff --git a/jni/love/src/common/delay.cpp b/jni/love/src/common/delay.cpp
index 6d8359b5..932231e6 100644
--- a/jni/love/src/common/delay.cpp
+++ b/jni/love/src/common/delay.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/common/delay.h b/jni/love/src/common/delay.h
index db0636f7..aa574ca3 100644
--- a/jni/love/src/common/delay.h
+++ b/jni/love/src/common/delay.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/common/int.h b/jni/love/src/common/int.h
index 3769370b..ac57f89e 100644
--- a/jni/love/src/common/int.h
+++ b/jni/love/src/common/int.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/common/math.h b/jni/love/src/common/math.h
index d77176a1..7fe57a21 100644
--- a/jni/love/src/common/math.h
+++ b/jni/love/src/common/math.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/common/runtime.cpp b/jni/love/src/common/runtime.cpp
index 75558edd..55c216ad 100644
--- a/jni/love/src/common/runtime.cpp
+++ b/jni/love/src/common/runtime.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
@@ -671,6 +671,7 @@ StringMap::Entry typeEntries[] =
// Graphics
{"Drawable", GRAPHICS_DRAWABLE_ID},
+ {"Texture", GRAPHICS_TEXTURE_ID},
{"Image", GRAPHICS_IMAGE_ID},
{"Quad", GRAPHICS_QUAD_ID},
{"Font", GRAPHICS_FONT_ID},
diff --git a/jni/love/src/common/runtime.h b/jni/love/src/common/runtime.h
index 3c283d51..8f99f259 100644
--- a/jni/love/src/common/runtime.h
+++ b/jni/love/src/common/runtime.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/common/types.h b/jni/love/src/common/types.h
index a161a80b..e9319ea5 100644
--- a/jni/love/src/common/types.h
+++ b/jni/love/src/common/types.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
@@ -45,7 +45,7 @@ enum Type
// Graphics
GRAPHICS_DRAWABLE_ID,
- GRAPHICS_DRAWQABLE_ID,
+ GRAPHICS_TEXTURE_ID,
GRAPHICS_IMAGE_ID,
GRAPHICS_QUAD_ID,
GRAPHICS_FONT_ID,
@@ -130,13 +130,13 @@ const bits FONT_RASTERIZER_T = (bits(1) << FONT_RASTERIZER_ID) | OBJECT_T;
// Graphics.
const bits GRAPHICS_DRAWABLE_T = (bits(1) << GRAPHICS_DRAWABLE_ID) | OBJECT_T;
-const bits GRAPHICS_DRAWQABLE_T = (bits(1) << GRAPHICS_DRAWQABLE_ID) | GRAPHICS_DRAWABLE_T;
-const bits GRAPHICS_IMAGE_T = (bits(1) << GRAPHICS_IMAGE_ID) | GRAPHICS_DRAWQABLE_T;
+const bits GRAPHICS_TEXTURE_T = (bits(1) << GRAPHICS_TEXTURE_ID) | GRAPHICS_DRAWABLE_T;
+const bits GRAPHICS_IMAGE_T = (bits(1) << GRAPHICS_IMAGE_ID) | GRAPHICS_TEXTURE_T;
const bits GRAPHICS_QUAD_T = (bits(1) << GRAPHICS_QUAD_ID) | OBJECT_T;
const bits GRAPHICS_FONT_T = (bits(1) << GRAPHICS_FONT_ID) | OBJECT_T;
const bits GRAPHICS_PARTICLE_SYSTEM_T = (bits(1) << GRAPHICS_PARTICLE_SYSTEM_ID) | GRAPHICS_DRAWABLE_T;
const bits GRAPHICS_SPRITE_BATCH_T = (bits(1) << GRAPHICS_SPRITE_BATCH_ID) | GRAPHICS_DRAWABLE_T;
-const bits GRAPHICS_CANVAS_T = (bits(1) << GRAPHICS_CANVAS_ID) | GRAPHICS_DRAWQABLE_T;
+const bits GRAPHICS_CANVAS_T = (bits(1) << GRAPHICS_CANVAS_ID) | GRAPHICS_TEXTURE_T;
const bits GRAPHICS_SHADER_T = (bits(1) << GRAPHICS_SHADER_ID) | OBJECT_T;
const bits GRAPHICS_MESH_T = (bits(1) << GRAPHICS_MESH_ID) | GRAPHICS_DRAWABLE_T;
diff --git a/jni/love/src/common/utf8.cpp b/jni/love/src/common/utf8.cpp
index 7f294349..fb12997a 100644
--- a/jni/love/src/common/utf8.cpp
+++ b/jni/love/src/common/utf8.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/common/utf8.h b/jni/love/src/common/utf8.h
index f16306a8..6f0d78ef 100644
--- a/jni/love/src/common/utf8.h
+++ b/jni/love/src/common/utf8.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/common/version.h b/jni/love/src/common/version.h
index f9203236..d8798f9d 100644
--- a/jni/love/src/common/version.h
+++ b/jni/love/src/common/version.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/common/wrap_Data.cpp b/jni/love/src/common/wrap_Data.cpp
index 06e0b689..c093a78f 100644
--- a/jni/love/src/common/wrap_Data.cpp
+++ b/jni/love/src/common/wrap_Data.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/common/wrap_Data.h b/jni/love/src/common/wrap_Data.h
index 84faf41b..94cc31cd 100644
--- a/jni/love/src/common/wrap_Data.h
+++ b/jni/love/src/common/wrap_Data.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/libraries/enet/lua-enet.h b/jni/love/src/libraries/enet/lua-enet.h
index 37bb5dcf..e42fcf0f 100644
--- a/jni/love/src/libraries/enet/lua-enet.h
+++ b/jni/love/src/libraries/enet/lua-enet.h
@@ -1,5 +1,5 @@
/**
-* Copyright (c) 2006-2012 LOVE Development Team
+* Copyright (c) 2006-2014 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
diff --git a/jni/love/src/libraries/luasocket/luasocket.cpp b/jni/love/src/libraries/luasocket/luasocket.cpp
index 7e467ad6..b7a5cb21 100644
--- a/jni/love/src/libraries/luasocket/luasocket.cpp
+++ b/jni/love/src/libraries/luasocket/luasocket.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/libraries/luasocket/luasocket.h b/jni/love/src/libraries/luasocket/luasocket.h
index 8f13cee3..804061e6 100644
--- a/jni/love/src/libraries/luasocket/luasocket.h
+++ b/jni/love/src/libraries/luasocket/luasocket.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/love.cpp b/jni/love/src/love.cpp
index 27c03a73..3dce2787 100644
--- a/jni/love/src/love.cpp
+++ b/jni/love/src/love.cpp
@@ -151,9 +151,9 @@ static const struct luaL_Reg sdl_lib[] = {
int main(int argc, char **argv)
{
+#ifdef __ANDROID__
SDL_SetHint("LOVE_GRAPHICS_USE_OPENGLES", "1");
-
- SDL_LogSetAllPriority(SDL_LOG_PRIORITY_VERBOSE);
+#endif
#ifdef LOVE_LEGENDARY_UTF8_ARGV_HACK
int hack_argc = 0; char **hack_argv = 0;
diff --git a/jni/love/src/modules/audio/Audio.cpp b/jni/love/src/modules/audio/Audio.cpp
index 7667d1aa..e9240add 100644
--- a/jni/love/src/modules/audio/Audio.cpp
+++ b/jni/love/src/modules/audio/Audio.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/audio/Audio.h b/jni/love/src/modules/audio/Audio.h
index 74d71885..b7c19257 100644
--- a/jni/love/src/modules/audio/Audio.h
+++ b/jni/love/src/modules/audio/Audio.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/audio/Source.cpp b/jni/love/src/modules/audio/Source.cpp
index fe95700d..10a89fe6 100644
--- a/jni/love/src/modules/audio/Source.cpp
+++ b/jni/love/src/modules/audio/Source.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/audio/Source.h b/jni/love/src/modules/audio/Source.h
index 4e0983e4..b7a17d02 100644
--- a/jni/love/src/modules/audio/Source.h
+++ b/jni/love/src/modules/audio/Source.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
@@ -51,7 +51,7 @@ public:
Source(Type type);
virtual ~Source();
- virtual Source *copy() = 0;
+ virtual Source *clone() = 0;
virtual void play() = 0;
virtual void stop() = 0;
diff --git a/jni/love/src/modules/audio/null/Audio.cpp b/jni/love/src/modules/audio/null/Audio.cpp
index 328a8c57..2e5031ae 100644
--- a/jni/love/src/modules/audio/null/Audio.cpp
+++ b/jni/love/src/modules/audio/null/Audio.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/audio/null/Audio.h b/jni/love/src/modules/audio/null/Audio.h
index dcd56709..3f571da6 100644
--- a/jni/love/src/modules/audio/null/Audio.h
+++ b/jni/love/src/modules/audio/null/Audio.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/audio/null/Source.cpp b/jni/love/src/modules/audio/null/Source.cpp
index 1d543a94..d343587f 100644
--- a/jni/love/src/modules/audio/null/Source.cpp
+++ b/jni/love/src/modules/audio/null/Source.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
@@ -36,7 +36,7 @@ Source::~Source()
{
}
-love::audio::Source *Source::copy()
+love::audio::Source *Source::clone()
{
this->retain();
return this;
diff --git a/jni/love/src/modules/audio/null/Source.h b/jni/love/src/modules/audio/null/Source.h
index 969c019a..887b3ef5 100644
--- a/jni/love/src/modules/audio/null/Source.h
+++ b/jni/love/src/modules/audio/null/Source.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
@@ -38,7 +38,7 @@ public:
Source();
virtual ~Source();
- virtual love::audio::Source *copy();
+ virtual love::audio::Source *clone();
virtual void play();
virtual void stop();
virtual void pause();
diff --git a/jni/love/src/modules/audio/openal/Audio.cpp b/jni/love/src/modules/audio/openal/Audio.cpp
index 0fac2f57..07ce2959 100644
--- a/jni/love/src/modules/audio/openal/Audio.cpp
+++ b/jni/love/src/modules/audio/openal/Audio.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/audio/openal/Audio.h b/jni/love/src/modules/audio/openal/Audio.h
index 1bb0389f..a40494b2 100644
--- a/jni/love/src/modules/audio/openal/Audio.h
+++ b/jni/love/src/modules/audio/openal/Audio.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
@@ -37,7 +37,7 @@
#include "thread/threads.h"
// OpenAL
-#ifdef LOVE_MACOSX
+#ifdef LOVE_MACOSX_USE_FRAMEWORKS // Frameworks have different include paths.
#include
#include
#else
diff --git a/jni/love/src/modules/audio/openal/Pool.cpp b/jni/love/src/modules/audio/openal/Pool.cpp
index 03434fac..f3d74a91 100644
--- a/jni/love/src/modules/audio/openal/Pool.cpp
+++ b/jni/love/src/modules/audio/openal/Pool.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/audio/openal/Pool.h b/jni/love/src/modules/audio/openal/Pool.h
index 74244e54..46353e75 100644
--- a/jni/love/src/modules/audio/openal/Pool.h
+++ b/jni/love/src/modules/audio/openal/Pool.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
@@ -33,7 +33,7 @@
#include "thread/threads.h"
// OpenAL
-#ifdef LOVE_MACOSX
+#ifdef LOVE_MACOSX_USE_FRAMEWORKS
#include
#include
#else
diff --git a/jni/love/src/modules/audio/openal/Source.cpp b/jni/love/src/modules/audio/openal/Source.cpp
index 465d2516..332eb336 100644
--- a/jni/love/src/modules/audio/openal/Source.cpp
+++ b/jni/love/src/modules/audio/openal/Source.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
@@ -33,10 +33,22 @@ namespace audio
namespace openal
{
+StaticDataBuffer::StaticDataBuffer(ALenum format, const ALvoid *data, ALsizei size, ALsizei freq)
+{
+ alGenBuffers(1, &buffer);
+ alBufferData(buffer, format, data, size, freq);
+}
+
+StaticDataBuffer::~StaticDataBuffer()
+{
+ alDeleteBuffers(1, &buffer);
+}
+
Source::Source(Pool *pool, love::sound::SoundData *soundData)
: love::audio::Source(Source::TYPE_STATIC)
, pool(pool)
, valid(false)
+ , staticBuffer(nullptr)
, pitch(1.0f)
, volume(1.0f)
, relative(false)
@@ -51,14 +63,13 @@ Source::Source(Pool *pool, love::sound::SoundData *soundData)
, offsetSamples(0)
, offsetSeconds(0)
, channels(soundData->getChannels())
- , decoder(0)
+ , decoder(nullptr)
, toLoop(0)
{
- alGenBuffers(1, buffers);
ALenum fmt = getFormat(soundData->getChannels(), soundData->getBitDepth());
- alBufferData(buffers[0], fmt, soundData->getData(), soundData->getSize(), soundData->getSampleRate());
+ staticBuffer = new StaticDataBuffer(fmt, soundData->getData(), soundData->getSize(), soundData->getSampleRate());
- static float z[3] = {0, 0, 0};
+ float z[3] = {0, 0, 0};
setFloatv(position, z);
setFloatv(velocity, z);
@@ -69,6 +80,7 @@ Source::Source(Pool *pool, love::sound::Decoder *decoder)
: love::audio::Source(Source::TYPE_STREAM)
, pool(pool)
, valid(false)
+ , staticBuffer(nullptr)
, pitch(1.0f)
, volume(1.0f)
, relative(false)
@@ -87,27 +99,70 @@ Source::Source(Pool *pool, love::sound::Decoder *decoder)
, toLoop(0)
{
decoder->retain();
- alGenBuffers(MAX_BUFFERS, buffers);
+ alGenBuffers(MAX_BUFFERS, streamBuffers);
- static float z[3] = {0, 0, 0};
+ float z[3] = {0, 0, 0};
setFloatv(position, z);
setFloatv(velocity, z);
setFloatv(direction, z);
}
+Source::Source(const Source &s)
+ : love::audio::Source(s.type)
+ , pool(s.pool)
+ , valid(false)
+ , staticBuffer(s.staticBuffer)
+ , pitch(s.pitch)
+ , volume(s.volume)
+ , relative(s.relative)
+ , looping(s.looping)
+ , paused(false)
+ , minVolume(s.minVolume)
+ , maxVolume(s.maxVolume)
+ , referenceDistance(s.referenceDistance)
+ , rolloffFactor(s.rolloffFactor)
+ , maxDistance(s.maxDistance)
+ , cone(s.cone)
+ , offsetSamples(0)
+ , offsetSeconds(0)
+ , channels(s.channels)
+ , decoder(nullptr)
+ , toLoop(0)
+{
+ if (type == TYPE_STREAM)
+ {
+ if (s.decoder)
+ decoder = s.decoder->clone();
+
+ alGenBuffers(MAX_BUFFERS, streamBuffers);
+ }
+ else
+ staticBuffer->retain();
+
+ setFloatv(position, s.position);
+ setFloatv(velocity, s.velocity);
+ setFloatv(direction, s.direction);
+}
+
Source::~Source()
{
if (valid)
pool->stop(this);
- alDeleteBuffers((type == TYPE_STATIC) ? 1 : MAX_BUFFERS, buffers);
+
+ if (type == TYPE_STREAM)
+ alDeleteBuffers(MAX_BUFFERS, streamBuffers);
+
+ if (staticBuffer)
+ staticBuffer->release();
+
if (decoder)
decoder->release();
}
-love::audio::Source *Source::copy()
+love::audio::Source *Source::clone()
{
- return 0;
+ return new Source(*this);
}
void Source::play()
@@ -341,13 +396,15 @@ float Source::tellAtomic(void *unit) const
break;
case Source::UNIT_SECONDS:
default:
- alGetSourcef(source, AL_SAMPLE_OFFSET, &offset);
- ALint buffer;
- alGetSourcei(source, AL_BUFFER, &buffer);
- int freq;
- alGetBufferi(buffer, AL_FREQUENCY, &freq);
- offset /= freq;
- if (type == TYPE_STREAM) offset += offsetSeconds;
+ {
+ alGetSourcef(source, AL_SAMPLE_OFFSET, &offset);
+ ALint buffer;
+ alGetSourcei(source, AL_BUFFER, &buffer);
+ int freq;
+ alGetBufferi(buffer, AL_FREQUENCY, &freq);
+ offset /= freq;
+ if (type == TYPE_STREAM) offset += offsetSeconds;
+ }
break;
}
return offset;
@@ -459,7 +516,7 @@ void Source::playAtomic()
{
if (type == TYPE_STATIC)
{
- alSourcei(source, AL_BUFFER, buffers[0]);
+ alSourcei(source, AL_BUFFER, staticBuffer->getBuffer());
}
else if (type == TYPE_STREAM)
{
@@ -467,14 +524,14 @@ void Source::playAtomic()
for (unsigned int i = 0; i < MAX_BUFFERS; i++)
{
- streamAtomic(buffers[i], decoder);
+ streamAtomic(streamBuffers[i], decoder);
++usedBuffers;
if (decoder->isFinished())
break;
}
if (usedBuffers > 0)
- alSourceQueueBuffers(source, usedBuffers, buffers);
+ alSourceQueueBuffers(source, usedBuffers, streamBuffers);
}
// This Source may now be associated with an OpenAL source that still has
diff --git a/jni/love/src/modules/audio/openal/Source.h b/jni/love/src/modules/audio/openal/Source.h
index 93824be4..9a1182d7 100644
--- a/jni/love/src/modules/audio/openal/Source.h
+++ b/jni/love/src/modules/audio/openal/Source.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
@@ -29,7 +29,7 @@
#include "sound/Decoder.h"
// OpenAL
-#ifdef LOVE_MACOSX
+#ifdef LOVE_MACOSX_USE_FRAMEWORKS
#include
#include
#else
@@ -47,14 +47,35 @@ namespace openal
class Audio;
class Pool;
+// Basically just a reference-counted non-streaming OpenAL buffer object.
+class StaticDataBuffer : public love::Object
+{
+public:
+
+ StaticDataBuffer(ALenum format, const ALvoid *data, ALsizei size, ALsizei freq);
+ virtual ~StaticDataBuffer();
+
+ inline ALuint getBuffer() const
+ {
+ return buffer;
+ }
+
+private:
+
+ ALuint buffer;
+
+}; // StaticDataBuffer
+
class Source : public love::audio::Source
{
public:
+
Source(Pool *pool, love::sound::SoundData *soundData);
Source(Pool *pool, love::sound::Decoder *decoder);
+ Source(const Source &s);
virtual ~Source();
- virtual love::audio::Source *copy();
+ virtual love::audio::Source *clone();
virtual void play();
virtual void stop();
virtual void pause();
@@ -123,8 +144,11 @@ private:
Pool *pool;
ALuint source;
bool valid;
+
static const unsigned int MAX_BUFFERS = 32;
- ALuint buffers[MAX_BUFFERS];
+ ALuint streamBuffers[MAX_BUFFERS];
+
+ StaticDataBuffer *staticBuffer;
float pitch;
float volume;
diff --git a/jni/love/src/modules/audio/wrap_Audio.cpp b/jni/love/src/modules/audio/wrap_Audio.cpp
index 513fcc0a..4b8e3996 100644
--- a/jni/love/src/modules/audio/wrap_Audio.cpp
+++ b/jni/love/src/modules/audio/wrap_Audio.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
@@ -304,6 +304,7 @@ static const lua_CFunction types[] =
extern "C" int luaopen_love_audio(lua_State *L)
{
+#ifdef LOVE_ENABLE_AUDIO_OPENAL
if (instance == 0)
{
// Try OpenAL first.
@@ -318,7 +319,9 @@ extern "C" int luaopen_love_audio(lua_State *L)
}
else
instance->retain();
+#endif
+#ifdef LOVE_ENABLE_AUDIO_NULL
if (instance == 0)
{
// Fall back to nullaudio.
@@ -331,6 +334,7 @@ extern "C" int luaopen_love_audio(lua_State *L)
std::cout << e.what() << std::endl;
}
}
+#endif
if (instance == 0)
return luaL_error(L, "Could not open any audio module.");
diff --git a/jni/love/src/modules/audio/wrap_Audio.h b/jni/love/src/modules/audio/wrap_Audio.h
index 40fe3d89..1960e0d1 100644
--- a/jni/love/src/modules/audio/wrap_Audio.h
+++ b/jni/love/src/modules/audio/wrap_Audio.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/audio/wrap_Source.cpp b/jni/love/src/modules/audio/wrap_Source.cpp
index 1ac39637..d1f3e61a 100644
--- a/jni/love/src/modules/audio/wrap_Source.cpp
+++ b/jni/love/src/modules/audio/wrap_Source.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
@@ -18,6 +18,8 @@
* 3. This notice may not be removed or altered from any source distribution.
**/
+#include
+
#include "wrap_Source.h"
namespace love
@@ -30,6 +32,15 @@ Source *luax_checksource(lua_State *L, int idx)
return luax_checktype(L, idx, "Source", AUDIO_SOURCE_T);
}
+int w_Source_clone(lua_State *L)
+{
+ Source *t = luax_checksource(L, 1);
+ Source *clone = nullptr;
+ EXCEPT_GUARD(clone = t->clone();)
+ luax_pushtype(L, "Source", AUDIO_SOURCE_T, clone);
+ return 1;
+}
+
int w_Source_play(lua_State *L)
{
Source *t = luax_checksource(L, 1);
@@ -69,6 +80,10 @@ int w_Source_setPitch(lua_State *L)
{
Source *t = luax_checksource(L, 1);
float p = (float)luaL_checknumber(L, 2);
+ if (p > std::numeric_limits::max() ||
+ p < std::numeric_limits::min() ||
+ p != p)
+ return luaL_error(L, "Pitch has to be finite and not NaN.");
t->setPitch(p);
return 0;
}
@@ -333,6 +348,8 @@ int w_Source_getChannels(lua_State *L)
static const luaL_Reg functions[] =
{
+ { "clone", w_Source_clone },
+
{ "play", w_Source_play },
{ "stop", w_Source_stop },
{ "pause", w_Source_pause },
diff --git a/jni/love/src/modules/audio/wrap_Source.h b/jni/love/src/modules/audio/wrap_Source.h
index bca5ecaa..0a49b4c6 100644
--- a/jni/love/src/modules/audio/wrap_Source.h
+++ b/jni/love/src/modules/audio/wrap_Source.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
@@ -30,6 +30,7 @@ namespace audio
{
Source *luax_checksource(lua_State *L, int idx);
+int w_Source_clone(lua_State *L);
int w_Source_play(lua_State *L);
int w_Source_stop(lua_State *L);
int w_Source_pause(lua_State *L);
diff --git a/jni/love/src/modules/event/Event.cpp b/jni/love/src/modules/event/Event.cpp
index ae78b2c6..1c7999ec 100644
--- a/jni/love/src/modules/event/Event.cpp
+++ b/jni/love/src/modules/event/Event.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/event/Event.h b/jni/love/src/modules/event/Event.h
index 387bf00c..38037edc 100644
--- a/jni/love/src/modules/event/Event.h
+++ b/jni/love/src/modules/event/Event.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/event/sdl/Event.cpp b/jni/love/src/modules/event/sdl/Event.cpp
index 02155617..a03036b7 100644
--- a/jni/love/src/modules/event/sdl/Event.cpp
+++ b/jni/love/src/modules/event/sdl/Event.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/event/sdl/Event.h b/jni/love/src/modules/event/sdl/Event.h
index ab5a0a9a..7b8df4ac 100644
--- a/jni/love/src/modules/event/sdl/Event.h
+++ b/jni/love/src/modules/event/sdl/Event.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/event/sdl/wrap_Event.cpp b/jni/love/src/modules/event/sdl/wrap_Event.cpp
index c97b36e3..f33bd661 100644
--- a/jni/love/src/modules/event/sdl/wrap_Event.cpp
+++ b/jni/love/src/modules/event/sdl/wrap_Event.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/event/sdl/wrap_Event.h b/jni/love/src/modules/event/sdl/wrap_Event.h
index 66de0e2b..b689335a 100644
--- a/jni/love/src/modules/event/sdl/wrap_Event.h
+++ b/jni/love/src/modules/event/sdl/wrap_Event.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/filesystem/File.cpp b/jni/love/src/modules/filesystem/File.cpp
index 49f0b341..ef20621d 100644
--- a/jni/love/src/modules/filesystem/File.cpp
+++ b/jni/love/src/modules/filesystem/File.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/filesystem/File.h b/jni/love/src/modules/filesystem/File.h
index 4c5bbdc7..e0be859e 100644
--- a/jni/love/src/modules/filesystem/File.h
+++ b/jni/love/src/modules/filesystem/File.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/filesystem/FileData.cpp b/jni/love/src/modules/filesystem/FileData.cpp
index dc3fab5f..dd59c73e 100644
--- a/jni/love/src/modules/filesystem/FileData.cpp
+++ b/jni/love/src/modules/filesystem/FileData.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/filesystem/FileData.h b/jni/love/src/modules/filesystem/FileData.h
index 8712e597..e74866be 100644
--- a/jni/love/src/modules/filesystem/FileData.h
+++ b/jni/love/src/modules/filesystem/FileData.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/filesystem/physfs/File.cpp b/jni/love/src/modules/filesystem/physfs/File.cpp
index ad691ced..ce2ac50e 100644
--- a/jni/love/src/modules/filesystem/physfs/File.cpp
+++ b/jni/love/src/modules/filesystem/physfs/File.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/filesystem/physfs/File.h b/jni/love/src/modules/filesystem/physfs/File.h
index ff82a485..a3fe3379 100644
--- a/jni/love/src/modules/filesystem/physfs/File.h
+++ b/jni/love/src/modules/filesystem/physfs/File.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
@@ -25,7 +25,7 @@
#include "filesystem/File.h"
// PhysFS
-#ifdef LOVE_MACOSX // wacky Mac behavior means different #include syntax!
+#ifdef LOVE_MACOSX_USE_FRAMEWORKS
#include
#else
#include
diff --git a/jni/love/src/modules/filesystem/physfs/Filesystem.cpp b/jni/love/src/modules/filesystem/physfs/Filesystem.cpp
index f9182918..303da54a 100644
--- a/jni/love/src/modules/filesystem/physfs/Filesystem.cpp
+++ b/jni/love/src/modules/filesystem/physfs/Filesystem.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/filesystem/physfs/Filesystem.h b/jni/love/src/modules/filesystem/physfs/Filesystem.h
index 33e20d89..aaf892a3 100644
--- a/jni/love/src/modules/filesystem/physfs/Filesystem.h
+++ b/jni/love/src/modules/filesystem/physfs/Filesystem.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
@@ -197,20 +197,6 @@ public:
**/
bool remove(const char *file);
- /**
- * Opens a file for reading or writing. (Depends
- * on the mode chosen at the time of creation).
- * @param file The file to open.
- * @param mode The mode to open the file in.
- **/
- bool open(File *file, File::Mode mode);
-
- /**
- * Closes a file.
- * @param file The file to close.
- **/
- bool close(File *file);
-
/**
* Reads data from a file.
* @param filename The name of the file to read from.
@@ -234,24 +220,6 @@ public:
**/
void append(const char *filename, const void *data, int64 size) const;
- /**
- * Check if end-of-file is reached.
- * @return True if EOF, false otherwise.
- **/
- bool eof(File *file);
-
- /**
- * Gets the current position in a file.
- * @param file An open File.
- **/
- int tell(File *file);
-
- /**
- * Seek to a position within a file.
- * @param pos The position to seek to.
- **/
- bool seek(File *file, uint64 pos);
-
/**
* This "native" method returns a table of all
* files in a given directory.
diff --git a/jni/love/src/modules/filesystem/physfs/wrap_File.cpp b/jni/love/src/modules/filesystem/physfs/wrap_File.cpp
index afd8d2dc..d136e4b4 100644
--- a/jni/love/src/modules/filesystem/physfs/wrap_File.cpp
+++ b/jni/love/src/modules/filesystem/physfs/wrap_File.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/filesystem/physfs/wrap_File.h b/jni/love/src/modules/filesystem/physfs/wrap_File.h
index 4aa86b14..a3d0b964 100644
--- a/jni/love/src/modules/filesystem/physfs/wrap_File.h
+++ b/jni/love/src/modules/filesystem/physfs/wrap_File.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/filesystem/physfs/wrap_FileData.cpp b/jni/love/src/modules/filesystem/physfs/wrap_FileData.cpp
index 9512e32b..b50c8123 100644
--- a/jni/love/src/modules/filesystem/physfs/wrap_FileData.cpp
+++ b/jni/love/src/modules/filesystem/physfs/wrap_FileData.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/filesystem/physfs/wrap_FileData.h b/jni/love/src/modules/filesystem/physfs/wrap_FileData.h
index e862cf3a..2d46165f 100644
--- a/jni/love/src/modules/filesystem/physfs/wrap_FileData.h
+++ b/jni/love/src/modules/filesystem/physfs/wrap_FileData.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/filesystem/physfs/wrap_Filesystem.cpp b/jni/love/src/modules/filesystem/physfs/wrap_Filesystem.cpp
index dc1a17c6..6e76cbb5 100644
--- a/jni/love/src/modules/filesystem/physfs/wrap_Filesystem.cpp
+++ b/jni/love/src/modules/filesystem/physfs/wrap_Filesystem.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
@@ -493,7 +493,10 @@ int loader(lua_State *L)
}
}
- lua_pushfstring(L, "\n\tno file \"%s\" in LOVE game directories.\n", (tmp + ".lua").c_str());
+ std::string errstr = "\n\tno file '%s' in LOVE game directories.";
+ errstr += errstr;
+
+ lua_pushfstring(L, errstr.c_str(), (tmp + ".lua").c_str(), (tmp + "/init.lua").c_str());
return 1;
}
@@ -529,7 +532,7 @@ int extloader(lua_State *L)
if (!handle)
{
- lua_pushfstring(L, "\n\tno extension \"%s\" in LOVE paths.\n", filename);
+ lua_pushfstring(L, "\n\tno file '%s' in LOVE paths.", tokenized_name.c_str());
return 1;
}
@@ -540,7 +543,7 @@ int extloader(lua_State *L)
if (!func)
{
SDL_UnloadObject(handle);
- lua_pushfstring(L, "\n\textension \"%s\" is incompatible.\n", filename);
+ lua_pushfstring(L, "\n\tC library '%s' is incompatible.", tokenized_name.c_str());
return 1;
}
@@ -599,8 +602,9 @@ extern "C" int luaopen_love_filesystem(lua_State *L)
else
instance->retain();
- love::luax_register_searcher(L, loader, 1);
- love::luax_register_searcher(L, extloader, 2);
+ // The love loaders should be tried after package.preload.
+ love::luax_register_searcher(L, loader, 2);
+ love::luax_register_searcher(L, extloader, 3);
WrappedModule w;
w.module = instance;
diff --git a/jni/love/src/modules/filesystem/physfs/wrap_Filesystem.h b/jni/love/src/modules/filesystem/physfs/wrap_Filesystem.h
index 57bb2f6a..711c5eb5 100644
--- a/jni/love/src/modules/filesystem/physfs/wrap_Filesystem.h
+++ b/jni/love/src/modules/filesystem/physfs/wrap_Filesystem.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/font/Font.h b/jni/love/src/modules/font/Font.h
index f52d7647..dacde034 100644
--- a/jni/love/src/modules/font/Font.h
+++ b/jni/love/src/modules/font/Font.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/font/GlyphData.cpp b/jni/love/src/modules/font/GlyphData.cpp
index 3cf25d41..27cf32af 100644
--- a/jni/love/src/modules/font/GlyphData.cpp
+++ b/jni/love/src/modules/font/GlyphData.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
@@ -36,7 +36,7 @@ namespace font
GlyphData::GlyphData(uint32 glyph, GlyphMetrics glyphMetrics, GlyphData::Format f)
: glyph(glyph)
, metrics(glyphMetrics)
- , data(0)
+ , data(nullptr)
, format(f)
{
if (metrics.width > 0 && metrics.height > 0)
diff --git a/jni/love/src/modules/font/GlyphData.h b/jni/love/src/modules/font/GlyphData.h
index 0bdb92c4..59aa1200 100644
--- a/jni/love/src/modules/font/GlyphData.h
+++ b/jni/love/src/modules/font/GlyphData.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/font/ImageRasterizer.cpp b/jni/love/src/modules/font/ImageRasterizer.cpp
index 89ca622e..fd0ec21b 100644
--- a/jni/love/src/modules/font/ImageRasterizer.cpp
+++ b/jni/love/src/modules/font/ImageRasterizer.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/font/ImageRasterizer.h b/jni/love/src/modules/font/ImageRasterizer.h
index 43a34ebd..5c7e9e8f 100644
--- a/jni/love/src/modules/font/ImageRasterizer.h
+++ b/jni/love/src/modules/font/ImageRasterizer.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/font/Rasterizer.cpp b/jni/love/src/modules/font/Rasterizer.cpp
index d0d42a5c..1454f255 100644
--- a/jni/love/src/modules/font/Rasterizer.cpp
+++ b/jni/love/src/modules/font/Rasterizer.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/font/Rasterizer.h b/jni/love/src/modules/font/Rasterizer.h
index f8766bbb..a4cd6e5c 100644
--- a/jni/love/src/modules/font/Rasterizer.h
+++ b/jni/love/src/modules/font/Rasterizer.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/font/freetype/Font.cpp b/jni/love/src/modules/font/freetype/Font.cpp
index a9c6f38c..ece8e8dd 100644
--- a/jni/love/src/modules/font/freetype/Font.cpp
+++ b/jni/love/src/modules/font/freetype/Font.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/font/freetype/Font.h b/jni/love/src/modules/font/freetype/Font.h
index abe9436c..814ee63b 100644
--- a/jni/love/src/modules/font/freetype/Font.h
+++ b/jni/love/src/modules/font/freetype/Font.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
@@ -25,15 +25,13 @@
#include "font/Font.h"
// FreeType2
-#ifdef LOVE_MACOSX
+#ifdef LOVE_MACOSX_USE_FRAMEWORKS
#include
#else
#include
#endif
-#include
-#include
-#include
-#include
+#include FT_FREETYPE_H
+#include FT_GLYPH_H
namespace love
{
@@ -73,4 +71,4 @@ private:
} // font
} // love
-#endif // LOVE_FONT_FREETYPE_FONT_H
\ No newline at end of file
+#endif // LOVE_FONT_FREETYPE_FONT_H
diff --git a/jni/love/src/modules/font/freetype/TrueTypeRasterizer.cpp b/jni/love/src/modules/font/freetype/TrueTypeRasterizer.cpp
index 2c490b25..84779368 100644
--- a/jni/love/src/modules/font/freetype/TrueTypeRasterizer.cpp
+++ b/jni/love/src/modules/font/freetype/TrueTypeRasterizer.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
@@ -34,11 +34,11 @@ TrueTypeRasterizer::TrueTypeRasterizer(FT_Library library, Data *data, int size)
: data(data)
{
if (FT_New_Memory_Face(library,
- (const FT_Byte *)data->getData(), /* first byte in memory */
- data->getSize(), /* size in bytes */
- 0, /* face_index */
- &face))
- throw love::Exception("TrueTypeFont Loading error: FT_New_Face failed (there is probably a problem with your font file)\n");
+ (const FT_Byte *)data->getData(), /* first byte in memory */
+ data->getSize(), /* size in bytes */
+ 0, /* face_index */
+ &face))
+ throw love::Exception("TrueTypeFont Loading error: FT_New_Face failed (there is probably a problem with your font file)");
FT_Set_Pixel_Sizes(face, size, size);
@@ -70,39 +70,67 @@ GlyphData *TrueTypeRasterizer::getGlyphData(uint32 glyph) const
// Initialize
if (FT_Load_Glyph(face, FT_Get_Char_Index(face, glyph), FT_LOAD_DEFAULT))
- throw love::Exception("TrueTypeFont Loading vm->error: FT_Load_Glyph failed\n");
+ throw love::Exception("TrueTypeFont Loading error: FT_Load_Glyph failed");
if (FT_Get_Glyph(face->glyph, &ftglyph))
- throw love::Exception("TrueTypeFont Loading vm->error: FT_Get_Glyph failed\n");
+ throw love::Exception("TrueTypeFont Loading error: FT_Get_Glyph failed");
FT_Glyph_To_Bitmap(&ftglyph, FT_RENDER_MODE_NORMAL, 0, 1);
+
FT_BitmapGlyph bitmap_glyph = (FT_BitmapGlyph) ftglyph;
FT_Bitmap &bitmap = bitmap_glyph->bitmap; //just to make things easier
// Get metrics
- glyphMetrics.bearingX = face->glyph->metrics.horiBearingX >> 6;
- glyphMetrics.bearingY = face->glyph->metrics.horiBearingY >> 6;
+ glyphMetrics.bearingX = bitmap_glyph->left;
+ glyphMetrics.bearingY = bitmap_glyph->top;
glyphMetrics.height = bitmap.rows;
glyphMetrics.width = bitmap.width;
- glyphMetrics.advance = face->glyph->metrics.horiAdvance >> 6;
+ glyphMetrics.advance = ftglyph->advance.x >> 16;
GlyphData *glyphData = new GlyphData(glyph, glyphMetrics, GlyphData::FORMAT_LUMINANCE_ALPHA);
- int size = bitmap.rows * bitmap.width;
- unsigned char *dst = (unsigned char *) glyphData->getData();
+ const uint8 *pixels = bitmap.buffer;
+ uint8 *dest = (uint8 *) glyphData->getData();
- // Note that bitmap.buffer contains only luminosity. We copy that single
- // value to our luminosity-alpha format.
- for (int i = 0; i < size; i++)
+ // We treat the luminance of the FreeType bitmap as alpha in the GlyphData.
+ if (bitmap.pixel_mode == FT_PIXEL_MODE_MONO)
{
- dst[2*i] = 255;
- dst[2*i+1] = bitmap.buffer[i];
+ for (int y = 0; y < bitmap.rows; y++)
+ {
+ for (int x = 0; x < bitmap.width; x++)
+ {
+ // Extract the 1-bit value and convert it to uint8.
+ uint8 v = ((pixels[x / 8]) & (1 << (7 - (x % 8)))) ? 255 : 0;
+ dest[2 * (y * bitmap.width + x) + 0] = 255;
+ dest[2 * (y * bitmap.width + x) + 1] = v;
+ }
+
+ pixels += bitmap.pitch;
+ }
+ }
+ else if (bitmap.pixel_mode == FT_PIXEL_MODE_GRAY)
+ {
+ for (int y = 0; y < bitmap.rows; y++)
+ {
+ for (int x = 0; x < bitmap.width; x++)
+ {
+ dest[2 * (y * bitmap.width + x) + 0] = 255;
+ dest[2 * (y * bitmap.width + x) + 1] = pixels[x];
+ }
+
+ pixels += bitmap.pitch;
+ }
+ }
+ else
+ {
+ delete glyphData;
+ FT_Done_Glyph(ftglyph);
+ throw love::Exception("Unknown TrueType glyph pixel mode.");
}
- // Having copied the data over, we can destroy the glyph
+ // Having copied the data over, we can destroy the glyph.
FT_Done_Glyph(ftglyph);
- // Return data
return glyphData;
}
diff --git a/jni/love/src/modules/font/freetype/TrueTypeRasterizer.h b/jni/love/src/modules/font/freetype/TrueTypeRasterizer.h
index 71c2b009..5600f324 100644
--- a/jni/love/src/modules/font/freetype/TrueTypeRasterizer.h
+++ b/jni/love/src/modules/font/freetype/TrueTypeRasterizer.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
@@ -27,10 +27,8 @@
// TrueType2
#include
-#include
-#include
-#include
-#include
+#include FT_FREETYPE_H
+#include FT_GLYPH_H
namespace love
{
@@ -67,4 +65,4 @@ private:
} // font
} // love
-#endif // LOVE_FONT_FREETYPE_TRUE_TYPE_RASTERIZER_H
\ No newline at end of file
+#endif // LOVE_FONT_FREETYPE_TRUE_TYPE_RASTERIZER_H
diff --git a/jni/love/src/modules/font/freetype/wrap_Font.cpp b/jni/love/src/modules/font/freetype/wrap_Font.cpp
index a3f56ed7..935df7d1 100644
--- a/jni/love/src/modules/font/freetype/wrap_Font.cpp
+++ b/jni/love/src/modules/font/freetype/wrap_Font.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/font/freetype/wrap_Font.h b/jni/love/src/modules/font/freetype/wrap_Font.h
index 7a8a74b0..6cf7b7b0 100644
--- a/jni/love/src/modules/font/freetype/wrap_Font.h
+++ b/jni/love/src/modules/font/freetype/wrap_Font.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/font/wrap_GlyphData.cpp b/jni/love/src/modules/font/wrap_GlyphData.cpp
index 5a822b27..c71dcb84 100644
--- a/jni/love/src/modules/font/wrap_GlyphData.cpp
+++ b/jni/love/src/modules/font/wrap_GlyphData.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/font/wrap_GlyphData.h b/jni/love/src/modules/font/wrap_GlyphData.h
index d76881d1..72ed79bb 100644
--- a/jni/love/src/modules/font/wrap_GlyphData.h
+++ b/jni/love/src/modules/font/wrap_GlyphData.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/font/wrap_Rasterizer.cpp b/jni/love/src/modules/font/wrap_Rasterizer.cpp
index 4e32a7a7..0f483a7d 100644
--- a/jni/love/src/modules/font/wrap_Rasterizer.cpp
+++ b/jni/love/src/modules/font/wrap_Rasterizer.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/font/wrap_Rasterizer.h b/jni/love/src/modules/font/wrap_Rasterizer.h
index aea8ca63..e2b895ee 100644
--- a/jni/love/src/modules/font/wrap_Rasterizer.h
+++ b/jni/love/src/modules/font/wrap_Rasterizer.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/graphics/DrawQable.h b/jni/love/src/modules/graphics/DrawQable.h
deleted file mode 100644
index 1c0d5230..00000000
--- a/jni/love/src/modules/graphics/DrawQable.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/**
- * Copyright (c) 2006-2013 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
- * arising from the use of this software.
- *
- * Permission is granted to anyone to use this software for any purpose,
- * including commercial applications, and to alter it and redistribute it
- * freely, subject to the following restrictions:
- *
- * 1. The origin of this software must not be misrepresented; you must not
- * claim that you wrote the original software. If you use this software
- * in a product, an acknowledgment in the product documentation would be
- * appreciated but is not required.
- * 2. Altered source versions must be plainly marked as such, and must not be
- * misrepresented as being the original software.
- * 3. This notice may not be removed or altered from any source distribution.
- **/
-
-#ifndef LOVE_GRAPHICS_DRAWQABLE_H
-#define LOVE_GRAPHICS_DRAWQABLE_H
-
-// LOVE
-#include "Drawable.h"
-#include "Quad.h"
-
-namespace love
-{
-namespace graphics
-{
-
-/**
- * A DrawQable is anything that be drawn in part with a Quad object.
- **/
-class DrawQable : public Drawable
-{
-public:
-
- /**
- * Destructor.
- **/
- virtual ~DrawQable() {}
-
- /**
- * Draws the object with the specified transformation.
- *
- * @param quad The Quad object to use to draw the object.
- * @param x The position of the object along the x-axis.
- * @param y The position of the object along the y-axis.
- * @param angle The angle of the object (in radians).
- * @param sx The scale factor along the x-axis.
- * @param sy The scale factor along the y-axis.
- * @param ox The origin offset along the x-axis.
- * @param oy The origin offset along the y-axis.
- * @param kx Shear along the x-axis.
- * @param ky Shear along the y-axis.
- **/
- virtual void drawq(Quad *quad, float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) const = 0;
-};
-
-} // graphics
-} // love
-
-#endif // LOVE_GRAPHICS_DRAWQABLE_H
diff --git a/jni/love/src/modules/graphics/Drawable.h b/jni/love/src/modules/graphics/Drawable.h
index d399a085..aea03b34 100644
--- a/jni/love/src/modules/graphics/Drawable.h
+++ b/jni/love/src/modules/graphics/Drawable.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
@@ -40,7 +40,7 @@ public:
/**
* Destructor.
**/
- virtual ~Drawable();
+ virtual ~Drawable() {}
/**
* Draws the object with the specified transformation.
diff --git a/jni/love/src/modules/graphics/Graphics.cpp b/jni/love/src/modules/graphics/Graphics.cpp
index b9f41013..c805cc17 100644
--- a/jni/love/src/modules/graphics/Graphics.cpp
+++ b/jni/love/src/modules/graphics/Graphics.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/graphics/Graphics.h b/jni/love/src/modules/graphics/Graphics.h
index 44ed3550..ed724135 100644
--- a/jni/love/src/modules/graphics/Graphics.h
+++ b/jni/love/src/modules/graphics/Graphics.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/graphics/Image.cpp b/jni/love/src/modules/graphics/Image.cpp
deleted file mode 100644
index 3bdc06e0..00000000
--- a/jni/love/src/modules/graphics/Image.cpp
+++ /dev/null
@@ -1,96 +0,0 @@
-/**
- * Copyright (c) 2006-2013 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
- * arising from the use of this software.
- *
- * Permission is granted to anyone to use this software for any purpose,
- * including commercial applications, and to alter it and redistribute it
- * freely, subject to the following restrictions:
- *
- * 1. The origin of this software must not be misrepresented; you must not
- * claim that you wrote the original software. If you use this software
- * in a product, an acknowledgment in the product documentation would be
- * appreciated but is not required.
- * 2. Altered source versions must be plainly marked as such, and must not be
- * misrepresented as being the original software.
- * 3. This notice may not be removed or altered from any source distribution.
- **/
-
-#include "Image.h"
-
-namespace love
-{
-namespace graphics
-{
-
-Image::Filter Image::defaultFilter;
-
-Image::Filter::Filter()
- : min(FILTER_LINEAR)
- , mag(FILTER_LINEAR)
- , mipmap(FILTER_NONE)
- , anisotropy(1.0f)
-{
-}
-
-Image::Wrap::Wrap()
- : s(WRAP_CLAMP)
- , t(WRAP_CLAMP)
-{
-}
-
-Image::~Image()
-{
-}
-
-void Image::setDefaultFilter(const Filter &f)
-{
- defaultFilter = f;
-}
-
-const Image::Filter &Image::getDefaultFilter()
-{
- return defaultFilter;
-}
-
-bool Image::getConstant(const char *in, FilterMode &out)
-{
- return filterModes.find(in, out);
-}
-
-bool Image::getConstant(FilterMode in, const char *&out)
-{
- return filterModes.find(in, out);
-}
-
-bool Image::getConstant(const char *in, WrapMode &out)
-{
- return wrapModes.find(in, out);
-}
-
-bool Image::getConstant(WrapMode in, const char *&out)
-{
- return wrapModes.find(in, out);
-}
-
-StringMap::Entry Image::filterModeEntries[] =
-{
- { "linear", Image::FILTER_LINEAR },
- { "nearest", Image::FILTER_NEAREST },
-};
-
-StringMap Image::filterModes(Image::filterModeEntries, sizeof(Image::filterModeEntries));
-
-StringMap::Entry Image::wrapModeEntries[] =
-{
- { "clamp", Image::WRAP_CLAMP },
- { "repeat", Image::WRAP_REPEAT },
-};
-
-StringMap Image::wrapModes(Image::wrapModeEntries, sizeof(Image::wrapModeEntries));
-
-
-} // graphics
-} // love
diff --git a/jni/love/src/modules/graphics/Quad.cpp b/jni/love/src/modules/graphics/Quad.cpp
index 2b1b04c7..4f0ba472 100644
--- a/jni/love/src/modules/graphics/Quad.cpp
+++ b/jni/love/src/modules/graphics/Quad.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/graphics/Quad.h b/jni/love/src/modules/graphics/Quad.h
index 7fd72c9b..d8c5ca88 100644
--- a/jni/love/src/modules/graphics/Quad.h
+++ b/jni/love/src/modules/graphics/Quad.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/graphics/Texture.cpp b/jni/love/src/modules/graphics/Texture.cpp
new file mode 100644
index 00000000..25034a3d
--- /dev/null
+++ b/jni/love/src/modules/graphics/Texture.cpp
@@ -0,0 +1,130 @@
+/**
+ * Copyright (c) 2006-2014 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
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ * 3. This notice may not be removed or altered from any source distribution.
+ **/
+
+#include "Texture.h"
+
+namespace love
+{
+namespace graphics
+{
+
+Texture::Filter Texture::defaultFilter;
+
+Texture::Filter::Filter()
+ : min(FILTER_LINEAR)
+ , mag(FILTER_LINEAR)
+ , mipmap(FILTER_NONE)
+ , anisotropy(1.0f)
+{
+}
+
+Texture::Wrap::Wrap()
+ : s(WRAP_CLAMP)
+ , t(WRAP_CLAMP)
+{
+}
+
+Texture::Texture()
+ : width(0)
+ , height(0)
+ , filter(getDefaultFilter())
+ , wrap()
+ , vertices()
+{
+}
+
+Texture::~Texture()
+{
+}
+
+int Texture::getWidth() const
+{
+ return width;
+}
+
+int Texture::getHeight() const
+{
+ return height;
+}
+
+const Texture::Filter &Texture::getFilter() const
+{
+ return filter;
+}
+
+const Texture::Wrap &Texture::getWrap() const
+{
+ return wrap;
+}
+
+const Vertex *Texture::getVertices() const
+{
+ return vertices;
+}
+
+void Texture::setDefaultFilter(const Filter &f)
+{
+ defaultFilter = f;
+}
+
+const Texture::Filter &Texture::getDefaultFilter()
+{
+ return defaultFilter;
+}
+
+bool Texture::getConstant(const char *in, FilterMode &out)
+{
+ return filterModes.find(in, out);
+}
+
+bool Texture::getConstant(FilterMode in, const char *&out)
+{
+ return filterModes.find(in, out);
+}
+
+bool Texture::getConstant(const char *in, WrapMode &out)
+{
+ return wrapModes.find(in, out);
+}
+
+bool Texture::getConstant(WrapMode in, const char *&out)
+{
+ return wrapModes.find(in, out);
+}
+
+StringMap::Entry Texture::filterModeEntries[] =
+{
+ { "linear", Texture::FILTER_LINEAR },
+ { "nearest", Texture::FILTER_NEAREST },
+};
+
+StringMap Texture::filterModes(Texture::filterModeEntries, sizeof(Texture::filterModeEntries));
+
+StringMap::Entry Texture::wrapModeEntries[] =
+{
+ { "clamp", Texture::WRAP_CLAMP },
+ { "repeat", Texture::WRAP_REPEAT },
+};
+
+StringMap Texture::wrapModes(Texture::wrapModeEntries, sizeof(Texture::wrapModeEntries));
+
+
+} // graphics
+} // love
diff --git a/jni/love/src/modules/graphics/Image.h b/jni/love/src/modules/graphics/Texture.h
similarity index 55%
rename from jni/love/src/modules/graphics/Image.h
rename to jni/love/src/modules/graphics/Texture.h
index e2c49116..e87c432f 100644
--- a/jni/love/src/modules/graphics/Image.h
+++ b/jni/love/src/modules/graphics/Texture.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
@@ -18,35 +18,40 @@
* 3. This notice may not be removed or altered from any source distribution.
**/
-#ifndef LOVE_GRAPHICS_IMAGE_H
-#define LOVE_GRAPHICS_IMAGE_H
+#ifndef LOVE_GRAPHICS_TEXTURE_H
+#define LOVE_GRAPHICS_TEXTURE_H
// LOVE
-#include "graphics/Volatile.h"
-#include "graphics/DrawQable.h"
#include "common/StringMap.h"
+#include "common/math.h"
+#include "Drawable.h"
+#include "Quad.h"
namespace love
{
namespace graphics
{
-class Image : public DrawQable, public Volatile
+/**
+ * Base class for 2D textures. All textures can be drawn with Quads, have a
+ * width and height, and have filter and wrap modes.
+ **/
+class Texture : public Drawable
{
public:
enum WrapMode
{
- WRAP_CLAMP = 1,
+ WRAP_CLAMP,
WRAP_REPEAT,
WRAP_MAX_ENUM
};
enum FilterMode
{
- FILTER_LINEAR = 1,
- FILTER_NEAREST,
FILTER_NONE,
+ FILTER_LINEAR,
+ FILTER_NEAREST,
FILTER_MAX_ENUM
};
@@ -66,17 +71,56 @@ public:
WrapMode t;
};
- virtual ~Image();
-
+ Texture();
+ virtual ~Texture();
+
+ /**
+ * Draws the texture using the specified transformation with a Quad applied.
+ *
+ * @param quad The Quad object to use to draw the object.
+ * @param x The position of the object along the x-axis.
+ * @param y The position of the object along the y-axis.
+ * @param angle The angle of the object (in radians).
+ * @param sx The scale factor along the x-axis.
+ * @param sy The scale factor along the y-axis.
+ * @param ox The origin offset along the x-axis.
+ * @param oy The origin offset along the y-axis.
+ * @param kx Shear along the x-axis.
+ * @param ky Shear along the y-axis.
+ **/
+ virtual void drawq(Quad *quad, float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) const = 0;
+
+ virtual int getWidth() const;
+ virtual int getHeight() const;
+
+ virtual void setFilter(const Filter &f) = 0;
+ virtual const Filter &getFilter() const;
+
+ virtual void setWrap(const Wrap &w) = 0;
+ virtual const Wrap &getWrap() const;
+
+ virtual const Vertex *getVertices() const;
+
// The default filter.
static void setDefaultFilter(const Filter &f);
static const Filter &getDefaultFilter();
static bool getConstant(const char *in, FilterMode &out);
static bool getConstant(FilterMode in, const char *&out);
+
static bool getConstant(const char *in, WrapMode &out);
static bool getConstant(WrapMode in, const char *&out);
+protected:
+
+ int width;
+ int height;
+
+ Filter filter;
+ Wrap wrap;
+
+ Vertex vertices[4];
+
private:
// The default texture filter.
@@ -84,12 +128,13 @@ private:
static StringMap::Entry filterModeEntries[];
static StringMap filterModes;
+
static StringMap::Entry wrapModeEntries[];
static StringMap wrapModes;
-}; // Image
+}; // Texture
} // graphics
} // love
-#endif // LOVE_GRAPHICS_IMAGE_H
+#endif // LOVE_GRAPHICS_TEXTURE_H
diff --git a/jni/love/src/modules/graphics/Volatile.cpp b/jni/love/src/modules/graphics/Volatile.cpp
index fa505e7d..920d8668 100644
--- a/jni/love/src/modules/graphics/Volatile.cpp
+++ b/jni/love/src/modules/graphics/Volatile.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/graphics/Volatile.h b/jni/love/src/modules/graphics/Volatile.h
index 34b2f8be..8fa1e412 100644
--- a/jni/love/src/modules/graphics/Volatile.h
+++ b/jni/love/src/modules/graphics/Volatile.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
diff --git a/jni/love/src/modules/graphics/opengl/Canvas.cpp b/jni/love/src/modules/graphics/opengl/Canvas.cpp
index ed9515a2..740e8499 100644
--- a/jni/love/src/modules/graphics/opengl/Canvas.cpp
+++ b/jni/love/src/modules/graphics/opengl/Canvas.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006-2013 LOVE Development Team
+ * Copyright (c) 2006-2014 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
@@ -115,7 +115,8 @@ struct FramebufferStrategyCore : public FramebufferStrategy
glGenTextures(1, &img);
gl.bindTexture(img);
- gl.setTextureFilter(Image::getDefaultFilter());
+ Texture::Filter filter = Texture::getDefaultFilter();
+ gl.setTextureFilter(filter);
glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, width, height,
0, GL_RGBA, format, NULL);
@@ -183,7 +184,7 @@ struct FramebufferStrategyCore : public FramebufferStrategy
for (size_t i = 0; i < canvases.size(); i++)
{
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1 + i,
- GL_TEXTURE_2D, canvases[i]->getTextureName(), 0);
+ GL_TEXTURE_2D, canvases[i]->getGLTexture(), 0);
drawbuffers.push_back(GL_COLOR_ATTACHMENT1 + i);
}
@@ -244,7 +245,8 @@ struct FramebufferStrategyPackedEXT : public FramebufferStrategy
glGenTextures(1, &img);
gl.bindTexture(img);
- gl.setTextureFilter(Image::getDefaultFilter());
+ Texture::Filter filter = Texture::getDefaultFilter();
+ gl.setTextureFilter(filter);
glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, width, height,
0, GL_RGBA, format, NULL);
@@ -312,7 +314,7 @@ struct FramebufferStrategyPackedEXT : public FramebufferStrategy
for (size_t i = 0; i < canvases.size(); i++)
{
glFramebufferTexture2DEXT(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1_EXT + i,
- GL_TEXTURE_2D, canvases[i]->getTextureName(), 0);
+ GL_TEXTURE_2D, canvases[i]->getGLTexture(), 0);
drawbuffers.push_back(GL_COLOR_ATTACHMENT1_EXT + i);
}
@@ -365,6 +367,7 @@ FramebufferStrategyPackedEXT strategyPackedEXT;
FramebufferStrategyEXT strategyEXT;
Canvas *Canvas::current = NULL;
+OpenGL::Viewport Canvas::systemViewport = OpenGL::Viewport();
static void getStrategy()
{
@@ -387,37 +390,36 @@ static int maxFBOColorAttachments = 0;
static int maxDrawBuffers = 0;
Canvas::Canvas(int width, int height, TextureType texture_type)
- : width(width)
- , height(height)
- , fbo(0)
+ : fbo(0)
, depth_stencil(0)
, img(0)
, texture_type(texture_type)
{
+ this->width = width;
+ this->height = height;
+
float w = static_cast(width);
float h = static_cast(height);
// world coordinates
vertices[0].x = 0;
- vertices[0].y = h;
- vertices[1].x = w;
+ vertices[0].y = 0;
+ vertices[1].x = 0;
vertices[1].y = h;
vertices[2].x = w;
- vertices[2].y = 0;
- vertices[3].x = 0;
+ vertices[2].y = h;
+ vertices[3].x = w;
vertices[3].y = 0;
// texture coordinates
vertices[0].s = 0;
vertices[0].t = 0;
- vertices[1].s = 1;
- vertices[1].t = 0;
+ vertices[1].s = 0;
+ vertices[1].t = 1;
vertices[2].s = 1;
vertices[2].t = 1;
- vertices[3].s = 0;
- vertices[3].t = 1;
-
- settings.filter = Image::getDefaultFilter();
+ vertices[3].s = 1;
+ vertices[3].t = 0;
getStrategy();
@@ -433,36 +435,103 @@ Canvas::~Canvas()
unloadVolatile();
}
-bool Canvas::isSupported()
+bool Canvas::loadVolatile()
{
- getStrategy();
- return (strategy != &strategyNone);
-}
+ fbo = depth_stencil = img = 0;
-bool Canvas::isHDRSupported()
-{
- return GLAD_VERSION_3_0 || (isSupported() && GLAD_ARB_texture_float);
-}
-
-bool Canvas::isMultiCanvasSupported()
-{
- if (!(isSupported() && (GLAD_VERSION_2_0 || GLAD_ES_VERSION_3_0 || GLAD_ARB_draw_buffers)))
- return false;
-
- if (maxFBOColorAttachments == 0 || maxDrawBuffers == 0)
+ // glTexImage2D is guaranteed to error in this case.
+ if (width > gl.getMaxTextureSize() || height > gl.getMaxTextureSize())
{
- glGetIntegerv(GL_MAX_COLOR_ATTACHMENTS, &maxFBOColorAttachments);
- glGetIntegerv(GL_MAX_DRAW_BUFFERS, &maxDrawBuffers);
+ status = GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
+ return false;
}
- // system must support at least 4 simultanious active canvases
- return maxFBOColorAttachments >= 4 && maxDrawBuffers >= 4;
+ status = strategy->createFBO(fbo, img, width, height, texture_type);
+ if (status != GL_FRAMEBUFFER_COMPLETE)
+ return false;
+
+ setFilter(filter);
+ setWrap(wrap);
+ clear(Color(0, 0, 0, 0));
+ return true;
}
-void Canvas::bindDefaultCanvas()
+void Canvas::unloadVolatile()
{
- if (current != NULL)
- current->stopGrab();
+ strategy->deleteFBO(fbo, depth_stencil, img);
+ fbo = depth_stencil = img = 0;
+
+ for (size_t i = 0; i < attachedCanvases.size(); i++)
+ attachedCanvases[i]->release();
+
+ attachedCanvases.clear();
+}
+
+void Canvas::drawv(const Matrix &t, const Vertex *v) const
+{
+ gl.matrices.transform.push(gl.matrices.transform.top());
+ gl.matrices.transform.top() *= t;
+
+ gl.prepareDraw();
+
+ predraw();
+
+ gl.enableVertexAttribArray(OpenGL::ATTRIB_POS);
+ gl.enableVertexAttribArray(OpenGL::ATTRIB_TEXCOORD);
+
+ gl.setVertexAttribArray(OpenGL::ATTRIB_POS, 2, GL_FLOAT, sizeof(Vertex), (GLvoid *) &v[0].x);
+ gl.setVertexAttribArray(OpenGL::ATTRIB_TEXCOORD, 2, GL_FLOAT, sizeof(Vertex), (GLvoid *) &v[0].s);
+
+ glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
+
+ gl.disableVertexAttribArray(OpenGL::ATTRIB_POS);
+ gl.disableVertexAttribArray(OpenGL::ATTRIB_TEXCOORD);
+
+ postdraw();
+
+ gl.matrices.transform.pop();
+
+}
+
+void Canvas::draw(float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) const
+{
+ static Matrix t;
+ t.setTransformation(x, y, angle, sx, sy, ox, oy, kx, ky);
+
+ drawv(t, vertices);
+}
+
+void Canvas::drawq(Quad *quad, float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) const
+{
+ static Matrix t;
+ t.setTransformation(x, y, angle, sx, sy, ox, oy, kx, ky);
+
+ const Vertex *v = quad->getVertices();
+ drawv(t, v);
+}
+
+void Canvas::setFilter(const Texture::Filter &f)
+{
+ filter = f;
+ gl.bindTexture(img);
+ gl.setTextureFilter(filter);
+}
+
+void Canvas::setWrap(const Texture::Wrap &w)
+{
+ wrap = w;
+ gl.bindTexture(img);
+ gl.setTextureWrap(wrap);
+}
+
+GLuint Canvas::getGLTexture() const
+{
+ return img;
+}
+
+void Canvas::predraw() const
+{
+ gl.bindTexture(img);
}
void Canvas::setupGrab()
@@ -476,12 +545,12 @@ void Canvas::setupGrab()
current->stopGrab();
// bind the framebuffer object.
- glPushAttrib(GL_VIEWPORT_BIT | GL_TRANSFORM_BIT);
+ systemViewport = gl.getViewport();
strategy->bindFBO(fbo);
gl.setViewport(OpenGL::Viewport(0, 0, width, height));
// Set up orthographic view (no depth)
- gl.matrices.projection.push(Matrix::ortho(0.0, width, height, 0.0));
+ gl.matrices.projection.push(Matrix::ortho(0.0, width, 0.0, height));
// indicate we are using this fbo
current = this;
@@ -555,11 +624,20 @@ void Canvas::stopGrab()
if (current != this)
return;
+ if (depth_stencil != 0 && GLAD_EXT_discard_framebuffer)
+ {
+ // Hint for the driver that it doesn't need to save these buffers.
+ GLenum attachments[] = {GL_STENCIL_ATTACHMENT, GL_DEPTH_ATTACHMENT};
+ glDiscardFramebufferEXT(GL_FRAMEBUFFER, 2, attachments);
+ }
+
// bind default
strategy->bindFBO(gl.getDefaultFBO());
gl.matrices.projection.pop();
- glPopAttrib();
- current = NULL;
+
+ current = nullptr;
+
+ gl.setViewport(systemViewport);
}
void Canvas::clear(Color c)
@@ -571,7 +649,7 @@ void Canvas::clear(Color c)
if (current != this)
{
- if (current != NULL)
+ if (current != nullptr)
previous = current->fbo;
strategy->bindFBO(fbo);
@@ -614,30 +692,6 @@ void Canvas::clear(Color c)
strategy->bindFBO(previous);
}
-void Canvas::draw(float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) const
-{
- static Matrix t;
- t.setTransformation(x, y, angle, sx, sy, ox, oy, kx, ky);
-
- drawv(t, vertices);
-}
-
-void Canvas::drawq(Quad *quad, float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) const
-{
- static Matrix t;
- t.setTransformation(x, y, angle, sx, sy, ox, oy, kx, ky);
-
- const Vertex *v = quad->getVertices();
-
- // flip texture coordinates vertically.
- Vertex w[4];
- memcpy(w, v, sizeof(Vertex) * 4);
- for (size_t i = 0; i < 4; i++)
- w[i].t = 1.0f - w[i].t;
-
- drawv(t, w);
-}
-
bool Canvas::checkCreateStencil()
{
// Do nothing if we've already created the stencil buffer.
@@ -662,7 +716,6 @@ love::image::ImageData *Canvas::getImageData(love::image::Image *image)
int row = 4 * width;
int size = row * height;
GLubyte *pixels = new GLubyte[size];
- GLubyte *flipped = new GLubyte[size];
strategy->bindFBO(fbo);
glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
@@ -671,15 +724,8 @@ love::image::ImageData *Canvas::getImageData(love::image::Image *image)
else
strategy->bindFBO(gl.getDefaultFBO());
- GLubyte *src = pixels, *dst = flipped + size - row;
- for (int i = 0; i < height; ++i, dst -= row, src += row)
- memcpy(dst, src, row);
-
- love::image::ImageData *img = image->newImageData(width, height, (void *)flipped, true);
-
- // The new ImageData now owns the flipped data, so we don't delete it here.
- delete[] pixels;
-
+ // The new ImageData now owns the pixel data, so we don't delete it here.
+ love::image::ImageData *img = image->newImageData(width, height, (void *)pixels, true);
return img;
}
@@ -696,99 +742,36 @@ void Canvas::getPixel(unsigned char* pixel_rgba, int x, int y)
strategy->bindFBO(gl.getDefaultFBO());
}
-const std::vector