summaryrefslogtreecommitdiff
path: root/src/widget.cpp
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2009-07-16 16:22:23 +0000
committeralberth <alberth@openttd.org>2009-07-16 16:22:23 +0000
commitd0a47fc1b417d697175b751d3236f66c4e325e91 (patch)
tree13681f47fc388cc4b331c11eca22c08c1b06fe83 /src/widget.cpp
parent3cba03c5eb540f3a29aee96a6d8426ab297aed9d (diff)
downloadopenttd-d0a47fc1b417d697175b751d3236f66c4e325e91.tar.xz
(svn r16845) -Codechange: Introduction of constants for describing the bits in a WWT_MATRIX data field.
Diffstat (limited to 'src/widget.cpp')
-rw-r--r--src/widget.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/widget.cpp b/src/widget.cpp
index b3585a844..652876b2f 100644
--- a/src/widget.cpp
+++ b/src/widget.cpp
@@ -336,10 +336,10 @@ static inline void DrawMatrix(const Rect &r, Colours colour, bool clicked, uint1
{
DrawFrameRect(r.left, r.top, r.right, r.bottom, colour, (clicked) ? FR_LOWERED : FR_NONE);
- int num_columns = GB(data, 0, 8); // Lower 8 bits of the widget data: Number of columns in the matrix.
+ int num_columns = GB(data, MAT_COL_START, MAT_COL_BITS); // Lower 8 bits of the widget data: Number of columns in the matrix.
int column_width = (r.right - r.left + 1) / num_columns; // Width of a single column in the matrix.
- int num_rows = GB(data, 8, 8); // Upper 8 bits of the widget data: Number of rows in the matrix.
+ int num_rows = GB(data, MAT_ROW_START, MAT_ROW_BITS); // Upper 8 bits of the widget data: Number of rows in the matrix.
int row_height = (r.bottom - r.top + 1) / num_rows; // Height of a single row in the matrix.
int col = _colour_gradient[colour & 0xF][6];