예제 #1
0
/*
==================
SCR_UpdateScreen

This is called every frame, and can also be called explicitly to flush
text to the screen.

WARNING: be very careful calling this from elsewhere, because the refresh
needs almost the entire 256k of stack space!
==================
*/
void SCR_UpdateScreen (void)
{
	vid.numpages = (gl_triplebuffer.value) ? 3 : 2;

	if (scr_disabled_for_loading)
	{
		if (realtime - scr_disabled_time > 60)
		{
			scr_disabled_for_loading = false;
			Con_Printf ("load failed.\n");
		}
		else
			return;
	}

	if (!scr_initialized || !con_initialized)
		return;				// not initialized yet


	GL_BeginRendering (&glx, &gly, &glwidth, &glheight);

	//
	// determine size of refresh window
	//
	if (vid.recalc_refdef)
		SCR_CalcRefdef ();

//
// do 3D refresh drawing, and then update the screen
//
	SCR_SetUpToDrawConsole ();

	V_RenderView ();

	GL_Set2D ();

	//FIXME: only call this when needed
	SCR_TileClear ();

	if (scr_drawdialog) //new game confirm
	{
		if (con_forcedup)
			Draw_ConsoleBackground ();
		else
			Sbar_Draw ();
		Draw_FadeScreen ();
		SCR_DrawNotifyString ();
	}
	else if (scr_drawloading) //loading
	{
		SCR_DrawLoading ();
		Sbar_Draw ();
	}
	else if (cl.intermission == 1 && key_dest == key_game) //end of level
	{
		Sbar_IntermissionOverlay ();
	}
	else if (cl.intermission == 2 && key_dest == key_game) //end of episode
	{
		Sbar_FinaleOverlay ();
		SCR_CheckDrawCenterString ();
	}
	else
	{
		SCR_DrawCrosshair (); //johnfitz
		SCR_DrawRam ();
		SCR_DrawNet ();
		SCR_DrawTurtle ();
		SCR_DrawPause ();
		SCR_CheckDrawCenterString ();
		Sbar_Draw ();
		SCR_DrawDevStats (); //johnfitz
		SCR_DrawFPS (); //johnfitz
		SCR_DrawClock (); //johnfitz
		SCR_DrawConsole ();
		M_Draw ();
	}

	V_UpdateBlend (); //johnfitz -- V_UpdatePalette cleaned up and renamed

	GLSLGamma_GammaCorrect ();

	GL_EndRendering ();
}
예제 #2
0
void SCR_UpdateScreenContent (void)
{

//
// do 3D refresh drawing, and then update the screen
//
	V_RenderView ();

	// test draw in 3d
	
	if(vr_enabled.value && !con_forcedup)
	{
		DrawRift2d();
	}
	else
	{
		GL_Set2D ();

		//FIXME: only call this when needed
		SCR_TileClear ();

		if (scr_drawdialog) //new game confirm
		{
			if (con_forcedup)
				Draw_ConsoleBackground ();
			else
				Sbar_Draw ();
			Draw_FadeScreen ();
			SCR_DrawNotifyString ();
		}
		else if (scr_drawloading) //loading
		{
			SCR_DrawLoading ();
			Sbar_Draw ();
		}
		else if (cl.intermission == 1 && key_dest == key_game) //end of level
		{
			Sbar_IntermissionOverlay ();
		}
		else if (cl.intermission == 2 && key_dest == key_game) //end of episode
		{
			Sbar_FinaleOverlay ();
			SCR_CheckDrawCenterString ();
		}
		else
		{
			SCR_DrawCrosshair (); //johnfitz
			SCR_DrawRam ();
			SCR_DrawNet ();
			SCR_DrawTurtle ();
			SCR_DrawPause ();
			SCR_CheckDrawCenterString ();
			Sbar_Draw ();
			SCR_DrawDevStats (); //johnfitz
			SCR_DrawFPS (); //johnfitz
			SCR_DrawClock (); //johnfitz
			SCR_DrawConsole ();
			M_Draw ();
		}
	}

	V_UpdateBlend (); //johnfitz -- V_UpdatePalette cleaned up and renamed
}