diff --git a/CMakeLists.txt b/CMakeLists.txt index 76a1fe9..edd7ed8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.13) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdata-sections -ffunction-sections") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections -rdynamic") -project (AlterLuanti VERSION 0.0 DESCRIPTION "AlterLuanti Description") +project (LuaVox VERSION 0.0 DESCRIPTION "LuaVox Description") add_executable(${PROJECT_NAME}) target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_20) diff --git a/Src/Client/Abstract.cpp b/Src/Client/Abstract.cpp index 0d016fc..14284f2 100644 --- a/Src/Client/Abstract.cpp +++ b/Src/Client/Abstract.cpp @@ -1,7 +1,7 @@ #include "Abstract.hpp" -namespace AL::Client { +namespace LV::Client { void IRenderSession::onChunksChange(WorldId_t worldId, const std::vector &changeOrAddList, const std::vector &remove) {} void IRenderSession::attachCameraToEntity(EntityId_t id) {} diff --git a/Src/Client/Abstract.hpp b/Src/Client/Abstract.hpp index d8d7196..21d574e 100644 --- a/Src/Client/Abstract.hpp +++ b/Src/Client/Abstract.hpp @@ -7,7 +7,7 @@ #include -namespace AL::Client { +namespace LV::Client { using VoxelId_t = uint16_t; diff --git a/Src/Client/ServerSession.cpp b/Src/Client/ServerSession.cpp index 42bbe08..44783f2 100644 --- a/Src/Client/ServerSession.cpp +++ b/Src/Client/ServerSession.cpp @@ -7,7 +7,7 @@ #include -namespace AL::Client { +namespace LV::Client { using namespace TOS; diff --git a/Src/Client/ServerSession.hpp b/Src/Client/ServerSession.hpp index bb09d22..0c58b12 100644 --- a/Src/Client/ServerSession.hpp +++ b/Src/Client/ServerSession.hpp @@ -6,7 +6,7 @@ #include -namespace AL::Client { +namespace LV::Client { class ServerSession : public AsyncObject, public IServerSession, public ISurfaceEventListener { std::unique_ptr _Socket; diff --git a/Src/Common/Abstract.hpp b/Src/Common/Abstract.hpp index 53a0132..233ba9e 100644 --- a/Src/Common/Abstract.hpp +++ b/Src/Common/Abstract.hpp @@ -3,7 +3,7 @@ #include #include -namespace AL { +namespace LV { namespace Pos { struct Local4_u { @@ -125,7 +125,7 @@ struct LightPrism { namespace std { -#define hash_for_pos(type) template <> struct hash { std::size_t operator()(const AL::Pos::type& obj) const { return std::hash()((AL::Pos::type::Key) obj); } }; +#define hash_for_pos(type) template <> struct hash { std::size_t operator()(const LV::Pos::type& obj) const { return std::hash()((LV::Pos::type::Key) obj); } }; hash_for_pos(Local4_u) hash_for_pos(Local16_u) hash_for_pos(Local16) @@ -133,4 +133,4 @@ hash_for_pos(GlobalChunk) hash_for_pos(GlobalRegion) #undef hash_for_pos -} \ No newline at end of file +} diff --git a/Src/Common/Async.hpp b/Src/Common/Async.hpp index 855e70c..faf4085 100644 --- a/Src/Common/Async.hpp +++ b/Src/Common/Async.hpp @@ -11,7 +11,7 @@ #include -namespace AL { +namespace LV { using namespace boost::asio::experimental::awaitable_operators; diff --git a/Src/Common/Collide.hpp b/Src/Common/Collide.hpp index 83c9a2e..36e8ae9 100644 --- a/Src/Common/Collide.hpp +++ b/Src/Common/Collide.hpp @@ -1,7 +1,7 @@ #include "Common/Abstract.hpp" #include -namespace AL { +namespace LV { template bool calcBoxToBoxCollide(const VecType vec1_min, const VecType vec1_max, diff --git a/Src/Common/Lockable.hpp b/Src/Common/Lockable.hpp index 66d8215..10e2e53 100644 --- a/Src/Common/Lockable.hpp +++ b/Src/Common/Lockable.hpp @@ -6,7 +6,7 @@ #include #include -namespace AL { +namespace LV { template class Lockable { diff --git a/Src/Common/MemoryPool.hpp b/Src/Common/MemoryPool.hpp index 5c009f1..47a8c3a 100644 --- a/Src/Common/MemoryPool.hpp +++ b/Src/Common/MemoryPool.hpp @@ -3,7 +3,7 @@ #include -namespace AL { +namespace LV { template struct BoostPool { diff --git a/Src/Common/Net.cpp b/Src/Common/Net.cpp index 40ca71b..21de8e1 100644 --- a/Src/Common/Net.cpp +++ b/Src/Common/Net.cpp @@ -2,7 +2,7 @@ #include #include -namespace AL::Net { +namespace LV::Net { using namespace TOS; diff --git a/Src/Common/Net.hpp b/Src/Common/Net.hpp index f88bb91..55c37e6 100644 --- a/Src/Common/Net.hpp +++ b/Src/Common/Net.hpp @@ -10,7 +10,7 @@ #include #include -namespace AL::Net { +namespace LV::Net { class Server : public AsyncObject { protected: diff --git a/Src/Server/Abstract.hpp b/Src/Server/Abstract.hpp index fbc6c81..2cc1248 100644 --- a/Src/Server/Abstract.hpp +++ b/Src/Server/Abstract.hpp @@ -6,7 +6,7 @@ #include -namespace AL::Server { +namespace LV::Server { using VoxelId_c = uint16_t; using NodeId_c = uint16_t; diff --git a/Src/Server/BinaryResourceManager.cpp b/Src/Server/BinaryResourceManager.cpp index d128573..0e86789 100644 --- a/Src/Server/BinaryResourceManager.cpp +++ b/Src/Server/BinaryResourceManager.cpp @@ -7,7 +7,7 @@ #include -namespace AL::Server { +namespace LV::Server { diff --git a/Src/Server/BinaryResourceManager.hpp b/Src/Server/BinaryResourceManager.hpp index 3de5faa..c38b532 100644 --- a/Src/Server/BinaryResourceManager.hpp +++ b/Src/Server/BinaryResourceManager.hpp @@ -12,7 +12,7 @@ #include "Abstract.hpp" -namespace AL::Server { +namespace LV::Server { namespace fs = std::filesystem; diff --git a/Src/Server/ContentEventController.cpp b/Src/Server/ContentEventController.cpp index b6d1cbc..12cac5a 100644 --- a/Src/Server/ContentEventController.cpp +++ b/Src/Server/ContentEventController.cpp @@ -4,7 +4,7 @@ #include "Server/Abstract.hpp" -namespace AL::Server { +namespace LV::Server { ContentEventController::ContentEventController(std::unique_ptr &&remote) : Remote(std::move(remote)) diff --git a/Src/Server/ContentEventController.hpp b/Src/Server/ContentEventController.hpp index 1a7f19c..56c2c98 100644 --- a/Src/Server/ContentEventController.hpp +++ b/Src/Server/ContentEventController.hpp @@ -8,7 +8,7 @@ #include -namespace AL::Server { +namespace LV::Server { class RemoteClient; class GameServer; @@ -138,11 +138,11 @@ public: namespace std { template <> -struct hash { - std::size_t operator()(const AL::Server::ServerObjectPos& obj) const { +struct hash { + std::size_t operator()(const LV::Server::ServerObjectPos& obj) const { return std::hash()(obj.WorldId) ^ std::hash()(obj.ObjectPos.x) ^ std::hash()(obj.ObjectPos.y) ^ std::hash()(obj.ObjectPos.z); } }; -} \ No newline at end of file +} diff --git a/Src/Server/GameServer.cpp b/Src/Server/GameServer.cpp index 0239708..29def32 100644 --- a/Src/Server/GameServer.cpp +++ b/Src/Server/GameServer.cpp @@ -12,7 +12,7 @@ #include #include "SaveBackends/Filesystem.hpp" -namespace AL::Server { +namespace LV::Server { GameServer::~GameServer() { shutdown("on ~GameServer"); diff --git a/Src/Server/GameServer.hpp b/Src/Server/GameServer.hpp index b207371..2144eec 100644 --- a/Src/Server/GameServer.hpp +++ b/Src/Server/GameServer.hpp @@ -21,7 +21,7 @@ #include "SaveBackend.hpp" -namespace AL::Server { +namespace LV::Server { namespace fs = std::filesystem; diff --git a/Src/Server/RemoteClient.cpp b/Src/Server/RemoteClient.cpp index 5b0dc85..1df1ee1 100644 --- a/Src/Server/RemoteClient.cpp +++ b/Src/Server/RemoteClient.cpp @@ -9,7 +9,7 @@ #include -namespace AL::Server { +namespace LV::Server { RemoteClient::~RemoteClient() { shutdown("~RemoteClient()"); diff --git a/Src/Server/RemoteClient.hpp b/Src/Server/RemoteClient.hpp index 8c1a97b..f102b6d 100644 --- a/Src/Server/RemoteClient.hpp +++ b/Src/Server/RemoteClient.hpp @@ -9,7 +9,7 @@ #include #include -namespace AL::Server { +namespace LV::Server { /* Шаблоны игрового контента, которые необходимо поддерживать в актуальном diff --git a/Src/Server/SaveBackend.cpp b/Src/Server/SaveBackend.cpp index c4c79d7..49d9d92 100644 --- a/Src/Server/SaveBackend.cpp +++ b/Src/Server/SaveBackend.cpp @@ -1,6 +1,6 @@ #include "SaveBackend.hpp" -namespace AL::Server { +namespace LV::Server { IWorldSaveBackend::~IWorldSaveBackend() = default; IPlayerSaveBackend::~IPlayerSaveBackend() = default; diff --git a/Src/Server/SaveBackend.hpp b/Src/Server/SaveBackend.hpp index b396d4b..89444de 100644 --- a/Src/Server/SaveBackend.hpp +++ b/Src/Server/SaveBackend.hpp @@ -8,7 +8,7 @@ #include -namespace AL::Server { +namespace LV::Server { struct SB_Region { std::vector Voxels; diff --git a/Src/Server/SaveBackends/Filesystem.cpp b/Src/Server/SaveBackends/Filesystem.cpp index 23756a7..ac890f8 100644 --- a/Src/Server/SaveBackends/Filesystem.cpp +++ b/Src/Server/SaveBackends/Filesystem.cpp @@ -12,7 +12,7 @@ #include #include -namespace AL::Server::SaveBackends { +namespace LV::Server::SaveBackends { namespace fs = std::filesystem; namespace js = boost::json; @@ -253,4 +253,4 @@ std::unique_ptr Filesystem::createModStorage(boost::json return std::make_unique(data); } -} \ No newline at end of file +} diff --git a/Src/Server/SaveBackends/Filesystem.hpp b/Src/Server/SaveBackends/Filesystem.hpp index f8575f7..8ae1e00 100644 --- a/Src/Server/SaveBackends/Filesystem.hpp +++ b/Src/Server/SaveBackends/Filesystem.hpp @@ -3,7 +3,7 @@ #include -namespace AL::Server::SaveBackends { +namespace LV::Server::SaveBackends { class Filesystem : public ISaveBackendProvider { public: @@ -17,4 +17,4 @@ public: virtual std::unique_ptr createModStorage(boost::json::object data) override; }; -} \ No newline at end of file +} diff --git a/Src/Server/World.cpp b/Src/Server/World.cpp index a15b651..9f2fcc7 100644 --- a/Src/Server/World.cpp +++ b/Src/Server/World.cpp @@ -1,7 +1,7 @@ #include "World.hpp" -namespace AL::Server { +namespace LV::Server { World::World(WorldId_t id) { diff --git a/Src/Server/World.hpp b/Src/Server/World.hpp index ba72613..5d8ad0a 100644 --- a/Src/Server/World.hpp +++ b/Src/Server/World.hpp @@ -7,7 +7,7 @@ #include -namespace AL::Server { +namespace LV::Server { class GameServer; diff --git a/Src/main.cpp b/Src/main.cpp index c9b437a..f9e7211 100644 --- a/Src/main.cpp +++ b/Src/main.cpp @@ -7,8 +7,11 @@ #include "Client/ServerSession.hpp" #include "Common/Net.hpp" #include "Server/GameServer.hpp" +#include -namespace AL { +namespace LV { + +using namespace TOS; coro<> runClient(asio::io_context &ioc, uint16_t port) { try { @@ -22,13 +25,15 @@ coro<> runClient(asio::io_context &ioc, uint16_t port) { int main() { - // VK::Vulkan VkInst; - // VkInst.getSettingsNext() = VkInst.getBestSettings(); - // VkInst.reInit(); + VK::Vulkan VkInst; + VkInst.getSettingsNext() = VkInst.getBestSettings(); + VkInst.reInit(); - // VkInst.start([&](VK::Vulkan *instance, int subpass, VkCommandBuffer &renderCmd) - // { - // }); + auto ot = std::async([&](){ + VkInst.start([&](VK::Vulkan *instance, int subpass, VkCommandBuffer &renderCmd) + { + }); + }); // LuaVox @@ -46,6 +51,7 @@ int main() { asio::co_spawn(ioc, runClient(ioc, server.getPort()), asio::detached); ioc.run(); + VkInst.shutdown(); return 0; } @@ -57,5 +63,5 @@ int main() { TOS::Logger::addLogOutput(".*", TOS::EnumLogType::All); std::cout << "Hello world!" << std::endl; - return AL::main(); + return LV::main(); } diff --git a/Work/imgui.ini b/Work/imgui.ini new file mode 100644 index 0000000..9930887 --- /dev/null +++ b/Work/imgui.ini @@ -0,0 +1,4 @@ +[Window][Debug##Default] +Pos=60,60 +Size=400,400 +