Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/model
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2014-12-13 20:20:10 +0000
committerStijn Buys <ingar@osirion.org>2014-12-13 20:20:10 +0000
commit300db69911bec3a17f9fb695d09be3d9830e3648 (patch)
tree9add4eb17754f5f5b7c4ce50c1ddb106916a878c /src/model
parent2c4d6e947546f2732dd59d13fb331ec1412315ee (diff)
Minro cleanup, added Model::add_layer() method.
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);