(svn r13994) -Codechange: replace a few rogue magic numbers with Colours enum values
authorbelugas
Mon, 04 Aug 2008 17:27:06 +0000
changeset 9850 61bd42a09ddd
parent 9849 1266e5d38d54
child 9851 20680f5b9c3a
(svn r13994) -Codechange: replace a few rogue magic numbers with Colours enum values
src/gfx.cpp
src/gfx_func.h
src/graph_gui.cpp
--- a/src/gfx.cpp	Mon Aug 04 17:12:23 2008 +0000
+++ b/src/gfx.cpp	Mon Aug 04 17:27:06 2008 +0000
@@ -47,7 +47,7 @@
 Colour _cur_palette[256];
 byte _stringwidth_table[FS_END][224]; ///< Cache containing width of often used characters. @see GetCharacterWidth()
 DrawPixelInfo *_cur_dpi;
-byte _colour_gradient[16][8];
+byte _colour_gradient[COLOUR_END][8];
 bool _use_dos_palette;
 
 static void GfxMainBlitter(const Sprite *sprite, int x, int y, BlitterMode mode, const SubSprite *sub = NULL);
--- a/src/gfx_func.h	Mon Aug 04 17:12:23 2008 +0000
+++ b/src/gfx_func.h	Mon Aug 04 17:27:06 2008 +0000
@@ -172,7 +172,7 @@
  * All 16 colour gradients
  * 8 colours per gradient from darkest (0) to lightest (7)
  */
-extern byte _colour_gradient[16][8];
+extern byte _colour_gradient[COLOUR_END][8];
 
 extern bool _use_dos_palette;
 
--- a/src/graph_gui.cpp	Mon Aug 04 17:12:23 2008 +0000
+++ b/src/graph_gui.cpp	Mon Aug 04 17:27:06 2008 +0000
@@ -159,7 +159,7 @@
 		assert(GRAPH_MAX_DATASETS >= (int)NUM_CARGO && GRAPH_MAX_DATASETS >= (int)MAX_PLAYERS);
 		assert(this->num_vert_lines > 0);
 
-		byte grid_colour = _colour_gradient[14][4];
+		byte grid_colour = _colour_gradient[COLOUR_GREY][4];
 
 		/* The coordinates of the opposite edges of the graph. */
 		int bottom = this->gd_top + this->gd_height - 1;