diff --git a/SHADE_Engine/SHADE_Engine.vcxproj b/SHADE_Engine/SHADE_Engine.vcxproj
index 2613f1dc..ca421c40 100644
--- a/SHADE_Engine/SHADE_Engine.vcxproj
+++ b/SHADE_Engine/SHADE_Engine.vcxproj
@@ -71,7 +71,7 @@
Windows
true
- vulkan-1.lib;shlwapi.lib;assimp-vc142-mtd.lib;ktxd.lib;librttr_core_d.lib;%(AdditionalDependencies)
+ vulkan-1.lib;shaderc_shared.lib;shlwapi.lib;assimp-vc142-mtd.lib;ktxd.lib;librttr_core_d.lib;%(AdditionalDependencies)
libs;$(VULKAN_SDK)\Lib;..\Dependencies\assimp\lib\Debug;..\Dependencies\assimp\lib\Release;..\Dependencies\RTTR\lib;..\Dependencies\ktx\lib\Debug;..\Dependencies\ktx\lib\Release;%(AdditionalLibraryDirectories)
bin\Debug_x86_64\SHADE_Engine\SHADE_Engine.lib
@@ -99,7 +99,7 @@
Windows
true
true
- vulkan-1.lib;shlwapi.lib;assimp-vc142-mt.lib;ktx.lib;librttr_core.lib;%(AdditionalDependencies)
+ vulkan-1.lib;shaderc_shared.lib;shlwapi.lib;assimp-vc142-mt.lib;ktx.lib;librttr_core.lib;%(AdditionalDependencies)
libs;$(VULKAN_SDK)\Lib;..\Dependencies\assimp\lib\Debug;..\Dependencies\assimp\lib\Release;..\Dependencies\RTTR\lib;..\Dependencies\ktx\lib\Debug;..\Dependencies\ktx\lib\Release;%(AdditionalLibraryDirectories)
bin\Release_x86_64\SHADE_Engine\SHADE_Engine.lib
@@ -108,20 +108,21 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -194,6 +195,7 @@
+
@@ -207,13 +209,14 @@
-
-
-
-
-
-
+
+
+
+
+
+
+
@@ -270,6 +273,7 @@
Create
+
diff --git a/SHADE_Engine/SHADE_Engine.vcxproj.filters b/SHADE_Engine/SHADE_Engine.vcxproj.filters
index 67d6bec9..f9b4dee7 100644
--- a/SHADE_Engine/SHADE_Engine.vcxproj.filters
+++ b/SHADE_Engine/SHADE_Engine.vcxproj.filters
@@ -1,23 +1,26 @@
+
+ {1AB26817-067F-C322-2F98-B1CA1BC4F8B0}
+
+
+ {EFD23933-5B34-1741-E4A1-5DF350024E00}
+
+
+ {261D0942-92A8-7606-9BB9-F9FA07C4D206}
+
+
+ {07FEB307-F3F6-D259-1C29-B8DE0881B265}
+
+
+ {EE037863-5A8F-E527-63A0-681CCFAA4128}
+
{DBC7D3B0-C769-FE86-B024-12DB9C6585D7}
-
- {7FF59BF8-EB80-09BD-F491-8CB1609C65BD}
-
-
- {340D0110-201D-ADE0-89D6-11FF75059C79}
-
-
- {EBFC8BDC-D7F6-B42E-C063-4B3FACFC1A9B}
-
-
- {6CD692F2-D80D-DB89-E117-3FAD4DCE0183}
-
-
- {B3E3FAFD-9FDD-2350-884A-BA6074E389BC}
+
+ {8A8E2B37-7646-6D84-DF4D-46E0CB240875}
{1653CE33-0220-293F-2B39-17E717655ECD}
@@ -117,48 +120,51 @@
-
- Engine\ECS_Base\Components
+
+ ECS_Base\Components
-
- Engine\ECS_Base\Components
+
+ ECS_Base\Components
-
- Engine\ECS_Base\Entity
+
+ ECS_Base\Entity
-
- Engine\ECS_Base\General
+
+ ECS_Base\General
-
- Engine\ECS_Base\General
+
+ ECS_Base\General
-
- Engine\ECS_Base\General
+
+ ECS_Base\General
-
- Engine\ECS_Base\General
+
+ ECS_Base\General
-
- Engine\ECS_Base\General
+
+ ECS_Base\General
-
- Engine\ECS_Base
+
+ ECS_Base
-
- Engine\ECS_Base\System
+
+ ECS_Base\System
-
- Engine\ECS_Base\System
+
+ ECS_Base\System
-
- Engine\ECS_Base\System
+
+ ECS_Base\System
-
- Engine\ECS_Base\System
+
+ ECS_Base\System
Engine
+
+ Filesystem
+
Graphics\Buffers
@@ -373,6 +379,9 @@
Scene
+
+ Scene
+
Scene
@@ -408,27 +417,30 @@
-
- Engine\ECS_Base\Components
+
+ ECS_Base\Components
-
- Engine\ECS_Base\Components
+
+ ECS_Base\Components
-
- Engine\ECS_Base\Entity
+
+ ECS_Base\Entity
-
- Engine\ECS_Base\System
+
+ ECS_Base\System
-
- Engine\ECS_Base\System
+
+ ECS_Base\System
-
- Engine\ECS_Base\System
+
+ ECS_Base\System
Engine
+
+ Filesystem
+
Graphics\Buffers
@@ -589,6 +601,9 @@
Resource
+
+ Scene
+
Scene
diff --git a/SHADE_Engine/premake5.lua b/SHADE_Engine/premake5.lua
index 83c3821b..39866d72 100644
--- a/SHADE_Engine/premake5.lua
+++ b/SHADE_Engine/premake5.lua
@@ -60,6 +60,7 @@ project "SHADE_Engine"
"imgui",
"spdlog",
"vulkan-1.lib",
+ "shaderc_shared.lib",
"shlwapi.lib"
}
diff --git a/SHADE_Engine/src/Engine/ECS_Base/Components/SHComponent.cpp b/SHADE_Engine/src/ECS_Base/Components/SHComponent.cpp
similarity index 100%
rename from SHADE_Engine/src/Engine/ECS_Base/Components/SHComponent.cpp
rename to SHADE_Engine/src/ECS_Base/Components/SHComponent.cpp
diff --git a/SHADE_Engine/src/Engine/ECS_Base/Components/SHComponent.h b/SHADE_Engine/src/ECS_Base/Components/SHComponent.h
similarity index 100%
rename from SHADE_Engine/src/Engine/ECS_Base/Components/SHComponent.h
rename to SHADE_Engine/src/ECS_Base/Components/SHComponent.h
diff --git a/SHADE_Engine/src/Engine/ECS_Base/Components/SHComponentGroup.cpp b/SHADE_Engine/src/ECS_Base/Components/SHComponentGroup.cpp
similarity index 100%
rename from SHADE_Engine/src/Engine/ECS_Base/Components/SHComponentGroup.cpp
rename to SHADE_Engine/src/ECS_Base/Components/SHComponentGroup.cpp
diff --git a/SHADE_Engine/src/Engine/ECS_Base/Components/SHComponentGroup.h b/SHADE_Engine/src/ECS_Base/Components/SHComponentGroup.h
similarity index 100%
rename from SHADE_Engine/src/Engine/ECS_Base/Components/SHComponentGroup.h
rename to SHADE_Engine/src/ECS_Base/Components/SHComponentGroup.h
diff --git a/SHADE_Engine/src/Engine/ECS_Base/Entity/SHEntity.cpp b/SHADE_Engine/src/ECS_Base/Entity/SHEntity.cpp
similarity index 100%
rename from SHADE_Engine/src/Engine/ECS_Base/Entity/SHEntity.cpp
rename to SHADE_Engine/src/ECS_Base/Entity/SHEntity.cpp
diff --git a/SHADE_Engine/src/Engine/ECS_Base/Entity/SHEntity.h b/SHADE_Engine/src/ECS_Base/Entity/SHEntity.h
similarity index 100%
rename from SHADE_Engine/src/Engine/ECS_Base/Entity/SHEntity.h
rename to SHADE_Engine/src/ECS_Base/Entity/SHEntity.h
diff --git a/SHADE_Engine/src/Engine/ECS_Base/General/SHFamily.h b/SHADE_Engine/src/ECS_Base/General/SHFamily.h
similarity index 100%
rename from SHADE_Engine/src/Engine/ECS_Base/General/SHFamily.h
rename to SHADE_Engine/src/ECS_Base/General/SHFamily.h
diff --git a/SHADE_Engine/src/Engine/ECS_Base/General/SHHandleGenerator.h b/SHADE_Engine/src/ECS_Base/General/SHHandleGenerator.h
similarity index 100%
rename from SHADE_Engine/src/Engine/ECS_Base/General/SHHandleGenerator.h
rename to SHADE_Engine/src/ECS_Base/General/SHHandleGenerator.h
diff --git a/SHADE_Engine/src/Engine/ECS_Base/General/SHSparseBase.h b/SHADE_Engine/src/ECS_Base/General/SHSparseBase.h
similarity index 100%
rename from SHADE_Engine/src/Engine/ECS_Base/General/SHSparseBase.h
rename to SHADE_Engine/src/ECS_Base/General/SHSparseBase.h
diff --git a/SHADE_Engine/src/Engine/ECS_Base/General/SHSparseSet.h b/SHADE_Engine/src/ECS_Base/General/SHSparseSet.h
similarity index 100%
rename from SHADE_Engine/src/Engine/ECS_Base/General/SHSparseSet.h
rename to SHADE_Engine/src/ECS_Base/General/SHSparseSet.h
diff --git a/SHADE_Engine/src/Engine/ECS_Base/General/SHSparseSetContainer.h b/SHADE_Engine/src/ECS_Base/General/SHSparseSetContainer.h
similarity index 100%
rename from SHADE_Engine/src/Engine/ECS_Base/General/SHSparseSetContainer.h
rename to SHADE_Engine/src/ECS_Base/General/SHSparseSetContainer.h
diff --git a/SHADE_Engine/src/Engine/ECS_Base/SHECSMacros.h b/SHADE_Engine/src/ECS_Base/SHECSMacros.h
similarity index 100%
rename from SHADE_Engine/src/Engine/ECS_Base/SHECSMacros.h
rename to SHADE_Engine/src/ECS_Base/SHECSMacros.h
diff --git a/SHADE_Engine/src/Engine/ECS_Base/System/SHComponentManager.cpp b/SHADE_Engine/src/ECS_Base/System/SHComponentManager.cpp
similarity index 100%
rename from SHADE_Engine/src/Engine/ECS_Base/System/SHComponentManager.cpp
rename to SHADE_Engine/src/ECS_Base/System/SHComponentManager.cpp
diff --git a/SHADE_Engine/src/Engine/ECS_Base/System/SHComponentManager.h b/SHADE_Engine/src/ECS_Base/System/SHComponentManager.h
similarity index 99%
rename from SHADE_Engine/src/Engine/ECS_Base/System/SHComponentManager.h
rename to SHADE_Engine/src/ECS_Base/System/SHComponentManager.h
index 05a3d1ee..2f6ff504 100644
--- a/SHADE_Engine/src/Engine/ECS_Base/System/SHComponentManager.h
+++ b/SHADE_Engine/src/ECS_Base/System/SHComponentManager.h
@@ -34,7 +34,7 @@ namespace SHADE
//The Container of all Componentgroups
static std::vector componentGroups;
- friend class SHSceneNode;
+ friend struct SHSceneNode;
diff --git a/SHADE_Engine/src/Engine/ECS_Base/System/SHEntityManager.cpp b/SHADE_Engine/src/ECS_Base/System/SHEntityManager.cpp
similarity index 100%
rename from SHADE_Engine/src/Engine/ECS_Base/System/SHEntityManager.cpp
rename to SHADE_Engine/src/ECS_Base/System/SHEntityManager.cpp
diff --git a/SHADE_Engine/src/Engine/ECS_Base/System/SHEntityManager.h b/SHADE_Engine/src/ECS_Base/System/SHEntityManager.h
similarity index 100%
rename from SHADE_Engine/src/Engine/ECS_Base/System/SHEntityManager.h
rename to SHADE_Engine/src/ECS_Base/System/SHEntityManager.h
diff --git a/SHADE_Engine/src/Engine/ECS_Base/System/SHSystem.h b/SHADE_Engine/src/ECS_Base/System/SHSystem.h
similarity index 100%
rename from SHADE_Engine/src/Engine/ECS_Base/System/SHSystem.h
rename to SHADE_Engine/src/ECS_Base/System/SHSystem.h
diff --git a/SHADE_Engine/src/Engine/ECS_Base/System/SHSystemManager.cpp b/SHADE_Engine/src/ECS_Base/System/SHSystemManager.cpp
similarity index 100%
rename from SHADE_Engine/src/Engine/ECS_Base/System/SHSystemManager.cpp
rename to SHADE_Engine/src/ECS_Base/System/SHSystemManager.cpp
diff --git a/SHADE_Engine/src/Engine/ECS_Base/System/SHSystemManager.h b/SHADE_Engine/src/ECS_Base/System/SHSystemManager.h
similarity index 100%
rename from SHADE_Engine/src/Engine/ECS_Base/System/SHSystemManager.h
rename to SHADE_Engine/src/ECS_Base/System/SHSystemManager.h
diff --git a/SHADE_Engine/src/Filesystem/SHFileSystem.cpp b/SHADE_Engine/src/Filesystem/SHFileSystem.cpp
new file mode 100644
index 00000000..5663dadd
--- /dev/null
+++ b/SHADE_Engine/src/Filesystem/SHFileSystem.cpp
@@ -0,0 +1,135 @@
+#include "SHpch.h"
+#include "SHFileSystem.h"
+#include "fileapi.h"
+#include
+#include
+#include
+
+namespace SHADE
+{
+ char const FOLDER_MAX_COUNT {15};
+
+ std::unordered_map> SHFileSystem::folders;
+ FolderPointer SHFileSystem::root {nullptr};
+
+ SHFolder::SHFolder(FolderHandle id, FolderName name)
+ :id{ id }, name{ name }, subFolders(0), folded{ false }, path{""}
+ {
+ }
+
+ FolderLocation SHFileSystem::CreateNewFolderHere(FolderName name, FolderLocation here) noexcept
+ {
+ if (here == 0)
+ {
+ if (!folders.contains(0))
+ {
+ folders[0] = std::make_unique(0, "root");
+ }
+
+ auto const count = static_cast(folders[here]->subFolders.size());
+
+ assert(count < FOLDER_MAX_COUNT, "Max subfolders reached\n");
+
+ auto const location = static_cast(count);
+
+ CreateFolder(folders[0]->path, here, location, name);
+
+ return location;
+ }
+
+ assert(folders.contains(here), "Folder creation location does not exist/invalid\n");
+
+ auto const count = static_cast(folders[here]->subFolders.size());
+
+ FolderHandle location = here;
+ location <<= FOLDER_BIT_ALLOCATE;
+ location |= count;
+
+ assert(count < FOLDER_MAX_COUNT, "Max subfolders reached\n");
+ CreateFolder(folders[0]->path, here, location, name);
+
+ return location;
+ }
+
+ bool SHFileSystem::DeleteFolder(FolderPointer location) noexcept
+ {
+ assert(folders.contains(location->id), "Delete target does not exist/invalid.\n");
+
+ for (auto const& subFolder : folders[location->id]->subFolders)
+ {
+ DeleteFolder(subFolder);
+ }
+
+ RemoveDirectoryA(folders[location->id]->path.c_str());
+ return true;
+ }
+
+ void SHFileSystem::StartupFillDirectories(FolderPath path) noexcept
+ {
+ std::queue folderQueue;
+
+ folderQueue.push(RegisterFolder(path, 0, 0, "Root"));
+
+ while (!folderQueue.empty())
+ {
+ auto folder = folderQueue.front();
+ folderQueue.pop();
+ FolderCounter count = 0;
+
+ for (auto const& dirEntry : std::filesystem::directory_iterator(folder->path))
+ {
+ if (!dirEntry.is_directory())
+ {
+ continue;
+ }
+
+ FolderLocation location = folder->id;
+ location <<= FOLDER_BIT_ALLOCATE;
+ location |= ++count;
+
+ std::string name = dirEntry.path().string();
+ name = name.substr(name.find_last_of('/') + 1, name.length() - name.find_last_of('/'));
+
+ FolderPointer newFolder{ RegisterFolder(
+ dirEntry.path().string(),
+ folder->id,
+ location,
+ name)
+ };
+
+ folderQueue.push(newFolder);
+ folder->subFolders.push_back(newFolder);
+ }
+ }
+ }
+
+ FolderPointer SHFileSystem::CreateFolder(FolderPath path, FolderLocation parent, FolderHandle location, FolderName name) noexcept
+ {
+ assert(
+ CreateDirectoryA(path.c_str(), nullptr),
+ "Failed to create folder\n"
+ );
+
+ folders[location] = std::make_unique(location, name);
+ folders[location]->path = path;
+ folders[parent]->subFolders.push_back(folders[location].get());
+
+ return FolderMakeHelper(path, parent, location, name);
+ }
+
+ FolderPointer SHFileSystem::RegisterFolder(FolderPath path, FolderLocation parent, FolderHandle location,
+ FolderName name) noexcept
+ {
+ return FolderMakeHelper(path, parent, location, name);
+ }
+
+ FolderPointer SHFileSystem::FolderMakeHelper(FolderPath path, FolderLocation parent, FolderHandle location,
+ FolderName name) noexcept
+ {
+ folders[location] = std::make_unique(location, name);
+ folders[location]->path = path;
+ folders[parent]->subFolders.push_back(folders[location].get());
+
+ return folders[location].get();
+ }
+}
diff --git a/SHADE_Engine/src/Filesystem/SHFileSystem.h b/SHADE_Engine/src/Filesystem/SHFileSystem.h
new file mode 100644
index 00000000..9b8b94a2
--- /dev/null
+++ b/SHADE_Engine/src/Filesystem/SHFileSystem.h
@@ -0,0 +1,57 @@
+#pragma once
+
+#include
+#include
+#include
+#include
+
+namespace SHADE
+{
+ class SHFolder;
+
+ typedef unsigned char FolderCounter;
+ typedef unsigned char FileCounter;
+ typedef uint64_t FolderLocation;
+ typedef uint64_t FolderHandle;
+ typedef std::string FolderName;
+ typedef std::string FolderPath;
+ typedef SHFolder* FolderPointer;
+
+ constexpr char FOLDER_BIT_ALLOCATE{ 4 };
+ constexpr char FOLDER_MAX_DEPTH{ 16 };
+
+ class SHFolder
+ {
+ public:
+ SHFolder(FolderHandle id, FolderName name);
+
+ FolderHandle id;
+ FolderName name;
+ std::vector subFolders;
+
+ bool folded;
+
+ private:
+ FolderPath path;
+ friend class SHFileSystem;
+ };
+
+ class SHFileSystem
+ {
+ public:
+ static FolderLocation CreateNewFolderHere(FolderName name, FolderLocation here = 0) noexcept;
+
+ static bool DeleteFolder(FolderPointer location) noexcept;
+
+ static void StartupFillDirectories(FolderPath path) noexcept;
+
+ private:
+ static FolderPointer root;
+
+ static std::unordered_map> folders;
+
+ static FolderPointer CreateFolder(FolderPath path, FolderLocation parent, FolderHandle location, FolderName name) noexcept;
+ static FolderPointer RegisterFolder(FolderPath path, FolderLocation parent, FolderHandle location, FolderName name) noexcept;
+ static FolderPointer FolderMakeHelper(FolderPath path, FolderLocation parent, FolderHandle location, FolderName name) noexcept;
+ };
+}
\ No newline at end of file
diff --git a/SHADE_Engine/src/SHpch.h b/SHADE_Engine/src/SHpch.h
index b54a8a5b..0342eedb 100644
--- a/SHADE_Engine/src/SHpch.h
+++ b/SHADE_Engine/src/SHpch.h
@@ -22,6 +22,7 @@
#include
#include
#include
+#include
#include
#include
#include