summaryrefslogtreecommitdiff
path: root/src/ai/ai_gui.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/ai/ai_gui.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/ai/ai_gui.cpp')
-rw-r--r--src/ai/ai_gui.cpp11
1 files changed, 6 insertions, 5 deletions
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()