From 2b56261e73342a752f54b80a684b25fdb6acdac3 Mon Sep 17 00:00:00 2001 From: mrq Date: Wed, 4 Nov 2020 00:00:00 -0600 Subject: [PATCH] Commit for 2020.11.04.7z --- Makefile | 169 +- bin/data/shaders/display.subpass.frag.glsl | 85 +- .../shaders/display.subpass.stereo.frag.glsl | 14 +- bin/data/shaders/gltf.stereo.vert.glsl | 15 +- bin/data/shaders/mcdonalds.frag.glsl | 7 +- client/client/ext.cpp | 7 +- debug.sh | 6 +- engine/inc/sol/config.hpp | 53 + engine/inc/sol/forward.hpp | 828 + engine/inc/sol/sol.hpp | 26674 ++++++++++++++++ engine/inc/uf/engine/behavior/behavior.h | 8 - engine/inc/uf/engine/entity/entity.inl | 4 +- engine/inc/uf/engine/object/behaviors/lua.h | 16 + engine/inc/uf/ext/lua/lua.h | 31 + engine/inc/uf/ext/lua/lua.inl | 14 + engine/inc/uf/ext/vulkan/rendermode.h | 2 +- .../multiview_stereoscopic_deferred.h | 20 + engine/inc/uf/ext/vulkan/rendertarget.h | 1 + engine/inc/uf/ext/vulkan/vulkan.h | 5 + engine/inc/uf/spec/renderer/vulkan.h | 1 + .../inc/uf/utils/math/collision/boundingbox.h | 2 +- engine/inc/uf/utils/math/collision/gjk.h | 2 +- engine/inc/uf/utils/math/collision/sphere.h | 2 +- engine/inc/uf/utils/math/vector/pod.inl | 2 + .../inc/uf/utils/math/vector/redundancy.inl | 24 +- engine/inc/uf/utils/renderer/vulkan.h | 1 + engine/inc/uf/utils/string/io.h | 1 + .../win64/{ => clang}/discord_game_sdk.bundle | Bin .../lib/win64/{ => clang}/openvr_api.dll.sig | Bin engine/lib/win64/{ => clang}/openvr_api.pdb | Bin engine/lib/win64/gcc/discord_game_sdk.bundle | Bin 0 -> 4469284 bytes engine/lib/win64/gcc/openvr_api.dll.sig | Bin 0 -> 1450 bytes engine/lib/win64/gcc/openvr_api.pdb | Bin 0 -> 10866688 bytes .../lib/win64/gcc10/discord_game_sdk.bundle | Bin 0 -> 4469284 bytes engine/lib/win64/gcc10/openvr_api.dll.sig | Bin 0 -> 1450 bytes engine/lib/win64/gcc10/openvr_api.pdb | Bin 0 -> 10866688 bytes engine/src/engine/asset/asset.cpp | 69 +- engine/src/engine/object/behavior.cpp | 2 +- engine/src/engine/object/behaviors/lua.cpp | 46 + engine/src/engine/object/object.cpp | 45 +- engine/src/ext/lua/lua.cpp | 244 + engine/src/ext/vulkan/graphic.cpp | 46 +- engine/src/ext/vulkan/rendermode.cpp | 2 - engine/src/ext/vulkan/rendermodes/base.cpp | 13 +- .../src/ext/vulkan/rendermodes/deferred.cpp | 243 +- .../multiview_stereoscopic_deferred.cpp | 366 + .../ext/vulkan/rendermodes/rendertarget.cpp | 23 +- .../rendermodes/stereoscopic_deferred.cpp | 38 +- engine/src/ext/vulkan/rendertarget.cpp | 30 +- engine/src/ext/vulkan/vulkan.cpp | 5 + engine/src/spec/window/windows.cpp | 2 +- engine/src/utils/component/component.cpp | 3 +- engine/src/utils/image/image.cpp | 1 + engine/src/utils/serialize/serializable.cpp | 2 +- engine/src/utils/string/io.cpp | 16 + ext/behaviors/scene/behavior.cpp | 9 +- ext/behaviors/staticemitter/behavior.cpp | 14 +- ext/gui/behavior.cpp | 2 +- ext/main.cpp | 59 +- ext/scenes/worldscape/terrain/behavior.cpp | 2 +- ext/scenes/worldscape/terrain/generator.cpp | 2 +- makefiles/win64.clang.make | 4 + makefiles/win64.gcc.make | 4 + makefiles/win64.gcc10.make | 4 + 64 files changed, 28965 insertions(+), 325 deletions(-) create mode 100644 engine/inc/sol/config.hpp create mode 100644 engine/inc/sol/forward.hpp create mode 100644 engine/inc/sol/sol.hpp create mode 100644 engine/inc/uf/engine/object/behaviors/lua.h create mode 100644 engine/inc/uf/ext/lua/lua.h create mode 100644 engine/inc/uf/ext/lua/lua.inl create mode 100644 engine/inc/uf/ext/vulkan/rendermodes/multiview_stereoscopic_deferred.h rename engine/lib/win64/{ => clang}/discord_game_sdk.bundle (100%) rename engine/lib/win64/{ => clang}/openvr_api.dll.sig (100%) rename engine/lib/win64/{ => clang}/openvr_api.pdb (100%) create mode 100644 engine/lib/win64/gcc/discord_game_sdk.bundle create mode 100644 engine/lib/win64/gcc/openvr_api.dll.sig create mode 100644 engine/lib/win64/gcc/openvr_api.pdb create mode 100644 engine/lib/win64/gcc10/discord_game_sdk.bundle create mode 100644 engine/lib/win64/gcc10/openvr_api.dll.sig create mode 100644 engine/lib/win64/gcc10/openvr_api.pdb create mode 100644 engine/src/engine/object/behaviors/lua.cpp create mode 100644 engine/src/ext/lua/lua.cpp create mode 100644 engine/src/ext/vulkan/rendermodes/multiview_stereoscopic_deferred.cpp create mode 100644 makefiles/win64.clang.make create mode 100644 makefiles/win64.gcc.make create mode 100644 makefiles/win64.gcc10.make diff --git a/Makefile b/Makefile index f3236628..36d02a70 100644 --- a/Makefile +++ b/Makefile @@ -1,117 +1,112 @@ - .PHONY: win64 +DEFAULT_PREFIX = gcc +include makefiles/win64.$(DEFAULT_PREFIX).make -TARGET_NAME = program -BIN_DIR = ./bin + .PHONY: $(ARCH)-$(PREFIX) -ENGINE_SRC_DIR = ./engine/src -ENGINE_INC_DIR = ./engine/inc -ENGINE_LIB_DIR = ./engine/lib +TARGET_NAME += program +BIN_DIR += ./bin -EXT_SRC_DIR = ./ext -CLIENT_SRC_DIR = ./client +ENGINE_SRC_DIR += ./engine/src +ENGINE_INC_DIR += ./engine/inc +ENGINE_LIB_DIR += ./engine/lib -UF_LIBS = -# EXT_LIBS = -lpng16 -lz -lsfml-main -lsfml-system -lsfml-window -lsfml-graphics -# EXT_LIBS = -lpng16 -lz -lassimp -lsfml-main -lsfml-system -lsfml-window -lsfml-graphics -llua52 -# EXT_LIBS = -lpng16 -lz -lassimp -ljsoncpp -lopenal32 -lalut -lvorbis -lvorbisfile -logg -lfreetype -EXT_LIBS = -#FLAGS = -std=c++0x -Wall -g -DUF_USE_JSON -DUF_USE_NCURSES -DUF_USE_OPENGL -DUF_USE_GLEW -DUF_USE_DISCORD -FLAGS = -fdiagnostics-color=always -Og -std=c++17 -g -DVK_USE_PLATFORM_WIN32_KHR -DUF_USE_VULKAN -DGLM_ENABLE_EXPERIMENTAL -DUF_USE_JSON -DUF_USE_NCURSES -DUF_USE_OPENAL -DUF_USE_VORBIS -DUF_USE_FREETYPE -DUSE_OPENVR_MINGW -#-march=native -LIB_NAME = uf -EXT_LIB_NAME = ext +EXT_SRC_DIR += ./ext +CLIENT_SRC_DIR += ./client +UF_LIBS += +EXT_LIBS += +FLAGS += -std=c++17 -DVK_USE_PLATFORM_WIN32_KHR -DUF_USE_VULKAN -DGLM_ENABLE_EXPERIMENTAL -DUF_USE_JSON -DUF_USE_NCURSES -DUF_USE_OPENAL -DUF_USE_VORBIS -DUF_USE_FREETYPE -DUSE_OPENVR_MINGW +LIB_NAME += uf +EXT_LIB_NAME += ext -#VULKAN_WIN64_SDK_PATH = /c/VulkanSDK/1.1.101.0/ -#VULKAN_WIN64_SDK_PATH = /c/VulkanSDK/1.1.108.0/ -#VULKAN_WIN64_SDK_PATH = /c/VulkanSDK/1.1.114.0/ -VULKAN_WIN64_SDK_PATH = /c/VulkanSDK/1.2.141.2/ -#VULKAN_WIN64_SDK_PATH = /c/VulkanSDK/1.2.154.0/ -WIN64_CC = /opt/mingw-w64/x86_64-7.2.0-posix-seh-rt_v5-rev1/mingw64/bin/g++ -WIN64_GLSL_VALIDATOR = $(VULKAN_WIN64_SDK_PATH)/Bin32/glslangValidator +#VULKAN_SDK_PATH += /c/VulkanSDK/1.1.101.0/ +#VULKAN_SDK_PATH += /c/VulkanSDK/1.1.108.0/ +#VULKAN_SDK_PATH += /c/VulkanSDK/1.1.114.0/ +VULKAN_SDK_PATH += /c/VulkanSDK/1.2.141.2/ +#VULKAN_SDK_PATH += /c/VulkanSDK/1.2.154.0/ +GLSL_VALIDATOR += $(VULKAN_SDK_PATH)/Bin32/glslangValidator # Base Engine's DLL -WIN64_INC_DIR = $(ENGINE_INC_DIR)/win64 -WIN64_LB_FLAGS = $(ENGINE_LIB_DIR)/win64 -WIN64_DEPS = -lgdi32 -lvulkan -lspirv-cross -lpng -lz -ljsoncpp -lopenal -lalut -lvorbis -lvorbisfile -logg -lfreetype -lncursesw -lcurl -ldiscord_game_sdk -lopenvr_api -#WIN64_DEPS = -lvulkan -lncursesw -WIN64_LINKS = $(UF_LIBS) $(EXT_LIBS) $(WIN64_DEPS) -WIN64_FLAGS = $(FLAGS) +INC_DIR += $(ENGINE_INC_DIR)/$(ARCH)/$(PREFIX) +LB_FLAGS += $(ENGINE_LIB_DIR)/$(ARCH)/$(PREFIX) +DEPS += -lgdi32 -lvulkan -lspirv-cross -lpng -lz -ljsoncpp -lopenal -lalut -lvorbis -lvorbisfile -logg -lfreetype -lncursesw -lcurl -ldiscord_game_sdk -lopenvr_api -lluajit-5.1 +#DEPS += -lvulkan -lncursesw +LINKS += $(UF_LIBS) $(EXT_LIBS) $(DEPS) #-Wl,-subsystem,windows -WIN64_LIB_DIR = $(ENGINE_LIB_DIR)/win64/ -WIN64_INCS = -I$(ENGINE_INC_DIR) -I$(WIN64_INC_DIR) -I$(VULKAN_WIN64_SDK_PATH)/include -I/mingw64/include -WIN64_LIBS = -L$(ENGINE_LIB_DIR) -L$(WIN64_LIB_DIR) -L$(VULKAN_WIN64_SDK_PATH)/Lib -L/mingw64/lib +LIB_DIR += $(ENGINE_LIB_DIR)/$(ARCH)/$(PREFIX) +INCS += -I$(ENGINE_INC_DIR) -I$(INC_DIR) -I$(VULKAN_SDK_PATH)/include -I/mingw64/include -I/mingw64/include/luajit-2.1 +LIBS += -L$(ENGINE_LIB_DIR) -L$(LIB_DIR) -L$(VULKAN_SDK_PATH)/Lib -L/mingw64/lib -SRCS_WIN64_DLL = $(wildcard $(ENGINE_SRC_DIR)/*.cpp) $(wildcard $(ENGINE_SRC_DIR)/*/*.cpp) $(wildcard $(ENGINE_SRC_DIR)/*/*/*.cpp) $(wildcard $(ENGINE_SRC_DIR)/*/*/*/*.cpp) $(wildcard $(ENGINE_SRC_DIR)/*/*/*/*/*.cpp) -OBJS_WIN64_DLL = $(patsubst %.cpp,%.win64.o,$(SRCS_WIN64_DLL)) -BASE_WIN64_DLL = lib$(LIB_NAME) -IM_WIN64_DLL = $(ENGINE_LIB_DIR)/win64/$(BASE_WIN64_DLL).dll.a -EX_WIN64_DLL = $(BIN_DIR)/lib/win64/$(BASE_WIN64_DLL).dll +SRCS_DLL += $(wildcard $(ENGINE_SRC_DIR)/*.cpp) $(wildcard $(ENGINE_SRC_DIR)/*/*.cpp) $(wildcard $(ENGINE_SRC_DIR)/*/*/*.cpp) $(wildcard $(ENGINE_SRC_DIR)/*/*/*/*.cpp) $(wildcard $(ENGINE_SRC_DIR)/*/*/*/*/*.cpp) +OBJS_DLL += $(patsubst %.cpp,%.$(ARCH).$(PREFIX).o,$(SRCS_DLL)) +BASE_DLL += lib$(LIB_NAME) +IM_DLL += $(ENGINE_LIB_DIR)/$(ARCH)/$(PREFIX)/$(BASE_DLL).dll.a +EX_DLL += $(BIN_DIR)/lib/$(ARCH)/$(PREFIX)/$(BASE_DLL).dll # External Engine's DLL -EXT_WIN64_INC_DIR = $(WIN64_INC_DIR) -EXT_WIN64_LB_FLAGS = $(WIN64_LIB_DIR) -EXT_WIN64_DEPS = -l$(LIB_NAME) $(WIN64_DEPS) -EXT_WIN64_LINKS = $(UF_LIBS) $(EXT_LIBS) $(EXT_WIN64_DEPS) -EXT_WIN64_FLAGS = $(FLAGS) +EXT_INC_DIR += $(INC_DIR) +EXT_LB_FLAGS += $(LIB_DIR) +EXT_DEPS += -l$(LIB_NAME) $(DEPS) +EXT_LINKS += $(UF_LIBS) $(EXT_LIBS) $(EXT_DEPS) +EXT_FLAGS += $(FLAGS) #-Wl,-subsystem,windows -EXT_WIN64_LIB_DIR = $(ENGINE_LIB_DIR)/win64/ -EXT_WIN64_INCS = -I$(ENGINE_INC_DIR) -I$(EXT_WIN64_INC_DIR) -I$(VULKAN_WIN64_SDK_PATH)/include -I/mingw64/include -EXT_WIN64_LIBS = -L$(ENGINE_LIB_DIR) -L$(EXT_WIN64_LIB_DIR) -L$(VULKAN_WIN64_SDK_PATH)/Lib -L/mingw64/lib +EXT_LIB_DIR += $(ENGINE_LIB_DIR)/$(ARCH)/$(PREFIX)/ +EXT_INCS += -I$(ENGINE_INC_DIR) -I$(EXT_INC_DIR) -I$(VULKAN_SDK_PATH)/include -I/mingw64/include +EXT_LIBS += -L$(ENGINE_LIB_DIR) -L$(EXT_LIB_DIR) -L$(VULKAN_SDK_PATH)/Lib -L/mingw64/lib -SRCS_EXT_WIN64_DLL = $(wildcard $(EXT_SRC_DIR)/*.cpp) $(wildcard $(EXT_SRC_DIR)/*/*.cpp) $(wildcard $(EXT_SRC_DIR)/*/*/*.cpp) $(wildcard $(EXT_SRC_DIR)/*/*/*/*.cpp) $(wildcard $(EXT_SRC_DIR)/*/*/*/*/*.cpp) -OBJS_EXT_WIN64_DLL = $(patsubst %.cpp,%.win64.o,$(SRCS_EXT_WIN64_DLL)) -BASE_EXT_WIN64_DLL = lib$(EXT_LIB_NAME) -EXT_IM_WIN64_DLL = $(ENGINE_LIB_DIR)/win64/$(BASE_EXT_WIN64_DLL).dll.a -EXT_EX_WIN64_DLL = $(BIN_DIR)/lib/win64/$(BASE_EXT_WIN64_DLL).dll +SRCS_EXT_DLL += $(wildcard $(EXT_SRC_DIR)/*.cpp) $(wildcard $(EXT_SRC_DIR)/*/*.cpp) $(wildcard $(EXT_SRC_DIR)/*/*/*.cpp) $(wildcard $(EXT_SRC_DIR)/*/*/*/*.cpp) $(wildcard $(EXT_SRC_DIR)/*/*/*/*/*.cpp) +OBJS_EXT_DLL += $(patsubst %.cpp,%.$(ARCH).$(PREFIX).o,$(SRCS_EXT_DLL)) +BASE_EXT_DLL += lib$(EXT_LIB_NAME) +EXT_IM_DLL += $(ENGINE_LIB_DIR)/$(ARCH)/$(PREFIX)/$(BASE_EXT_DLL).dll.a +EXT_EX_DLL += $(BIN_DIR)/lib/$(ARCH)/$(PREFIX)/$(BASE_EXT_DLL).dll # Client EXE -SRCS_WIN64 = $(wildcard $(CLIENT_SRC_DIR)/*.cpp) $(wildcard $(CLIENT_SRC_DIR)/*/*.cpp) -OBJS_WIN64 = $(patsubst %.cpp,%.win64.o,$(SRCS_WIN64)) -TARGET_WIN64 = $(BIN_DIR)/$(TARGET_NAME).exe +SRCS += $(wildcard $(CLIENT_SRC_DIR)/*.cpp) $(wildcard $(CLIENT_SRC_DIR)/*/*.cpp) +OBJS += $(patsubst %.cpp,%.$(ARCH).$(PREFIX).o,$(SRCS)) +TARGET += $(BIN_DIR)/$(TARGET_NAME).$(PREFIX).exe # Shaders -SRCS_SHADERS = $(wildcard bin/data/shaders/*.glsl) -TARGET_SHADERS = $(patsubst %.glsl,%.spv,$(SRCS_SHADERS)) +SRCS_SHADERS += $(wildcard bin/data/shaders/*.glsl) +TARGET_SHADERS += $(patsubst %.glsl,%.spv,$(SRCS_SHADERS)) -win64: $(EX_WIN64_DLL) $(EXT_EX_WIN64_DLL) $(TARGET_WIN64) $(TARGET_SHADERS) +$(ARCH): $(EX_DLL) $(EXT_EX_DLL) $(TARGET) $(TARGET_SHADERS) rm-exe64: - -rm $(EX_WIN64_DLL) - -rm $(EXT_EX_WIN64_DLL) - -rm $(TARGET_WIN64) + -rm $(EX_DLL) + -rm $(EXT_EX_DLL) + -rm $(TARGET) -rm $(TARGET_SHADERS) -%.win64.o: %.cpp - $(WIN64_CC) $(WIN64_FLAGS) $(WIN64_INCS) -c $< -o $@ +%.$(ARCH).$(PREFIX).o: %.cpp + $(CC) $(FLAGS) $(INCS) -c $< -o $@ -$(EX_WIN64_DLL): WIN64_FLAGS += -DUF_EXPORTS -$(EX_WIN64_DLL): $(OBJS_WIN64_DLL) - $(WIN64_CC) -shared -o $(EX_WIN64_DLL) -g -Wl,--out-implib=$(IM_WIN64_DLL) $(OBJS_WIN64_DLL) $(WIN64_LIBS) $(WIN64_INCS) $(WIN64_LINKS) - cp $(ENGINE_LIB_DIR)/win64/$(BASE_WIN64_DLL).dll.a $(ENGINE_LIB_DIR)/win64/$(BASE_WIN64_DLL).a +$(EX_DLL): FLAGS += -DUF_EXPORTS +$(EX_DLL): $(OBJS_DLL) + $(CC) -shared -o $(EX_DLL) -g -Wl,--out-implib=$(IM_DLL) $(OBJS_DLL) $(LIBS) $(INCS) $(LINKS) + cp $(ENGINE_LIB_DIR)/$(ARCH)/$(PREFIX)/$(BASE_DLL).dll.a $(ENGINE_LIB_DIR)/$(ARCH)/$(PREFIX)/$(BASE_DLL).a -$(EXT_EX_WIN64_DLL): WIN64_FLAGS += -DEXT_EXPORTS -$(EXT_EX_WIN64_DLL): $(OBJS_EXT_WIN64_DLL) - $(WIN64_CC) -shared -o $(EXT_EX_WIN64_DLL) -g -Wl,--out-implib=$(EXT_IM_WIN64_DLL) $(OBJS_EXT_WIN64_DLL) $(EXT_WIN64_LIBS) $(EXT_WIN64_INCS) $(EXT_WIN64_LINKS) - cp $(ENGINE_LIB_DIR)/win64/$(BASE_EXT_WIN64_DLL).dll.a $(ENGINE_LIB_DIR)/win64/$(BASE_EXT_WIN64_DLL).a +$(EXT_EX_DLL): FLAGS += -DEXT_EXPORTS +$(EXT_EX_DLL): $(OBJS_EXT_DLL) + $(CC) -shared -o $(EXT_EX_DLL) -g -Wl,--out-implib=$(EXT_IM_DLL) $(OBJS_EXT_DLL) $(EXT_LIBS) $(EXT_INCS) $(EXT_LINKS) + cp $(ENGINE_LIB_DIR)/$(ARCH)/$(PREFIX)/$(BASE_EXT_DLL).dll.a $(ENGINE_LIB_DIR)/$(ARCH)/$(PREFIX)/$(BASE_EXT_DLL).a -$(TARGET_WIN64): $(OBJS_WIN64) - $(WIN64_CC) $(WIN64_FLAGS) $(OBJS_WIN64) $(WIN64_LIBS) $(WIN64_INCS) $(WIN64_LINKS) -l$(LIB_NAME) -l$(EXT_LIB_NAME) -o $(TARGET_WIN64) +$(TARGET): $(OBJS) + $(CC) $(FLAGS) $(OBJS) $(LIBS) $(INCS) $(LINKS) -l$(LIB_NAME) -l$(EXT_LIB_NAME) -o $(TARGET) %.spv: %.glsl - $(WIN64_GLSL_VALIDATOR) -V $< -o $@ + $(GLSL_VALIDATOR) -V $< -o $@ -clean-win64: - @-rm $(EX_WIN64_DLL) - @-rm $(EXT_EX_WIN64_DLL) - @-rm $(TARGET_WIN64) +clean-$(ARCH): + @-rm $(EX_DLL) + @-rm $(EXT_EX_DLL) + @-rm $(TARGET) - @-rm -f $(OBJS_WIN64_DLL) - @-rm -f $(OBJS_EXT_WIN64_DLL) - @-rm -f $(OBJS_WIN64) + @-rm -f $(OBJS_DLL) + @-rm -f $(OBJS_EXT_DLL) + @-rm -f $(OBJS) -clean-uf-win64: - @-rm $(EX_WIN64_DLL) - @-rm -f $(OBJS_WIN64_DLL) +clean-uf-$(ARCH): + @-rm $(EX_DLL) + @-rm -f $(OBJS_DLL) -clean-ext-win64: - @-rm $(EXT_EX_WIN64_DLL) - @-rm -f $(OBJS_EXT_WIN64_DLL) \ No newline at end of file +clean-ext-$(ARCH): + @-rm $(EXT_EX_DLL) + @-rm -f $(OBJS_EXT_DLL) \ No newline at end of file diff --git a/bin/data/shaders/display.subpass.frag.glsl b/bin/data/shaders/display.subpass.frag.glsl index ab693a64..6987e52c 100644 --- a/bin/data/shaders/display.subpass.frag.glsl +++ b/bin/data/shaders/display.subpass.frag.glsl @@ -164,10 +164,12 @@ float shadowFactor( Light light, uint shadowMap ) { vec2 uv = positionClip.xy * 0.5 + 0.5; float bias = light.depthBias; - if ( false ) { + if ( !true ) { float cosTheta = clamp(dot(normal.eye, normalize(light.position.xyz - position.eye)), 0, 1); bias = clamp(bias * tan(acos(cosTheta)), 0, 0.01); - } + } else if ( true ) { + bias = max(bias * 10 * (1.0 - dot(normal.eye, normalize(light.position.xyz - position.eye))), bias); + } float eyeDepth = positionClip.z; int samples = poissonDisk.length(); @@ -212,9 +214,9 @@ float hueDistance(float h1, float h2) { float diff = abs((h1 - h2)); return min(abs((1.0 - diff)), diff); } -const float lightnessSteps = 4.0; +const float lightnessSteps = 16.0; float lightnessStep(float l) { - return floor((0.5 + l * lightnessSteps)) / lightnessSteps; + return floor((0.5 + l * lightnessSteps)) / lightnessSteps; } const int indexMatrix16x16[256] = int[](0,192, 48,240, 12,204, 60,252, 3,195, 51,243, 15,207, 63,255, 128, 64,176,112,140, 76,188,124,131, 67,179,115,143, 79,191,127, @@ -286,12 +288,13 @@ float dither(float color) { float closestColor = (color < 0.5) ? 0 : 1; float secondClosestColor = 1 - closestColor; float d = 1; // -0.5 - fract(ubo.mode.parameters.w / 8.0); + float scale = 1; if ( ubo.mode.scalar == 16 ) { - d = indexValue16x16(1); + d = indexValue16x16(scale); } else if ( ubo.mode.scalar == 8 ) { - d = indexValue8x8(1); + d = indexValue8x8(scale); } else if ( ubo.mode.scalar == 4 ) { - d = indexValue4x4(1); + d = indexValue4x4(scale); } float distance = abs(closestColor - color); return (distance < d) ? closestColor : secondClosestColor; @@ -314,21 +317,45 @@ void dither1(inout vec3 color) { } else if ( ubo.mode.scalar == 4 ) { d = indexValue4x4(scale); } - float hueDiff = hueDistance(hsl.x, cs[0].x) / hueDistance(cs[1].x, cs[0].x); - float l1 = lightnessStep(max((hsl.z - 0.125), 0.0)); - float l2 = lightnessStep(min((hsl.z + 0.124), 1.0)); - float lightnessDiff = (hsl.z - l1) / (l2 - l1); + float hueDiff = hueDistance(hsl.x, cs[0].x) / hueDistance(cs[1].x, cs[0].x); + float l1 = lightnessStep(max((hsl.z - 0.125), 0.0)); + float l2 = lightnessStep(min((hsl.z + 0.124), 1.0)); + float lightnessDiff = (hsl.z - l1) / (l2 - l1); - vec3 resultColor = (hueDiff < d) ? cs[0] : cs[1]; - resultColor.z = (lightnessDiff < d) ? l1 : l2; - color = hslToRgb(resultColor); + vec3 resultColor = (hueDiff < d) ? cs[0] : cs[1]; + resultColor.z = (lightnessDiff < d) ? l1 : l2; + color = hslToRgb(resultColor); +} +void dither2(inout vec3 color) { + vec3 hsl = rgbToHsl(color); + float d = 1; + float scale = 1; + if ( ubo.mode.scalar == 16 ) { + d = indexValue16x16(scale); + } else if ( ubo.mode.scalar == 8 ) { + d = indexValue8x8(scale); + } else if ( ubo.mode.scalar == 4 ) { + d = indexValue4x4(scale); + } + hsl.z *= d; +/* + float l1 = lightnessStep(max((hsl.z - 0.125), 0.0)); + float l2 = lightnessStep(min((hsl.z + 0.124), 1.0)); + float lightnessDiff = (hsl.z - l1) / (l2 - l1); + hsl.z = (lightnessDiff < d) ? l1 : l2; +*/ + color = hslToRgb(hsl); +} +vec3 dither3() { + vec3 vDither = dot( vec2( 171.0, 231.0 ), inUv.xy + ubo.mode.parameters.w ).xxx; + vDither.rgb = fract( vDither.rgb / vec3( 103.0, 71.0, 97.0 ) ) - vec3( 0.5, 0.5, 0.5 ); + return ( vDither.rgb / 255.0 ) * 0.375; } - float rand2(vec2 co){ - return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 143758.5453); + return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 143758.5453); } float rand3(vec3 co){ - return fract(sin(dot(co.xyz ,vec3(12.9898,78.233, 37.719))) * 143758.5453); + return fract(sin(dot(co.xyz ,vec3(12.9898,78.233, 37.719))) * 143758.5453); } void whitenoise(inout vec3 color) { float flicker = ubo.mode.parameters.x; @@ -345,27 +372,13 @@ void whitenoise(inout vec3 color) { void main() { vec4 albedoSpecular = subpassLoad(samplerAlbedo); vec3 fragColor = albedoSpecular.rgb * ubo.ambient.rgb; + normal.eye = subpassLoad(samplerNormal).rgb; -/* - position.eye = subpassLoad(samplerPosition).rgb; { - mat4 iView = inverse( ubo.matrices.view[inPushConstantPass] ); - vec4 positionWorld = iView * vec4(position.eye, 1); - position.world = positionWorld.xyz; - } -*/ { mat4 iProj = inverse( ubo.matrices.projection[inPushConstantPass] ); mat4 iView = inverse( ubo.matrices.view[inPushConstantPass] ); - float depth = subpassLoad(samplerDepth).r; - - if ( false ) { - depth /= 0.00526; - outFragColor.rgb = vec3( 1 - depth ); - outFragColor.a = 1; - return; - } - + float depth = subpassLoad(samplerDepth).r; vec4 positionClip = vec4(inUv * 2.0 - 1.0, depth, 1.0); vec4 positionEye = iProj * positionClip; positionEye /= positionEye.w; @@ -389,12 +402,14 @@ void main() { } phong( light, albedoSpecular, fragColor ); } - + fog(fragColor, litFactor); if ( (ubo.mode.type & (0x1 << 0)) == (0x1 << 0) ) { - dither1(fragColor); + // dither2(fragColor); + fragColor += dither3(); } + if ( (ubo.mode.type & (0x1 << 1)) == (0x1 << 1) ) { whitenoise(fragColor); } diff --git a/bin/data/shaders/display.subpass.stereo.frag.glsl b/bin/data/shaders/display.subpass.stereo.frag.glsl index c34eaa4d..db9e1b43 100644 --- a/bin/data/shaders/display.subpass.stereo.frag.glsl +++ b/bin/data/shaders/display.subpass.stereo.frag.glsl @@ -164,10 +164,12 @@ float shadowFactor( Light light, uint shadowMap ) { vec2 uv = positionClip.xy * 0.5 + 0.5; float bias = light.depthBias; - if ( false ) { + if ( !true ) { float cosTheta = clamp(dot(normal.eye, normalize(light.position.xyz - position.eye)), 0, 1); bias = clamp(bias * tan(acos(cosTheta)), 0, 0.01); - } + } else if ( true ) { + bias = max(bias * 10 * (1.0 - dot(normal.eye, normalize(light.position.xyz - position.eye))), bias); + } float eyeDepth = positionClip.z; int samples = poissonDisk.length(); @@ -323,6 +325,11 @@ void dither1(inout vec3 color) { resultColor.z = (lightnessDiff < d) ? l1 : l2; color = hslToRgb(resultColor); } +vec3 dither2() { + vec3 vDither = dot( vec2( 171.0, 231.0 ), inUv.xy + ubo.mode.parameters.w ).xxx; + vDither.rgb = fract( vDither.rgb / vec3( 103.0, 71.0, 97.0 ) ) - vec3( 0.5, 0.5, 0.5 ); + return ( vDither.rgb / 255.0 ) * 0.375; +} float rand2(vec2 co){ return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 143758.5453); @@ -370,7 +377,8 @@ void main() { fog(fragColor, litFactor); if ( (ubo.mode.type & (0x1 << 0)) == (0x1 << 0) ) { - dither1(fragColor); + //dither1(fragColor); + fragColor += dither2(); } if ( (ubo.mode.type & (0x1 << 1)) == (0x1 << 1) ) { whitenoise(fragColor); diff --git a/bin/data/shaders/gltf.stereo.vert.glsl b/bin/data/shaders/gltf.stereo.vert.glsl index 43791b0d..7adb92aa 100644 --- a/bin/data/shaders/gltf.stereo.vert.glsl +++ b/bin/data/shaders/gltf.stereo.vert.glsl @@ -20,16 +20,24 @@ layout (binding = 0) uniform UBO { vec4 color; } ubo; -layout (location = 0) out vec2 outUv; +layout (location = 0) noperspective out vec2 outUv; layout (location = 1) out vec4 outColor; layout (location = 2) out vec3 outNormal; layout (location = 3) out vec3 outPosition; layout (location = 4) flat out uint outId; +layout (location = 5) out float affine; out gl_PerVertex { vec4 gl_Position; }; +vec4 snap(vec4 vertex, vec2 resolution) { + vec4 snappedPos = vertex; + snappedPos.xyz = vertex.xyz / vertex.w; + snappedPos.xy = floor(resolution * snappedPos.xy) / resolution; + snappedPos.xyz *= vertex.w; + return snappedPos; +} void main() { outUv = inUv; @@ -42,4 +50,9 @@ void main() { outId = inId; gl_Position = ubo.matrices.projection[PushConstant.pass] * ubo.matrices.view[PushConstant.pass] * ubo.matrices.model * vec4(inPos.xyz, 1.0); +// gl_Position = snap( gl_Position, vec2(320.0, 240.0) ); +// gl_Position = snap( gl_Position, vec2(480.0, 270.0) ); +// gl_Position = snap( gl_Position, vec2(640.0, 480.0) ); + + affine = 1; } \ No newline at end of file diff --git a/bin/data/shaders/mcdonalds.frag.glsl b/bin/data/shaders/mcdonalds.frag.glsl index 825c2f04..17b0335b 100644 --- a/bin/data/shaders/mcdonalds.frag.glsl +++ b/bin/data/shaders/mcdonalds.frag.glsl @@ -15,6 +15,7 @@ layout (location = 1) in vec4 inColor; layout (location = 2) in vec3 inNormal; layout (location = 3) in vec3 inPosition; layout (location = 4) flat in uint inId; +layout (location = 5) in float inAffine; layout (location = 0) out vec4 outAlbedoSpecular; layout (location = 1) out vec4 outNormal; @@ -22,12 +23,12 @@ layout (location = 2) out vec4 outPosition; void main() { uint offset = inId; - outAlbedoSpecular = texture(samplerTextures[offset], inUv.xy); + outAlbedoSpecular = texture(samplerTextures[offset], inUv.xy / inAffine); Map mapped = ubo.map[offset]; if ( offset != mapped.target ) { - outAlbedoSpecular = mix(texture(samplerTextures[offset], inUv.xy), texture(samplerTextures[mapped.target], inUv.xy), mapped.blend); + outAlbedoSpecular = mix(texture(samplerTextures[offset], inUv.xy / inAffine), texture(samplerTextures[mapped.target], inUv.xy / inAffine), mapped.blend); } else { - outAlbedoSpecular = texture(samplerTextures[offset], inUv.xy); + outAlbedoSpecular = texture(samplerTextures[offset], inUv.xy / inAffine); } if ( outAlbedoSpecular.a < 0.001 ) discard; diff --git a/client/client/ext.cpp b/client/client/ext.cpp index 733941c0..ab5947e4 100644 --- a/client/client/ext.cpp +++ b/client/client/ext.cpp @@ -131,8 +131,11 @@ void client::initialize() { client::window.setSize(size); } // Update viewport - uf::renderer::settings::width = size.x; - uf::renderer::settings::height = size.y; + if ( !client::config["engine"]["ext"]["vulkan"]["framebuffer"]["size"].isArray() ) { + float scale = client::config["engine"]["ext"]["vulkan"]["framebuffer"]["size"].isNumeric() ? client::config["engine"]["ext"]["vulkan"]["framebuffer"]["size"].asFloat() : 1; + uf::renderer::settings::width = size.x * scale; + uf::renderer::settings::height = size.y * scale; + } uf::renderer::states::resized = true; return "true"; diff --git a/debug.sh b/debug.sh index 110fc7ab..a9c80213 100644 --- a/debug.sh +++ b/debug.sh @@ -1,6 +1,8 @@ #!/bin/bash +PREFIX=gcc + cd bin -cp lib/win64/*.dll . -gdb program.exe +cp lib/win64/$PREFIX/*.dll . +gdb program.$PREFIX.exe rm *.dll diff --git a/engine/inc/sol/config.hpp b/engine/inc/sol/config.hpp new file mode 100644 index 00000000..90ec711b --- /dev/null +++ b/engine/inc/sol/config.hpp @@ -0,0 +1,53 @@ +// The MIT License (MIT) + +// Copyright (c) 2013-2020 Rapptz, ThePhD and contributors + +// Permission is hereby granted, free of charge, to any person obtaining a copy of +// this software and associated documentation files (the "Software"), to deal in +// the Software without restriction, including without limitation the rights to +// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +// the Software, and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +// This file was generated with a script. +// Generated 2020-10-03 21:34:25.034794 UTC +// This header was generated with sol v3.2.1 (revision 48eea7b5) +// https://github.com/ThePhD/sol2 + +#ifndef SOL_SINGLE_CONFIG_HPP +#define SOL_SINGLE_CONFIG_HPP + +// beginning of sol/config.hpp + +/* Base, empty configuration file! + + To override, place a file in your include paths of the form: + +. (your include path here) +| sol (directory, or equivalent) + | config.hpp (your config.hpp file) + + So that when sol2 includes the file + +#include + + it gives you the configuration values you desire. Configuration values can be +seen in the safety.rst of the doc/src, or at +https://sol2.readthedocs.io/en/latest/safety.html ! You can also pass them through +the build system, or the command line options of your compiler. + +*/ + +// end of sol/config.hpp + +#endif // SOL_SINGLE_CONFIG_HPP diff --git a/engine/inc/sol/forward.hpp b/engine/inc/sol/forward.hpp new file mode 100644 index 00000000..51fae7dd --- /dev/null +++ b/engine/inc/sol/forward.hpp @@ -0,0 +1,828 @@ +// The MIT License (MIT) + +// Copyright (c) 2013-2020 Rapptz, ThePhD and contributors + +// Permission is hereby granted, free of charge, to any person obtaining a copy of +// this software and associated documentation files (the "Software"), to deal in +// the Software without restriction, including without limitation the rights to +// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +// the Software, and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +// This file was generated with a script. +// Generated 2020-10-03 21:34:25.022965 UTC +// This header was generated with sol v3.2.1 (revision 48eea7b5) +// https://github.com/ThePhD/sol2 + +#ifndef SOL_SINGLE_INCLUDE_FORWARD_HPP +#define SOL_SINGLE_INCLUDE_FORWARD_HPP + +// beginning of sol/forward.hpp + +#ifndef SOL_FORWARD_HPP +#define SOL_FORWARD_HPP + +// beginning of sol/version.hpp + +#include + +#include + +#define SOL_VERSION_MAJOR 3 +#define SOL_VERSION_MINOR 5 +#define SOL_VERSION_PATCH 0 +#define SOL_VERSION_STRING "3.5.0" +#define SOL_VERSION ((SOL_VERSION_MAJOR * 100000) + (SOL_VERSION_MINOR * 100) + (SOL_VERSION_PATCH)) + +#define SOL_IS_ON(OP_SYMBOL) ((3 OP_SYMBOL 3) != 0) +#define SOL_IS_OFF(OP_SYMBOL) ((3 OP_SYMBOL 3) == 0) +#define SOL_IS_DEFAULT_ON(OP_SYMBOL) ((3 OP_SYMBOL 3) > 3) +#define SOL_IS_DEFAULT_OFF(OP_SYMBOL) ((3 OP_SYMBOL 3 OP_SYMBOL 3) < 0) + +#define SOL_ON | +#define SOL_OFF ^ +#define SOL_DEFAULT_ON + +#define SOL_DEFAULT_OFF - + +#if defined(_MSC_VER) + #define SOL_COMPILER_CLANG_I_ SOL_OFF + #define SOL_COMPILER_GCC_I_ SOL_OFF + #define SOL_COMPILER_EDG_I_ SOL_OFF + #define SOL_COMPILER_VCXX_I_ SOL_ON +#elif defined(__clang__) + #define SOL_COMPILER_CLANG_I_ SOL_ON + #define SOL_COMPILER_GCC_I_ SOL_OFF + #define SOL_COMPILER_EDG_I_ SOL_OFF + #define SOL_COMPILER_VCXX_I_ SOL_OFF +#elif defined(__GNUC__) + #define SOL_COMPILER_CLANG_I_ SOL_OFF + #define SOL_COMPILER_GCC_I_ SOL_ON + #define SOL_COMPILER_EDG_I_ SOL_OFF + #define SOL_COMPILER_VCXX_I_ SOL_OFF +#else + #define SOL_COMPILER_CLANG_I_ SOL_OFF + #define SOL_COMPILER_GCC_I_ SOL_OFF + #define SOL_COMPILER_EDG_I_ SOL_OFF + #define SOL_COMPILER_VCXX_I_ SOL_OFF +#endif + +#if defined(__MINGW32__) + #define SOL_COMPILER_FRONTEND_MINGW_I_ SOL_ON +#else + #define SOL_COMPILER_FRONTEND_MINGW_I_ SOL_OFF +#endif + +#if SIZE_MAX <= 0xFFFFULL + #define SOL_PLATFORM_X16_I_ SOL_ON + #define SOL_PLATFORM_X86_I_ SOL_OFF + #define SOL_PLATFORM_X64_I_ SOL_OFF +#elif SIZE_MAX <= 0xFFFFFFFFULL + #define SOL_PLATFORM_X16_I_ SOL_OFF + #define SOL_PLATFORM_X86_I_ SOL_ON + #define SOL_PLATFORM_X64_I_ SOL_OFF +#else + #define SOL_PLATFORM_X16_I_ SOL_OFF + #define SOL_PLATFORM_X86_I_ SOL_OFF + #define SOL_PLATFORM_X64_I_ SOL_ON +#endif + +#define SOL_PLATFORM_ARM32_I_ SOL_OFF +#define SOL_PLATFORM_ARM64_I_ SOL_OFF + +#if defined(_WIN32) + #define SOL_PLATFORM_WINDOWS_I_ SOL_ON +#else + #define SOL_PLATFORM_WINDOWS_I_ SOL_OFF +#endif +#if defined(__APPLE__) + #define SOL_PLATFORM_APPLE_I_ SOL_ON +#else + #define SOL_PLATFORM_APPLE_I_ SOL_OFF +#endif +#if defined(__unix__) + #define SOL_PLATFORM_UNIXLIKE_I_ SOL_ON +#else + #define SOL_PLATFORM_UNIXLIKE_I_ SOL_OFF +#endif +#if defined(__linux__) + #define SOL_PLATFORM_LINUXLIKE_I_ SOL_ON +#else + #define SOL_PLATFORM_LINUXLIKE_I_ SOL_OFF +#endif + +#define SOL_PLATFORM_APPLE_IPHONE_I_ SOL_OFF +#define SOL_PLATFORM_BSDLIKE_I_ SOL_OFF + +#if defined(SOL_IN_DEBUG_DETECTED) + #if SOL_IN_DEBUG_DETECTED != 0 + #define SOL_DEBUG_BUILD_I_ SOL_ON + #else + #define SOL_DEBUG_BUILD_I_ SOL_OFF + #endif +#elif !defined(NDEBUG) + #if SOL_IS_ON(SOL_COMPILER_VCXX_I_) && defined(_DEBUG) + #define SOL_DEBUG_BUILD_I_ SOL_ON + #elif (SOL_IS_ON(SOL_COMPILER_CLANG_I_) || SOL_IS_ON(SOL_COMPILER_GCC_I_)) && !defined(__OPTIMIZE__) + #define SOL_DEBUG_BUILD_I_ SOL_ON + #else + #define SOL_DEBUG_BUILD_I_ SOL_OFF + #endif +#else + #define SOL_DEBUG_BUILD_I_ SOL_DEFAULT_OFF +#endif // We are in a debug mode of some sort + +#if defined(SOL_NO_EXCEPTIONS) + #if (SOL_NO_EXCEPTIONS != 0) + #define SOL_EXCEPTIONS_I_ SOL_OFF + #else + #define SOL_EXCEPTIONS_I_ SOL_ON + #endif +#elif SOL_IS_ON(SOL_COMPILER_VCXX_I_) + #if !defined(_CPPUNWIND) + #define SOL_EXCEPTIONS_I_ SOL_OFF + #else + #define SOL_EXCEPTIONS_I_ SOL_ON + #endif +#elif SOL_IS_ON(SOL_COMPILER_CLANG_I_) || SOL_IS_ON(SOL_COMPILER_GCC_I_) + #if !defined(__EXCEPTIONS) + #define SOL_EXCEPTIONS_I_ SOL_OFF + #else + #define SOL_EXCEPTIONS_I_ SOL_ON + #endif +#else + #define SOL_EXCEPTIONS_I_ SOL_DEFAULT_ON +#endif + +#if defined(SOL_NO_RTTI) + #if (SOL_NO_RTTI != 0) + #define SOL_RTTI_I_ SOL_OFF + #else + #define SOL_RTTI_I_ SOL_ON + #endif +#elif SOL_IS_ON(SOL_COMPILER_VCXX_I_) + #if !defined(_CPPRTTI) + #define SOL_RTTI_I_ SOL_OFF + #else + #define SOL_RTTI_I_ SOL_ON + #endif +#elif SOL_IS_ON(SOL_COMPILER_CLANG_I_) || SOL_IS_ON(SOL_COMPILER_GCC_I_) + #if !defined(__GXX_RTTI) + #define SOL_RTTI_I_ SOL_OFF + #else + #define SOL_RTTI_I_ SOL_ON + #endif +#else + #define SOL_RTTI_I_ SOL_DEFAULT_ON +#endif + +#if defined(SOL_NO_THREAD_LOCAL) && (SOL_NO_THREAD_LOCAL != 0) + #define SOL_USE_THREAD_LOCAL_I_ SOL_OFF +#else + #define SOL_USE_THREAD_LOCAL_I_ SOL_DEFAULT_ON +#endif // thread_local keyword is bjorked on some platforms + +#if defined(SOL_ALL_SAFETIES_ON) && (SOL_ALL_SAFETIES_ON != 0) + #define SOL_ALL_SAFETIES_ON_I_ SOL_ON +#else + #define SOL_ALL_SAFETIES_ON_I_ SOL_DEFAULT_OFF +#endif + +#if defined(SOL_SAFE_GETTER) && (SOL_SAFE_GETTER != 0) + #define SOL_SAFE_GETTER_I_ SOL_ON +#else + #if SOL_IS_ON(SOL_ALL_SAFETIES_ON_I_) + #define SOL_SAFE_GETTER_I_ SOL_ON + #elif SOL_IS_ON(SOL_DEBUG_BUILD_I_) + #define SOL_SAFE_GETTER_I_ SOL_DEFAULT_ON + #else + #define SOL_SAFE_GETTER_I_ SOL_DEFAULT_OFF + #endif +#endif + +#if defined(SOL_SAFE_USERTYPE) && (SOL_SAFE_USERTYPE != 0) + #define SOL_SAFE_USERTYPE_I_ SOL_ON +#else + #if SOL_IS_ON(SOL_ALL_SAFETIES_ON_I_) + #define SOL_SAFE_USERTYPE_I_ SOL_ON + #elif SOL_IS_ON(SOL_DEBUG_BUILD_I_) + #define SOL_SAFE_USERTYPE_I_ SOL_DEFAULT_ON + #else + #define SOL_SAFE_USERTYPE_I_ SOL_DEFAULT_OFF + #endif +#endif + +#if defined(SOL_SAFE_REFERENCES) && (SOL_SAFE_REFERENCES != 0) + #define SOL_SAFE_REFERENCES_I_ SOL_ON +#else + #if SOL_IS_ON(SOL_ALL_SAFETIES_ON_I_) + #define SOL_SAFE_REFERENCES_I_ SOL_ON + #elif SOL_IS_ON(SOL_DEBUG_BUILD_I_) + #define SOL_SAFE_REFERENCES_I_ SOL_DEFAULT_ON + #else + #define SOL_SAFE_REFERENCES_I_ SOL_DEFAULT_OFF + #endif +#endif + +#if (defined(SOL_SAFE_FUNCTIONS) && (SOL_SAFE_FUNCTIONS != 0)) \ + || (defined(SOL_SAFE_FUNCTION_OBJECTS) && (SOL_SAFE_FUNCTION_OBJECTS != 0)) + #define SOL_SAFE_FUNCTION_OBJECTS_I_ SOL_ON +#else + #if SOL_IS_ON(SOL_ALL_SAFETIES_ON_I_) + #define SOL_SAFE_FUNCTION_OBJECTS_I_ SOL_ON + #elif SOL_IS_ON(SOL_DEBUG_BUILD_I_) + #define SOL_SAFE_FUNCTION_OBJECTS_I_ SOL_DEFAULT_ON + #else + #define SOL_SAFE_FUNCTION_OBJECTS_I_ SOL_DEFAULT_OFF + #endif +#endif + +#if defined(SOL_SAFE_FUNCTION_CALLS) && (SOL_SAFE_FUNCTION_CALLS != 0) + #define SOL_SAFE_FUNCTION_CALLS_I_ SOL_ON +#else + #if SOL_IS_ON(SOL_ALL_SAFETIES_ON_I_) + #define SOL_SAFE_FUNCTION_CALLS_I_ SOL_ON + #elif SOL_IS_ON(SOL_DEBUG_BUILD_I_) + #define SOL_SAFE_FUNCTION_CALLS_I_ SOL_DEFAULT_ON + #else + #define SOL_SAFE_FUNCTION_CALLS_I_ SOL_DEFAULT_OFF + #endif +#endif + +#if defined(SOL_SAFE_PROXIES) && (SOL_SAFE_PROXIES != 0) + #define SOL_SAFE_PROXIES_I_ SOL_ON +#else + #if SOL_IS_ON(SOL_ALL_SAFETIES_ON_I_) + #define SOL_SAFE_PROXIES_I_ SOL_ON + #elif SOL_IS_ON(SOL_DEBUG_BUILD_I_) + #define SOL_SAFE_PROXIES_I_ SOL_DEFAULT_ON + #else + #define SOL_SAFE_PROXIES_I_ SOL_DEFAULT_OFF + #endif +#endif + +#if defined(SOL_SAFE_NUMERICS) && (SOL_SAFE_NUMERICS != 0) + #define SOL_SAFE_NUMERICS_I_ SOL_ON +#else + #if SOL_IS_ON(SOL_ALL_SAFETIES_ON_I_) + #define SOL_SAFE_NUMERICS_I_ SOL_ON + #elif SOL_IS_ON(SOL_DEBUG_BUILD_I_) + #define SOL_SAFE_NUMERICS_I_ SOL_DEFAULT_ON + #else + #define SOL_SAFE_NUMERICS_I_ SOL_DEFAULT_OFF + #endif +#endif + +#if defined(SOL_SAFE_STACK_CHECK) && (SOL_SAFE_STACK_CHECK != 0) + #define SOL_SAFE_STACK_CHECK_I_ SOL_ON +#else + #if SOL_IS_ON(SOL_ALL_SAFETIES_ON_I_) + #define SOL_SAFE_STACK_CHECK_I_ SOL_ON + #elif SOL_IS_ON(SOL_DEBUG_BUILD_I_) + #define SOL_SAFE_STACK_CHECK_I_ SOL_DEFAULT_ON + #else + #define SOL_SAFE_STACK_CHECK_I_ SOL_DEFAULT_OFF + #endif +#endif + +#if (defined(SOL_NO_CHECK_NUMBER_PRECISION) && (SOL_NO_CHECK_NUMBER_PRECISION != 0)) \ + || (defined(SOL_NO_CHECKING_NUMBER_PRECISION) && (SOL_NO_CHECKING_NUMBER_PRECISION != 0)) + #define SOL_NUMBER_PRECISION_CHECKS_I_ SOL_OFF +#else + #if SOL_IS_ON(SOL_ALL_SAFETIES_ON_I_) + #define SOL_NUMBER_PRECISION_CHECKS_I_ SOL_ON + #elif SOL_IS_ON(SOL_SAFE_NUMERICS_I_) + #define SOL_NUMBER_PRECISION_CHECKS_I_ SOL_ON + #elif SOL_IS_ON(SOL_DEBUG_BUILD_I_) + #define SOL_NUMBER_PRECISION_CHECKS_I_ SOL_DEFAULT_ON + #else + #define SOL_NUMBER_PRECISION_CHECKS_I_ SOL_DEFAULT_OFF + #endif +#endif + +#if defined(SOL_STRINGS_ARE_NUMBERS) + #if (SOL_STRINGS_ARE_NUMBERS != 0) + #define SOL_STRINGS_ARE_NUMBERS_I_ SOL_ON + #else + #define SOL_STRINGS_ARE_NUMBERS_I_ SOL_OFF + #endif +#else + #define SOL_STRINGS_ARE_NUMBERS_I_ SOL_DEFAULT_OFF +#endif + +#if defined(SOL_ENABLE_INTEROP) && (SOL_ENABLE_INTEROP != 0) \ + || defined(SOL_USE_INTEROP) && (SOL_USE_INTEROP != 0) + #define SOL_USE_INTEROP_I_ SOL_ON +#else + #define SOL_USE_INTEROP_I_ SOL_DEFAULT_OFF +#endif + +#if defined(SOL_NO_NIL) + #if (SOL_NO_NIL != 0) + #define SOL_NIL_I_ SOL_OFF + #else + #define SOL_NIL_I_ SOL_ON + #endif +#elif defined(__MAC_OS_X_VERSION_MAX_ALLOWED) || defined(__OBJC__) || defined(nil) + #define SOL_NIL_I_ SOL_DEFAULT_OFF +#else + #define SOL_NIL_I_ SOL_DEFAULT_ON +#endif + +#if defined(SOL_USERTYPE_TYPE_BINDING_INFO) + #if (SOL_USERTYPE_TYPE_BINDING_INFO != 0) + #define SOL_USERTYPE_TYPE_BINDING_INFO_I_ SOL_ON + #else + #define SOL_USERTYPE_TYPE_BINDING_INFO_I_ SOL_OFF + #endif +#else + #define SOL_USERTYPE_TYPE_BINDING_INFO_I_ SOL_DEFAULT_ON +#endif // We should generate a my_type.__type table with lots of class information for usertypes + +#if defined(SOL_AUTOMAGICAL_TYPES_BY_DEFAULT) + #if (SOL_AUTOMAGICAL_TYPES_BY_DEFAULT != 0) + #define SOL_DEFAULT_AUTOMAGICAL_USERTYPES_I_ SOL_ON + #else + #define SOL_DEFAULT_AUTOMAGICAL_USERTYPES_I_ SOL_OFF + #endif +#elif defined(SOL_DEFAULT_AUTOMAGICAL_USERTYPES) + #if (SOL_DEFAULT_AUTOMAGICAL_USERTYPES != 0) + #define SOL_DEFAULT_AUTOMAGICAL_USERTYPES_I_ SOL_ON + #else + #define SOL_DEFAULT_AUTOMAGICAL_USERTYPES_I_ SOL_OFF + #endif +#else + #define SOL_DEFAULT_AUTOMAGICAL_USERTYPES_I_ SOL_DEFAULT_ON +#endif // make is_automagical on/off by default + +#if defined(SOL_STD_VARIANT) + #if (SOL_STD_VARIANT != 0) + #define SOL_STD_VARIANT_I_ SOL_ON + #else + #define SOL_STD_VARIANT_I_ SOL_OFF + #endif +#else + #if SOL_IS_ON(SOL_COMPILER_CLANG_I_) && SOL_IS_ON(SOL_PLATFORM_APPLE_I_) + #if defined(__has_include) + #if __has_include() + #define SOL_STD_VARIANT_I_ SOL_ON + #else + #define SOL_STD_VARIANT_I_ SOL_OFF + #endif + #else + #define SOL_STD_VARIANT_I_ SOL_OFF + #endif + #else + #define SOL_STD_VARIANT_I_ SOL_DEFAULT_ON + #endif +#endif // make is_automagical on/off by default + +#if defined(SOL_NOEXCEPT_FUNCTION_TYPE) + #if (SOL_NOEXCEPT_FUNCTION_TYPE != 0) + #define SOL_USE_NOEXCEPT_FUNCTION_TYPE_I_ SOL_ON + #else + #define SOL_USE_NOEXCEPT_FUNCTION_TYPE_I_ SOL_OFF + #endif +#else + #if defined(__cpp_noexcept_function_type) + #define SOL_USE_NOEXCEPT_FUNCTION_TYPE_I_ SOL_ON + #elif SOL_IS_ON(SOL_COMPILER_VCXX_I_) && (defined(_MSVC_LANG) && (_MSVC_LANG < 201403L)) + // There is a bug in the VC++ compiler?? + // on /std:c++latest under x86 conditions (VS 15.5.2), + // compiler errors are tossed for noexcept markings being on function types + // that are identical in every other way to their non-noexcept marked types function types... + // VS 2019: There is absolutely a bug. + #define SOL_USE_NOEXCEPT_FUNCTION_TYPE_I_ SOL_OFF + #else + #define SOL_USE_NOEXCEPT_FUNCTION_TYPE_I_ SOL_DEFAULT_ON + #endif +#endif // noexcept is part of a function's type + +#if defined(SOL_STACK_STRING_OPTIMIZATION_SIZE) && SOL_STACK_STRING_OPTIMIZATION_SIZE > 0 + #define SOL_OPTIMIZATION_STRING_CONVERSION_STACK_SIZE_I_ SOL_STACK_STRING_OPTIMIZATION_SIZE +#else + #define SOL_OPTIMIZATION_STRING_CONVERSION_STACK_SIZE_I_ 1024 +#endif + +#if defined(SOL_ID_SIZE) && SOL_ID_SIZE > 0 + #define SOL_ID_SIZE_I_ SOL_ID_SIZE +#else + #define SOL_ID_SIZE_I_ 512 +#endif + +#if defined(LUA_IDSIZE) && LUA_IDSIZE > 0 + #define SOL_FILE_ID_SIZE_I_ LUA_IDSIZE +#elif defined(SOL_ID_SIZE) && SOL_ID_SIZE > 0 + #define SOL_FILE_ID_SIZE_I_ SOL_FILE_ID_SIZE +#else + #define SOL_FILE_ID_SIZE_I_ 2048 +#endif + +#if defined(SOL_PRINT_ERRORS) + #if (SOL_PRINT_ERRORS != 0) + #define SOL_PRINT_ERRORS_I_ SOL_ON + #else + #define SOL_PRINT_ERRORS_I_ SOL_OFF + #endif +#else + #if SOL_IS_ON(SOL_ALL_SAFETIES_ON_I_) + #define SOL_PRINT_ERRORS_I_ SOL_ON + #elif SOL_IS_ON(SOL_DEBUG_BUILD_I_) + #define SOL_PRINT_ERRORS_I_ SOL_DEFAULT_ON + #else + #define SOL_PRINT_ERRORS_I_ SOL_OFF + #endif +#endif + +#if defined(SOL_DEFAULT_PASS_ON_ERROR) && (SOL_DEFAULT_PASS_ON_ERROR != 0) + #define SOL_DEFAULT_PASS_ON_ERROR_I_ SOL_ON +#else + #if SOL_IS_ON(SOL_ALL_SAFETIES_ON_I_) + #define SOL_DEFAULT_PASS_ON_ERROR_I_ SOL_ON + #elif SOL_IS_ON(SOL_DEBUG_BUILD_I_) + #define SOL_DEFAULT_PASS_ON_ERROR_I_ SOL_DEFAULT_ON + #else + #define SOL_DEFAULT_PASS_ON_ERROR_I_ SOL_OFF + #endif +#endif + +#if defined(SOL_USING_CXX_LUA) + #if (SOL_USING_CXX_LUA != 0) + #define SOL_USE_CXX_LUA_I_ SOL_ON + #else + #define SOL_USE_CXX_LUA_I_ SOL_OFF + #endif +#elif defined(SOL_USE_CXX_LUA) + #if (SOL_USE_CXX_LUA != 0) + #define SOL_USE_CXX_LUA_I_ SOL_ON + #else + #define SOL_USE_CXX_LUA_I_ SOL_OFF + #endif +#else + #define SOL_USE_CXX_LUA_I_ SOL_OFF +#endif + +#if defined(SOL_USING_CXX_LUAJIT) + #if (SOL_USING_CXX_LUA != 0) + #define SOL_USE_CXX_LUAJIT_I_ SOL_ON + #else + #define SOL_USE_CXX_LUAJIT_I_ SOL_OFF + #endif +#elif defined(SOL_USE_CXX_LUAJIT) + #if (SOL_USE_CXX_LUA != 0) + #define SOL_USE_CXX_LUAJIT_I_ SOL_ON + #else + #define SOL_USE_CXX_LUAJIT_I_ SOL_OFF + #endif +#else + #define SOL_USE_CXX_LUAJIT_I_ SOL_OFF +#endif + +#if defined(SOL_NO_LUA_HPP) + #if (SOL_NO_LUA_HPP != 0) + #define SOL_USE_LUA_HPP_I_ SOL_OFF + #else + #define SOL_USE_LUA_HPP_I_ SOL_ON + #endif +#elif defined(SOL_USING_CXX_LUA) + #define SOL_USE_LUA_HPP_I_ SOL_OFF +#elif defined(__has_include) + #if __has_include() + #define SOL_USE_LUA_HPP_I_ SOL_ON + #else + #define SOL_USE_LUA_HPP_I_ SOL_OFF + #endif +#else + #define SOL_USE_LUA_HPP_I_ SOL_DEFAULT_ON +#endif + +#if defined(SOL_CONTAINERS_START) + #define SOL_CONTAINER_START_INDEX_I_ SOL_CONTAINERS_START +#elif defined(SOL_CONTAINERS_START_INDEX) + #define SOL_CONTAINER_START_INDEX_I_ SOL_CONTAINERS_START_INDEX +#elif defined(SOL_CONTAINER_START_INDEX) + #define SOL_CONTAINER_START_INDEX_I_ SOL_CONTAINER_START_INDEX +#else + #define SOL_CONTAINER_START_INDEX_I_ 1 +#endif + +#if defined (SOL_NO_MEMORY_ALIGNMENT) + #if (SOL_NO_MEMORY_ALIGNMENT != 0) + #define SOL_ALIGN_MEMORY_I_ SOL_OFF + #else + #define SOL_ALIGN_MEMORY_I_ SOL_ON + #endif +#else + #define SOL_ALIGN_MEMORY_I_ SOL_DEFAULT_ON +#endif + +#if defined(SOL_USE_BOOST) + #if (SOL_USE_BOOST != 0) + #define SOL_USE_BOOST_I_ SOL_ON + #else + #define SOL_USE_BOOST_I_ SOL_OFF + #endif +#else + #define SOL_USE_BOOST_I_ SOL_OFF +#endif + +#if defined(SOL_USE_UNSAFE_BASE_LOOKUP) + #if (SOL_USE_UNSAFE_BASE_LOOKUP != 0) + #define SOL_USE_UNSAFE_BASE_LOOKUP_I_ SOL_ON + #else + #define SOL_USE_UNSAFE_BASE_LOOKUP_I_ SOL_OFF + #endif +#else + #define SOL_USE_UNSAFE_BASE_LOOKUP_I_ SOL_OFF +#endif + +#if defined(SOL_INSIDE_UNREAL) + #if (SOL_INSIDE_UNREAL != 0) + #define SOL_INSIDE_UNREAL_ENGINE_I_ SOL_ON + #else + #define SOL_INSIDE_UNREAL_ENGINE_I_ SOL_OFF + #endif +#else + #if defined(UE_BUILD_DEBUG) || defined(UE_BUILD_DEVELOPMENT) || defined(UE_BUILD_TEST) || defined(UE_BUILD_SHIPPING) || defined(UE_SERVER) + #define SOL_INSIDE_UNREAL_ENGINE_I_ SOL_ON + #else + #define SOL_INSIDE_UNREAL_ENGINE_I_ SOL_DEFAULT_OFF + #endif +#endif + +#if defined(SOL_NO_COMPAT) + #if (SOL_NO_COMPAT != 0) + #define SOL_USE_COMPATIBILITY_LAYER_I_ SOL_OFF + #else + #define SOL_USE_COMPATIBILITY_LAYER_I_ SOL_ON + #endif +#else + #define SOL_USE_COMPATIBILITY_LAYER_I_ SOL_DEFAULT_ON +#endif + +#if defined(SOL_GET_FUNCTION_POINTER_UNSAFE) + #if (SOL_GET_FUNCTION_POINTER_UNSAFE != 0) + #define SOL_GET_FUNCTION_POINTER_UNSAFE_I_ SOL_ON + #else + #define SOL_GET_FUNCTION_POINTER_UNSAFE_I_ SOL_OFF + #endif +#else + #define SOL_GET_FUNCTION_POINTER_UNSAFE_I_ SOL_DEFAULT_OFF +#endif + +#if SOL_IS_ON(SOL_COMPILER_FRONTEND_MINGW_I_) && defined(__GNUC__) && (__GNUC__ < 6) + // MinGW is off its rocker in some places... + #define SOL_MINGW_CCTYPE_IS_POISONED_I_ SOL_ON +#else + #define SOL_MINGW_CCTYPE_IS_POISONED_I_ SOL_DEFAULT_OFF +#endif + +// end of sol/version.hpp + +#include +#include +#include + +#if SOL_IS_ON(SOL_USE_CXX_LUA_I_) || SOL_IS_ON(SOL_USE_CXX_LUAJIT_I_) +struct lua_State; +#else +extern "C" { +struct lua_State; +} +#endif // C++ Mangling for Lua vs. Not + +namespace sol { + + enum class type; + + class stateless_reference; + template + class basic_reference; + using reference = basic_reference; + using main_reference = basic_reference; + class stateless_stack_reference; + class stack_reference; + + template + class basic_bytecode; + + struct lua_value; + + struct proxy_base_tag; + template + struct proxy_base; + template + struct table_proxy; + + template + class basic_table_core; + template + using table_core = basic_table_core; + template + using main_table_core = basic_table_core; + template + using stack_table_core = basic_table_core; + template + using basic_table = basic_table_core; + using table = table_core; + using global_table = table_core; + using main_table = main_table_core; + using main_global_table = main_table_core; + using stack_table = stack_table_core; + using stack_global_table = stack_table_core; + + template + struct basic_lua_table; + using lua_table = basic_lua_table; + using stack_lua_table = basic_lua_table; + + template + class basic_usertype; + template + using usertype = basic_usertype; + template + using stack_usertype = basic_usertype; + + template + class basic_metatable; + using metatable = basic_metatable; + using stack_metatable = basic_metatable; + + template + struct basic_environment; + using environment = basic_environment; + using main_environment = basic_environment; + using stack_environment = basic_environment; + + template + class basic_function; + template + class basic_protected_function; + using unsafe_function = basic_function; + using safe_function = basic_protected_function; + using main_unsafe_function = basic_function; + using main_safe_function = basic_protected_function; + using stack_unsafe_function = basic_function; + using stack_safe_function = basic_protected_function; + using stack_aligned_unsafe_function = basic_function; + using stack_aligned_safe_function = basic_protected_function; + using protected_function = safe_function; + using main_protected_function = main_safe_function; + using stack_protected_function = stack_safe_function; + using stack_aligned_protected_function = stack_aligned_safe_function; +#if SOL_IS_ON(SOL_SAFE_FUNCTION_OBJECTS_I_) + using function = protected_function; + using main_function = main_protected_function; + using stack_function = stack_protected_function; + using stack_aligned_function = stack_aligned_safe_function; +#else + using function = unsafe_function; + using main_function = main_unsafe_function; + using stack_function = stack_unsafe_function; + using stack_aligned_function = stack_aligned_unsafe_function; +#endif + using stack_aligned_stack_handler_function = basic_protected_function; + + struct unsafe_function_result; + struct protected_function_result; + using safe_function_result = protected_function_result; +#if SOL_IS_ON(SOL_SAFE_FUNCTION_OBJECTS_I_) + using function_result = safe_function_result; +#else + using function_result = unsafe_function_result; +#endif + + template + class basic_object_base; + template + class basic_object; + template + class basic_userdata; + template + class basic_lightuserdata; + template + class basic_coroutine; + template + class basic_thread; + + using object = basic_object; + using userdata = basic_userdata; + using lightuserdata = basic_lightuserdata; + using thread = basic_thread; + using coroutine = basic_coroutine; + using main_object = basic_object; + using main_userdata = basic_userdata; + using main_lightuserdata = basic_lightuserdata; + using main_coroutine = basic_coroutine; + using stack_object = basic_object; + using stack_userdata = basic_userdata; + using stack_lightuserdata = basic_lightuserdata; + using stack_thread = basic_thread; + using stack_coroutine = basic_coroutine; + + struct stack_proxy_base; + struct stack_proxy; + struct variadic_args; + struct variadic_results; + struct stack_count; + struct this_state; + struct this_main_state; + struct this_environment; + + class state_view; + class state; + + template + struct as_table_t; + template + struct as_container_t; + template + struct nested; + template + struct light; + template + struct user; + template + struct as_args_t; + template + struct protect_t; + template + struct policy_wrapper; + + template + struct usertype_traits; + template + struct unique_usertype_traits; + + template + struct types { + typedef std::make_index_sequence indices; + static constexpr std::size_t size() { + return sizeof...(Args); + } + }; + + template + struct derive : std::false_type { + typedef types<> type; + }; + + template + struct base : std::false_type { + typedef types<> type; + }; + + template + struct weak_derive { + static bool value; + }; + + template + bool weak_derive::value = false; + + namespace stack { + struct record; + } + +#if SOL_IS_OFF(SOL_USE_BOOST_I_) + template + class optional; + + template + class optional; +#endif + + using check_handler_type = int(lua_State*, int, type, type, const char*); + +} // namespace sol + +#define SOL_BASE_CLASSES(T, ...) \ + namespace sol { \ + template <> \ + struct base : std::true_type { \ + typedef ::sol::types<__VA_ARGS__> type; \ + }; \ + } \ + void a_sol3_detail_function_decl_please_no_collide() +#define SOL_DERIVED_CLASSES(T, ...) \ + namespace sol { \ + template <> \ + struct derive : std::true_type { \ + typedef ::sol::types<__VA_ARGS__> type; \ + }; \ + } \ + void a_sol3_detail_function_decl_please_no_collide() + +#endif // SOL_FORWARD_HPP +// end of sol/forward.hpp + +#endif // SOL_SINGLE_INCLUDE_FORWARD_HPP diff --git a/engine/inc/sol/sol.hpp b/engine/inc/sol/sol.hpp new file mode 100644 index 00000000..4a52e7c6 --- /dev/null +++ b/engine/inc/sol/sol.hpp @@ -0,0 +1,26674 @@ +// The MIT License (MIT) + +// Copyright (c) 2013-2020 Rapptz, ThePhD and contributors + +// Permission is hereby granted, free of charge, to any person obtaining a copy of +// this software and associated documentation files (the "Software"), to deal in +// the Software without restriction, including without limitation the rights to +// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +// the Software, and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +// This file was generated with a script. +// Generated 2020-10-03 21:34:24.496436 UTC +// This header was generated with sol v3.2.1 (revision 48eea7b5) +// https://github.com/ThePhD/sol2 + +#ifndef SOL_SINGLE_INCLUDE_HPP +#define SOL_SINGLE_INCLUDE_HPP + +// beginning of sol/sol.hpp + +#ifndef SOL_HPP +#define SOL_HPP + +// beginning of sol/version.hpp + +#include + +#include + +#define SOL_VERSION_MAJOR 3 +#define SOL_VERSION_MINOR 5 +#define SOL_VERSION_PATCH 0 +#define SOL_VERSION_STRING "3.5.0" +#define SOL_VERSION ((SOL_VERSION_MAJOR * 100000) + (SOL_VERSION_MINOR * 100) + (SOL_VERSION_PATCH)) + +#define SOL_IS_ON(OP_SYMBOL) ((3 OP_SYMBOL 3) != 0) +#define SOL_IS_OFF(OP_SYMBOL) ((3 OP_SYMBOL 3) == 0) +#define SOL_IS_DEFAULT_ON(OP_SYMBOL) ((3 OP_SYMBOL 3) > 3) +#define SOL_IS_DEFAULT_OFF(OP_SYMBOL) ((3 OP_SYMBOL 3 OP_SYMBOL 3) < 0) + +#define SOL_ON | +#define SOL_OFF ^ +#define SOL_DEFAULT_ON + +#define SOL_DEFAULT_OFF - + +#if defined(_MSC_VER) + #define SOL_COMPILER_CLANG_I_ SOL_OFF + #define SOL_COMPILER_GCC_I_ SOL_OFF + #define SOL_COMPILER_EDG_I_ SOL_OFF + #define SOL_COMPILER_VCXX_I_ SOL_ON +#elif defined(__clang__) + #define SOL_COMPILER_CLANG_I_ SOL_ON + #define SOL_COMPILER_GCC_I_ SOL_OFF + #define SOL_COMPILER_EDG_I_ SOL_OFF + #define SOL_COMPILER_VCXX_I_ SOL_OFF +#elif defined(__GNUC__) + #define SOL_COMPILER_CLANG_I_ SOL_OFF + #define SOL_COMPILER_GCC_I_ SOL_ON + #define SOL_COMPILER_EDG_I_ SOL_OFF + #define SOL_COMPILER_VCXX_I_ SOL_OFF +#else + #define SOL_COMPILER_CLANG_I_ SOL_OFF + #define SOL_COMPILER_GCC_I_ SOL_OFF + #define SOL_COMPILER_EDG_I_ SOL_OFF + #define SOL_COMPILER_VCXX_I_ SOL_OFF +#endif + +#if defined(__MINGW32__) + #define SOL_COMPILER_FRONTEND_MINGW_I_ SOL_ON +#else + #define SOL_COMPILER_FRONTEND_MINGW_I_ SOL_OFF +#endif + +#if SIZE_MAX <= 0xFFFFULL + #define SOL_PLATFORM_X16_I_ SOL_ON + #define SOL_PLATFORM_X86_I_ SOL_OFF + #define SOL_PLATFORM_X64_I_ SOL_OFF +#elif SIZE_MAX <= 0xFFFFFFFFULL + #define SOL_PLATFORM_X16_I_ SOL_OFF + #define SOL_PLATFORM_X86_I_ SOL_ON + #define SOL_PLATFORM_X64_I_ SOL_OFF +#else + #define SOL_PLATFORM_X16_I_ SOL_OFF + #define SOL_PLATFORM_X86_I_ SOL_OFF + #define SOL_PLATFORM_X64_I_ SOL_ON +#endif + +#define SOL_PLATFORM_ARM32_I_ SOL_OFF +#define SOL_PLATFORM_ARM64_I_ SOL_OFF + +#if defined(_WIN32) + #define SOL_PLATFORM_WINDOWS_I_ SOL_ON +#else + #define SOL_PLATFORM_WINDOWS_I_ SOL_OFF +#endif +#if defined(__APPLE__) + #define SOL_PLATFORM_APPLE_I_ SOL_ON +#else + #define SOL_PLATFORM_APPLE_I_ SOL_OFF +#endif +#if defined(__unix__) + #define SOL_PLATFORM_UNIXLIKE_I_ SOL_ON +#else + #define SOL_PLATFORM_UNIXLIKE_I_ SOL_OFF +#endif +#if defined(__linux__) + #define SOL_PLATFORM_LINUXLIKE_I_ SOL_ON +#else + #define SOL_PLATFORM_LINUXLIKE_I_ SOL_OFF +#endif + +#define SOL_PLATFORM_APPLE_IPHONE_I_ SOL_OFF +#define SOL_PLATFORM_BSDLIKE_I_ SOL_OFF + +#if defined(SOL_IN_DEBUG_DETECTED) + #if SOL_IN_DEBUG_DETECTED != 0 + #define SOL_DEBUG_BUILD_I_ SOL_ON + #else + #define SOL_DEBUG_BUILD_I_ SOL_OFF + #endif +#elif !defined(NDEBUG) + #if SOL_IS_ON(SOL_COMPILER_VCXX_I_) && defined(_DEBUG) + #define SOL_DEBUG_BUILD_I_ SOL_ON + #elif (SOL_IS_ON(SOL_COMPILER_CLANG_I_) || SOL_IS_ON(SOL_COMPILER_GCC_I_)) && !defined(__OPTIMIZE__) + #define SOL_DEBUG_BUILD_I_ SOL_ON + #else + #define SOL_DEBUG_BUILD_I_ SOL_OFF + #endif +#else + #define SOL_DEBUG_BUILD_I_ SOL_DEFAULT_OFF +#endif // We are in a debug mode of some sort + +#if defined(SOL_NO_EXCEPTIONS) + #if (SOL_NO_EXCEPTIONS != 0) + #define SOL_EXCEPTIONS_I_ SOL_OFF + #else + #define SOL_EXCEPTIONS_I_ SOL_ON + #endif +#elif SOL_IS_ON(SOL_COMPILER_VCXX_I_) + #if !defined(_CPPUNWIND) + #define SOL_EXCEPTIONS_I_ SOL_OFF + #else + #define SOL_EXCEPTIONS_I_ SOL_ON + #endif +#elif SOL_IS_ON(SOL_COMPILER_CLANG_I_) || SOL_IS_ON(SOL_COMPILER_GCC_I_) + #if !defined(__EXCEPTIONS) + #define SOL_EXCEPTIONS_I_ SOL_OFF + #else + #define SOL_EXCEPTIONS_I_ SOL_ON + #endif +#else + #define SOL_EXCEPTIONS_I_ SOL_DEFAULT_ON +#endif + +#if defined(SOL_NO_RTTI) + #if (SOL_NO_RTTI != 0) + #define SOL_RTTI_I_ SOL_OFF + #else + #define SOL_RTTI_I_ SOL_ON + #endif +#elif SOL_IS_ON(SOL_COMPILER_VCXX_I_) + #if !defined(_CPPRTTI) + #define SOL_RTTI_I_ SOL_OFF + #else + #define SOL_RTTI_I_ SOL_ON + #endif +#elif SOL_IS_ON(SOL_COMPILER_CLANG_I_) || SOL_IS_ON(SOL_COMPILER_GCC_I_) + #if !defined(__GXX_RTTI) + #define SOL_RTTI_I_ SOL_OFF + #else + #define SOL_RTTI_I_ SOL_ON + #endif +#else + #define SOL_RTTI_I_ SOL_DEFAULT_ON +#endif + +#if defined(SOL_NO_THREAD_LOCAL) && (SOL_NO_THREAD_LOCAL != 0) + #define SOL_USE_THREAD_LOCAL_I_ SOL_OFF +#else + #define SOL_USE_THREAD_LOCAL_I_ SOL_DEFAULT_ON +#endif // thread_local keyword is bjorked on some platforms + +#if defined(SOL_ALL_SAFETIES_ON) && (SOL_ALL_SAFETIES_ON != 0) + #define SOL_ALL_SAFETIES_ON_I_ SOL_ON +#else + #define SOL_ALL_SAFETIES_ON_I_ SOL_DEFAULT_OFF +#endif + +#if defined(SOL_SAFE_GETTER) && (SOL_SAFE_GETTER != 0) + #define SOL_SAFE_GETTER_I_ SOL_ON +#else + #if SOL_IS_ON(SOL_ALL_SAFETIES_ON_I_) + #define SOL_SAFE_GETTER_I_ SOL_ON + #elif SOL_IS_ON(SOL_DEBUG_BUILD_I_) + #define SOL_SAFE_GETTER_I_ SOL_DEFAULT_ON + #else + #define SOL_SAFE_GETTER_I_ SOL_DEFAULT_OFF + #endif +#endif + +#if defined(SOL_SAFE_USERTYPE) && (SOL_SAFE_USERTYPE != 0) + #define SOL_SAFE_USERTYPE_I_ SOL_ON +#else + #if SOL_IS_ON(SOL_ALL_SAFETIES_ON_I_) + #define SOL_SAFE_USERTYPE_I_ SOL_ON + #elif SOL_IS_ON(SOL_DEBUG_BUILD_I_) + #define SOL_SAFE_USERTYPE_I_ SOL_DEFAULT_ON + #else + #define SOL_SAFE_USERTYPE_I_ SOL_DEFAULT_OFF + #endif +#endif + +#if defined(SOL_SAFE_REFERENCES) && (SOL_SAFE_REFERENCES != 0) + #define SOL_SAFE_REFERENCES_I_ SOL_ON +#else + #if SOL_IS_ON(SOL_ALL_SAFETIES_ON_I_) + #define SOL_SAFE_REFERENCES_I_ SOL_ON + #elif SOL_IS_ON(SOL_DEBUG_BUILD_I_) + #define SOL_SAFE_REFERENCES_I_ SOL_DEFAULT_ON + #else + #define SOL_SAFE_REFERENCES_I_ SOL_DEFAULT_OFF + #endif +#endif + +#if (defined(SOL_SAFE_FUNCTIONS) && (SOL_SAFE_FUNCTIONS != 0)) \ + || (defined(SOL_SAFE_FUNCTION_OBJECTS) && (SOL_SAFE_FUNCTION_OBJECTS != 0)) + #define SOL_SAFE_FUNCTION_OBJECTS_I_ SOL_ON +#else + #if SOL_IS_ON(SOL_ALL_SAFETIES_ON_I_) + #define SOL_SAFE_FUNCTION_OBJECTS_I_ SOL_ON + #elif SOL_IS_ON(SOL_DEBUG_BUILD_I_) + #define SOL_SAFE_FUNCTION_OBJECTS_I_ SOL_DEFAULT_ON + #else + #define SOL_SAFE_FUNCTION_OBJECTS_I_ SOL_DEFAULT_OFF + #endif +#endif + +#if defined(SOL_SAFE_FUNCTION_CALLS) && (SOL_SAFE_FUNCTION_CALLS != 0) + #define SOL_SAFE_FUNCTION_CALLS_I_ SOL_ON +#else + #if SOL_IS_ON(SOL_ALL_SAFETIES_ON_I_) + #define SOL_SAFE_FUNCTION_CALLS_I_ SOL_ON + #elif SOL_IS_ON(SOL_DEBUG_BUILD_I_) + #define SOL_SAFE_FUNCTION_CALLS_I_ SOL_DEFAULT_ON + #else + #define SOL_SAFE_FUNCTION_CALLS_I_ SOL_DEFAULT_OFF + #endif +#endif + +#if defined(SOL_SAFE_PROXIES) && (SOL_SAFE_PROXIES != 0) + #define SOL_SAFE_PROXIES_I_ SOL_ON +#else + #if SOL_IS_ON(SOL_ALL_SAFETIES_ON_I_) + #define SOL_SAFE_PROXIES_I_ SOL_ON + #elif SOL_IS_ON(SOL_DEBUG_BUILD_I_) + #define SOL_SAFE_PROXIES_I_ SOL_DEFAULT_ON + #else + #define SOL_SAFE_PROXIES_I_ SOL_DEFAULT_OFF + #endif +#endif + +#if defined(SOL_SAFE_NUMERICS) && (SOL_SAFE_NUMERICS != 0) + #define SOL_SAFE_NUMERICS_I_ SOL_ON +#else + #if SOL_IS_ON(SOL_ALL_SAFETIES_ON_I_) + #define SOL_SAFE_NUMERICS_I_ SOL_ON + #elif SOL_IS_ON(SOL_DEBUG_BUILD_I_) + #define SOL_SAFE_NUMERICS_I_ SOL_DEFAULT_ON + #else + #define SOL_SAFE_NUMERICS_I_ SOL_DEFAULT_OFF + #endif +#endif + +#if defined(SOL_SAFE_STACK_CHECK) && (SOL_SAFE_STACK_CHECK != 0) + #define SOL_SAFE_STACK_CHECK_I_ SOL_ON +#else + #if SOL_IS_ON(SOL_ALL_SAFETIES_ON_I_) + #define SOL_SAFE_STACK_CHECK_I_ SOL_ON + #elif SOL_IS_ON(SOL_DEBUG_BUILD_I_) + #define SOL_SAFE_STACK_CHECK_I_ SOL_DEFAULT_ON + #else + #define SOL_SAFE_STACK_CHECK_I_ SOL_DEFAULT_OFF + #endif +#endif + +#if (defined(SOL_NO_CHECK_NUMBER_PRECISION) && (SOL_NO_CHECK_NUMBER_PRECISION != 0)) \ + || (defined(SOL_NO_CHECKING_NUMBER_PRECISION) && (SOL_NO_CHECKING_NUMBER_PRECISION != 0)) + #define SOL_NUMBER_PRECISION_CHECKS_I_ SOL_OFF +#else + #if SOL_IS_ON(SOL_ALL_SAFETIES_ON_I_) + #define SOL_NUMBER_PRECISION_CHECKS_I_ SOL_ON + #elif SOL_IS_ON(SOL_SAFE_NUMERICS_I_) + #define SOL_NUMBER_PRECISION_CHECKS_I_ SOL_ON + #elif SOL_IS_ON(SOL_DEBUG_BUILD_I_) + #define SOL_NUMBER_PRECISION_CHECKS_I_ SOL_DEFAULT_ON + #else + #define SOL_NUMBER_PRECISION_CHECKS_I_ SOL_DEFAULT_OFF + #endif +#endif + +#if defined(SOL_STRINGS_ARE_NUMBERS) + #if (SOL_STRINGS_ARE_NUMBERS != 0) + #define SOL_STRINGS_ARE_NUMBERS_I_ SOL_ON + #else + #define SOL_STRINGS_ARE_NUMBERS_I_ SOL_OFF + #endif +#else + #define SOL_STRINGS_ARE_NUMBERS_I_ SOL_DEFAULT_OFF +#endif + +#if defined(SOL_ENABLE_INTEROP) && (SOL_ENABLE_INTEROP != 0) \ + || defined(SOL_USE_INTEROP) && (SOL_USE_INTEROP != 0) + #define SOL_USE_INTEROP_I_ SOL_ON +#else + #define SOL_USE_INTEROP_I_ SOL_DEFAULT_OFF +#endif + +#if defined(SOL_NO_NIL) + #if (SOL_NO_NIL != 0) + #define SOL_NIL_I_ SOL_OFF + #else + #define SOL_NIL_I_ SOL_ON + #endif +#elif defined(__MAC_OS_X_VERSION_MAX_ALLOWED) || defined(__OBJC__) || defined(nil) + #define SOL_NIL_I_ SOL_DEFAULT_OFF +#else + #define SOL_NIL_I_ SOL_DEFAULT_ON +#endif + +#if defined(SOL_USERTYPE_TYPE_BINDING_INFO) + #if (SOL_USERTYPE_TYPE_BINDING_INFO != 0) + #define SOL_USERTYPE_TYPE_BINDING_INFO_I_ SOL_ON + #else + #define SOL_USERTYPE_TYPE_BINDING_INFO_I_ SOL_OFF + #endif +#else + #define SOL_USERTYPE_TYPE_BINDING_INFO_I_ SOL_DEFAULT_ON +#endif // We should generate a my_type.__type table with lots of class information for usertypes + +#if defined(SOL_AUTOMAGICAL_TYPES_BY_DEFAULT) + #if (SOL_AUTOMAGICAL_TYPES_BY_DEFAULT != 0) + #define SOL_DEFAULT_AUTOMAGICAL_USERTYPES_I_ SOL_ON + #else + #define SOL_DEFAULT_AUTOMAGICAL_USERTYPES_I_ SOL_OFF + #endif +#elif defined(SOL_DEFAULT_AUTOMAGICAL_USERTYPES) + #if (SOL_DEFAULT_AUTOMAGICAL_USERTYPES != 0) + #define SOL_DEFAULT_AUTOMAGICAL_USERTYPES_I_ SOL_ON + #else + #define SOL_DEFAULT_AUTOMAGICAL_USERTYPES_I_ SOL_OFF + #endif +#else + #define SOL_DEFAULT_AUTOMAGICAL_USERTYPES_I_ SOL_DEFAULT_ON +#endif // make is_automagical on/off by default + +#if defined(SOL_STD_VARIANT) + #if (SOL_STD_VARIANT != 0) + #define SOL_STD_VARIANT_I_ SOL_ON + #else + #define SOL_STD_VARIANT_I_ SOL_OFF + #endif +#else + #if SOL_IS_ON(SOL_COMPILER_CLANG_I_) && SOL_IS_ON(SOL_PLATFORM_APPLE_I_) + #if defined(__has_include) + #if __has_include() + #define SOL_STD_VARIANT_I_ SOL_ON + #else + #define SOL_STD_VARIANT_I_ SOL_OFF + #endif + #else + #define SOL_STD_VARIANT_I_ SOL_OFF + #endif + #else + #define SOL_STD_VARIANT_I_ SOL_DEFAULT_ON + #endif +#endif // make is_automagical on/off by default + +#if defined(SOL_NOEXCEPT_FUNCTION_TYPE) + #if (SOL_NOEXCEPT_FUNCTION_TYPE != 0) + #define SOL_USE_NOEXCEPT_FUNCTION_TYPE_I_ SOL_ON + #else + #define SOL_USE_NOEXCEPT_FUNCTION_TYPE_I_ SOL_OFF + #endif +#else + #if defined(__cpp_noexcept_function_type) + #define SOL_USE_NOEXCEPT_FUNCTION_TYPE_I_ SOL_ON + #elif SOL_IS_ON(SOL_COMPILER_VCXX_I_) && (defined(_MSVC_LANG) && (_MSVC_LANG < 201403L)) + // There is a bug in the VC++ compiler?? + // on /std:c++latest under x86 conditions (VS 15.5.2), + // compiler errors are tossed for noexcept markings being on function types + // that are identical in every other way to their non-noexcept marked types function types... + // VS 2019: There is absolutely a bug. + #define SOL_USE_NOEXCEPT_FUNCTION_TYPE_I_ SOL_OFF + #else + #define SOL_USE_NOEXCEPT_FUNCTION_TYPE_I_ SOL_DEFAULT_ON + #endif +#endif // noexcept is part of a function's type + +#if defined(SOL_STACK_STRING_OPTIMIZATION_SIZE) && SOL_STACK_STRING_OPTIMIZATION_SIZE > 0 + #define SOL_OPTIMIZATION_STRING_CONVERSION_STACK_SIZE_I_ SOL_STACK_STRING_OPTIMIZATION_SIZE +#else + #define SOL_OPTIMIZATION_STRING_CONVERSION_STACK_SIZE_I_ 1024 +#endif + +#if defined(SOL_ID_SIZE) && SOL_ID_SIZE > 0 + #define SOL_ID_SIZE_I_ SOL_ID_SIZE +#else + #define SOL_ID_SIZE_I_ 512 +#endif + +#if defined(LUA_IDSIZE) && LUA_IDSIZE > 0 + #define SOL_FILE_ID_SIZE_I_ LUA_IDSIZE +#elif defined(SOL_ID_SIZE) && SOL_ID_SIZE > 0 + #define SOL_FILE_ID_SIZE_I_ SOL_FILE_ID_SIZE +#else + #define SOL_FILE_ID_SIZE_I_ 2048 +#endif + +#if defined(SOL_PRINT_ERRORS) + #if (SOL_PRINT_ERRORS != 0) + #define SOL_PRINT_ERRORS_I_ SOL_ON + #else + #define SOL_PRINT_ERRORS_I_ SOL_OFF + #endif +#else + #if SOL_IS_ON(SOL_ALL_SAFETIES_ON_I_) + #define SOL_PRINT_ERRORS_I_ SOL_ON + #elif SOL_IS_ON(SOL_DEBUG_BUILD_I_) + #define SOL_PRINT_ERRORS_I_ SOL_DEFAULT_ON + #else + #define SOL_PRINT_ERRORS_I_ SOL_OFF + #endif +#endif + +#if defined(SOL_DEFAULT_PASS_ON_ERROR) && (SOL_DEFAULT_PASS_ON_ERROR != 0) + #define SOL_DEFAULT_PASS_ON_ERROR_I_ SOL_ON +#else + #if SOL_IS_ON(SOL_ALL_SAFETIES_ON_I_) + #define SOL_DEFAULT_PASS_ON_ERROR_I_ SOL_ON + #elif SOL_IS_ON(SOL_DEBUG_BUILD_I_) + #define SOL_DEFAULT_PASS_ON_ERROR_I_ SOL_DEFAULT_ON + #else + #define SOL_DEFAULT_PASS_ON_ERROR_I_ SOL_OFF + #endif +#endif + +#if defined(SOL_USING_CXX_LUA) + #if (SOL_USING_CXX_LUA != 0) + #define SOL_USE_CXX_LUA_I_ SOL_ON + #else + #define SOL_USE_CXX_LUA_I_ SOL_OFF + #endif +#elif defined(SOL_USE_CXX_LUA) + #if (SOL_USE_CXX_LUA != 0) + #define SOL_USE_CXX_LUA_I_ SOL_ON + #else + #define SOL_USE_CXX_LUA_I_ SOL_OFF + #endif +#else + #define SOL_USE_CXX_LUA_I_ SOL_OFF +#endif + +#if defined(SOL_USING_CXX_LUAJIT) + #if (SOL_USING_CXX_LUA != 0) + #define SOL_USE_CXX_LUAJIT_I_ SOL_ON + #else + #define SOL_USE_CXX_LUAJIT_I_ SOL_OFF + #endif +#elif defined(SOL_USE_CXX_LUAJIT) + #if (SOL_USE_CXX_LUA != 0) + #define SOL_USE_CXX_LUAJIT_I_ SOL_ON + #else + #define SOL_USE_CXX_LUAJIT_I_ SOL_OFF + #endif +#else + #define SOL_USE_CXX_LUAJIT_I_ SOL_OFF +#endif + +#if defined(SOL_NO_LUA_HPP) + #if (SOL_NO_LUA_HPP != 0) + #define SOL_USE_LUA_HPP_I_ SOL_OFF + #else + #define SOL_USE_LUA_HPP_I_ SOL_ON + #endif +#elif defined(SOL_USING_CXX_LUA) + #define SOL_USE_LUA_HPP_I_ SOL_OFF +#elif defined(__has_include) + #if __has_include() + #define SOL_USE_LUA_HPP_I_ SOL_ON + #else + #define SOL_USE_LUA_HPP_I_ SOL_OFF + #endif +#else + #define SOL_USE_LUA_HPP_I_ SOL_DEFAULT_ON +#endif + +#if defined(SOL_CONTAINERS_START) + #define SOL_CONTAINER_START_INDEX_I_ SOL_CONTAINERS_START +#elif defined(SOL_CONTAINERS_START_INDEX) + #define SOL_CONTAINER_START_INDEX_I_ SOL_CONTAINERS_START_INDEX +#elif defined(SOL_CONTAINER_START_INDEX) + #define SOL_CONTAINER_START_INDEX_I_ SOL_CONTAINER_START_INDEX +#else + #define SOL_CONTAINER_START_INDEX_I_ 1 +#endif + +#if defined (SOL_NO_MEMORY_ALIGNMENT) + #if (SOL_NO_MEMORY_ALIGNMENT != 0) + #define SOL_ALIGN_MEMORY_I_ SOL_OFF + #else + #define SOL_ALIGN_MEMORY_I_ SOL_ON + #endif +#else + #define SOL_ALIGN_MEMORY_I_ SOL_DEFAULT_ON +#endif + +#if defined(SOL_USE_BOOST) + #if (SOL_USE_BOOST != 0) + #define SOL_USE_BOOST_I_ SOL_ON + #else + #define SOL_USE_BOOST_I_ SOL_OFF + #endif +#else + #define SOL_USE_BOOST_I_ SOL_OFF +#endif + +#if defined(SOL_USE_UNSAFE_BASE_LOOKUP) + #if (SOL_USE_UNSAFE_BASE_LOOKUP != 0) + #define SOL_USE_UNSAFE_BASE_LOOKUP_I_ SOL_ON + #else + #define SOL_USE_UNSAFE_BASE_LOOKUP_I_ SOL_OFF + #endif +#else + #define SOL_USE_UNSAFE_BASE_LOOKUP_I_ SOL_OFF +#endif + +#if defined(SOL_INSIDE_UNREAL) + #if (SOL_INSIDE_UNREAL != 0) + #define SOL_INSIDE_UNREAL_ENGINE_I_ SOL_ON + #else + #define SOL_INSIDE_UNREAL_ENGINE_I_ SOL_OFF + #endif +#else + #if defined(UE_BUILD_DEBUG) || defined(UE_BUILD_DEVELOPMENT) || defined(UE_BUILD_TEST) || defined(UE_BUILD_SHIPPING) || defined(UE_SERVER) + #define SOL_INSIDE_UNREAL_ENGINE_I_ SOL_ON + #else + #define SOL_INSIDE_UNREAL_ENGINE_I_ SOL_DEFAULT_OFF + #endif +#endif + +#if defined(SOL_NO_COMPAT) + #if (SOL_NO_COMPAT != 0) + #define SOL_USE_COMPATIBILITY_LAYER_I_ SOL_OFF + #else + #define SOL_USE_COMPATIBILITY_LAYER_I_ SOL_ON + #endif +#else + #define SOL_USE_COMPATIBILITY_LAYER_I_ SOL_DEFAULT_ON +#endif + +#if defined(SOL_GET_FUNCTION_POINTER_UNSAFE) + #if (SOL_GET_FUNCTION_POINTER_UNSAFE != 0) + #define SOL_GET_FUNCTION_POINTER_UNSAFE_I_ SOL_ON + #else + #define SOL_GET_FUNCTION_POINTER_UNSAFE_I_ SOL_OFF + #endif +#else + #define SOL_GET_FUNCTION_POINTER_UNSAFE_I_ SOL_DEFAULT_OFF +#endif + +#if SOL_IS_ON(SOL_COMPILER_FRONTEND_MINGW_I_) && defined(__GNUC__) && (__GNUC__ < 6) + // MinGW is off its rocker in some places... + #define SOL_MINGW_CCTYPE_IS_POISONED_I_ SOL_ON +#else + #define SOL_MINGW_CCTYPE_IS_POISONED_I_ SOL_DEFAULT_OFF +#endif + +// end of sol/version.hpp + +#if SOL_IS_ON(SOL_INSIDE_UNREAL_ENGINE_I_) +#ifdef check +#pragma push_macro("check") +#undef check +#endif +#endif // Unreal Engine 4 Bullshit + +#if SOL_IS_ON(SOL_COMPILER_GCC_I_) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wconversion" +#if __GNUC__ > 6 +#pragma GCC diagnostic ignored "-Wnoexcept-type" +#endif +#elif SOL_IS_ON(SOL_COMPILER_CLANG_I_) +#elif SOL_IS_ON(SOL_COMPILER_VCXX_I_) +#pragma warning(push) +#pragma warning(disable : 4505) // unreferenced local function has been removed GEE THANKS +#endif // clang++ vs. g++ vs. VC++ + +// beginning of sol/forward.hpp + +#ifndef SOL_FORWARD_HPP +#define SOL_FORWARD_HPP + +#include +#include +#include + +#if SOL_IS_ON(SOL_USE_CXX_LUA_I_) || SOL_IS_ON(SOL_USE_CXX_LUAJIT_I_) +struct lua_State; +#else +extern "C" { +struct lua_State; +} +#endif // C++ Mangling for Lua vs. Not + +namespace sol { + + enum class type; + + class stateless_reference; + template + class basic_reference; + using reference = basic_reference; + using main_reference = basic_reference; + class stateless_stack_reference; + class stack_reference; + + template + class basic_bytecode; + + struct lua_value; + + struct proxy_base_tag; + template + struct proxy_base; + template + struct table_proxy; + + template + class basic_table_core; + template + using table_core = basic_table_core; + template + using main_table_core = basic_table_core; + template + using stack_table_core = basic_table_core; + template + using basic_table = basic_table_core; + using table = table_core; + using global_table = table_core; + using main_table = main_table_core; + using main_global_table = main_table_core; + using stack_table = stack_table_core; + using stack_global_table = stack_table_core; + + template + struct basic_lua_table; + using lua_table = basic_lua_table; + using stack_lua_table = basic_lua_table; + + template + class basic_usertype; + template + using usertype = basic_usertype; + template + using stack_usertype = basic_usertype; + + template + class basic_metatable; + using metatable = basic_metatable; + using stack_metatable = basic_metatable; + + template + struct basic_environment; + using environment = basic_environment; + using main_environment = basic_environment; + using stack_environment = basic_environment; + + template + class basic_function; + template + class basic_protected_function; + using unsafe_function = basic_function; + using safe_function = basic_protected_function; + using main_unsafe_function = basic_function; + using main_safe_function = basic_protected_function; + using stack_unsafe_function = basic_function; + using stack_safe_function = basic_protected_function; + using stack_aligned_unsafe_function = basic_function; + using stack_aligned_safe_function = basic_protected_function; + using protected_function = safe_function; + using main_protected_function = main_safe_function; + using stack_protected_function = stack_safe_function; + using stack_aligned_protected_function = stack_aligned_safe_function; +#if SOL_IS_ON(SOL_SAFE_FUNCTION_OBJECTS_I_) + using function = protected_function; + using main_function = main_protected_function; + using stack_function = stack_protected_function; + using stack_aligned_function = stack_aligned_safe_function; +#else + using function = unsafe_function; + using main_function = main_unsafe_function; + using stack_function = stack_unsafe_function; + using stack_aligned_function = stack_aligned_unsafe_function; +#endif + using stack_aligned_stack_handler_function = basic_protected_function; + + struct unsafe_function_result; + struct protected_function_result; + using safe_function_result = protected_function_result; +#if SOL_IS_ON(SOL_SAFE_FUNCTION_OBJECTS_I_) + using function_result = safe_function_result; +#else + using function_result = unsafe_function_result; +#endif + + template + class basic_object_base; + template + class basic_object; + template + class basic_userdata; + template + class basic_lightuserdata; + template + class basic_coroutine; + template + class basic_thread; + + using object = basic_object; + using userdata = basic_userdata; + using lightuserdata = basic_lightuserdata; + using thread = basic_thread; + using coroutine = basic_coroutine; + using main_object = basic_object; + using main_userdata = basic_userdata; + using main_lightuserdata = basic_lightuserdata; + using main_coroutine = basic_coroutine; + using stack_object = basic_object; + using stack_userdata = basic_userdata; + using stack_lightuserdata = basic_lightuserdata; + using stack_thread = basic_thread; + using stack_coroutine = basic_coroutine; + + struct stack_proxy_base; + struct stack_proxy; + struct variadic_args; + struct variadic_results; + struct stack_count; + struct this_state; + struct this_main_state; + struct this_environment; + + class state_view; + class state; + + template + struct as_table_t; + template + struct as_container_t; + template + struct nested; + template + struct light; + template + struct user; + template + struct as_args_t; + template + struct protect_t; + template + struct policy_wrapper; + + template + struct usertype_traits; + template + struct unique_usertype_traits; + + template + struct types { + typedef std::make_index_sequence indices; + static constexpr std::size_t size() { + return sizeof...(Args); + } + }; + + template + struct derive : std::false_type { + typedef types<> type; + }; + + template + struct base : std::false_type { + typedef types<> type; + }; + + template + struct weak_derive { + static bool value; + }; + + template + bool weak_derive::value = false; + + namespace stack { + struct record; + } + +#if SOL_IS_OFF(SOL_USE_BOOST_I_) + template + class optional; + + template + class optional; +#endif + + using check_handler_type = int(lua_State*, int, type, type, const char*); + +} // namespace sol + +#define SOL_BASE_CLASSES(T, ...) \ + namespace sol { \ + template <> \ + struct base : std::true_type { \ + typedef ::sol::types<__VA_ARGS__> type; \ + }; \ + } \ + void a_sol3_detail_function_decl_please_no_collide() +#define SOL_DERIVED_CLASSES(T, ...) \ + namespace sol { \ + template <> \ + struct derive : std::true_type { \ + typedef ::sol::types<__VA_ARGS__> type; \ + }; \ + } \ + void a_sol3_detail_function_decl_please_no_collide() + +#endif // SOL_FORWARD_HPP +// end of sol/forward.hpp + +// beginning of sol/forward_detail.hpp + +#ifndef SOL_FORWARD_DETAIL_HPP +#define SOL_FORWARD_DETAIL_HPP + +// beginning of sol/traits.hpp + +// beginning of sol/tuple.hpp + +// beginning of sol/base_traits.hpp + +#include + +namespace sol { + namespace detail { + struct unchecked_t {}; + const unchecked_t unchecked = unchecked_t{}; + } // namespace detail + + namespace meta { + using sfinae_yes_t = std::true_type; + using sfinae_no_t = std::false_type; + + template + using void_t = void; + + template + using unqualified = std::remove_cv>; + + template + using unqualified_t = typename unqualified::type; + + namespace meta_detail { + template + struct unqualified_non_alias : unqualified {}; + + template