Implementing basic asset serialization

This commit is contained in:
Dynamitos
2023-02-13 14:56:13 +01:00
parent 9e1e4076f0
commit 48fa098546
82 changed files with 1834 additions and 423 deletions
+4 -6
View File
@@ -7,20 +7,18 @@ DECLARE_NAME_REF(Gfx, Texture)
class TextureAsset : public Asset
{
public:
static constexpr uint64 IDENTIFIER = 0x1;
TextureAsset();
TextureAsset(const std::string& directory, const std::string& name);
TextureAsset(const std::filesystem::path& fullPath);
TextureAsset(std::string_view folderPath, std::string_view name);
virtual ~TextureAsset();
virtual void save(Gfx::PGraphics graphics) override;
virtual void load(Gfx::PGraphics graphics) override;
virtual void save(ArchiveBuffer& buffer) const override;
virtual void load(ArchiveBuffer& buffer) override;
void setTexture(Gfx::PTexture _texture)
{
std::scoped_lock lck(lock);
texture = _texture;
}
Gfx::PTexture getTexture()
{
std::scoped_lock lck(lock);
return texture;
}
private: