summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/colour.h
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2012-03-13 04:34:08 +0100
committerAdam Borowski <kilobyte@angband.pl>2012-03-13 10:43:28 +0100
commit1495978437e71a2461e7d35e00e16c8edc131d13 (patch)
tree2d6c1e283f1ea5337dfa8a8c279f55ef850bc888 /crawl-ref/source/colour.h
parentb10dbcdf6daad946e426cdb08687ad89c004af5c (diff)
downloadcrawl-ref-1495978437e71a2461e7d35e00e16c8edc131d13.tar.gz
crawl-ref-1495978437e71a2461e7d35e00e16c8edc131d13.zip
Declare an explicit type for colours.
An imperial buttload of places assumes these to be 8 bits, which makes it impossible to add support for 256 (or more!) colours. This commit tries to allow expanding it in the future; sadly, it is badly incomplete. At least, new code can use the new type. Also, beware of "branded" colours which use bits above 8 for inverse, underline, etc.
Diffstat (limited to 'crawl-ref/source/colour.h')
-rw-r--r--crawl-ref/source/colour.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/crawl-ref/source/colour.h b/crawl-ref/source/colour.h
index e72803a1cf..60d42012ba 100644
--- a/crawl-ref/source/colour.h
+++ b/crawl-ref/source/colour.h
@@ -96,18 +96,18 @@ protected:
int str_to_colour(const std::string &str, int default_colour = -1,
bool accept_number = true);
-const std::string colour_to_str(uint8_t colour);
+const std::string colour_to_str(colour_t colour);
unsigned int str_to_tile_colour(std::string colour);
void init_element_colours();
void add_element_colour(element_colour_calc *colour);
void clear_colours_on_exit();
-uint8_t random_colour();
-uint8_t random_uncommon_colour();
-bool is_low_colour(uint8_t colour);
-bool is_high_colour(uint8_t colour);
-uint8_t make_low_colour(uint8_t colour);
-uint8_t make_high_colour(uint8_t colour);
+colour_t random_colour();
+colour_t random_uncommon_colour();
+bool is_low_colour(colour_t colour);
+bool is_high_colour(colour_t colour);
+colour_t make_low_colour(colour_t colour);
+colour_t make_high_colour(colour_t colour);
int element_colour(int element, bool no_random = false,
const coord_def& loc = coord_def());
bool get_tornado_phase(const coord_def& loc);
@@ -116,7 +116,7 @@ int dam_colour(const monster_info&);
#if defined(TARGET_OS_WINDOWS) || defined(USE_TILE_LOCAL)
unsigned short dos_brand(unsigned short colour,
- unsigned brand = CHATTR_REVERSE);
+ unsigned brand = CHATTR_REVERSE);
#endif
// Applies ETC_ colour substitutions and brands.