diff --git a/engine-api/src/Render.cpp b/engine-api/src/Render.cpp index 92971de..7cd5534 100644 --- a/engine-api/src/Render.cpp +++ b/engine-api/src/Render.cpp @@ -2,7 +2,6 @@ module; #include #include -#include module Render; import std; @@ -10,7 +9,7 @@ import utils; ee_engine::IRenderer::IRenderer(GLFWwindow *window) { - commandsMapping[RendererCommand::UPDATE_REGION] = MAP_WORKER_COMMAND(RendererCommand, UpdateRegionCmd); + commandsMapping[RendererCommand::UPDATE_REGION] = std::bind_front(&IRenderer::UpdateRegionCmd, this); this->window = window; glfwGetFramebufferSize(window, &screenWidth, &screenHeight); diff --git a/engine/modules/AssetManager.cppm b/engine/modules/AssetManager.cppm index a4227b9..79002e5 100644 --- a/engine/modules/AssetManager.cppm +++ b/engine/modules/AssetManager.cppm @@ -1,7 +1,6 @@ module; #include "compile_config.hpp" -#include #include export module AssetManager; @@ -99,9 +98,9 @@ export public: AssetManager() : ee_utils::ThreadedWorker(L"Assets Stream") { - commandsMapping[AssetStreamCommand::LOAD] = MAP_WORKER_COMMAND(AssetStreamCommand, LoadCmd); - commandsMapping[AssetStreamCommand::FIND] = MAP_WORKER_COMMAND(AssetStreamCommand, FindCmd); - commandsMapping[AssetStreamCommand::GET] = MAP_WORKER_COMMAND(AssetStreamCommand, GetCmd); + commandsMapping[AssetStreamCommand::LOAD] = std::bind_front(&AssetManager::LoadCmd, this); + commandsMapping[AssetStreamCommand::FIND] = std::bind_front(&AssetManager::FindCmd, this); + commandsMapping[AssetStreamCommand::GET] = std::bind_front(&AssetManager::GetCmd, this); diskSystem = Allocate(); } diff --git a/engine/src/Client.cpp b/engine/src/Client.cpp index 39811f4..0e76143 100644 --- a/engine/src/Client.cpp +++ b/engine/src/Client.cpp @@ -1,7 +1,3 @@ -module; - -#include - module Client; import utils; import views; @@ -9,8 +5,7 @@ import Engine; Client::Client() : ee_utils::ThreadedWorker(L"Client") { - commandsMapping[ClientCommand::SEND] = MAP_WORKER_COMMAND(ClientCommand, SendCmd); - + commandsMapping[ClientCommand::SEND] = std::bind_front(&Client::SendCmd, this); } void Client::Init() diff --git a/engine/src/FileSystem.cpp b/engine/src/FileSystem.cpp index 2538234..b222d56 100644 --- a/engine/src/FileSystem.cpp +++ b/engine/src/FileSystem.cpp @@ -5,6 +5,7 @@ module; module FileSystem; import utils; +//TOO: REWORK WITH IOCP IFileSystem::~IFileSystem() { diff --git a/utils/include/ee_utils/utils.hpp b/utils/include/ee_utils/utils.hpp deleted file mode 100644 index 6f93970..0000000 --- a/utils/include/ee_utils/utils.hpp +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef ETREDIAEMPIRES_UTILS_HPP -#define ETREDIAEMPIRES_UTILS_HPP - -#define MAP_WORKER_COMMAND(TCommand, method) [this](TCommand &cmd) {this->method(cmd);} - -#endif //ETREDIAEMPIRES_UTILS_HPP