Loading logic moved to Asset classes

This commit is contained in:
Dynamitos
2020-06-08 01:44:47 +02:00
parent 356e6058fe
commit ab4a3b5e23
50 changed files with 966 additions and 558 deletions
+13 -4
View File
@@ -4,19 +4,28 @@
namespace Seele
{
DECLARE_REF(Mesh);
DECLARE_REF(MaterialAsset);
class MeshAsset : public Asset
{
public:
MeshAsset();
MeshAsset(const std::string& directory, const std::string& name);
MeshAsset(const std::string& fullPath);
void setMesh(PMesh mesh)
MeshAsset(const std::filesystem::path& fullPath);
virtual ~MeshAsset();
virtual void save() override;
virtual void load() override;
void addMesh(PMesh mesh)
{
std::scoped_lock lck(lock);
this->mesh = mesh;
meshes.add(mesh);
}
const Array<PMesh> getMeshes() const
{
return meshes;
}
private:
PMesh mesh;
Array<PMesh> meshes;
Array<PMaterialAsset> referencedMaterials;
};
DEFINE_REF(MeshAsset);
} // namespace Seele