Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/model
diff options
context:
space:
mode:
Diffstat (limited to 'src/model')
-rw-r--r--src/model/material.cc7
-rw-r--r--src/model/material.h17
2 files changed, 19 insertions, 5 deletions
diff --git a/src/model/material.cc b/src/model/material.cc
index 3d67cad..9f47f1e 100644
--- a/src/model/material.cc
+++ b/src/model/material.cc
@@ -40,6 +40,13 @@ void Material::set_size(const math::Vector2f & size)
material_size.assign(size);
}
+Layer * Material::add_layer()
+{
+ Layer * layer = new Layer();
+ material_layers.push_back(layer);
+ return (layer);
+}
+
void Material::print()
{
con_print << name() << std::endl;
diff --git a/src/model/material.h b/src/model/material.h
index a3ad5fc..c775c04 100644
--- a/src/model/material.h
+++ b/src/model/material.h
@@ -16,7 +16,9 @@
namespace model
{
-/// fragment surface material parameters
+/**
+ * @brief fragment material properties
+ * */
class Material
{
public:
@@ -161,6 +163,11 @@ public:
{
return material_layers;
}
+
+ /**
+ * @brief add a new layer to the material
+ * */
+ Layer *add_layer();
/* ---- static ----------------------------------------------------- */
@@ -175,7 +182,7 @@ public:
/**
* @brief initialize material registry
* reads materials from the shader files listed in shaderlist.txt
- */
+ * */
static void init();
/**
@@ -185,7 +192,7 @@ public:
/**
* @brief clear material registry
- */
+ * */
static void clear();
/**
@@ -199,12 +206,12 @@ public:
* If it doesnt, a mew material will be created, containing a single layer
* with a texture with the same name as the material.
* @param ui_texture set to true if the material is a material used by the user interface
- */
+ * */
static Material *load(const std::string &name, const bool ui_texture=false);
/**
* @brief find a material in the registry
- */
+ * */
static Material *find(const std::string &name);
static void set_imageloader_func(ImageLoaderFuncPtr func);