///////////////////////////////////////////// // Track our list of merged clients // void CG_mvProcessClientList( void ) { int i, bit, newList = cg.snap->ps.powerups[PW_MVCLIENTLIST]; cg.mvTotalClients = 0; for ( i = 0; i < MAX_MVCLIENTS; i++ ) { bit = 1 << i; if ( ( cg.mvClientList & bit ) != ( newList & bit ) ) { if ( ( newList & bit ) == 0 ) { CG_mvFree( i ); } // If no active views at all, start up with the first one else if ( cg.mvCurrentMainview == NULL ) { CG_mvCreate( i ); } } if ( newList & bit ) { cg.mvTotalClients++; } } cg.mvClientList = newList; CG_mvOverlayUpdate(); }
// Activate a window view for a particular MV client void CG_mvShowView_f( void ) { int i; for ( i = 0; i < cg.mvTotalClients; i++ ) { if ( cg.mvOverlay[i].fActive ) { if ( cg.mvOverlay[i].w == NULL ) { CG_mvCreate( cg.mvOverlay[i].pID ); CG_mvOverlayUpdate(); } return; } } }
// Toggle a view window on/off void CG_mvToggleView_f(void) { int i; for(i=0; i<cg.mvTotalClients; i++) { if(cg.mvOverlay[i].fActive) { if(cg.mvOverlay[i].w != NULL) CG_mvHideView_f(); else { CG_mvCreate(cg.mvOverlay[i].pID); CG_mvOverlayUpdate(); } return; } } }