Fixing map when being moved
This commit is contained in:
@@ -205,6 +205,5 @@ void EnvironmentLoader::import(EnvironmentImportArgs args, PEnvironmentMapAsset
|
|||||||
|
|
||||||
asset->skybox = std::move(cubeMap);
|
asset->skybox = std::move(cubeMap);
|
||||||
asset->irradianceMap = std::move(convolutedMap);
|
asset->irradianceMap = std::move(convolutedMap);
|
||||||
asset->specularMap = std::move(cubeMap);
|
|
||||||
graphics->waitDeviceIdle();
|
graphics->waitDeviceIdle();
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-3
@@ -1,10 +1,10 @@
|
|||||||
#include "Asset/AssetImporter.h"
|
#include "Asset/AssetImporter.h"
|
||||||
#include "Asset/AssetRegistry.h"
|
#include "Asset/AssetRegistry.h"
|
||||||
|
#include "Asset/EnvironmentLoader.h"
|
||||||
#include "Asset/FontLoader.h"
|
#include "Asset/FontLoader.h"
|
||||||
#include "Asset/MaterialLoader.h"
|
#include "Asset/MaterialLoader.h"
|
||||||
#include "Asset/MeshLoader.h"
|
#include "Asset/MeshLoader.h"
|
||||||
#include "Asset/TextureLoader.h"
|
#include "Asset/TextureLoader.h"
|
||||||
#include "Asset/EnvironmentLoader.h"
|
|
||||||
#include "Graphics/Initializer.h"
|
#include "Graphics/Initializer.h"
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#include "Graphics/Metal/Graphics.h"
|
#include "Graphics/Metal/Graphics.h"
|
||||||
@@ -50,8 +50,10 @@ int main() {
|
|||||||
AssetImporter::importEnvironmentMap(EnvironmentImportArgs{
|
AssetImporter::importEnvironmentMap(EnvironmentImportArgs{
|
||||||
.filePath = sourcePath / "import" / "textures" / "newport_loft.hdr",
|
.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();
|
getThreadPool().waitIdle();
|
||||||
vd->commitMeshes();
|
vd->commitMeshes();
|
||||||
|
|||||||
@@ -61,13 +61,15 @@ template <typename KeyType, typename NodeData, typename KeyFun, typename Compare
|
|||||||
constexpr IteratorBase& operator++() {
|
constexpr IteratorBase& operator++() {
|
||||||
// if current node has no right subtree
|
// if current node has no right subtree
|
||||||
if (node->rightChild == nullptr) {
|
if (node->rightChild == nullptr) {
|
||||||
Node* temp = node;
|
if (node->parent != nullptr) {
|
||||||
node = node->parent;
|
Node* temp = node;
|
||||||
// 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;
|
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 {
|
} else {
|
||||||
// if there is a right subtree, descend there
|
// 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
|
constexpr Tree(Tree&& other) noexcept
|
||||||
: alloc(std::move(other.alloc)), root(std::move(other.root)), pseudoRoot(std::move(other.pseudoRoot)), iteratorsDirty(true),
|
: 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)) {
|
_size(std::move(other._size)), comp(std::move(other.comp)) {
|
||||||
|
pseudoRoot.setLeftChild(root);
|
||||||
other._size = 0;
|
other._size = 0;
|
||||||
}
|
}
|
||||||
constexpr ~Tree() noexcept { clear(); }
|
constexpr ~Tree() noexcept { clear(); }
|
||||||
@@ -165,6 +168,7 @@ template <typename KeyType, typename NodeData, typename KeyFun, typename Compare
|
|||||||
for (const auto& elem : other) {
|
for (const auto& elem : other) {
|
||||||
insert(elem);
|
insert(elem);
|
||||||
}
|
}
|
||||||
|
pseudoRoot.setLeftChild(root);
|
||||||
markIteratorsDirty();
|
markIteratorsDirty();
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
@@ -180,6 +184,7 @@ template <typename KeyType, typename NodeData, typename KeyFun, typename Compare
|
|||||||
_size = std::move(other._size);
|
_size = std::move(other._size);
|
||||||
comp = std::move(other.comp);
|
comp = std::move(other.comp);
|
||||||
other._size = 0;
|
other._size = 0;
|
||||||
|
pseudoRoot.setLeftChild(root);
|
||||||
markIteratorsDirty();
|
markIteratorsDirty();
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
|
|||||||
@@ -79,8 +79,8 @@ BasePass::BasePass(Gfx::PGraphics graphics, PScene scene) : RenderPass(graphics)
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
skybox = Seele::Component::Skybox{
|
skybox = Seele::Component::Skybox{
|
||||||
.day = scene->getLightEnvironment()->getEnvironmentMap()->getIrradianceMap(),
|
.day = scene->getLightEnvironment()->getEnvironmentMap()->getSkybox(),
|
||||||
.night = scene->getLightEnvironment()->getEnvironmentMap()->getIrradianceMap(),
|
.night = scene->getLightEnvironment()->getEnvironmentMap()->getSkybox(),
|
||||||
.fogColor = Vector(0.1, 0.1, 0.8),
|
.fogColor = Vector(0.1, 0.1, 0.8),
|
||||||
.blendFactor = 0,
|
.blendFactor = 0,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user