diff options
Diffstat (limited to 'src/client/cl_scrn.c')
-rw-r--r-- | src/client/cl_scrn.c | 77 |
1 files changed, 63 insertions, 14 deletions
diff --git a/src/client/cl_scrn.c b/src/client/cl_scrn.c index f0a64bb4..cf89fb9d 100644 --- a/src/client/cl_scrn.c +++ b/src/client/cl_scrn.c @@ -322,6 +322,46 @@ int SCR_GetBigStringWidth( const char *str ) { //=============================================================================== /* +================= +SCR_DrawVoipMeter +================= +*/ +void SCR_DrawVoipMeter( void ) { + char buffer[16]; + char string[256]; + int limit, i; + + if (!cl_voipShowMeter->integer) + return; // player doesn't want to show meter at all. + else if (!cl_voipSend->integer) + return; // not recording at the moment. + else if (cls.state != CA_ACTIVE) + return; // not connected to a server. + else if (!cl_connectedToVoipServer) + return; // server doesn't support VoIP. + else if (clc.demoplaying) + return; // playing back a demo. + else if (!cl_voip->integer) + return; // client has VoIP support disabled. + + limit = (int) (clc.voipPower * 10.0f); + if (limit > 10) + limit = 10; + + for (i = 0; i < limit; i++) + buffer[i] = '*'; + while (i < 10) + buffer[i++] = ' '; + buffer[i] = '\0'; + + sprintf( string, "VoIP: [%s]", buffer ); + SCR_DrawStringExt( 320 - strlen( string ) * 4, 10, 8, string, g_color_table[7], qtrue, qfalse ); +} + + + + +/* =============================================================================== DEBUG GRAPH @@ -452,10 +492,14 @@ void SCR_DrawScreenField( stereoFrame_t stereoFrame ) { case CA_LOADING: case CA_PRIMED: // draw the game information screen and loading progress - CL_CGameRendering( stereoFrame ); + CL_CGameRendering(stereoFrame); break; case CA_ACTIVE: - CL_CGameRendering( stereoFrame ); + // always supply STEREO_CENTER as vieworg offset is now done by the engine. + CL_CGameRendering(stereoFrame); +#ifdef USE_VOIP + SCR_DrawVoipMeter(); +#endif break; } } @@ -494,20 +538,25 @@ void SCR_UpdateScreen( void ) { } recursive = 1; - // if running in stereo, we need to draw the frame twice - if ( cls.glconfig.stereoEnabled ) { - SCR_DrawScreenField( STEREO_LEFT ); - SCR_DrawScreenField( STEREO_RIGHT ); - } else { - SCR_DrawScreenField( STEREO_CENTER ); - } + // If there is no VM, there are also no rendering commands issued. Stop the renderer in + // that case. + if( uivm || com_dedicated->integer ) + { + // if running in stereo, we need to draw the frame twice + if ( cls.glconfig.stereoEnabled || Cvar_VariableIntegerValue("r_anaglyphMode")) { + SCR_DrawScreenField( STEREO_LEFT ); + SCR_DrawScreenField( STEREO_RIGHT ); + } else { + SCR_DrawScreenField( STEREO_CENTER ); + } - if ( com_speeds->integer ) { - re.EndFrame( &time_frontend, &time_backend ); - } else { - re.EndFrame( NULL, NULL ); + if ( com_speeds->integer ) { + re.EndFrame( &time_frontend, &time_backend ); + } else { + re.EndFrame( NULL, NULL ); + } } - + recursive = 0; } |