diff --git a/deps/glfw/src/glfw3Config.cmake b/deps/glfw/src/glfw3Config.cmake new file mode 100644 index 000000000..f41a722a2 --- /dev/null +++ b/deps/glfw/src/glfw3Config.cmake @@ -0,0 +1,29 @@ +# - Config file for the glfw3 package +# It defines the following variables +# GLFW3_INCLUDE_DIR, the path where GLFW headers are located +# GLFW3_LIBRARY_DIR, folder in which the GLFW library is located +# GLFW3_LIBRARY, library to link against to use GLFW + +set(GLFW3_VERSION "3.1.2") + + +####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() ####### +####### Any changes to this file will be overwritten by the next CMake run #### +####### The input file was glfw3Config.cmake.in ######## + +get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE) + +macro(set_and_check _var _file) + set(${_var} "${_file}") + if(NOT EXISTS "${_file}") + message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !") + endif() +endmacro() + +#################################################################################### + +set_and_check(GLFW3_INCLUDE_DIR "${PACKAGE_PREFIX_DIR}/include") +set_and_check(GLFW3_LIBRARY_DIR "${PACKAGE_PREFIX_DIR}/lib") + +find_library(GLFW3_LIBRARY "glfw3" HINTS ${GLFW3_LIBRARY_DIR}) + diff --git a/deps/glfw/src/glfw3ConfigVersion.cmake b/deps/glfw/src/glfw3ConfigVersion.cmake new file mode 100644 index 000000000..c949894dd --- /dev/null +++ b/deps/glfw/src/glfw3ConfigVersion.cmake @@ -0,0 +1,51 @@ +# This is a basic version file for the Config-mode of find_package(). +# It is used by write_basic_package_version_file() as input file for configure_file() +# to create a version-file which can be installed along a config.cmake file. +# +# The created file sets PACKAGE_VERSION_EXACT if the current version string and +# the requested version string are exactly the same and it sets +# PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version, +# but only if the requested major version is the same as the current one. +# The variable CVF_VERSION must be set before calling configure_file(). + + +set(PACKAGE_VERSION "3.1.2") + +if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) + set(PACKAGE_VERSION_COMPATIBLE FALSE) +else() + + if("3.1.2" MATCHES "^([0-9]+)\\.") + set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}") + else() + set(CVF_VERSION_MAJOR "3.1.2") + endif() + + if(PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR) + set(PACKAGE_VERSION_COMPATIBLE TRUE) + else() + set(PACKAGE_VERSION_COMPATIBLE FALSE) + endif() + + if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) + set(PACKAGE_VERSION_EXACT TRUE) + endif() +endif() + + +# if the installed project requested no architecture check, don't perform the check +if("FALSE") + return() +endif() + +# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: +if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "") + return() +endif() + +# check that the installed version has the same 32/64bit-ness as the one which is currently searching: +if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8") + math(EXPR installedBits "8 * 8") + set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") + set(PACKAGE_VERSION_UNSUITABLE TRUE) +endif() diff --git a/deps/glfw/src/glfw_config.h b/deps/glfw/src/glfw_config.h new file mode 100644 index 000000000..fc58e1781 --- /dev/null +++ b/deps/glfw/src/glfw_config.h @@ -0,0 +1,81 @@ +//======================================================================== +// GLFW 3.1 - www.glfw.org +//------------------------------------------------------------------------ +// Copyright (c) 2010 Camilla Berglund +// +// 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. +// +//======================================================================== +// As glfw_config.h.in, this file is used by CMake to produce the +// glfw_config.h configuration header file. If you are adding a feature +// requiring conditional compilation, this is where to add the macro. +//======================================================================== +// As glfw_config.h, this file defines compile-time option macros for a +// specific platform and development environment. If you are using the +// GLFW CMake files, modify glfw_config.h.in instead of this file. If you +// are using your own build system, make this file define the appropriate +// macros in whatever way is suitable. +//======================================================================== + +// Define this to 1 if building GLFW for X11 +/* #undef _GLFW_X11 */ +// Define this to 1 if building GLFW for Win32 +/* #undef _GLFW_WIN32 */ +// Define this to 1 if building GLFW for Cocoa +#define _GLFW_COCOA +// Define this to 1 if building GLFW for Wayland +/* #undef _GLFW_WAYLAND */ +// Define this to 1 if building GLFW for Mir +/* #undef _GLFW_MIR */ + +// Define this to 1 if building GLFW for EGL +/* #undef _GLFW_EGL */ +// Define this to 1 if building GLFW for GLX +/* #undef _GLFW_GLX */ +// Define this to 1 if building GLFW for WGL +/* #undef _GLFW_WGL */ +// Define this to 1 if building GLFW for NSGL +#define _GLFW_NSGL + +// Define this to 1 if building as a shared library / dynamic library / DLL +/* #undef _GLFW_BUILD_DLL */ + +// Define this to 1 to force use of high-performance GPU on hybrid systems +/* #undef _GLFW_USE_HYBRID_HPG */ + +// Define this to 1 if the XInput X11 extension is available +/* #undef _GLFW_HAS_XINPUT */ +// Define this to 1 if the Xxf86vm X11 extension is available +/* #undef _GLFW_HAS_XF86VM */ + +// Define this to 1 if glfwInit should change the current directory +#define _GLFW_USE_CHDIR +// Define this to 1 if glfwCreateWindow should populate the menu bar +#define _GLFW_USE_MENUBAR +// Define this to 1 if windows should use full resolution on Retina displays +#define _GLFW_USE_RETINA + +// Define this to 1 if using OpenGL as the client library +#define _GLFW_USE_OPENGL +// Define this to 1 if using OpenGL ES 1.1 as the client library +/* #undef _GLFW_USE_GLESV1 */ +// Define this to 1 if using OpenGL ES 2.0 as the client library +/* #undef _GLFW_USE_GLESV2 */ + diff --git a/deps/glfw/tests/cursor b/deps/glfw/tests/cursor new file mode 100755 index 000000000..6d74f480c Binary files /dev/null and b/deps/glfw/tests/cursor differ diff --git a/deps/glfw/tests/monitors b/deps/glfw/tests/monitors new file mode 100755 index 000000000..846f28188 Binary files /dev/null and b/deps/glfw/tests/monitors differ diff --git a/deps/glfw/tests/msaa b/deps/glfw/tests/msaa new file mode 100755 index 000000000..4f9b87885 Binary files /dev/null and b/deps/glfw/tests/msaa differ diff --git a/src/item.c b/src/item.c index 907c4c30b..f9852b545 100644 --- a/src/item.c +++ b/src/item.c @@ -56,7 +56,8 @@ const int items[] = { COLOR_28, COLOR_29, COLOR_30, - COLOR_31 + COLOR_31, + LANTERN, }; const int item_count = sizeof(items) / sizeof(int); @@ -127,6 +128,7 @@ const int blocks[256][6] = { {205, 205, 205, 205, 205, 205}, // 61 {206, 206, 206, 206, 206, 206}, // 62 {207, 207, 207, 207, 207, 207}, // 63 + {15, 15, 15, 15, 15, 15}, // 64 -- bright white }; const int plants[256] = { @@ -197,3 +199,12 @@ int is_destructable(int w) { return 1; } } + +int is_lantern(int w) { + switch (w) { + case LANTERN: + return 10; + default: + return 0; + } +} \ No newline at end of file diff --git a/src/item.h b/src/item.h index ed801cf15..a626a3d2d 100644 --- a/src/item.h +++ b/src/item.h @@ -57,6 +57,7 @@ #define COLOR_29 61 #define COLOR_30 62 #define COLOR_31 63 +#define LANTERN 64 extern const int items[]; extern const int item_count; @@ -67,5 +68,6 @@ int is_plant(int w); int is_obstacle(int w); int is_transparent(int w); int is_destructable(int w); +int is_lantern(int w); #endif diff --git a/src/main.c b/src/main.c index a0b622861..52cdda76a 100644 --- a/src/main.c +++ b/src/main.c @@ -1573,6 +1573,9 @@ void set_block(int x, int y, int z, int w) { } } client_block(x, y, z, w); + if (is_lantern(w)) { + set_light(p, q, x, y,z, is_lantern(w)); + } } void record_block(int x, int y, int z, int w) {