From d0a47fc1b417d697175b751d3236f66c4e325e91 Mon Sep 17 00:00:00 2001 From: alberth Date: Thu, 16 Jul 2009 16:22:23 +0000 Subject: (svn r16845) -Codechange: Introduction of constants for describing the bits in a WWT_MATRIX data field. --- src/ai/ai_gui.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/ai/ai_gui.cpp') diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp index acfb93e4f..6e1826bef 100644 --- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -53,7 +53,7 @@ struct AIListWindow : public Window { this->ai_info_list = AI::GetUniqueInfoList(); this->resize.step_height = 14; this->vscroll.cap = (this->widget[AIL_WIDGET_LIST].bottom - this->widget[AIL_WIDGET_LIST].top) / 14 + 1; - this->widget[AIL_WIDGET_LIST].data = (this->vscroll.cap << 8) + 1; + this->widget[AIL_WIDGET_LIST].data = (this->vscroll.cap << MAT_ROW_START) + (1 << MAT_COL_START); SetVScrollCount(this, (int)this->ai_info_list->size() + 1); /* Try if we can find the currently selected AI */ @@ -181,7 +181,7 @@ struct AIListWindow : public Window { this->vscroll.cap += delta.y / 14; SetVScrollCount(this, (int)this->ai_info_list->size() + 1); - this->widget[AIL_WIDGET_LIST].data = (this->vscroll.cap << 8) + 1; + this->widget[AIL_WIDGET_LIST].data = (this->vscroll.cap << MAT_ROW_START) + (1 << MAT_COL_START); } }; @@ -265,7 +265,7 @@ struct AISettingsWindow : public Window { this->ai_config = AIConfig::GetConfig(slot); this->resize.step_height = 14; this->vscroll.cap = (this->widget[AIS_WIDGET_BACKGROUND].bottom - this->widget[AIS_WIDGET_BACKGROUND].top) / 14 + 1; - this->widget[AIS_WIDGET_BACKGROUND].data = (this->vscroll.cap << 8) + 1; + this->widget[AIS_WIDGET_BACKGROUND].data = (this->vscroll.cap << MAT_ROW_START) + (1 << MAT_COL_START); SetVScrollCount(this, (int)this->ai_config->GetConfigList()->size()); this->FindWindowPlacementAndResize(desc); } @@ -378,7 +378,7 @@ struct AISettingsWindow : public Window { } this->vscroll.cap += delta.y / 14; - this->widget[AIS_WIDGET_BACKGROUND].data = (this->vscroll.cap << 8) + 1; + this->widget[AIS_WIDGET_BACKGROUND].data = (this->vscroll.cap << MAT_ROW_START) + (1 << MAT_COL_START); } virtual void OnTick() @@ -505,6 +505,7 @@ struct AIConfigWindow : public Window { this->resize.step_height = 14; this->vscroll.cap = (this->widget[AIC_WIDGET_LIST].bottom - this->widget[AIC_WIDGET_LIST].top) / 14 + 1; this->widget[AIC_WIDGET_LIST].data = (this->vscroll.cap << 8) + 1; + this->widget[AIC_WIDGET_LIST].data = (this->vscroll.cap << MAT_ROW_START) + (1 << MAT_COL_START); SetVScrollCount(this, MAX_COMPANIES); this->FindWindowPlacementAndResize(&_ai_config_desc); } @@ -597,7 +598,7 @@ struct AIConfigWindow : public Window { virtual void OnResize(Point delta) { this->vscroll.cap += delta.y / 14; - this->widget[AIC_WIDGET_LIST].data = (this->vscroll.cap << 8) + 1; + this->widget[AIC_WIDGET_LIST].data = (this->vscroll.cap << MAT_ROW_START) + (1 << MAT_COL_START); } virtual void OnTick() -- cgit v1.2.3-54-g00ecf