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
-1
View File
@@ -205,6 +205,5 @@ void EnvironmentLoader::import(EnvironmentImportArgs args, PEnvironmentMapAsset
asset->skybox = std::move(cubeMap);
asset->irradianceMap = std::move(convolutedMap);
asset->specularMap = std::move(cubeMap);
graphics->waitDeviceIdle();
}
+6 -4
View File
@@ -1,10 +1,10 @@
#include "Asset/AssetImporter.h"
#include "Asset/AssetRegistry.h"
#include "Asset/EnvironmentLoader.h"
#include "Asset/FontLoader.h"
#include "Asset/MaterialLoader.h"
#include "Asset/MeshLoader.h"
#include "Asset/TextureLoader.h"
#include "Asset/EnvironmentLoader.h"
#include "Graphics/Initializer.h"
#ifdef __APPLE__
#include "Graphics/Metal/Graphics.h"
@@ -50,9 +50,11 @@ int main() {
AssetImporter::importEnvironmentMap(EnvironmentImportArgs{
.filePath = sourcePath / "import" / "textures" / "newport_loft.hdr",
});
AssetImporter::importTexture(TextureImportArgs{.filePath = sourcePath / "import" / "texture" / "Dirt.png", .importPath = ""});
AssetImporter::importTexture(TextureImportArgs{
.filePath = sourcePath / "import" / "textures" / "grass_block_side.png",
.importPath = "",
});
getThreadPool().waitIdle();
vd->commitMeshes();
WindowCreateInfo mainWindowInfo = {
+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,
};