Grindstone Game Engine v0.2.0
An open source game engine and toolkit.
Loading...
Searching...
No Matches
ArchiveAssetLoader.hpp
1#pragma once
2
3#include <filesystem>
4
5#include <Common/Buffer.hpp>
6#include <Common/Assets/ArchiveDirectory.hpp>
7
8#include "AssetLoader.hpp"
9
10namespace Grindstone::Assets {
12 public:
14 void InitializeDirectory();
15 virtual AssetLoadBinaryResult LoadBinaryByPath(AssetType assetType, const std::filesystem::path& path) override;
16 virtual AssetLoadBinaryResult LoadBinaryByAddress(AssetType assetType, std::string_view address) override;
17 virtual AssetLoadBinaryResult LoadBinaryByUuid(AssetType assetType, Uuid uuid) override;
18
19 virtual AssetLoadTextResult LoadTextByPath(AssetType assetType, const std::filesystem::path& path) override;
20 virtual AssetLoadTextResult LoadTextByAddress(AssetType assetType, std::string_view address) override;
21 virtual AssetLoadTextResult LoadTextByUuid(AssetType assetType, Uuid uuid) override;
22
23 virtual bool LoadShaderStageByPath(
24 const std::filesystem::path& path,
25 GraphicsAPI::ShaderStage shaderStage,
27 std::vector<char>& fileData
28 ) override;
29 virtual bool LoadShaderStageByAddress(
30 std::string_view address,
31 const GraphicsAPI::ShaderStage shaderStage,
33 std::vector<char>& fileData
34 ) override;
35 virtual bool LoadShaderStageByUuid(
36 Uuid uuid,
37 GraphicsAPI::ShaderStage shaderStage,
39 std::vector<char>& fileData
40 ) override;
41 protected:
42 AssetLoadBinaryResult LoadAsset(const ArchiveDirectory::AssetInfo& assetInfo);
43 ArchiveDirectory archiveDirectory;
44
45 Buffer lastBuffer;
46 uint16_t lastBufferIndex = UINT16_MAX;
47 };
48}
Definition ArchiveAssetLoader.hpp:11
Definition AssetLoader.hpp:32
Definition Buffer.hpp:46
Definition Uuid.hpp:6
Definition ArchiveDirectory.hpp:13
Definition ArchiveDirectory.hpp:12
Definition AssetLoader.hpp:20
Definition AssetLoader.hpp:26