summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2009-09-13 17:37:47 +0000
committerfrosch <frosch@openttd.org>2009-09-13 17:37:47 +0000
commit734edc178db2d134923ed887b17242bbce55c802 (patch)
tree281fe56953557f05c066121821967366632a7edd /src
parent53cc397607222c9c1a8b56c545c5050dbc306b41 (diff)
downloadopenttd-734edc178db2d134923ed887b17242bbce55c802.tar.xz
(svn r17525) -Cleanup: Remove SetWindowDirty(), it is completely covered by other functions already.
Diffstat (limited to 'src')
-rw-r--r--src/cheat_gui.cpp2
-rw-r--r--src/console_gui.cpp4
-rw-r--r--src/misc_gui.cpp4
-rw-r--r--src/rail_gui.cpp4
-rw-r--r--src/settings.cpp2
-rw-r--r--src/toolbar_gui.cpp2
-rw-r--r--src/window.cpp10
-rw-r--r--src/window_func.h2
8 files changed, 9 insertions, 21 deletions
diff --git a/src/cheat_gui.cpp b/src/cheat_gui.cpp
index 29087aea3..be5c99303 100644
--- a/src/cheat_gui.cpp
+++ b/src/cheat_gui.cpp
@@ -104,7 +104,7 @@ static int32 ClickChangeDateCheat(int32 p1, int32 p2)
SetDate(ConvertYMDToDate(_cur_year + p2, ymd.month, ymd.day));
EnginesMonthlyLoop();
- SetWindowDirty(FindWindowById(WC_STATUS_BAR, 0));
+ InvalidateWindow(WC_STATUS_BAR, 0);
InvalidateWindowClassesData(WC_BUILD_STATION, 0);
ResetSignalVariant();
return _cur_year;
diff --git a/src/console_gui.cpp b/src/console_gui.cpp
index c74b08685..7cde4e807 100644
--- a/src/console_gui.cpp
+++ b/src/console_gui.cpp
@@ -141,7 +141,7 @@ static void IConsoleClearCommand()
_iconsole_cmdline.width = 0;
_iconsole_cmdline.caretpos = 0;
_iconsole_cmdline.caretxoffs = 0;
- SetWindowDirty(FindWindowById(WC_CONSOLE, 0));
+ InvalidateWindow(WC_CONSOLE, 0);
}
static inline void IConsoleResetHistoryPos() {_iconsole_historypos = ICON_HISTORY_SIZE - 1;}
@@ -470,5 +470,5 @@ static void IConsoleHistoryNavigate(int direction)
void IConsoleGUIPrint(ConsoleColour colour_code, char *str)
{
new IConsoleLine(str, (TextColour)colour_code);
- SetWindowDirty(FindWindowById(WC_CONSOLE, 0));
+ InvalidateWindow(WC_CONSOLE, 0);
}
diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp
index 5017b31f9..7e4d019e3 100644
--- a/src/misc_gui.cpp
+++ b/src/misc_gui.cpp
@@ -929,7 +929,7 @@ void CheckRedrawStationCoverage(const Window *w)
{
if (_thd.dirty & 1) {
_thd.dirty &= ~1;
- SetWindowDirty(w);
+ w->SetDirty();
}
}
@@ -2079,7 +2079,7 @@ void ShowSaveLoadDialog(SaveLoadDialogMode mode)
void RedrawAutosave()
{
- SetWindowDirty(FindWindowById(WC_STATUS_BAR, 0));
+ InvalidateWindow(WC_STATUS_BAR, 0);
}
void SetFiosType(const byte fiostype)
diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp
index 7a060a628..3d29c624f 100644
--- a/src/rail_gui.cpp
+++ b/src/rail_gui.cpp
@@ -1601,14 +1601,14 @@ public:
case BSW_DRAG_SIGNALS_DENSITY_DECREASE:
if (_settings_client.gui.drag_signals_density > 1) {
_settings_client.gui.drag_signals_density--;
- SetWindowDirty(FindWindowById(WC_GAME_OPTIONS, 0));
+ InvalidateWindow(WC_GAME_OPTIONS, 0);
}
break;
case BSW_DRAG_SIGNALS_DENSITY_INCREASE:
if (_settings_client.gui.drag_signals_density < 20) {
_settings_client.gui.drag_signals_density++;
- SetWindowDirty(FindWindowById(WC_GAME_OPTIONS, 0));
+ InvalidateWindow(WC_GAME_OPTIONS, 0);
}
break;
diff --git a/src/settings.cpp b/src/settings.cpp
index 312045a59..fa30c8a7a 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -752,7 +752,7 @@ static bool TrainAccelerationModelChanged(int32 p1)
static bool DragSignalsDensityChanged(int32)
{
- SetWindowDirty(FindWindowById(WC_BUILD_SIGNAL, 0));
+ InvalidateWindow(WC_BUILD_SIGNAL, 0);
return true;
}
diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp
index 411a688a5..ff22ed7c8 100644
--- a/src/toolbar_gui.cpp
+++ b/src/toolbar_gui.cpp
@@ -782,7 +782,7 @@ static void ToolbarSwitchClick(Window *w)
SplitToolbar(w);
w->HandleButtonClick(TBN_SWITCHBAR);
- SetWindowDirty(w);
+ w->SetDirty();
SndPlayFx(SND_15_BEEP);
}
diff --git a/src/window.cpp b/src/window.cpp
index 70fee8754..222dd04d1 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -591,16 +591,6 @@ void Window::SetDirty() const
SetDirtyBlocks(this->left, this->top, this->left + this->width, this->top + this->height);
}
-/**
- * Mark entire window as dirty (in need of re-paint)
- * @param w Window to redraw
- * @ingroup dirty
- */
-void SetWindowDirty(const Window *w)
-{
- if (w != NULL) w->SetDirty();
-}
-
/** Re-initialize a window. */
void Window::ReInit()
{
diff --git a/src/window_func.h b/src/window_func.h
index 641e8f3aa..1690a310c 100644
--- a/src/window_func.h
+++ b/src/window_func.h
@@ -15,8 +15,6 @@
#include "window_type.h"
#include "company_type.h"
-void SetWindowDirty(const Window *w);
-
Window *FindWindowById(WindowClass cls, WindowNumber number);
void ChangeWindowOwner(Owner old_owner, Owner new_owner);