[Bf-committers] [RFC] Re: Blender profiling-1 O16.2int

Kester Maddock bf-committers@blender.org
Tue, 26 Aug 2003 15:34:47 +1200


On Tue, 26 Aug 2003 2:46, John K. Walton wrote:
> yes i've mentioned this in the past. holding the middle mouse or right
> mouse button _without_doing_anything_ eats up cpu time. it is clearly
> a waste of cpu time. nobody responded.

In source/blender/src/view.c void viewmove(void)
we have
while (TRUE)
{
	getmouseco_sc(mval);
	/* do stuff w/ mouse coordinates */
}

and getmouseco_sc (& related) poll the mouse when they could be waiting for 
mouse events.

The solution is to duplicate 
void getmouse(short *mval)
{
	winlay_process_events(0);
	window_get_mouse(mainwin, mval);
}

as

void getmouse_wait(short *mval)
{
	winlay_process_events(1);
	window_get_mouse(mainwin, mval);
}

and change all the loops that can use this behaviour to use it.

Kester