summaryrefslogtreecommitdiff
path: root/src/build_vehicle_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-05-06 22:08:18 +0000
committerrubidium <rubidium@openttd.org>2008-05-06 22:08:18 +0000
commit9bf519f26bc9b3e174803c8ebfd2427bf7c5fb61 (patch)
tree6760a7b433eda594e11470ba7695e8c399fadbfd /src/build_vehicle_gui.cpp
parente6c944a6c4507ec00948391d1b0bdf300bbd879e (diff)
downloadopenttd-9bf519f26bc9b3e174803c8ebfd2427bf7c5fb61.tar.xz
(svn r12976) -Codechange: use w->SetDirty() instead of SetWindowDirty(w) when it's certain that w != NULL.
Diffstat (limited to 'src/build_vehicle_gui.cpp')
-rw-r--r--src/build_vehicle_gui.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp
index 2361a6ddc..66aeffeac 100644
--- a/src/build_vehicle_gui.cpp
+++ b/src/build_vehicle_gui.cpp
@@ -1011,9 +1011,9 @@ static void DrawBuildVehicleWindow(Window *w)
int text_end = DrawVehiclePurchaseInfo(2, wi->top + 1, wi->right - wi->left - 2, bv->sel_engine);
if (text_end > wi->bottom) {
- SetWindowDirty(w);
+ w->SetDirty();
ResizeWindowForWidget(w, BUILD_VEHICLE_WIDGET_PANEL, 0, text_end - wi->bottom);
- SetWindowDirty(w);
+ w->SetDirty();
}
}
@@ -1029,14 +1029,14 @@ static void BuildVehicleClickEvent(Window *w, WindowEvent *e)
bv->descending_sort_order ^= true;
_last_sort_order[bv->vehicle_type] = bv->descending_sort_order;
bv->regenerate_list = true;
- SetWindowDirty(w);
+ w->SetDirty();
break;
case BUILD_VEHICLE_WIDGET_LIST: {
uint i = (e->we.click.pt.y - w->widget[BUILD_VEHICLE_WIDGET_LIST].top) / GetVehicleListHeight(bv->vehicle_type) + w->vscroll.pos;
uint num_items = EngList_Count(&bv->eng_list);
bv->sel_engine = (i < num_items) ? bv->eng_list[i] : INVALID_ENGINE;
- SetWindowDirty(w);
+ w->SetDirty();
break;
}
@@ -1108,7 +1108,7 @@ static void NewVehicleWndProc(Window *w, WindowEvent *e)
case WE_INVALIDATE_DATA:
bv->regenerate_list = true;
- SetWindowDirty(w);
+ w->SetDirty();
break;
case WE_DESTROY:
@@ -1157,7 +1157,7 @@ static void NewVehicleWndProc(Window *w, WindowEvent *e)
_last_sort_criteria[bv->vehicle_type] = bv->sort_criteria;
bv->regenerate_list = true;
}
- SetWindowDirty(w);
+ w->SetDirty();
break;
case WE_RESIZE: