1
0
Fork 0

(svn r17525) -Cleanup: Remove SetWindowDirty(), it is completely covered by other functions already.

release/1.0
frosch 2009-09-13 17:37:47 +00:00
parent 53cc397607
commit 734edc178d
8 changed files with 9 additions and 21 deletions

View File

@ -104,7 +104,7 @@ static int32 ClickChangeDateCheat(int32 p1, int32 p2)
SetDate(ConvertYMDToDate(_cur_year + p2, ymd.month, ymd.day)); SetDate(ConvertYMDToDate(_cur_year + p2, ymd.month, ymd.day));
EnginesMonthlyLoop(); EnginesMonthlyLoop();
SetWindowDirty(FindWindowById(WC_STATUS_BAR, 0)); InvalidateWindow(WC_STATUS_BAR, 0);
InvalidateWindowClassesData(WC_BUILD_STATION, 0); InvalidateWindowClassesData(WC_BUILD_STATION, 0);
ResetSignalVariant(); ResetSignalVariant();
return _cur_year; return _cur_year;

View File

@ -141,7 +141,7 @@ static void IConsoleClearCommand()
_iconsole_cmdline.width = 0; _iconsole_cmdline.width = 0;
_iconsole_cmdline.caretpos = 0; _iconsole_cmdline.caretpos = 0;
_iconsole_cmdline.caretxoffs = 0; _iconsole_cmdline.caretxoffs = 0;
SetWindowDirty(FindWindowById(WC_CONSOLE, 0)); InvalidateWindow(WC_CONSOLE, 0);
} }
static inline void IConsoleResetHistoryPos() {_iconsole_historypos = ICON_HISTORY_SIZE - 1;} 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) void IConsoleGUIPrint(ConsoleColour colour_code, char *str)
{ {
new IConsoleLine(str, (TextColour)colour_code); new IConsoleLine(str, (TextColour)colour_code);
SetWindowDirty(FindWindowById(WC_CONSOLE, 0)); InvalidateWindow(WC_CONSOLE, 0);
} }

View File

@ -929,7 +929,7 @@ void CheckRedrawStationCoverage(const Window *w)
{ {
if (_thd.dirty & 1) { if (_thd.dirty & 1) {
_thd.dirty &= ~1; _thd.dirty &= ~1;
SetWindowDirty(w); w->SetDirty();
} }
} }
@ -2079,7 +2079,7 @@ void ShowSaveLoadDialog(SaveLoadDialogMode mode)
void RedrawAutosave() void RedrawAutosave()
{ {
SetWindowDirty(FindWindowById(WC_STATUS_BAR, 0)); InvalidateWindow(WC_STATUS_BAR, 0);
} }
void SetFiosType(const byte fiostype) void SetFiosType(const byte fiostype)

View File

@ -1601,14 +1601,14 @@ public:
case BSW_DRAG_SIGNALS_DENSITY_DECREASE: case BSW_DRAG_SIGNALS_DENSITY_DECREASE:
if (_settings_client.gui.drag_signals_density > 1) { if (_settings_client.gui.drag_signals_density > 1) {
_settings_client.gui.drag_signals_density--; _settings_client.gui.drag_signals_density--;
SetWindowDirty(FindWindowById(WC_GAME_OPTIONS, 0)); InvalidateWindow(WC_GAME_OPTIONS, 0);
} }
break; break;
case BSW_DRAG_SIGNALS_DENSITY_INCREASE: case BSW_DRAG_SIGNALS_DENSITY_INCREASE:
if (_settings_client.gui.drag_signals_density < 20) { if (_settings_client.gui.drag_signals_density < 20) {
_settings_client.gui.drag_signals_density++; _settings_client.gui.drag_signals_density++;
SetWindowDirty(FindWindowById(WC_GAME_OPTIONS, 0)); InvalidateWindow(WC_GAME_OPTIONS, 0);
} }
break; break;

View File

@ -752,7 +752,7 @@ static bool TrainAccelerationModelChanged(int32 p1)
static bool DragSignalsDensityChanged(int32) static bool DragSignalsDensityChanged(int32)
{ {
SetWindowDirty(FindWindowById(WC_BUILD_SIGNAL, 0)); InvalidateWindow(WC_BUILD_SIGNAL, 0);
return true; return true;
} }

View File

@ -782,7 +782,7 @@ static void ToolbarSwitchClick(Window *w)
SplitToolbar(w); SplitToolbar(w);
w->HandleButtonClick(TBN_SWITCHBAR); w->HandleButtonClick(TBN_SWITCHBAR);
SetWindowDirty(w); w->SetDirty();
SndPlayFx(SND_15_BEEP); SndPlayFx(SND_15_BEEP);
} }

View File

@ -591,16 +591,6 @@ void Window::SetDirty() const
SetDirtyBlocks(this->left, this->top, this->left + this->width, this->top + this->height); 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. */ /** Re-initialize a window. */
void Window::ReInit() void Window::ReInit()
{ {

View File

@ -15,8 +15,6 @@
#include "window_type.h" #include "window_type.h"
#include "company_type.h" #include "company_type.h"
void SetWindowDirty(const Window *w);
Window *FindWindowById(WindowClass cls, WindowNumber number); Window *FindWindowById(WindowClass cls, WindowNumber number);
void ChangeWindowOwner(Owner old_owner, Owner new_owner); void ChangeWindowOwner(Owner old_owner, Owner new_owner);