diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-03-27 01:42:53 +0100 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-03-27 01:43:55 +0100 |
commit | 1715d0afe44a282a356ca88e47c92ec556f094dd (patch) | |
tree | 36dcaa69dcf0165c33d7da1c1cc1a9f5fb7e228f /src/resources/dye.cpp | |
parent | 511d9ac780e094767e806c9a448ac973279dd4c8 (diff) | |
download | mana-1715d0afe44a282a356ca88e47c92ec556f094dd.tar.gz mana-1715d0afe44a282a356ca88e47c92ec556f094dd.tar.bz2 mana-1715d0afe44a282a356ca88e47c92ec556f094dd.tar.xz mana-1715d0afe44a282a356ca88e47c92ec556f094dd.zip |
Fixed include structure in resource/ directory
There is also a new rule that trivial constructors and destructors
should no longer be trivially "documented", since this just takes up
space with no gain.
Diffstat (limited to 'src/resources/dye.cpp')
-rw-r--r-- | src/resources/dye.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/resources/dye.cpp b/src/resources/dye.cpp index 1e4fd2fd..7ba6689f 100644 --- a/src/resources/dye.cpp +++ b/src/resources/dye.cpp @@ -19,16 +19,17 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include <sstream> +#include "resources/dye.h" -#include "dye.h" +#include "log.h" -#include "../log.h" +#include <sstream> DyePalette::DyePalette(const std::string &description) { int size = description.length(); - if (size == 0) return; + if (size == 0) + return; if (description[0] != '#') { // TODO: load palette from file. @@ -113,7 +114,8 @@ Dye::Dye(const std::string &description) for (int i = 0; i < 7; ++i) mDyePalettes[i] = 0; - if (description.empty()) return; + if (description.empty()) + return; std::string::size_type next_pos = 0, length = description.length(); do @@ -156,7 +158,8 @@ Dye::~Dye() void Dye::update(int color[3]) const { int cmax = std::max(color[0], std::max(color[1], color[2])); - if (cmax == 0) return; + if (cmax == 0) + return; int cmin = std::min(color[0], std::min(color[1], color[2])); int intensity = color[0] + color[1] + color[2]; @@ -177,7 +180,8 @@ void Dye::update(int color[3]) const void Dye::instantiate(std::string &target, const std::string &palettes) { std::string::size_type next_pos = target.find('|'); - if (next_pos == std::string::npos || palettes.empty()) return; + if (next_pos == std::string::npos || palettes.empty()) + return; ++next_pos; std::ostringstream s; @@ -187,7 +191,8 @@ void Dye::instantiate(std::string &target, const std::string &palettes) { std::string::size_type pos = next_pos; next_pos = target.find(';', pos); - if (next_pos == std::string::npos) next_pos = last_pos; + if (next_pos == std::string::npos) + next_pos = last_pos; if (next_pos == pos + 1 && pal_pos != std::string::npos) { std::string::size_type pal_next_pos = palettes.find(';', pal_pos); |