diff options
author | rubidium <rubidium@openttd.org> | 2008-05-09 09:29:27 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-05-09 09:29:27 +0000 |
commit | f4387004025efb3860a2934ed6d82a7e6f1cd716 (patch) | |
tree | 3a614e86500df9bd4d6ff37cbc44cca603933d88 /src | |
parent | 486172e07f92f4ac4a9602cf47568d0e1d3cf9bb (diff) | |
download | openttd-f4387004025efb3860a2934ed6d82a7e6f1cd716.tar.xz |
(svn r13024) -Codechange: do not use WE_MOUSELOOP when WE_TICK suffices, rename WE_4 to something more descriptive and correct some (completely incorrect) comments.
Diffstat (limited to 'src')
-rw-r--r-- | src/airport_gui.cpp | 2 | ||||
-rw-r--r-- | src/dock_gui.cpp | 4 | ||||
-rw-r--r-- | src/industry_gui.cpp | 2 | ||||
-rw-r--r-- | src/misc_gui.cpp | 2 | ||||
-rw-r--r-- | src/music_gui.cpp | 2 | ||||
-rw-r--r-- | src/openttd.cpp | 1 | ||||
-rw-r--r-- | src/player_gui.cpp | 2 | ||||
-rw-r--r-- | src/rail_gui.cpp | 8 | ||||
-rw-r--r-- | src/road_gui.cpp | 4 | ||||
-rw-r--r-- | src/settings_gui.cpp | 2 | ||||
-rw-r--r-- | src/smallmap_gui.cpp | 2 | ||||
-rw-r--r-- | src/toolbar_gui.cpp | 4 | ||||
-rw-r--r-- | src/town_gui.cpp | 4 | ||||
-rw-r--r-- | src/vehicle_gui.cpp | 2 | ||||
-rw-r--r-- | src/window.cpp | 2 | ||||
-rw-r--r-- | src/window_gui.h | 7 |
16 files changed, 25 insertions, 25 deletions
diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp index 557dc0b63..f3b960b74 100644 --- a/src/airport_gui.cpp +++ b/src/airport_gui.cpp @@ -230,7 +230,7 @@ static void BuildAirportPickerWndProc(Window *w, WindowEvent *e) } } break; - case WE_MOUSELOOP: { + case WE_TICK: { if (WP(w, def_d).close) { delete w; return; diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp index 532ea9633..e6369fdcf 100644 --- a/src/dock_gui.cpp +++ b/src/dock_gui.cpp @@ -274,7 +274,7 @@ static void BuildDockStationWndProc(Window *w, WindowEvent *e) } break; - case WE_MOUSELOOP: + case WE_TICK: if (WP(w, def_d).close) { delete w; return; @@ -349,7 +349,7 @@ static void BuildDocksDepotWndProc(Window *w, WindowEvent *e) } } break; - case WE_MOUSELOOP: + case WE_TICK: if (WP(w, def_d).close) delete w; break; diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 35aee71d8..5e2c7f652 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -881,7 +881,7 @@ static void IndustryDirectoryWndProc(Window *w, WindowEvent *e) } break; - case WE_4: + case WE_100_TICKS: w->SetDirty(); break; diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index dfbee20f7..06af009d8 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -401,7 +401,7 @@ static void ErrmsgWndProc(Window *w, WindowEvent *e) if (_right_button_down) delete w; break; - case WE_4: + case WE_100_TICKS: if (--_errmsg_duration == 0) delete w; break; diff --git a/src/music_gui.cpp b/src/music_gui.cpp index 7508ea9d2..589dbeca9 100644 --- a/src/music_gui.cpp +++ b/src/music_gui.cpp @@ -463,7 +463,7 @@ static void MusicWindowWndProc(Window *w, WindowEvent *e) } break; - case WE_MOUSELOOP: + case WE_TICK: InvalidateWindowWidget(WC_MUSIC_WINDOW, 0, 7); break; } diff --git a/src/openttd.cpp b/src/openttd.cpp index c07ca1db8..1f2d7c3b5 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -97,6 +97,7 @@ void MusicLoop(); void ResetMusic(); void ResetOldNames(); void ProcessAsyncSaveFinish(); +void CallWindowTickEvent(); extern void SetDifficultyLevel(int mode, GameOptions *gm_opt); extern Player* DoStartupNewPlayer(bool is_ai); diff --git a/src/player_gui.cpp b/src/player_gui.cpp index 845d5249f..78f5120d2 100644 --- a/src/player_gui.cpp +++ b/src/player_gui.cpp @@ -1309,7 +1309,7 @@ static void PlayerCompanyWndProc(Window *w, WindowEvent *e) } break; - case WE_MOUSELOOP: + case WE_TICK: /* redraw the window every now and then */ if ((++w->vscroll.pos & 0x1F) == 0) w->SetDirty(); break; diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index 2354689b3..12ddba97b 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -1122,7 +1122,7 @@ static void StationBuildWndProc(Window *w, WindowEvent *e) w->SetDirty(); break; - case WE_MOUSELOOP: + case WE_TICK: if (WP(w, def_d).close) { delete w; return; @@ -1345,7 +1345,7 @@ static void SignalBuildWndProc(Window *w, WindowEvent *e) w->SetDirty(); break; - case WE_MOUSELOOP: + case WE_TICK: if (WP(w, def_d).close) delete w; return; @@ -1436,7 +1436,7 @@ static void BuildTrainDepotWndProc(Window *w, WindowEvent *e) } break; - case WE_MOUSELOOP: + case WE_TICK: if (WP(w, def_d).close) delete w; return; @@ -1535,7 +1535,7 @@ static void BuildWaypointWndProc(Window *w, WindowEvent *e) break; } - case WE_MOUSELOOP: + case WE_TICK: if (WP(w, def_d).close) delete w; break; diff --git a/src/road_gui.cpp b/src/road_gui.cpp index 07a6f1d0e..511aa44a6 100644 --- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -762,7 +762,7 @@ static void BuildRoadDepotWndProc(Window *w, WindowEvent *e) } break; - case WE_MOUSELOOP: + case WE_TICK: if (WP(w, def_d).close) delete w; break; @@ -919,7 +919,7 @@ static void RoadStationPickerWndProc(Window *w, WindowEvent *e) } break; - case WE_MOUSELOOP: + case WE_TICK: if (WP(w, def_d).close) { delete w; return; diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 3ce65d5ab..5145644f6 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -655,7 +655,7 @@ static void GameDifficultyWndProc(Window *w, WindowEvent *e) break; } break; - case WE_MOUSELOOP: /* Handle the visual 'clicking' of the buttons */ + case WE_TICK: /* Handle the visual 'clicking' of the buttons */ if (diffic_d->timeout != 0) { diffic_d->timeout--; if (diffic_d->timeout == 0) diffic_d->clicked_button = NO_SETTINGS_BUTTON; diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp index 5ea843f4f..11d9f8435 100644 --- a/src/smallmap_gui.cpp +++ b/src/smallmap_gui.cpp @@ -982,7 +982,7 @@ static void SmallMapWindowProc(Window *w, WindowEvent *e) } break; - case WE_MOUSELOOP: + case WE_TICK: /* update the window every now and then */ if ((++w->vscroll.pos & 0x1F) == 0) w->SetDirty(); break; diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp index 17061c005..43b34dce9 100644 --- a/src/toolbar_gui.cpp +++ b/src/toolbar_gui.cpp @@ -745,7 +745,7 @@ static void MainToolbarWndProc(Window *w, WindowEvent *e) w->SetDirty(); break; - case WE_MOUSELOOP: + case WE_TICK: if (w->IsWidgetLowered(0) != !!_pause_game) { w->ToggleWidgetLoweredState(0); w->InvalidateWidget(0); @@ -1017,7 +1017,7 @@ static void ScenEditToolbarWndProc(Window *w, WindowEvent *e) } } break; - case WE_MOUSELOOP: + case WE_TICK: if (w->IsWidgetLowered(0) != !!_pause_game) { w->ToggleWidgetLoweredState(0); w->SetDirty(); diff --git a/src/town_gui.cpp b/src/town_gui.cpp index 283cd448c..83a487659 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -252,7 +252,7 @@ static void TownAuthorityWndProc(Window *w, WindowEvent *e) } break; - case WE_4: + case WE_100_TICKS: w->SetDirty(); break; } @@ -555,7 +555,7 @@ static void TownDirectoryWndProc(Window *w, WindowEvent *e) } break; - case WE_4: + case WE_100_TICKS: w->SetDirty(); break; diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index c35560e77..d2b19763e 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -2157,7 +2157,7 @@ static void VehicleViewWndProc(Window *w, WindowEvent *e) DeleteWindowById(WC_VEHICLE_TIMETABLE, w->window_number); break; - case WE_MOUSELOOP: { + case WE_TICK: { const Vehicle *v = GetVehicle(w->window_number); bool veh_stopped = v->IsStoppedInDepot(); diff --git a/src/window.cpp b/src/window.cpp index 787c607f7..742b63c71 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -1984,7 +1984,7 @@ void UpdateWindows() if (t >= 100) { for (wz = _last_z_window; wz != _z_windows;) { - CallWindowEventNP(*--wz, WE_4); + CallWindowEventNP(*--wz, WE_100_TICKS); } t = 0; } diff --git a/src/window_gui.h b/src/window_gui.h index c9c1b91bb..e9cb2d066 100644 --- a/src/window_gui.h +++ b/src/window_gui.h @@ -117,10 +117,10 @@ enum WindowEventCodes { WE_DOUBLE_CLICK, ///< Left mouse button double click WE_RCLICK, ///< Right mouse button click WE_MOUSEOVER, - WE_MOUSELOOP, WE_MOUSEWHEEL, - WE_TICK, ///< Regularly occurring event (about once every 20 seconds orso, 10 days) for slowly changing content (typically list sorting) - WE_4, ///< Regularly occurring event for updating continuously changing window content (other than view ports), or timer expiring + WE_MOUSELOOP, ///< Event for each mouse event in the game (at least once every game tick) + WE_TICK, ///< Regularly occurring event (every game tick) + WE_100_TICKS, ///< Regularly occurring event (every 100 game ticks, approximatelly 3 seconds) WE_TIMEOUT, WE_PLACE_OBJ, WE_ABORT_PLACE_OBJ, @@ -504,7 +504,6 @@ enum WindowFlags { /* window.cpp */ void CallWindowEventNP(Window *w, int event); -void CallWindowTickEvent(); Window *BringWindowToFrontById(WindowClass cls, WindowNumber number); Window *FindWindowFromPt(int x, int y); |