Updated to Godot HashMap, HashSet, and Pair types#901
Draft
rpgshooter wants to merge 1 commit intoTokisanGames:mainfrom
Draft
Updated to Godot HashMap, HashSet, and Pair types#901rpgshooter wants to merge 1 commit intoTokisanGames:mainfrom
rpgshooter wants to merge 1 commit intoTokisanGames:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace std::unordered_set/map with Godot containers:
Addition to #880
Summary
Replace std::unordered_map and std::unordered_set with Godot's HashMap and HashSet in Terrain3DInstancer
Remove custom hash structs that are no longer needed (Godot's HashMapHasherDefault provides built-in hashing for Vector2i, Vector3, and Pair<F, S>)
This change prepares the codebase for C++20 compatibility
Changes
constants.h
Removed Vector2iHash, PairVector2iIntHash, and Vector3Hash structs
terrain_3d_instancer.h
Replaced <unordered_map> and <unordered_set> includes with Godot templates
Changed type aliases to use HashMap<Vector2i, Pair<RID, RID>> and HashSet<Pair<Vector2i, int>>
terrain_3d_instancer.cpp
Updated API calls: .empty() → .is_empty(), .count() → .has(), .emplace() → .insert()
Changed std::make_pair to Pair<Vector2i, int>
Updated iteration patterns to use KeyValue<K, V> for HashMap and explicit Pair access for HashSet