From 055a0a17111af666250cadbcc810f55ec9102c5c Mon Sep 17 00:00:00 2001 From: Kah Wei Date: Tue, 27 Sep 2022 19:52:36 +0800 Subject: [PATCH] Fixed textures not loading correctly --- SHADE_Application/src/Scenes/SBTestScene.cpp | 4 ++-- SHADE_Engine/src/Assets/Libraries/SHTextureLoader.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/SHADE_Application/src/Scenes/SBTestScene.cpp b/SHADE_Application/src/Scenes/SBTestScene.cpp index 39c8cf97..dcca9e7b 100644 --- a/SHADE_Application/src/Scenes/SBTestScene.cpp +++ b/SHADE_Application/src/Scenes/SBTestScene.cpp @@ -55,13 +55,13 @@ namespace Sandbox graphicsSystem->BuildMeshBuffers(); // Load Textures - /*auto textures = SHADE::SHAssetManager::GetAllTextures(); + auto textures = SHADE::SHAssetManager::GetAllTextures(); std::vector> texHandles; for (const auto& tex : textures) { auto texture = graphicsSystem->Add(tex); texHandles.push_back(texture); - }*/ + } graphicsSystem->BuildTextures(); // Create Materials diff --git a/SHADE_Engine/src/Assets/Libraries/SHTextureLoader.cpp b/SHADE_Engine/src/Assets/Libraries/SHTextureLoader.cpp index b317ee09..bff15f2b 100644 --- a/SHADE_Engine/src/Assets/Libraries/SHTextureLoader.cpp +++ b/SHADE_Engine/src/Assets/Libraries/SHTextureLoader.cpp @@ -79,7 +79,7 @@ namespace SHADE } SHTexture::PixelChannel* pixel = new SHTexture::PixelChannel[totalBytes]; - //std::memcpy(pixel, file.GetDDSData(), totalBytes); + std::memcpy(pixel, file.GetDDSData(), totalBytes); //pixel = std::move(reinterpret_cast(file.GetDDSData())); asset.numBytes = totalBytes;