engine/EngineVideoScreen.c
/*	Displays a text string in the center of the screen and waits for a Y or N
	keypress.
*/
Displays a text string in the center of the screen and waits for a Y or N
keypress.
Displays a text string in the center of the screen and waits for a Y or N keypress .
int SCR_ModalMessage (char *text, float timeout) 
{
	double time1, time2; 
	if (cls.state == ca_dedicated)
		return true;
	scr_notifystring = text;
	bDrawDialog = true;
	Video_Frame();
	bDrawDialog = false;
	S_ClearBuffer ();		
	time1 = System_DoubleTime () + timeout; 
	time2 = 0.0f; 
	do
	{
		key_count = -1;		
		Input_Frame();
		if (timeout)
			time2 = System_DoubleTime (); 
	} while(	key_lastpress != 'y'		&&
				key_lastpress != 'n'		&&
				key_lastpress != K_ESCAPE	&&
				time2 <= time1);
	if (time2 > time1)
		return false;
	return key_lastpress == 'y';
}
int SCR_ModalMessage ( char * text , float timeout ) { double time1 , time2 ; if ( cls . state == ca_dedicated ) return true ; scr_notifystring = text ; bDrawDialog = true ; Video_Frame ( ) ; bDrawDialog = false ; S_ClearBuffer ( ) ; time1 = System_DoubleTime ( ) + timeout ; time2 = 0.0f ; do { key_count = -1 ; Input_Frame ( ) ; if ( timeout ) time2 = System_DoubleTime ( ) ; } while ( key_lastpress != ' ' && key_lastpress != ' ' && key_lastpress != K_ESCAPE && time2 <= time1 ) ; if ( time2 > time1 ) return false ; return key_lastpress == ' ' ; }
Displays a text string in the center of the screen and waits for a Y or N
keypress.
Displays a text string in the center of the screen and waits for a Y or N keypress .
//johnfitz -- timeout //johnfitz -- timeout // draw a fresh screen // so dma doesn't loop current sound //johnfitz -- timeout //johnfitz -- timeout // wait for a key down and up //johnfitz -- zero timeout means wait forever. //	SCR_UpdateScreen (); //johnfitz -- commented out //johnfitz -- timeout //johnfitz