implemented basic shader expressions

This commit is contained in:
Dynamitos
2023-02-24 22:09:07 +01:00
parent 48fa098546
commit f46262b66e
67 changed files with 1390 additions and 852 deletions
+7 -19
View File
@@ -6,10 +6,6 @@
namespace Seele
{
DECLARE_REF(TextureLoader)
DECLARE_REF(FontLoader)
DECLARE_REF(MeshLoader)
DECLARE_REF(MaterialLoader)
DECLARE_REF(TextureAsset)
DECLARE_REF(FontAsset)
DECLARE_REF(MeshAsset)
@@ -32,22 +28,14 @@ public:
static std::ofstream createWriteStream(const std::string& relativePath, std::ios_base::openmode openmode = std::ios::out);
static std::ifstream createReadStream(const std::string& relativePath, std::ios_base::openmode openmode = std::ios::in);
static void importMesh(struct MeshImportArgs args);
static void importTexture(struct TextureImportArgs args);
static void importFont(struct FontImportArgs args);
static void importMaterial(struct MaterialImportArgs args);
static void set(AssetRegistry registry);
static void loadRegistry();
static void saveRegistry();
AssetRegistry();
private:
struct AssetFolder
{
std::string folderPath;
Map<std::string, AssetFolder*> children;
//Todo: Seele::Map doesn't really work with strings for some reason, so just use std::map for now
Map<std::string, PTextureAsset> textures;
Map<std::string, PFontAsset> fonts;
Map<std::string, PMeshAsset> meshes;
@@ -55,13 +43,17 @@ private:
AssetFolder(std::string_view folderPath);
~AssetFolder();
};
AssetFolder* getOrCreateFolder(std::string foldername);
AssetRegistry();
private:
static AssetRegistry& get();
void initialize(const std::filesystem::path& rootFolder, Gfx::PGraphics graphics);
void loadRegistryInternal();
void peekFolder(AssetFolder* folder);
void loadFolder(AssetFolder* folder);
void peekAsset(ArchiveBuffer& buffer);
void loadAsset(ArchiveBuffer& buffer);
void saveRegistryInternal();
void saveFolder(const std::filesystem::path& folderPath, AssetFolder* folder);
void saveAsset(PAsset asset, uint64 identifier, const std::filesystem::path& folderPath, std::string name);
@@ -71,18 +63,14 @@ private:
void registerFont(PFontAsset font);
void registerMaterial(PMaterialAsset material);
AssetFolder* getOrCreateFolder(std::string foldername);
std::ofstream internalCreateWriteStream(const std::string& relativePath, std::ios_base::openmode openmode = std::ios::out);
std::ifstream internalCreateReadStream(const std::string& relaitvePath, std::ios_base::openmode openmode = std::ios::in);
std::filesystem::path rootFolder;
AssetFolder* assetRoot;
Gfx::PGraphics graphics;
UPTextureLoader textureLoader;
UPFontLoader fontLoader;
UPMeshLoader meshLoader;
UPMaterialLoader materialLoader;
ArchiveBuffer assetBuffer;
bool release = false;
friend class TextureLoader;
friend class FontLoader;
friend class MaterialLoader;