diff options
author | alberth <alberth@openttd.org> | 2009-07-16 16:22:23 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2009-07-16 16:22:23 +0000 |
commit | d0a47fc1b417d697175b751d3236f66c4e325e91 (patch) | |
tree | 13681f47fc388cc4b331c11eca22c08c1b06fe83 /src/depot_gui.cpp | |
parent | 3cba03c5eb540f3a29aee96a6d8426ab297aed9d (diff) | |
download | openttd-d0a47fc1b417d697175b751d3236f66c4e325e91.tar.xz |
(svn r16845) -Codechange: Introduction of constants for describing the bits in a WWT_MATRIX data field.
Diffstat (limited to 'src/depot_gui.cpp')
-rw-r--r-- | src/depot_gui.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp index 8c6138c6f..b6d3ec13b 100644 --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -308,8 +308,8 @@ struct DepotWindow : Window { uint16 hnum; /* Set the row and number of boxes in each row based on the number of boxes drawn in the matrix */ - uint16 rows_in_display = this->widget[DEPOT_WIDGET_MATRIX].data >> 8; - uint16 boxes_in_each_row = this->widget[DEPOT_WIDGET_MATRIX].data & 0xFF; + uint16 rows_in_display = GB(this->widget[DEPOT_WIDGET_MATRIX].data, MAT_ROW_START, MAT_ROW_BITS); + uint16 boxes_in_each_row = GB(this->widget[DEPOT_WIDGET_MATRIX].data, MAT_COL_START, MAT_COL_BITS); /* setup disabled buttons */ this->SetWidgetsDisabledState(!IsTileOwner(tile, _local_company), @@ -397,7 +397,7 @@ struct DepotWindow : Window { { uint xt, row, xm = 0, ym = 0; int pos, skip = 0; - uint16 boxes_in_each_row = this->widget[DEPOT_WIDGET_MATRIX].data & 0xFF; + uint16 boxes_in_each_row = GB(this->widget[DEPOT_WIDGET_MATRIX].data, MAT_COL_START, MAT_COL_BITS); if (this->type == VEH_TRAIN) { xt = 0; @@ -727,8 +727,8 @@ struct DepotWindow : Window { this->SetupStringsForDepotWindow(type); this->widget[DEPOT_WIDGET_MATRIX].data = - (this->vscroll.cap * 0x100) // number of rows to draw on the background - + (type == VEH_TRAIN ? 1 : this->hscroll.cap); // number of boxes in each row. Trains always have just one + (this->vscroll.cap << MAT_ROW_START) // number of rows to draw on the background + + ((type == VEH_TRAIN ? 1 : this->hscroll.cap) << MAT_COL_START); // number of boxes in each row. Trains always have just one this->SetWidgetsHiddenState(type != VEH_TRAIN, @@ -1001,7 +1001,7 @@ struct DepotWindow : Window { { this->vscroll.cap += delta.y / (int)this->resize.step_height; this->hscroll.cap += delta.x / (int)this->resize.step_width; - this->widget[DEPOT_WIDGET_MATRIX].data = (this->vscroll.cap << 8) + (this->type == VEH_TRAIN ? 1 : this->hscroll.cap); + this->widget[DEPOT_WIDGET_MATRIX].data = (this->vscroll.cap << MAT_ROW_START) + ((this->type == VEH_TRAIN ? 1 : this->hscroll.cap) << MAT_COL_START); ResizeDepotButtons(this); } |