Fixing map when being moved

This commit is contained in:
Dynamitos
2025-04-10 23:43:07 +02:00
parent b81d722680
commit e0a6860c86
4 changed files with 19 additions and 13 deletions
+11 -6
View File
@@ -61,13 +61,15 @@ template <typename KeyType, typename NodeData, typename KeyFun, typename Compare
constexpr IteratorBase& operator++() {
// if current node has no right subtree
if (node->rightChild == nullptr) {
Node* temp = node;
node = node->parent;
// walk up hierarchy until we were the left subtree of any parent
// this means that that parent is the correct next element
while (node->rightChild == temp) {
temp = node;
if (node->parent != nullptr) {
Node* temp = node;
node = node->parent;
// walk up hierarchy until we were the left subtree of any parent
// this means that that parent is the correct next element
while (node->rightChild == temp) {
temp = node;
node = node->parent;
}
}
} else {
// if there is a right subtree, descend there
@@ -153,6 +155,7 @@ template <typename KeyType, typename NodeData, typename KeyFun, typename Compare
constexpr Tree(Tree&& other) noexcept
: alloc(std::move(other.alloc)), root(std::move(other.root)), pseudoRoot(std::move(other.pseudoRoot)), iteratorsDirty(true),
_size(std::move(other._size)), comp(std::move(other.comp)) {
pseudoRoot.setLeftChild(root);
other._size = 0;
}
constexpr ~Tree() noexcept { clear(); }
@@ -165,6 +168,7 @@ template <typename KeyType, typename NodeData, typename KeyFun, typename Compare
for (const auto& elem : other) {
insert(elem);
}
pseudoRoot.setLeftChild(root);
markIteratorsDirty();
}
return *this;
@@ -180,6 +184,7 @@ template <typename KeyType, typename NodeData, typename KeyFun, typename Compare
_size = std::move(other._size);
comp = std::move(other.comp);
other._size = 0;
pseudoRoot.setLeftChild(root);
markIteratorsDirty();
}
return *this;
+2 -2
View File
@@ -79,8 +79,8 @@ BasePass::BasePass(Gfx::PGraphics graphics, PScene scene) : RenderPass(graphics)
});
}
skybox = Seele::Component::Skybox{
.day = scene->getLightEnvironment()->getEnvironmentMap()->getIrradianceMap(),
.night = scene->getLightEnvironment()->getEnvironmentMap()->getIrradianceMap(),
.day = scene->getLightEnvironment()->getEnvironmentMap()->getSkybox(),
.night = scene->getLightEnvironment()->getEnvironmentMap()->getSkybox(),
.fogColor = Vector(0.1, 0.1, 0.8),
.blendFactor = 0,
};