[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4787: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4789: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4790: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4791: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
InsideQC Forums • View topic - WinQuake: SCR_UpdateScreen Walkthrough

WinQuake: SCR_UpdateScreen Walkthrough

Discuss programming topics for the various GPL'd game engine sources.

Moderator: InsideQC Admins

WinQuake: SCR_UpdateScreen Walkthrough

Postby Baker » Tue Jul 13, 2010 3:56 am

SCR_UpdateScreen - screen.c [r_screen.c]

1. Check to see if viewsize changed
2. Check to see if FOV changed
3. Check to see if lcd_x changed
4. If (any of those changed) SCR_CalcRefdef () ;
/////
4a. Set full screen update
4b. Sbar_Changed () ;
4c. Determine if we draw sbar based on intermission, viewsize
4d. R_SetVrect (vrect_t *pvrectin, vrect_t *pvrect, int lineadj)
4e. R_ViewChanged (&vrect, sb_lines, vid.aspect) ;
////////
5. D_EnableBackBufferAccess () ; (All this does is VID_LockBuffer () ; )
6. Draw_TileClear if necessary.
7. SCR_SetUpToDrawConsole () ;
8. SCR_EraseCenterString () ;
9. D_DisableBackBufferAccess () ; (All this does is VID_UnlockBuffer () ; )
10. VID_LockBuffer () ;
11. V_RenderView () ;
12. VID_UnlockBuffer () ;
13. D_EnableBackBufferAccess () ; (All this does is VID_LockBuffer () ; )

14. Draw 2D stuff: crosshair, sbar, center string, console, menu, intermission, etc.

15. D_DisableBackBufferAccess () ; (All this does is VID_UnlockBuffer () ; )

16. V_UpdatePalette () ; // Update the palette View blends applied to palette here
16a. V_CalcPowerupCshift () ;


Looking at V_RenderView

V_RenderView is the point where drawing the world is entered.

If the console is forced up, we exit. It is a bit annoying how there are 10 different ways to detect a "disconnect" state and Quake appears to use different methods in different places in the code. Why not just if (cls.state != ca_connected). Oh well ...

Anyhow ...

1. if (cl.intermission) V_CalcIntermissionRefdef () ; // Do camera sway from intermission point
2. if (!cl.paused) V_CalcRefdef () ; // If not paused

/// V_CalcRefdef - modifications to view x,y,z pitch, yaw, roll
2a. Calc pitches, rolls (you know ... strafing stuff and so on ...)
2b. Calc gun angle
2c. Calc bobs
2d. Weapon position with or without the gun position hacking
2e. Gun Kick
2f. Stair steps smoothing
/// End V_CalcRefdef

3. R_PushDlights

4. R_RenderView () ; --> R_RenderView_

/// R_RenderView_

R_SetupFrame () ;
-- R_CheckVariables () ; "if (r_fullbright.value != oldbright) D_FlushCaches () ;"
-- R_AnimateLight () ;
-- if (r_waterwarp) do water warp stuff;
-- R_TransformFrustum () ;
-- R_SetSkyFrame () ;
-- R_SetUpFrustumIndexes () ;
-- D_SetupFrame () ;
R_MarkLeaves () ;
Sys_LowFPPrecision () ; // ASM - floating point precision to low
VID_UnlockBuffer () ;
S_ExtraUpdate () ;
VID_LockBuffer () ;
R_EdgeDrawing () ;
--- R_BeginEdgeFrame () ;
--- R_RenderWorld () ;
--- if (r_drawculledpolys) R_ScanEdges () ;
--- R_DrawBEntitiesOnList () ; // map brush models
--- VID_UnlockBuffer () ;
--- S_ExtraUpdate () ;
--- VID_LockBuffer () ;
VID_UnlockBuffer () ;
S_ExtraUpdate () ;
VID_LockBuffer () ;
R_DrawEntitiesOnList () ;
--- do each entity
--- case mod_sprite: R_DrawSprite () ;
--- case mod_alias: R_AliasDrawModel (&lighting) ;
R_DrawViewModel () ;
R_DrawParticles () ;
if (r_dowarp) D_WarpScreen () ;
V_SetContentsColor (r_viewleaf->contents) ; Calculates the view blends, doesn't apply them here
if (r_timegraph.value) R_TimeGraph () ;
if (r_aliasstats.value) R_PrintAliasStats () ;
if (r_speeds.value) R_PrintTimes () ;
Sys_HighFPPrecision () ; // ASM - floating point precision to high

Now ....

Start WinQuake, goto start map and type "impulse -1". Then type disconnect. You keep the blue quad blend.

Why? The part that calculates the view blend is only done if the world is being rendered. But it is applied even when the world isn't being rendered. Annoying ...
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby Baker » Tue Jul 13, 2010 9:00 am

The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am


Return to Engine Programming

Who is online

Users browsing this forum: No registered users and 2 guests