diff --git a/CMakeLists.txt b/CMakeLists.txt index 07bc526..6be01b0 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,12 +21,6 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") set(ENABLE_LINUX TRUE) endif() -FetchContent_Declare( - lua - GIT_REPOSITORY https://github.com/NLua/lua.git - GIT_TAG master -) - FetchContent_Declare( bullet GIT_REPOSITORY https://github.com/bulletphysics/bullet3.git @@ -59,17 +53,12 @@ macro(manual_download) set(ENABLE_GLSLANG_BINARIES OFF CACHE BOOL "" FORCE) set(USE_MSVC_RUNTIME_LIBRARY_DLL ON CACHE BOOL "" FORCE) - add_definitions(-DLUA_USE_APPLE) - set(CMAKE_FOLDER "External") - FetchContent_MakeAvailable(lua) FetchContent_MakeAvailable(bullet) FetchContent_MakeAvailable(spirv-cross) FetchContent_MakeAvailable(glslang) - remove_definitions(LUA_USE_MACOSX) - set(CMAKE_FOLDER "") endmacro() diff --git a/engine/core/CMakeLists.txt b/engine/core/CMakeLists.txt index 98e05c3..a40046f 100755 --- a/engine/core/CMakeLists.txt +++ b/engine/core/CMakeLists.txt @@ -33,7 +33,7 @@ set(SRC src/debug.cpp) if(NOT ENABLE_IOS AND NOT ENABLE_TVOS) - set(EXTRA_LIBRARIES Audio sol) + set(EXTRA_LIBRARIES Audio) endif() add_library(Core STATIC ${SRC}) diff --git a/engine/core/include/engine.hpp b/engine/core/include/engine.hpp index 8fefd67..11600ca 100755 --- a/engine/core/include/engine.hpp +++ b/engine/core/include/engine.hpp @@ -8,10 +8,6 @@ #include #include -#if !defined(PLATFORM_IOS) && !defined(PLATFORM_TVOS) && !defined(PLATFORM_WINDOWS) -#include -#endif - #include "scene.hpp" #include "renderer.hpp" #include "input.hpp" @@ -323,10 +319,6 @@ public: /// If physics should upate. This is a control indepentent of the pause state. bool update_physics = true; -#if !defined(PLATFORM_IOS) && !defined(PLATFORM_TVOS) && !defined(PLATFORM_WINDOWS) - sol::state lua; -#endif - #if defined(PLATFORM_TVOS) || defined(PLATFORM_IOS) bool debug_enabled = true; #else @@ -334,7 +326,6 @@ public: #endif private: - void create_lua_interface(); void setup_scene(Scene& scene); void on_remove(Object object); diff --git a/engine/core/include/scene.hpp b/engine/core/include/scene.hpp index b8989f6..ecc002e 100755 --- a/engine/core/include/scene.hpp +++ b/engine/core/include/scene.hpp @@ -5,10 +5,6 @@ #include #include -#if !defined(PLATFORM_IOS) && !defined(PLATFORM_TVOS) && !defined(PLATFORM_WINDOWS) -#include -#endif - #include #include "vector.hpp" @@ -254,13 +250,6 @@ public: std::array environment_dirty; GFXTexture *irradianceCubeArray = nullptr, *prefilteredCubeArray = nullptr; - - // script - std::string script_path; - -#if !defined(PLATFORM_IOS) && !defined(PLATFORM_TVOS) && !defined(PLATFORM_WINDOWS) - sol::environment env; -#endif }; /** Positions and rotates a camera to look at a target from a position. diff --git a/engine/core/include/screen.hpp b/engine/core/include/screen.hpp index ed5ba45..47ed384 100755 --- a/engine/core/include/screen.hpp +++ b/engine/core/include/screen.hpp @@ -5,10 +5,6 @@ #include #include -#if !defined(PLATFORM_IOS) && !defined(PLATFORM_TVOS) && !defined(PLATFORM_WINDOWS) -#include -#endif - #include "uielement.hpp" #include "file.hpp" @@ -42,11 +38,5 @@ namespace ui { GFXBuffer* glyph_buffer = nullptr; GFXBuffer* instance_buffer = nullptr; GFXBuffer* elements_buffer = nullptr; - - std::string script_path; - -#if !defined(PLATFORM_IOS) && !defined(PLATFORM_TVOS) && !defined(PLATFORM_WINDOWS) - sol::environment env; -#endif }; } diff --git a/engine/core/src/engine.cpp b/engine/core/src/engine.cpp index bf16786..839fd3d 100755 --- a/engine/core/src/engine.cpp +++ b/engine/core/src/engine.cpp @@ -27,8 +27,6 @@ Engine::Engine(const int argc, char* argv[]) { _physics = std::make_unique(); _imgui = std::make_unique(); assetm = std::make_unique(); - - create_lua_interface(); } void Engine::set_app(App* app) { @@ -122,9 +120,6 @@ Scene* Engine::load_scene(const file::Path path) { auto scene = std::make_unique(); - if(j.contains("script")) - scene->script_path = j["script"]; - std::map parentQueue; for(auto& obj : j["objects"]) { @@ -147,17 +142,6 @@ Scene* Engine::load_scene(const file::Path path) { for(auto& [obj, toParent] : parentQueue) scene->get(obj).parent = scene->find_object(toParent); - -#if !defined(PLATFORM_IOS) && !defined(PLATFORM_TVOS) && !defined(PLATFORM_WINDOWS) - scene->env = sol::environment(lua, sol::create, lua.globals()); - scene->env["scene"] = scene.get(); - - if(!scene->script_path.empty()) { - auto script_file = file::open(file::root_path(path) / scene->script_path); - if(script_file != std::nullopt) - engine->lua.safe_script(script_file->read_as_string(), scene->env); - } -#endif setup_scene(*scene); @@ -178,8 +162,6 @@ void Engine::save_scene(const std::string_view path) { j["objects"].push_back(save_object(obj)); } - j["script"] = _current_scene->script_path; - std::ofstream out(path.data()); out << j; } @@ -819,74 +801,6 @@ void Engine::stop_animation(Object target) { } } -void Engine::create_lua_interface() { -#if !defined(PLATFORM_IOS) && !defined(PLATFORM_TVOS) && !defined(PLATFORM_WINDOWS) - lua.open_libraries(sol::lib::base, sol::lib::package, sol::lib::table, sol::lib::string, sol::lib::math); - - lua.new_usertype("Cutscene"); - - lua.new_usertype("InputBindingData", - "name", &InputBindingData::name); - - lua.new_usertype("Input", - "get_bindings", sol::readonly_property(&Input::get_bindings)); - - lua.new_usertype("Engine", - "pause", &Engine::pause, - "unpause", &Engine::unpause, - "clear_cutscene", [this] { - cutscene = nullptr; - }, - "update_screen", [this] { - get_renderer()->update_screen(); - }, - "quit", &Engine::quit, - "get_input", sol::readonly_property(&Engine::get_input), - "push_event", &Engine::push_event); - - lua["engine"] = this; - - lua.new_usertype("UIScreen", - "find_element", &ui::Screen::find_element, - "add_element", [](ui::Screen* screen, UIElement& element) { - screen->elements.push_back(element); - }); - - lua.new_usertype("UIElementBackground", - "image", &UIElement::Background::image); - - lua.new_usertype("UIElementMetric", - "value", &UIElement::Metrics::Metric::value); - - lua.new_usertype("UIElementMetrics", - "x", &UIElement::Metrics::x, - "y", &UIElement::Metrics::y, - "width", &UIElement::Metrics::width, - "height", &UIElement::Metrics::height); - - lua.new_usertype("UIElement", - "id", &UIElement::id, - "text", &UIElement::text, - "=background", &UIElement::background, - "visible", &UIElement::visible, - "metrics", &UIElement::metrics); - - lua.new_usertype("Scene"); - - lua["get_transform"] = [](Object o) -> Transform& { - return engine->get_scene()->get(o); - }; - - lua.new_usertype("Transform", - "position", &Transform::position); - - lua.new_usertype("Vector3", - "x", &Vector3::x, - "y", &Vector3::y, - "z", &Vector3::z); -#endif -} - void Engine::setup_scene(Scene& scene) { _physics->reset(); diff --git a/engine/core/src/screen.cpp b/engine/core/src/screen.cpp index 6886ee2..ed5874f 100755 --- a/engine/core/src/screen.cpp +++ b/engine/core/src/screen.cpp @@ -77,19 +77,6 @@ void ui::Screen::calculate_sizes() { void ui::Screen::process_mouse(const int x, const int y) { Expects(x >= 0); Expects(y >= 0); - -#if !defined(PLATFORM_IOS) && !defined(PLATFORM_TVOS) && !defined(PLATFORM_WINDOWS) - for(auto& element : elements) { - if(x > element.absolute_x && - y > element.absolute_y && - x < (element.absolute_x + element.absolute_width) && - y < (element.absolute_y + element.absolute_height)) { - - if(!element.on_click_script.empty()) - engine->lua.safe_script(element.on_click_script, env); - } - } -#endif } UIElement* ui::Screen::find_element(const std::string& id) { @@ -116,9 +103,6 @@ ui::Screen::Screen(const file::Path path) { nlohmann::json j; file->read_as_stream() >> j; - if(j.count("script")) - script_path = j["script"]; - for(auto& element : j["elements"]) { UIElement ue; ue.id = element["id"]; @@ -195,17 +179,6 @@ ui::Screen::Screen(const file::Path path) { elements.push_back(ue); } - -#if !defined(PLATFORM_IOS) && !defined(PLATFORM_TVOS) && !defined(PLATFORM_WINDOWS) - env = sol::environment(engine->lua, sol::create, engine->lua.globals()); - env["screen"] = this; - - if(!script_path.empty()) { - auto script_file = file::open(file::app_domain / script_path); - if(script_file != std::nullopt) - engine->lua.safe_script(script_file->read_as_string(), env); - } -#endif } void ui::Screen::add_listener(const std::string& id, std::function callback) { @@ -213,8 +186,5 @@ void ui::Screen::add_listener(const std::string& id, std::function callb } void ui::Screen::process_event(const std::string& type, const std::string data) { -#if !defined(PLATFORM_IOS) && !defined(PLATFORM_TVOS) && !defined(PLATFORM_WINDOWS) - auto func = env["process_event"]; - func(type, data); -#endif + } diff --git a/engine/renderer/src/shadercompiler.cpp b/engine/renderer/src/shadercompiler.cpp index 5b4434f..953027a 100755 --- a/engine/renderer/src/shadercompiler.cpp +++ b/engine/renderer/src/shadercompiler.cpp @@ -155,7 +155,7 @@ const std::vector CompileGLSL(const std::string& filename, EShLang includer.pushExternalLocalDirectory(file::get_domain_path(file::Domain::Internal).string()); if (!Shader.parse(&Resources, 100, false, (EShMessages)0, includer)) { - std::cout << Shader.getInfoLog() << std::endl; + console::error(System::Renderer, "{}", Shader.getInfoLog()); return {}; } @@ -179,8 +179,8 @@ const std::vector CompileGLSL(const std::string& filename, EShLang std::variant> get_shader(std::string filename, bool skinned, bool cubemap) { auto shader_file = file::open(file::internal_domain / filename); - if(!shader_file) { - std::cerr << "Failed to open " << filename << "!!" << std::endl; + if(!shader_file.has_value()) { + console::error(System::Renderer, "Failed to open shader file {}!", filename); return ""; } diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt index 0295885..eb4412e 100755 --- a/extern/CMakeLists.txt +++ b/extern/CMakeLists.txt @@ -13,7 +13,6 @@ add_subdirectory(stb) add_subdirectory(imgui) add_subdirectory(magic_enum) add_subdirectory(smaa) -add_subdirectory(sol) add_subdirectory(doctest) include(FetchContent) diff --git a/extern/sol/CMakeLists.txt b/extern/sol/CMakeLists.txt deleted file mode 100755 index 2848cf0..0000000 --- a/extern/sol/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -if(TARGET liblua_static) - set(LUA_LIBRARY liblua_static) - set(LUA_INCLUDE_DIR ${CMAKE_BINARY_DIR}/_deps/lua-build/include) -else() - find_package(LuaJIT REQUIRED) -endif() - -add_library(sol INTERFACE) -target_include_directories(sol SYSTEM INTERFACE include ${LUA_INCLUDE_DIR}) -target_link_libraries(sol INTERFACE ${LUA_LIBRARY}) -target_compile_definitions(sol INTERFACE SOL_ALL_SAFETIES_ON SOL_EXCEPTIONS_SAFE_PROPAGATION) - -if(ENABLE_IOS OR ENABLE_TVOS) -target_compile_definitions(sol INTERFACE LUA_USE_APPLE) -endif() \ No newline at end of file diff --git a/extern/sol/include/sol.hpp b/extern/sol/include/sol.hpp deleted file mode 100644 index de97281..0000000 --- a/extern/sol/include/sol.hpp +++ /dev/null @@ -1,25838 +0,0 @@ -// 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-05-22 13:37:38.805887 UTC -// This header was generated with sol v3.2.0 (revision d9c034d) -// 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 - -#if defined(UE_BUILD_DEBUG) || defined(UE_BUILD_DEVELOPMENT) || defined(UE_BUILD_TEST) || defined(UE_BUILD_SHIPPING) || defined(UE_SERVER) -#define SOL_INSIDE_UNREAL -#ifdef check -#pragma push_macro("check") -#undef check -#endif -#endif // Unreal Engine 4 Bullshit - -#if defined(__GNUC__) -#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 defined(__clang__) -#elif defined _MSC_VER -#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 - -// beginning of sol/feature_test.hpp - -#if (defined(__cplusplus) && __cplusplus >= 201703L) \ - || (defined(_MSC_VER) && _MSC_VER > 1900 && ((defined(_HAS_CXX17) && _HAS_CXX17 == 1) || (defined(_MSVC_LANG) && (_MSVC_LANG > 201402L)))) -#endif // C++17 features check - -#if defined(__cpp_noexcept_function_type) || ((defined(_MSC_VER) && _MSC_VER > 1911) && (defined(_MSVC_LANG) && ((_MSVC_LANG >= 201403L)))) -#ifndef SOL_NOEXCEPT_FUNCTION_TYPE -#define SOL_NOEXCEPT_FUNCTION_TYPE 1 -#endif // noexcept is part of a function's type -#endif // compiler-specific checks -#if defined(__clang__) && defined(__APPLE__) -#if defined(__has_include) -#if __has_include() -#define SOL_STD_VARIANT 1 -#endif // has include nonsense -#endif // __has_include -#else -#define SOL_STD_VARIANT 1 -#endif // Clang screws up variant - -// beginning of sol/config.hpp - -#ifdef _MSC_VER -#if defined(_DEBUG) && !defined(NDEBUG) -#ifndef SOL_IN_DEBUG_DETECTED -#define SOL_IN_DEBUG_DETECTED 1 -#endif -#endif // VC++ Debug macros - -#if !defined(_CPPUNWIND) -#if !defined(SOL_NO_EXCEPTIONS) -#define SOL_NO_EXCEPTIONS 1 -#endif -#endif // Automatic Exceptions - -#if !defined(_CPPRTTI) -#if !defined(SOL_NO_RTTI) -#define SOL_NO_RTTI 1 -#endif -#endif // Automatic RTTI -#elif defined(__GNUC__) || defined(__clang__) - -#if !defined(NDEBUG) && !defined(__OPTIMIZE__) -#if !defined(SOL_IN_DEBUG_DETECTED) -#define SOL_IN_DEBUG_DETECTED 1 -#endif -#endif // Not Debug && g++ optimizer flag - -#if !defined(__EXCEPTIONS) -#if !defined(SOL_NO_EXCEPTIONS) -#define SOL_NO_EXCEPTIONS 1 -#endif -#endif // No Exceptions - -#if !defined(__GXX_RTTI) -#if !defined(SOL_NO_RTTI) -#define SOL_NO_RTTI 1 -#endif -#endif // No RTTI - -#endif // vc++ || clang++/g++ - -#if defined(SOL_CHECK_ARGUMENTS) && SOL_CHECK_ARGUMENTS != 0 -#if defined(SOL_ALL_SAFETIES_ON) -#define SOL_ALL_SAFETIES_ON 1 -#endif // turn all the safeties on -#endif // Compatibility Define for Safety - -#if defined(SOL_ALL_SAFETIES_ON) && SOL_ALL_SAFETIES_ON != 0 - -#if !defined(SOL_SAFE_GETTER) -#define SOL_SAFE_GETTER 1 -#endif - -#if !defined(SOL_SAFE_USERTYPE) -#define SOL_SAFE_USERTYPE 1 -#endif - -#if !defined(SOL_SAFE_REFERENCES) -#define SOL_SAFE_REFERENCES 1 -#endif - -#if !defined(SOL_SAFE_FUNCTION) -#define SOL_SAFE_FUNCTION 1 -#endif - -#if !defined(SOL_SAFE_FUNCTION_CALLS) -#define SOL_SAFE_FUNCTION_CALLS 1 -#endif - -#if !defined(SOL_SAFE_PROXIES) -#define SOL_SAFE_PROXIES 1 -#endif - -#if !defined(SOL_SAFE_NUMERICS) -#define SOL_SAFE_NUMERICS 1 -#endif - -#if !defined(SOL_NO_CHECK_NUMBER_PRECISION) -#define SOL_NO_CHECK_NUMBER_PRECISION 0 -#endif - -#if !defined(SOL_SAFE_STACK_CHECK) -#define SOL_SAFE_STACK_CHECK 1 -#endif - -#endif // Turn on Safety for all if top-level macro is defined - -#if defined(SOL_IN_DEBUG_DETECTED) && SOL_IN_DEBUG_DETECTED != 0 - -#if !defined(SOL_SAFE_REFERENCES) -#define SOL_SAFE_REFERENCES 1 -#endif - -#if !defined(SOL_SAFE_USERTYPE) -#define SOL_SAFE_USERTYPE 1 -#endif - -#if !defined(SOL_SAFE_FUNCTION_CALLS) -#define SOL_SAFE_FUNCTION_CALLS 1 -#endif - -#if !defined(SOL_PRINT_ERRORS) -#define SOL_PRINT_ERRORS 1 -#endif - -#if !defined(SOL_SAFE_STACK_CHECK) -#define SOL_SAFE_STACK_CHECK 1 -#endif - -#endif // DEBUG: Turn on all debug safety features for VC++ / g++ / clang++ and similar - -#if !defined(SOL_PRINT_ERRORS) -#define SOL_PRINT_ERRORS 0 -#endif - -#if !defined(SOL_DEFAULT_PASS_ON_ERROR) -#define SOL_DEFAULT_PASS_ON_ERROR 0 -#endif - -#if !defined(SOL_ENABLE_INTEROP) -#define SOL_ENABLE_INTEROP 0 -#endif - -#if defined(__MAC_OS_X_VERSION_MAX_ALLOWED) || defined(__OBJC__) || defined(nil) -#if !defined(SOL_NO_NIL) -#define SOL_NO_NIL 1 -#endif -#endif // avoiding nil defines / keywords - -#ifndef SOL_STACK_STRING_OPTIMIZATION_SIZE -#define SOL_STACK_STRING_OPTIMIZATION_SIZE 1024 -#endif // Optimized conversion routines using a KB or so off the stack - -#if !defined(SOL_SAFE_STACK_CHECK) -#define SOL_SAFE_STACK_CHECK 0 -#endif // use luaL_checkstack to check stack overflow / overrun - -#if !defined(SOL_AUTOMAGICAL_TYPES_BY_DEFAULT) -#define SOL_AUTOMAGICAL_TYPES_BY_DEFAULT 1 -#endif // make is_automagical on/off by default - -// end of sol/config.hpp - -// beginning of sol/config_setup.hpp - -// end of sol/config_setup.hpp - -// end of sol/feature_test.hpp - -#include -#include -#include - -#if defined(SOL_USING_CXX_LUA) && SOL_USING_CXX_LUA -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 defined(SOL_SAFE_FUNCTION) && SOL_SAFE_FUNCTION - 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 defined(SOL_SAFE_FUNCTION) && SOL_SAFE_FUNCTION - 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 !defined(SOL_USE_BOOST) || (SOL_USE_BOOST == 0) - 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 - -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