diff --git a/src/container/sparseset.h b/src/container/sparseset.h index 4d9d6afc..ff07ad31 100644 --- a/src/container/sparseset.h +++ b/src/container/sparseset.h @@ -43,7 +43,7 @@ template class SparseSet final free_dense = new_free; } else { // Append to the data - sparse[index] = dense.size(); + sparse[index] = static_cast(dense.size()); dense.push_back(index); data.emplace_back(value); } @@ -67,7 +67,7 @@ template class SparseSet final free_dense = new_free; } else { // Append to the data - sparse[index] = dense.size(); + sparse[index] = static_cast(dense.size()); dense.push_back(index); data.emplace_back(std::move(value)); } diff --git a/src/ecs/component.h b/src/ecs/component.h index 551a80e9..0b3d9f36 100644 --- a/src/ecs/component.h +++ b/src/ecs/component.h @@ -23,6 +23,9 @@ class ComponentStorageBase { }; template class ComponentStorage : public ComponentStorageBase { +public: + ComponentStorage() : ComponentStorageBase() {} +private: void destroy(uint32_t index) override { sparseset.remove(index); @@ -36,11 +39,12 @@ template class ComponentStorage : public ComponentStorageBase { SparseSet sparseset; - static inline ComponentStorage storage; + static ComponentStorage storage; friend class Entity; template friend class Query; friend class ComponentReplication; }; -} \ No newline at end of file +template inline ComponentStorage ComponentStorage::storage{}; +} diff --git a/src/multiplayer.cpp b/src/multiplayer.cpp index 0664ddcd..fdc60167 100644 --- a/src/multiplayer.cpp +++ b/src/multiplayer.cpp @@ -99,6 +99,10 @@ template <> void multiplayerReplicationFunctions::receiveData(v *e = sp::ecs::Entity{}; } +// Explicit template instantiation to ensure symbols are exported +template void multiplayerReplicationFunctions::sendData(void*, sp::io::DataBuffer&); +template void multiplayerReplicationFunctions::receiveData(void*, sp::io::DataBuffer&); + void MultiplayerObject::sendClientCommand(sp::io::DataBuffer& packet) { if (game_server) diff --git a/src/windowManager.cpp b/src/windowManager.cpp index e8d3f55e..74d48b78 100644 --- a/src/windowManager.cpp +++ b/src/windowManager.cpp @@ -1,6 +1,6 @@ #include "windowManager.h" -#ifdef WIN32 +#ifdef _WIN32 #include "dynamicLibrary.h" #define WIN32_LEAN_AND_MEAN