diff options
author | Stijn Buys <ingar@osirion.org> | 2014-07-09 19:18:31 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2014-07-09 19:18:31 +0000 |
commit | 1d518a54914531d7a4fab3a6835b75de85bd7bc7 (patch) | |
tree | cabfcb6f735e3c928cddf79169fb84d9b422747f /src/model/layer.cc | |
parent | 25a7edee2f003f259fc3a97bbfc047d72adaa361 (diff) |
Initial support for multi-layered materials, requires shaders files in the new format.
Diffstat (limited to 'src/model/layer.cc')
-rw-r--r-- | src/model/layer.cc | 46 |
1 files changed, 43 insertions, 3 deletions
diff --git a/src/model/layer.cc b/src/model/layer.cc index 81faa6c..51d8c9a 100644 --- a/src/model/layer.cc +++ b/src/model/layer.cc @@ -10,12 +10,15 @@ namespace model { Layer::Layer() : + layer_size(), layer_rgbgen(RGBGenIdentity), - layer_color(), + layer_color(1.0f), + layer_color_specular(1.0f), layer_texmap(TexMapNone), layer_texture_name(), layer_texture_id(0), - layer_tcgen(TCGenNone) + layer_tcgen(TCGenBase), + layer_bright(false) { } @@ -23,6 +26,11 @@ Layer::~Layer() { } +void Layer::set_size(const math::Vector2f & size) +{ + layer_size.assign(size); +} + void Layer::set_rgbgen(const RGBGen rgbgen) { layer_rgbgen = rgbgen; @@ -32,11 +40,43 @@ void Layer::set_color(const math::Color & color) { layer_color.assign(color); } + +void Layer::set_specular(const math::Color & specular) +{ + layer_color_specular.assign(specular); +} + +void Layer::set_texmap(const TexMap texmap) +{ + layer_texmap = texmap; +} + +void Layer::set_texture(const std::string & texture) +{ + if (texture.size()) + { + layer_texture_name.assign(texture); + set_texmap(TexMapImage); + } else { + layer_texture_name.clear(); + set_texmap(TexMapNone); + } +} +void Layer::set_texture_id(const size_t id) +{ + layer_texture_id = id; +} + void Layer::set_tcgen(const TCGen tcgen) { layer_tcgen = tcgen; } - + +void Layer::set_bright(const bool bright) +{ + layer_bright = bright; +} + } |