/* ================== 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) { static float oldscr_viewsize; vrect_t vrect; if (scr_skipupdate || block_drawing) return; if (scr_disabled_for_loading) return; #ifdef _WIN32 { // don't suck up any cpu if minimized extern int Minimized; if (Minimized) return; } #endif scr_copytop = 0; scr_copyeverything = 0; if (!scr_initialized || !con_initialized) return; // not initialized yet if (scr_viewsize.value != oldscr_viewsize) { oldscr_viewsize = scr_viewsize.value; vid.recalc_refdef = 1; } // // check for vid changes // if (oldfov != scr_fov.value) { oldfov = scr_fov.value; vid.recalc_refdef = true; } if (oldscreensize != scr_viewsize.value) { oldscreensize = scr_viewsize.value; vid.recalc_refdef = true; } if (oldsbar != cl_sbar.value) { oldsbar = cl_sbar.value; vid.recalc_refdef = true; } if (vid.recalc_refdef) { // something changed, so reorder the screen SCR_CalcRefdef (); } // // do 3D refresh drawing, and then update the screen // D_EnableBackBufferAccess (); // of all overlay stuff if drawing directly if (scr_fullupdate++ < vid.numpages) { // clear the entire screen scr_copyeverything = 1; Draw_TileClear (0,0,vid.width,vid.height); Sbar_Changed (); } pconupdate = NULL; SCR_SetUpToDrawConsole (); SCR_EraseCenterString (); D_DisableBackBufferAccess (); // for adapters that can't stay mapped in // for linear writes all the time VID_LockBuffer (); V_RenderView (); VID_UnlockBuffer (); D_EnableBackBufferAccess (); // of all overlay stuff if drawing directly if (scr_drawdialog) { Sbar_Draw (); Draw_FadeScreen (); SCR_DrawNotifyString (); scr_copyeverything = true; } else if (cl.intermission == 1 && key_dest == key_game) { Sbar_IntermissionOverlay (); } else if (cl.intermission == 2 && key_dest == key_game) { Sbar_FinaleOverlay (); SCR_CheckDrawCenterString (); } else { SCR_DrawRam (); SCR_DrawNet (); SCR_DrawTurtle (); SCR_DrawPause (); SCR_DrawFPS (); SCR_CheckDrawCenterString (); Sbar_Draw (); SCR_DrawConsole (); M_Draw (); } D_DisableBackBufferAccess (); // for adapters that can't stay mapped in // for linear writes all the time if (pconupdate) { D_UpdateRects (pconupdate); } V_UpdatePalette (); // // update one of three areas // if (scr_copyeverything) { vrect.x = 0; vrect.y = 0; vrect.width = vid.width; vrect.height = vid.height; vrect.pnext = 0; VID_Update (&vrect); } else if (scr_copytop) { vrect.x = 0; vrect.y = 0; vrect.width = vid.width; vrect.height = vid.height - sb_lines; vrect.pnext = 0; VID_Update (&vrect); } else { vrect.x = scr_vrect.x; vrect.y = scr_vrect.y; vrect.width = scr_vrect.width; vrect.height = scr_vrect.height; vrect.pnext = 0; VID_Update (&vrect); } }
/* ================== 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) { static float oldscr_viewsize; static float oldlcd_x; vrect_t vrect; if (scr_skipupdate || block_drawing) return; scr_copytop = 0; scr_copyeverything = 0; if (scr_disabled_for_loading) { if (realtime - scr_disabled_time > 60) { scr_disabled_for_loading = false; Con_Printf ("load failed.\n"); } else return; } if (cls.state == ca_dedicated) return; // stdout only if (!scr_initialized || !con_initialized) return; // not initialized yet if (scr_viewsize.value != oldscr_viewsize) { oldscr_viewsize = scr_viewsize.value; vid.recalc_refdef = 1; } // // check for vid changes // if (oldfov != scr_fov.value) { oldfov = scr_fov.value; vid.recalc_refdef = true; } if (oldlcd_x != lcd_x.value) { oldlcd_x = lcd_x.value; vid.recalc_refdef = true; } if (oldscreensize != scr_viewsize.value) { oldscreensize = scr_viewsize.value; vid.recalc_refdef = true; } if (vid.recalc_refdef) { // something changed, so reorder the screen SCR_CalcRefdef (); } // // do 3D refresh drawing, and then update the screen if (scr_fullupdate++ < vid.numpages) { // clear the entire screen scr_copyeverything = 1; Draw_TileClear (0,0,vid.width,vid.height); Sbar_Changed (); } SCR_SetUpToDrawConsole (); SCR_EraseCenterString (); V_RenderView (); SCR_DrawScreen(); if(separation_distance){ VID_SetBuffer(1); SCR_DrawScreen(); VID_SetBuffer(0); } V_UpdatePalette (); // // update one of three areas // if (scr_copyeverything) { vrect.x = 0; vrect.y = 0; vrect.width = vid.width; vrect.height = vid.height; vrect.pnext = 0; VID_Update (&vrect); } else if (scr_copytop) { vrect.x = 0; vrect.y = 0; vrect.width = vid.width; vrect.height = vid.height - sb_lines; vrect.pnext = 0; VID_Update (&vrect); } else { vrect.x = scr_vrect.x; vrect.y = scr_vrect.y; vrect.width = scr_vrect.width; vrect.height = scr_vrect.height; vrect.pnext = 0; VID_Update (&vrect); } }
/* ================== 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) { static float oldscr_viewsize; vrect_t vrect; if (scr_skipupdate || block_drawing) return; scr_copytop = 0; scr_copyeverything = 0; if (scr_disabled_for_loading) { /* * FIXME - this really needs to be fixed properly. * Simply starting a new game and typing "changelevel foo" will hang * the engine for 15s (was 60s!) if foo.bsp does not exist. */ if (realtime - scr_disabled_time > 15) { scr_disabled_for_loading = false; Con_Printf("load failed.\n"); } else return; } if (cls.state == ca_dedicated) return; // stdout only if (!scr_initialized || !con_initialized) return; // not initialized yet if (scr_viewsize.value != oldscr_viewsize) { oldscr_viewsize = scr_viewsize.value; vid.recalc_refdef = 1; } // // check for vid changes // if (oldfov != scr_fov.value) { oldfov = scr_fov.value; vid.recalc_refdef = true; } if (oldscreensize != scr_viewsize.value) { oldscreensize = scr_viewsize.value; vid.recalc_refdef = true; } if (vid.recalc_refdef) { // something changed, so reorder the screen SCR_CalcRefdef(); } // // do 3D refresh drawing, and then update the screen // D_EnableBackBufferAccess(); // of all overlay stuff if drawing directly if (scr_fullupdate++ < vid.numpages) { // clear the entire screen scr_copyeverything = 1; Draw_TileClear(0, 0, vid.width, vid.height); Sbar_Changed(); } pconupdate = NULL; SCR_SetUpToDrawConsole(); SCR_EraseCenterString(); D_DisableBackBufferAccess(); // for adapters that can't stay mapped in // for linear writes all the time VID_LockBuffer(); V_RenderView(); VID_UnlockBuffer(); D_EnableBackBufferAccess(); // of all overlay stuff if drawing directly if (scr_drawdialog) { Sbar_Draw(); Draw_FadeScreen(); SCR_DrawNotifyString(); scr_copyeverything = true; } else if (scr_drawloading) { SCR_DrawLoading(); Sbar_Draw(); } else if (cl.intermission == 1 && key_dest == key_game) { Sbar_IntermissionOverlay(); } else if (cl.intermission == 2 && key_dest == key_game) { Sbar_FinaleOverlay(); SCR_CheckDrawCenterString(); } else if (cl.intermission == 3 && key_dest == key_game) { SCR_CheckDrawCenterString(); } else { SCR_DrawRam(); SCR_DrawNet(); SCR_DrawTurtle(); SCR_DrawPause(); SCR_CheckDrawCenterString(); Sbar_Draw(); SCR_DrawConsole(); M_Draw(); } D_DisableBackBufferAccess(); // for adapters that can't stay mapped in // for linear writes all the time if (pconupdate) { D_UpdateRects(pconupdate); } V_UpdatePalette(); // // update one of three areas // if (scr_copyeverything) { vrect.x = 0; vrect.y = 0; vrect.width = vid.width; vrect.height = vid.height; vrect.pnext = 0; VID_Update(&vrect); } else if (scr_copytop) { vrect.x = 0; vrect.y = 0; vrect.width = vid.width; vrect.height = vid.height - sb_lines; vrect.pnext = 0; VID_Update(&vrect); } else { vrect.x = scr_vrect.x; vrect.y = scr_vrect.y; vrect.width = scr_vrect.width; vrect.height = scr_vrect.height; vrect.pnext = 0; VID_Update(&vrect); } }