Ejemplo n.º 1
0
//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CTeamControlPoint::Precache( void )
{
	for ( int i = 0; i < m_TeamData.Count(); i++ )
	{
		// Skip over spectator
		if ( i == TEAM_SPECTATOR )
			continue;

		if ( m_TeamData[i].iszCapSound != NULL_STRING )
		{
			PrecacheScriptSound( STRING(m_TeamData[i].iszCapSound) );
		}

		if ( m_TeamData[i].iszModel != NULL_STRING )
		{
			PrecacheModel( STRING(m_TeamData[i].iszModel) );
		}

		if ( m_TeamData[i].iszIcon != NULL_STRING )
		{
			PrecacheMaterial( STRING( m_TeamData[i].iszIcon ) );
			m_TeamData[i].iIcon = GetMaterialIndex( STRING( m_TeamData[i].iszIcon ) );
			Assert( m_TeamData[i].iIcon != 0 );
		}

		if ( !m_TeamData[i].iIcon )
		{
			Warning( "Invalid hud icon material for team %d in control point '%s' ( point index %d )\n", i, GetDebugName(), GetPointIndex() );
		}

		if ( m_TeamData[i].iszOverlay != NULL_STRING )
		{
			PrecacheMaterial( STRING( m_TeamData[i].iszOverlay ) );
			m_TeamData[i].iOverlay = GetMaterialIndex( STRING( m_TeamData[i].iszOverlay ) );
			Assert( m_TeamData[i].iOverlay != 0 );

			if ( !m_TeamData[i].iOverlay )
			{
				Warning( "Invalid hud overlay material for team %d in control point '%s' ( point index %d )\n", i, GetDebugName(), GetPointIndex() );
			}
		}
	}

	PrecacheScriptSound( STRING( m_iszCaptureStartSound ) );
	PrecacheScriptSound( STRING( m_iszCaptureEndSound ) );
	PrecacheScriptSound( STRING( m_iszCaptureInProgress ) );
	PrecacheScriptSound( STRING( m_iszCaptureInterrupted ) );

	if ( m_iszWarnSound != NULL_STRING )
	{
		PrecacheScriptSound( STRING( m_iszWarnSound ) );
	}

#if defined (TF_DLL) || defined (TF_CLASSIC)
	PrecacheScriptSound( "Announcer.ControlPointContested" );
	PrecacheScriptSound( "Announcer.ControlPointContested_Neutral" );
#endif
}
Ejemplo n.º 2
0
void C_DHL_Player::Precache( void )
{
	//This function gets called for every player that joins...oh well
	PrecacheMaterial( "dhl_shaders/dhl_nightvision" );
	PrecacheMaterial( "dhl_shaders/dhl_grayscale" );
	PrecacheMaterial( "dhl_shaders/dhl_blur" );

	BaseClass::Precache();
}
Ejemplo n.º 3
0
void CWeapon_Manhack::Precache( void )
{
	BaseClass::Precache();

	UTIL_PrecacheOther( "npc_manhack" );
	UTIL_PrecacheOther( "vehicle_manhack" );

	//if panel:
	PrecacheMaterial( SCREEN_OVERLAY_MATERIAL );
	PrecacheMaterial( "vgui/screens/manhack_back" );
}
void CWeaponDD44::Precache(void)
{
	PrecacheModel("models/weapons/dd44/v_dd44.mdl");
	PrecacheModel("models/weapons/dd44/w_dd44.mdl");

	PrecacheMaterial("sprites/hud/weaponicons/dd44");
	PrecacheMaterial("sprites/hud/ammoicons/ammo_9mm");

	PrecacheScriptSound("Weapon_dd44.Single");
	PrecacheScriptSound("Weapon_dd44.NPC_Single");
	PrecacheScriptSound("Weapon.Special1");
	PrecacheScriptSound("Weapon.Special2");

	BaseClass::Precache();
}
void CWeaponAR33::Precache(void)
{
	PrecacheModel("models/weapons/ar33/v_ar33.mdl");
	PrecacheModel("models/weapons/ar33/w_ar33.mdl");

	PrecacheMaterial("sprites/hud/weaponicons/ar33");
	PrecacheMaterial("sprites/hud/ammoicons/ammo_rifle");

	PrecacheScriptSound("Weapon.Rifle_Reload");
	PrecacheScriptSound("Weapon_ar33.Single");
	PrecacheScriptSound("Weapon_ar33.NPC_Single");
	PrecacheScriptSound("Weapon_ar33.Burst");

	BaseClass::Precache();
}
Ejemplo n.º 6
0
void CWeaponPP7 :: Precache(void)
{
	PrecacheModel("models/weapons/pp7/v_pp7.mdl");
	PrecacheModel("models/weapons/pp7/w_pp7.mdl");

	PrecacheMaterial("sprites/hud/weaponicons/pp7");
	PrecacheMaterial("sprites/hud/ammoicons/ammo_9mm");

	PrecacheScriptSound("Weapon_pp7.Single");
	PrecacheScriptSound("Weapon_pp7.AltSingle");
	PrecacheScriptSound("Weapon.Silenced");
	PrecacheScriptSound("Weapon_pp7.NPC_Single");

	BaseClass::Precache();
}
void CWeaponGG::Precache(void)
{
	PrecacheModel("models/weapons/goldengun/v_goldengun.mdl");
	PrecacheModel("models/weapons/goldengun/w_goldengun.mdl");

	PrecacheMaterial("sprites/hud/weaponicons/gg");
	PrecacheMaterial("sprites/hud/ammoicons/ammo_goldengun");

	PrecacheScriptSound("Weapon_gg.Reload");
	PrecacheScriptSound("Weapon_gg.Single");
	PrecacheScriptSound("Weapon_gg.NPC_Single");
	PrecacheScriptSound("Weapon.Special1");
	PrecacheScriptSound("Weapon.Special2");

	BaseClass::Precache();
}
Ejemplo n.º 8
0
void CEnvParticleScript::PrecacheAnimationEventMaterials()
{
	CStudioHdr *hdr = GetModelPtr();
	if ( hdr )
	{
		int numseq = hdr->GetNumSeq();
		for ( int i = 0; i < numseq; ++i )
		{
			mstudioseqdesc_t& seqdesc = hdr->pSeqdesc( i );
			int ecount = seqdesc.numevents;
			for ( int j = 0 ; j < ecount; ++j )
			{
				const mstudioevent_t* event = (const mstudioevent_for_client_server_t*)seqdesc.pEvent( j );
				if ( event->Event() == CL_EVENT_SPRITEGROUP_CREATE )
				{
					char pAttachmentName[256];
					char pSpriteName[256];
					int nArgs = sscanf( event->pszOptions(), "%255s %255s", pAttachmentName, pSpriteName );
					if ( nArgs == 2 )
					{
						PrecacheMaterial( pSpriteName );
					}
				}
			}
		}
	}
}
Ejemplo n.º 9
0
void CRopeKeyframe::Precache()
{
	m_iRopeMaterialModelIndex = PrecacheModel( STRING( m_strRopeMaterialModel ) );
	PrecacheMaterial( "cable/rope_shadowdepth" );

	BaseClass::Precache();
}
Ejemplo n.º 10
0
void CWeaponShotgun::Precache(void)
{
	PrecacheModel("models/Weapons/shotgun/v_shotgun.mdl");
	PrecacheModel("models/weapons/shotgun/w_shotgun.mdl");

	PrecacheMaterial("sprites/hud/weaponicons/shotgun");
	PrecacheMaterial("sprites/hud/ammoicons/ammo_buckshot");

	PrecacheScriptSound("Weapon.Shotgun_Reload");
	PrecacheScriptSound("Weapon_pshotgun.Single");
	PrecacheScriptSound("Weapon_pshotgun.NPC_Single");
	PrecacheScriptSound("Weapon.Special1");
	PrecacheScriptSound("Weapon.Special2");

	BaseClass::Precache();
}
void CGEWeaponRocketLauncher::Precache( void )
{
	PrecacheModel("models/weapons/rocket_launcher/v_rocket_launcher.mdl");
	PrecacheModel("models/weapons/rocket_launcher/w_rocket_launcher.mdl");

	PrecacheModel("models/weapons/rocket_launcher/w_rocket.mdl");
	PrecacheMaterial("models/weapons/w_models/w_gl/grenadeprojectile");

	PrecacheMaterial("sprites/hud/weaponicons/rocket_launcher");
	PrecacheMaterial("sprites/hud/ammoicons/ammo_rocket");

	PrecacheScriptSound("Weapon_RocketLauncher.Single");
	PrecacheScriptSound("Weapon_RocketLauncher.Ignite");

	BaseClass::Precache();
}
void CWeaponSniper::Precache(void)
{
	PrecacheModel("models/weapons/sniperrifle/v_sniperrifle.mdl");
	PrecacheModel("models/weapons/sniperrifle/w_sniperrifle.mdl");

	PrecacheMaterial("sprites/hud/weaponicons/sniper_rifle");
	PrecacheMaterial("sprites/hud/ammoicons/ammo_rifle");

	PrecacheScriptSound("Weapon.Rifle_Reload");
	PrecacheScriptSound("Weapon_sniper.Single");
	PrecacheScriptSound("Weapon_sniper.NPC_Single");
	PrecacheScriptSound("Weapon.Special1");
	PrecacheScriptSound("Weapon.Special2");

	BaseClass::Precache();
}
void C_GrenadeHopwire::Precache(void)
{
	PrecacheScriptSound("Weapon_AR3.BlackHole");
	//PrecacheScriptSound( "Weapon_AR3.Geiger" );
	PrecacheMaterial("effects/strider_pinch_dudv");

	BaseClass::Precache();
}
//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CObjectBaseMannedGun::Precache()
{
	BaseClass::Precache();
#if !defined( CLIENT_DLL )
	PrecacheVGuiScreen( "screen_obj_manned_plasmagun" );
	PrecacheMaterial( "sprites/laserbeam" );
#endif
}
Ejemplo n.º 15
0
//-----------------------------------------------------------------------------
// Precache...
//-----------------------------------------------------------------------------
void CVGuiScreen::Precache()
{
	BaseClass::Precache();
	if ( m_strOverlayMaterial != NULL_STRING )
	{
		PrecacheMaterial( STRING(m_strOverlayMaterial) );
	}
}
//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CEnvScreenOverlay::Precache( void )
{
	for ( int i = 0; i < 10; i++ )
	{
		if ( m_iszOverlayNames[i] == NULL_STRING )
			continue;

		PrecacheMaterial( STRING( m_iszOverlayNames[i] ) );
	}
}
Ejemplo n.º 17
0
void CFireTrail::Precache( void )
{
	PrecacheMaterial( "sprites/flamelet1" );
	PrecacheMaterial( "sprites/flamelet2" );
	PrecacheMaterial( "sprites/flamelet3" );
	PrecacheMaterial( "sprites/flamelet4" );
	PrecacheMaterial( "sprites/flamelet5" );
	PrecacheMaterial( "particle/particle_smokegrenade" );
	PrecacheMaterial( "particle/particle_noisesphere" );
}
void CGEWeaponGrenade::Precache( void )
{
	PrecacheModel("models/weapons/grenade/v_grenade.mdl");
	PrecacheModel("models/weapons/grenade/w_grenade.mdl");

	PrecacheMaterial("sprites/hud/ammoicons/ammo_grenade");

	PrecacheScriptSound("Weapon_mines.Throw");

	BaseClass::Precache();
	m_iCrateModelIndex = PrecacheModel( BABYCRATE_MODEL );
	m_iWorldModelIndex = PrecacheModel( BaseClass::GetWorldModel() );
}
Ejemplo n.º 19
0
//------------------------------------------------------------------------------
// Purpose :
// Input   :
// Output  :
//------------------------------------------------------------------------------
void CBreakableSurface::Spawn(void)
{
	BaseClass::Spawn();
	SetCollisionGroup( COLLISION_GROUP_BREAKABLE_GLASS ); 
	m_bIsBroken = false;

	if (m_nQuadError == QUAD_ERR_MULT_FACES)
	{
		Warning("Rejecting func_breakablesurf.  Has multiple faces that aren't NODRAW.\n");
		UTIL_Remove(this);
	}
	else if (m_nQuadError == QUAD_ERR_NOT_QUAD)
	{
		Warning("Rejecting func_breakablesurf.  Drawn face isn't a quad.\n");
		UTIL_Remove(this);
	}

	int materialCount = modelinfo->GetModelMaterialCount( const_cast<model_t*>(GetModel()) );
	if( materialCount != 1 )
	{
		Warning( "Encountered func_breakablesurf that has a material applied to more than one surface!\n" );
		UTIL_Remove(this);
	}

	// Get at the first material; even if there are more than one.
	IMaterial* pMaterial;
	modelinfo->GetModelMaterials( const_cast<model_t*>(GetModel()), 1, &pMaterial );

	// The material should point to a cracked version of itself
	bool foundVar;
	IMaterialVar* pCrackName = pMaterial->FindVar( "$crackmaterial", &foundVar, false );
	if (foundVar)
	{
		PrecacheMaterial( pCrackName->GetStringValue() );
	}

	// Init the Panel bit vector to all true. ( no panes are broken )
	int bitVecLength = MAX_NUM_PANELS * MAX_NUM_PANELS;
	
	for( int i=0;i<bitVecLength;i++ )
	{
		m_RawPanelBitVec.Set( i, true );
	}
}
Ejemplo n.º 20
0
//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
C_TFObjectiveResource::C_TFObjectiveResource()
{
	PrecacheMaterial( "sprites/obj_icons/icon_obj_cap_blu" );
	PrecacheMaterial( "sprites/obj_icons/icon_obj_cap_red" );
}
Ejemplo n.º 21
0
void CWorld::Precache( void )
{
	COM_TimestampedLog( "CWorld::Precache - Start" );

	g_WorldEntity = this;
	g_fGameOver = false;
	g_pLastSpawn = NULL;
	g_Language.SetValue( LANGUAGE_ENGLISH );	// TODO use VGUI to get current language

#ifndef INFESTED_DLL
	ConVarRef stepsize( "sv_stepsize" );
	stepsize.SetValue( 24 );
#endif

	ConVarRef roomtype( "room_type" );
	roomtype.SetValue( 0 );

	// Set up game rules
	Assert( !g_pGameRules );
	if (g_pGameRules)
	{
		delete g_pGameRules;
	}

	InstallGameRules();
	Assert( g_pGameRules );
	g_pGameRules->Init();

	CSoundEnt::InitSoundEnt();

	// UNDONE: Make most of these things server systems or precache_registers
	// =================================================
	//	Activities
	// =================================================
	ActivityList_Free();
	RegisterSharedActivities();

	EventList_Free();
	RegisterSharedEvents();

	// Only allow precaching between LevelInitPreEntity and PostEntity
	CBaseEntity::SetAllowPrecache( true );

	COM_TimestampedLog( "IGameSystem::LevelInitPreEntityAllSystems" );
	IGameSystem::LevelInitPreEntityAllSystems( STRING( GetModelName() ) );

	COM_TimestampedLog( "g_pGameRules->CreateStandardEntities()" );
	// Create the player resource
	g_pGameRules->CreateStandardEntities();

	COM_TimestampedLog( "InitBodyQue()" );
	InitBodyQue();
	
	COM_TimestampedLog( "SENTENCEG_Init()" );
	// init sentence group playback stuff from sentences.txt.
	// ok to call this multiple times, calls after first are ignored.
	SENTENCEG_Init();

	COM_TimestampedLog( "PrecacheStandardParticleSystems()" );
	// Precache standard particle systems
	PrecacheStandardParticleSystems( );

	// the area based ambient sounds MUST be the first precache_sounds

	COM_TimestampedLog( "W_Precache()" );
	// player precaches     
	W_Precache ();									// get weapon precaches
	COM_TimestampedLog( "ClientPrecache()" );
	ClientPrecache();
	
	COM_TimestampedLog( "PrecacheTempEnts()" );
	// precache all temp ent stuff
	CBaseTempEntity::PrecacheTempEnts();

	COM_TimestampedLog( "LightStyles" );
	//
	// Setup light animation tables. 'a' is total darkness, 'z' is maxbright.
	//
	for ( int i = 0; i < ARRAYSIZE(g_DefaultLightstyles); i++ )
	{
		engine->LightStyle( i, GetDefaultLightstyleString(i) );
	}

	// styles 32-62 are assigned by the light program for switchable lights

	// 63 testing
	engine->LightStyle(63, "a");

	COM_TimestampedLog( "InitializeAINetworks" );
	// =================================================
	//	Load and Init AI Networks
	// =================================================
	CAI_NetworkManager::InitializeAINetworks();
	// =================================================
	//	Load and Init AI Schedules
	// =================================================
	COM_TimestampedLog( "LoadAllSchedules" );
	g_AI_SchedulesManager.LoadAllSchedules();
	// =================================================
	//	Initialize NPC Relationships
	// =================================================
	COM_TimestampedLog( "InitDefaultAIRelationships" );
	g_pGameRules->InitDefaultAIRelationships();
	COM_TimestampedLog( "InitInteractionSystem" );
	CBaseCombatCharacter::InitInteractionSystem();

	COM_TimestampedLog( "g_pGameRules->Precache" );
	// Call the gamerules precache after the AI precache so that games can precache NPCs that are always loaded
	g_pGameRules->Precache();
	
	if ( m_iszChapterTitle != NULL_STRING )
	{
		DevMsg( 2, "Chapter title: %s\n", STRING(m_iszChapterTitle) );
		CMessage *pMessage = (CMessage *)CBaseEntity::Create( "env_message", vec3_origin, vec3_angle, NULL );
		if ( pMessage )
		{
			pMessage->SetMessage( m_iszChapterTitle );
			m_iszChapterTitle = NULL_STRING;

			// send the message entity a play message command, delayed by 1 second
			pMessage->AddSpawnFlags( SF_MESSAGE_ONCE );
			pMessage->SetThink( &CMessage::SUB_CallUseToggle );
			pMessage->SetNextThink( gpGlobals->curtime + 1.0f );
		}
	}

	g_iszFuncBrushClassname = AllocPooledString("func_brush");

	if ( m_iszDetailSpriteMaterial.Get() != NULL_STRING )
	{
		PrecacheMaterial( STRING( m_iszDetailSpriteMaterial.Get() ) );
	}

	COM_TimestampedLog( "CWorld::Precache - Finish" );
}
Ejemplo n.º 22
0
void CScriptIntro::Precache()
{
	PrecacheMaterial( "scripted/intro_screenspaceeffect" );
	BaseClass::Precache();
}
Ejemplo n.º 23
0
//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CBreakableSurface::Precache(void)
{
	UTIL_PrecacheOther( "window_pane" );

	// Load the edge types and styles for the specific surface type
	if (m_nSurfaceType == SHATTERSURFACE_TILE)
	{
		PrecacheMaterial( "models/brokentile/tilebroken_03a" );
		PrecacheMaterial( "models/brokentile/tilebroken_03b" );
		PrecacheMaterial( "models/brokentile/tilebroken_03c" );
		PrecacheMaterial( "models/brokentile/tilebroken_03d" );

		PrecacheMaterial( "models/brokentile/tilebroken_02a" );
		PrecacheMaterial( "models/brokentile/tilebroken_02b" );
		PrecacheMaterial( "models/brokentile/tilebroken_02c" );
		PrecacheMaterial( "models/brokentile/tilebroken_02d" );

		PrecacheMaterial( "models/brokentile/tilebroken_01a" );
		PrecacheMaterial( "models/brokentile/tilebroken_01b" );
		PrecacheMaterial( "models/brokentile/tilebroken_01c" );
		PrecacheMaterial( "models/brokentile/tilebroken_01d" );
	}
	else
	{
		PrecacheMaterial( "models/brokenglass/glassbroken_solid" );
		PrecacheMaterial( "models/brokenglass/glassbroken_01a" );
		PrecacheMaterial( "models/brokenglass/glassbroken_01b" );
		PrecacheMaterial( "models/brokenglass/glassbroken_01c" );
		PrecacheMaterial( "models/brokenglass/glassbroken_01d" );
		PrecacheMaterial( "models/brokenglass/glassbroken_02a" );
		PrecacheMaterial( "models/brokenglass/glassbroken_02b" );
		PrecacheMaterial( "models/brokenglass/glassbroken_02c" );
		PrecacheMaterial( "models/brokenglass/glassbroken_02d" );
		PrecacheMaterial( "models/brokenglass/glassbroken_03a" );
		PrecacheMaterial( "models/brokenglass/glassbroken_03b" );
		PrecacheMaterial( "models/brokenglass/glassbroken_03c" );
		PrecacheMaterial( "models/brokenglass/glassbroken_03d" );
	}

	BaseClass::Precache();
}
Ejemplo n.º 24
0
//-----------------------------------------------------------------------------
// Precache: 
//-----------------------------------------------------------------------------
void CCitadelEnergyCore::Precache()
{
	BaseClass::Precache();
	PrecacheMaterial( "effects/combinemuzzle2_dark" ); 
}
Ejemplo n.º 25
0
void CStar::Precache()
{
	PrecacheMaterial("textures/star-yellow-space.mat");
	PrecacheMaterial("textures/star-yellow-atmosphere.mat");
}
void CEnvScreenEffect::Precache( void )
{
	PrecacheMaterial( "effects/stun" );
	PrecacheMaterial( "effects/introblur" );
}
Ejemplo n.º 27
0
void CRotorWashEmitter::Precache( void )
{
	PrecacheMaterial( "effects/splashwake3" );
}
Ejemplo n.º 28
0
void CSteamJet::Precache( void )
{
    PrecacheMaterial( "particle/particle_smokegrenade" );
    PrecacheMaterial( "sprites/heatwave" );
}
Ejemplo n.º 29
0
void CEnvStarfield::Precache()
{
	BaseClass::Precache();

	PrecacheMaterial( "effects/spark_noz" );
}
Ejemplo n.º 30
0
void CFunc_Dust::Precache()
{
	PrecacheMaterial( "particle/sparkles" );
}