diff options
author | Steve Cotton <steve@s.cotton.clara.co.uk> | 2009-03-16 19:04:38 +0000 |
---|---|---|
committer | Steve Cotton <steve@s.cotton.clara.co.uk> | 2009-03-16 19:04:38 +0000 |
commit | 13b064998c0f7142a134817c9dde08ad29db97fe (patch) | |
tree | aa7177718259171a6d47414b1ab143afc0146ded | |
parent | 94495012ea5919cddaf47e7a7818fd8ba4e76708 (diff) | |
download | mana-13b064998c0f7142a134817c9dde08ad29db97fe.tar.gz mana-13b064998c0f7142a134817c9dde08ad29db97fe.tar.bz2 mana-13b064998c0f7142a134817c9dde08ad29db97fe.tar.xz mana-13b064998c0f7142a134817c9dde08ad29db97fe.zip |
Code reformatting
Cherry-picking changes from Bjørn's 1b3cb122be1a418ce82b66fb9ce1ecf3aa5813fb
Mainly making sure 'const std::string &' is used everywhere instead of
'std::string const &'. The former has always been the preferred order in
this project.
-rw-r--r-- | src/resources/dye.cpp | 6 | ||||
-rw-r--r-- | src/resources/dye.h | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/resources/dye.cpp b/src/resources/dye.cpp index a5998017..92176852 100644 --- a/src/resources/dye.cpp +++ b/src/resources/dye.cpp @@ -26,7 +26,7 @@ #include "../log.h" -Palette::Palette(std::string const &description) +Palette::Palette(const std::string &description) { int size = description.length(); if (size == 0) return; @@ -109,7 +109,7 @@ void Palette::getColor(int intensity, int color[3]) const color[2] = ((255 - t) * b1 + t * b2) / 255; } -Dye::Dye(std::string const &description) +Dye::Dye(const std::string &description) { for (int i = 0; i < 7; ++i) mPalettes[i] = 0; @@ -175,7 +175,7 @@ void Dye::update(int color[3]) const mPalettes[i - 1]->getColor(cmax, color); } -void Dye::instantiate(std::string &target, std::string const &palettes) +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; diff --git a/src/resources/dye.h b/src/resources/dye.h index 48254b6f..ef867058 100644 --- a/src/resources/dye.h +++ b/src/resources/dye.h @@ -38,7 +38,7 @@ class Palette * The string is either a file name or a sequence of hexadecimal RGB * values separated by ',' and starting with '#'. */ - Palette(std::string const &pallete); + Palette(const std::string &pallete); /** * Gets a pixel color depending on its intensity. @@ -65,7 +65,7 @@ class Dye * The parts of string are separated by semi-colons. Each part starts * by an uppercase letter, followed by a colon and then a palette name. */ - Dye(std::string const &dye); + Dye(const std::string &dye); /** * Destroys the associated palettes. @@ -81,7 +81,7 @@ class Dye * Fills the blank in a dye placeholder with some palette names. */ static void instantiate(std::string &target, - std::string const &palettes); + const std::string &palettes); private: |