summaryrefslogtreecommitdiff
path: root/dock_gui.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-11-14 19:48:04 +0000
committertron <tron@openttd.org>2005-11-14 19:48:04 +0000
commitf7abff5f963cddfdd134ac52ffd8e72e3ed88f0c (patch)
treea9ba5d4f3c5c47ab3857060c5f95ed482530ed97 /dock_gui.c
parentd8b56c123eab7f7b48f2af3579130e366f6106ab (diff)
downloadopenttd-f7abff5f963cddfdd134ac52ffd8e72e3ed88f0c.tar.xz
(svn r3181) -Bracing
-Indentation -Whitespace -DeMorgan's Law -Test with NULL or 0 for non-booleans -'\0' instead of 0 for chars -Remove redundantly redundant comments (like DoFoo(); // Do foo) -Join multiple short lines with a single statement -Split single lines with multiple statements -Avoid assignments in if
Diffstat (limited to 'dock_gui.c')
-rw-r--r--dock_gui.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/dock_gui.c b/dock_gui.c
index a1e14b726..0c6c97a24 100644
--- a/dock_gui.c
+++ b/dock_gui.c
@@ -222,35 +222,39 @@ void ShowBuildDocksToolbar(void)
static void BuildDockStationWndProc(Window *w, WindowEvent *e)
{
- int rad;
-
- switch(e->event) {
+ switch (e->event) {
case WE_PAINT: {
- if (WP(w,def_d).close)
- return;
+ int rad;
+
+ if (WP(w,def_d).close) return;
w->click_state = (1<<3) << _station_show_coverage;
DrawWindowWidgets(w);
rad = (_patches.modified_catchment) ? CA_DOCK : 4;
- if (_station_show_coverage) SetTileSelectBigSize(-rad, -rad, 2 * rad, 2 * rad);
- else SetTileSelectBigSize(0, 0, 0, 0);
+ if (_station_show_coverage) {
+ SetTileSelectBigSize(-rad, -rad, 2 * rad, 2 * rad);
+ } else {
+ SetTileSelectBigSize(0, 0, 0, 0);
+ }
DrawStringCentered(74, 17, STR_3066_COVERAGE_AREA_HIGHLIGHT, 0);
DrawStationCoverageAreaText(4, 50, (uint)-1, rad);
- } break;
+ break;
+ }
- case WE_CLICK: {
- switch(e->click.widget) {
- case 3: case 4:
- _station_show_coverage = e->click.widget - 3;
- SndPlayFx(SND_15_BEEP);
- SetWindowDirty(w);
- break;
+ case WE_CLICK:
+ switch (e->click.widget) {
+ case 3:
+ case 4:
+ _station_show_coverage = e->click.widget - 3;
+ SndPlayFx(SND_15_BEEP);
+ SetWindowDirty(w);
+ break;
}
- } break;
+ break;
- case WE_MOUSELOOP: {
+ case WE_MOUSELOOP:
if (WP(w,def_d).close) {
DeleteWindow(w);
return;
@@ -258,11 +262,9 @@ static void BuildDockStationWndProc(Window *w, WindowEvent *e)
CheckRedrawStationCoverage(w);
break;
- }
case WE_DESTROY:
- if (!WP(w,def_d).close)
- ResetObjectToPlace();
+ if (!WP(w,def_d).close) ResetObjectToPlace();
break;
}
}
@@ -324,13 +326,11 @@ static void BuildDocksDepotWndProc(Window *w, WindowEvent *e)
} break;
case WE_MOUSELOOP:
- if (WP(w,def_d).close)
- DeleteWindow(w);
+ if (WP(w,def_d).close) DeleteWindow(w);
break;
case WE_DESTROY:
- if (!WP(w,def_d).close)
- ResetObjectToPlace();
+ if (!WP(w,def_d).close) ResetObjectToPlace();
break;
}
}