summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--.gitmodules3
-rw-r--r--editor/CMakeLists.txt2
-rw-r--r--external/CMakeLists.txt10
m---------external/robin-map0
-rw-r--r--serialize/CMakeLists.txt1
-rw-r--r--src/CMakeLists.txt1
-rw-r--r--src/world.hpp3
-rw-r--r--test/CMakeLists.txt2
8 files changed, 15 insertions, 7 deletions
diff --git a/.gitmodules b/.gitmodules
index fd4fc9fd..0f55e625 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -25,3 +25,6 @@
[submodule "luajit"]
path = external/luajit
url = https://github.com/WohlSoft/LuaJIT.git
+[submodule "robin-map"]
+ path = external/robin-map
+ url = https://github.com/Tessil/robin-map.git
diff --git a/editor/CMakeLists.txt b/editor/CMakeLists.txt
index 306c95f4..0eb7bcb7 100644
--- a/editor/CMakeLists.txt
+++ b/editor/CMakeLists.txt
@@ -10,7 +10,7 @@ else()
endif()
add_library(${self}_o OBJECT "${res}" "${sources}")
-target_link_libraries(${self}_o PUBLIC MagnumIntegration::ImGui fmt::fmt nlohmann_json::nlohmann_json)
+target_link_libraries(${self}_o PUBLIC MagnumIntegration::ImGui fmt::fmt nlohmann_json::nlohmann_json tsl::robin_map)
if(WIN32)
target_sources(${self}_o PRIVATE "../main/floormat.rc")
diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt
index ad383f36..024c2c4e 100644
--- a/external/CMakeLists.txt
+++ b/external/CMakeLists.txt
@@ -217,12 +217,12 @@ function(message m)
endif()
endfunction()
+set(system "")
+if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.25)
+ set(system "SYSTEM")
+endif()
if(FLOORMAT_SUBMODULE-DEPENDENCIES)
sets(PATH IMGUI_DIR "${CMAKE_CURRENT_SOURCE_DIR}/imgui")
- set(system "")
- if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.25)
- set(system "SYSTEM")
- endif()
function(fm_add_sdl2)
if(FLOORMAT_SUBMODULE-SDL2)
@@ -285,6 +285,8 @@ if(FLOORMAT_SUBMODULE-DEPENDENCIES)
fm_add_libs()
endif()
+add_subdirectory(robin-map ${system})
+
if(FLOORMAT_SUBMODULE-DEPENDENCIES)
if(MSVC)
target_compile_options(CorradeTestSuiteObjects PRIVATE -EHsc)
diff --git a/external/robin-map b/external/robin-map
new file mode 160000
+Subproject 851a59e0e3063ee0e23089062090a73fd3de482
diff --git a/serialize/CMakeLists.txt b/serialize/CMakeLists.txt
index 45d7704e..bede6c6c 100644
--- a/serialize/CMakeLists.txt
+++ b/serialize/CMakeLists.txt
@@ -17,6 +17,7 @@ if(WIN32 OR MAGNUM_BUILD_PLUGINS_STATIC)
target_link_libraries(${self} PUBLIC
MagnumPlugins::StbImageImporter
Magnum::TgaImporter
+ tsl::robin_map
)
endif()
if(WIN32)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index a03235e8..4aa9dbb4 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -7,4 +7,5 @@ target_link_libraries(
Magnum::Magnum
Magnum::Shaders
fmt::fmt
+ tsl::robin_map
)
diff --git a/src/world.hpp b/src/world.hpp
index 4b8ce797..90067c35 100644
--- a/src/world.hpp
+++ b/src/world.hpp
@@ -6,6 +6,7 @@
#include "compat/exception.hpp"
#include <unordered_map>
#include <memory>
+#include <tsl/robin_map.h>
template<>
struct std::hash<floormat::chunk_coords_> final {
@@ -31,7 +32,7 @@ private:
} _last_chunk;
std::unordered_map<chunk_coords_, chunk> _chunks;
- std::unordered_map<object_id, std::weak_ptr<entity>> _entities;
+ tsl::robin_map<object_id, std::weak_ptr<entity>> _entities;
size_t _last_collection = 0;
size_t _collect_every = 64;
std::shared_ptr<char> _unique_id = std::make_shared<char>('A');
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index bca15714..20b66a6d 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -4,7 +4,7 @@ file(GLOB sources "*.cpp" CONFIGURE_ARGS)
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/test")
add_library(${self}_o OBJECT "${sources}")
-target_link_libraries(${self}_o PUBLIC Magnum::GL Magnum::Trade nlohmann_json::nlohmann_json fmt::fmt)
+target_link_libraries(${self}_o PUBLIC Magnum::GL Magnum::Trade nlohmann_json::nlohmann_json fmt::fmt tsl::robin_map)
if(APPLE)
target_link_libraries(${self}_o PUBLIC Magnum::WindowlessCglApplication)