static void CG_ConfigStringModified( void ) { const char *str; int num; num = atoi( CG_Argv( 1 ) ); // get the gamestate from the client system, which will have the // new configstring already integrated cgi_GetGameState( &cgs.gameState ); // look up the individual string that was modified str = CG_ConfigString( num ); // do something with it if necessary if ( num == CS_ITEMS ) { int i; for ( i = 1 ; i < bg_numItems ; i++ ) { if ( str[ i ] == '1' ) { if (bg_itemlist[i].classname) { CG_RegisterItemSounds( i ); CG_RegisterItemVisuals( i ); } } } } else if ( num == CS_MUSIC ) { CG_StartMusic( qtrue ); } else if ( num == CS_SERVERINFO ) { CG_ParseServerinfo(); } else if ( num >= CS_MODELS && num < CS_MODELS+MAX_MODELS ) { cgs.model_draw[ num-CS_MODELS ] = cgi_R_RegisterModel( str ); // OutputDebugString(va("### CG_ConfigStringModified(): cgs.model_draw[%d] = \"%s\"\n",num-CS_MODELS,str)); // GHOUL2 Insert start } else if ( num >= CS_CHARSKINS && num < CS_CHARSKINS+MAX_CHARSKINS ) { cgs.skins[ num-CS_CHARSKINS ] = cgi_R_RegisterSkin( str ); // Ghoul2 Insert end } else if ( num >= CS_SOUNDS && num < CS_SOUNDS+MAX_SOUNDS ) { if ( str[0] != '*' ) { cgs.sound_precache[ num-CS_SOUNDS] = cgi_S_RegisterSound( str ); } } else if ( num >= CS_EFFECTS && num < CS_EFFECTS + MAX_FX ) { theFxScheduler.RegisterEffect( str ); } else if ( num >= CS_PLAYERS && num < CS_PLAYERS+MAX_CLIENTS ) { CG_NewClientinfo( num - CS_PLAYERS ); CG_RegisterClientModels( num - CS_PLAYERS ); } else if ( num >= CS_LIGHT_STYLES && num < CS_LIGHT_STYLES + (MAX_LIGHT_STYLES*3)) { CG_SetLightstyle(num - CS_LIGHT_STYLES); } else if ( num >= CS_WORLD_FX && num < CS_WORLD_FX + MAX_WORLD_FX ) { cgi_R_WorldEffectCommand( str ); } }
static void CG_ConfigStringModified( void ) { const char *str; int num; num = atoi( CG_Argv( 1 ) ); // get the gamestate from the client system, which will have the // new configstring already integrated cgi_GetGameState( &cgs.gameState ); // look up the individual string that was modified str = CG_ConfigString( num ); // do something with it if necessary if ( num == CS_MUSIC ) { CG_StartMusic(); } else if ( num == CS_SERVERINFO ) { CG_ParseServerinfo(); } else if ( num >= CS_MODELS && num < CS_MODELS+MAX_MODELS ) { cgs.model_draw[ num-CS_MODELS ] = cgi_R_RegisterModel( str ); } else if ( num >= CS_SOUNDS && num < CS_SOUNDS+MAX_MODELS ) { if ( str[0] != '*' ) { cgs.sound_precache[ num-CS_SOUNDS] = cgi_S_RegisterSound( str ); } } else if ( num >= CS_PLAYERS && num < CS_PLAYERS+MAX_CLIENTS ) { CG_NewClientinfo( num - CS_PLAYERS ); CG_RegisterClientModels( num - CS_PLAYERS ); } }
/* ================= CG_TestModel_f Creates an entity in front of the current position, which can then be moved around ================= */ void CG_TestModel_f (void) { vec3_t angles; memset( &cg.testModelEntity, 0, sizeof(cg.testModelEntity) ); if ( cgi_Argc() < 2 ) { return; } Q_strncpyz (cg.testModelName, CG_Argv( 1 ), MAX_QPATH ); cg.testModelEntity.hModel = cgi_R_RegisterModel( cg.testModelName ); if ( cgi_Argc() == 3 ) { cg.testModelEntity.backlerp = atof( CG_Argv( 2 ) ); cg.testModelEntity.frame = 1; cg.testModelEntity.oldframe = 0; } if (! cg.testModelEntity.hModel ) { CG_Printf( "Can't register model\n" ); return; } VectorMA( cg.refdef.vieworg, 100, cg.refdef.viewaxis[0], cg.testModelEntity.origin ); angles[PITCH] = 0; angles[YAW] = 180 + cg.refdefViewAngles[1]; angles[ROLL] = 0; AnglesToAxis( angles, cg.testModelEntity.axis ); cg.testGun = qfalse; }
//--------------------------------------------- void FX_DEMP2_AltDetonate( vec3_t org, float size ) { localEntity_t *ex; ex = CG_AllocLocalEntity(); ex->leType = LE_FADE_SCALE_MODEL; memset( &ex->refEntity, 0, sizeof( refEntity_t )); ex->refEntity.renderfx |= RF_VOLUMETRIC; ex->startTime = cg.time; ex->endTime = ex->startTime + 1300; ex->radius = size; ex->refEntity.customShader = cgi_R_RegisterShader( "gfx/effects/demp2shell" ); ex->refEntity.hModel = cgi_R_RegisterModel( "models/items/sphere.md3" ); VectorCopy( org, ex->refEntity.origin ); ex->color[0] = ex->color[1] = ex->color[2] = 255.0f; }
//------------------------------------------------------ int SFxHelper::RegisterModel( const char *model ) { return cgi_R_RegisterModel( model ); }
//------------------------------------------------------ int SFxHelper::RegisterModel( const gsl::cstring_view& model ) { return cgi_R_RegisterModel( std::string( model.begin(), model.end() ).c_str() ); }