File diff r23123:aa31147b532e → r23124:8fa6d269005b
src/window.cpp
Show inline comments
 
@@ -3066,31 +3066,50 @@ void InputLoop()
 
		/* The input loop is called only once per GameLoop() - so we can clear the counter here */
 
		_input_events_this_tick = 0;
 
		/* there were some inputs this tick, don't scroll ??? */
 
		return;
 
	}
 

	
 
	/* HandleMouseEvents was already called for this tick */
 
	HandleMouseEvents();
 
	HandleAutoscroll();
 
}
 

	
 
/**
 
 * Dispatch OnRealtimeTick event over all windows
 
 */
 
void CallWindowRealtimeTickEvent(uint delta_ms)
 
{
 
	Window *w;
 
	FOR_ALL_WINDOWS_FROM_FRONT(w) {
 
		w->OnRealtimeTick(delta_ms);
 
	}
 
}
 

	
 
/**
 
 * Update the continuously changing contents of the windows, such as the viewports
 
 */
 
void UpdateWindows()
 
{
 
	static uint32 last_realtime_tick = _realtime_tick;
 
	uint delta_ms = _realtime_tick - last_realtime_tick;
 
	last_realtime_tick = _realtime_tick;
 

	
 
	if (delta_ms == 0) return;
 

	
 
	PerformanceMeasurer framerate(PFE_DRAWING);
 
	PerformanceAccumulator::Reset(PFE_DRAWWORLD);
 

	
 
	CallWindowRealtimeTickEvent(delta_ms);
 

	
 
	Window *w;
 

	
 
	static int highlight_timer = 1;
 
	if (--highlight_timer == 0) {
 
		highlight_timer = 15;
 
		_window_highlight_colour = !_window_highlight_colour;
 
	}
 

	
 
	FOR_ALL_WINDOWS_FROM_FRONT(w) {
 
		w->ProcessScheduledInvalidations();
 
		w->ProcessHighlightedInvalidations();
 
	}
 
@@ -3254,31 +3273,31 @@ void InvalidateWindowData(WindowClass cl
 
void InvalidateWindowClassesData(WindowClass cls, int data, bool gui_scope)
 
{
 
	Window *w;
 

	
 
	FOR_ALL_WINDOWS_FROM_BACK(w) {
 
		if (w->window_class == cls) {
 
			w->InvalidateData(data, gui_scope);
 
		}
 
	}
 
}
 

	
 
/**
 
 * Dispatch WE_TICK event over all windows
 
 * Dispatch OnTick event over all windows
 
 */
 
void CallWindowTickEvent()
 
void CallWindowGameTickEvent()
 
{
 
	Window *w;
 
	FOR_ALL_WINDOWS_FROM_FRONT(w) {
 
		w->OnTick();
 
		w->OnGameTick();
 
	}
 
}
 

	
 
/**
 
 * Try to delete a non-vital window.
 
 * Non-vital windows are windows other than the game selection, main toolbar,
 
 * status bar, toolbar menu, and tooltip windows. Stickied windows are also
 
 * considered vital.
 
 */
 
void DeleteNonVitalWindows()
 
{
 
	Window *w;