Codechange: Remove direct access to _colour_gradient.

Access is now through GetColourGradient, which ensures parameters are in range.
This commit is contained in:
2023-12-24 22:51:55 +00:00
committed by Peter Nelson
parent 56cf89d189
commit 0463d4c198
23 changed files with 98 additions and 65 deletions

View File

@@ -384,7 +384,7 @@ struct DepotWindow : Window {
*/
if (this->type == VEH_TRAIN && _consistent_train_width != 0) {
int w = ScaleSpriteTrad(2 * _consistent_train_width);
int col = _colour_gradient[wid->colour][4];
int col = GetColourGradient(wid->colour, 4);
Rect image = ir.Indent(this->header_width, rtl).Indent(this->count_width, !rtl);
int first_line = w + (-this->hscroll->GetPosition()) % w;
if (rtl) {