From 300db69911bec3a17f9fb695d09be3d9830e3648 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 13 Dec 2014 20:20:10 +0000 Subject: Minro cleanup, added Model::add_layer() method. --- src/model/material.cc | 7 +++++++ src/model/material.h | 17 ++++++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) (limited to 'src/model') 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); -- cgit v1.2.3