diff options
author | Stijn Buys <ingar@osirion.org> | 2015-02-01 21:28:17 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2015-02-01 21:28:17 +0000 |
commit | a0d8d44c93820754e887603ce6251c8ac135802e (patch) | |
tree | 61975f5b487fca7396779084e3ce50ea712b74db | |
parent | 5bbbdc24293ad1138a0b93628f7d28f8b249b92d (diff) |
Parse the rgbgen directive in material files.
-rw-r--r-- | src/model/material.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/model/material.cc b/src/model/material.cc index 93492f5..29dde49 100644 --- a/src/model/material.cc +++ b/src/model/material.cc @@ -332,6 +332,25 @@ void Material::load_shaderfile(const std::string &shadername) } else if (firstword.compare("environment") == 0) { layer->set_tcgen(Layer::TCGenEnvironment); layer->set_texmap(Layer::TexMapEnvironment); + } else if (firstword.compare("rgbgen") == 0) { + if (linestream >> firstword) { + aux::to_lowercase(firstword); + if (firstword.compare("color") == 0) { + layer->set_rgbgen(Layer::RGBGenColor); + } else if (firstword.compare("engine") == 0) { + layer->set_rgbgen(Layer::RGBGenEngine); + } else if (firstword.compare("entity") == 0) { + layer->set_rgbgen(Layer::RGBGenPrimary); + } else if (firstword.compare("entitysecond") == 0) { + layer->set_rgbgen(Layer::RGBGenSecondary); + } else if (firstword.compare("entitythird") == 0) { + layer->set_rgbgen(Layer::RGBGenTertiary); + } else { + con_warn << shaderfile.name() << " unknown rgbgen function '" << firstword << "' at line " << linenumber << std::endl; + } + } else { + con_warn << shaderfile.name() << " missing rgbgen function at line " << linenumber << std::endl; + } } else if (firstword.compare("blendfunc") == 0) { if (linestream >> firstword) { aux::to_lowercase(firstword); |