diff options
author | Hop311 <Hop3114@gmail.com> | 2024-01-09 20:29:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-09 20:29:17 +0100 |
commit | e6c62c148924767bcc798b27af580bf9f18f724d (patch) | |
tree | a7b0df56cac7a87e039e1d489ea66e64b67ccf9c /extension/src/openvic-extension/singletons/AssetManager.hpp | |
parent | cf34ce1d7459ee91fc75e89835a8e7171fac636b (diff) | |
parent | 41d35fbecc9061720625cf2d6ef2b84a3a85272a (diff) |
Merge pull request #187 from OpenVicProject/update-sim-ordered-map
Updated SIM submodule and switched to ordered_map
Diffstat (limited to 'extension/src/openvic-extension/singletons/AssetManager.hpp')
-rw-r--r-- | extension/src/openvic-extension/singletons/AssetManager.hpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/extension/src/openvic-extension/singletons/AssetManager.hpp b/extension/src/openvic-extension/singletons/AssetManager.hpp index 40577ad..7f73e4c 100644 --- a/extension/src/openvic-extension/singletons/AssetManager.hpp +++ b/extension/src/openvic-extension/singletons/AssetManager.hpp @@ -17,14 +17,15 @@ namespace OpenVic { godot::Ref<godot::Image> image; godot::Ref<godot::ImageTexture> texture; }; - using image_asset_map_t = std::map<godot::StringName, image_asset_t>; - using font_map_t = std::map<godot::StringName, godot::Ref<godot::Font>>; + /* deque_ordered_map to avoid the need to reallocate. */ + using image_asset_map_t = deque_ordered_map<godot::StringName, image_asset_t>; + using font_map_t = deque_ordered_map<godot::StringName, godot::Ref<godot::Font>>; image_asset_map_t image_assets; font_map_t fonts; static godot::Ref<godot::Image> _load_image(godot::StringName const& path); - image_asset_map_t::iterator _get_image_asset(godot::StringName const& path); + image_asset_t* _get_image_asset(godot::StringName const& path); protected: static void _bind_methods(); |