Loading logic moved to Asset classes
This commit is contained in:
@@ -15,7 +15,7 @@ Material::Material(const std::string& directory, const std::string& name)
|
||||
{
|
||||
}
|
||||
|
||||
Material::Material(const std::string& fullPath)
|
||||
Material::Material(const std::filesystem::path& fullPath)
|
||||
: MaterialAsset(fullPath)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -10,12 +10,13 @@ class Material : public MaterialAsset
|
||||
public:
|
||||
Material();
|
||||
Material(const std::string &directory, const std::string &name);
|
||||
Material(const std::string &fullPath);
|
||||
Material(const std::filesystem::path& fullPath);
|
||||
~Material();
|
||||
inline std::string getMaterialName() const {return materialName;}
|
||||
private:
|
||||
void compile();
|
||||
std::string materialName;
|
||||
Array<std::string> materialCode;
|
||||
friend class MaterialLoader;
|
||||
};
|
||||
DEFINE_REF(Material);
|
||||
|
||||
@@ -11,7 +11,7 @@ MaterialAsset::MaterialAsset(const std::string& directory, const std::string& na
|
||||
{
|
||||
}
|
||||
|
||||
MaterialAsset::MaterialAsset(const std::string& fullPath)
|
||||
MaterialAsset::MaterialAsset(const std::filesystem::path& fullPath)
|
||||
: Asset(fullPath)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ class MaterialAsset : public Asset
|
||||
public:
|
||||
MaterialAsset();
|
||||
MaterialAsset(const std::string &directory, const std::string &name);
|
||||
MaterialAsset(const std::string &fullPath);
|
||||
MaterialAsset(const std::filesystem::path &fullPath);
|
||||
~MaterialAsset();
|
||||
protected:
|
||||
//For now its simply the collection of parameters, since there is no point for expressions
|
||||
|
||||
@@ -17,6 +17,11 @@ MaterialInstance::MaterialInstance(const std::string& fullPath)
|
||||
{
|
||||
}
|
||||
|
||||
MaterialInstance::MaterialInstance(const std::filesystem::path& fullPath)
|
||||
: Asset(fullPath)
|
||||
{
|
||||
}
|
||||
|
||||
MaterialInstance::~MaterialInstance()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ public:
|
||||
MaterialInstance();
|
||||
MaterialInstance(const std::string& directory, const std::string& name);
|
||||
MaterialInstance(const std::string& fullPath);
|
||||
MaterialInstance(const std::filesystem::path& fullPath);
|
||||
~MaterialInstance();
|
||||
PMaterial getBaseMaterial() const;
|
||||
Gfx::PDescriptorSet getDescriptor();
|
||||
|
||||
Reference in New Issue
Block a user