Exemplo n.º 1
0
LTBOOL CSnowFX::Init( SFXCREATESTRUCT* psfxCreateStruct )
{
	if( !psfxCreateStruct )
		return LTFALSE;

	CSpecialFX::Init( psfxCreateStruct );

	SNOWCREATESTRUCT* cs = (SNOWCREATESTRUCT*)psfxCreateStruct;

	m_vDims = cs->vDims;
	m_fDensity = cs->fDensity;
	m_fParticleRadius = cs->fParticleRadius * 2.0f;
	m_fFallRate = cs->fFallRate;
	m_fTumbleRate = cs->fTumbleRate / 360.0f;
	m_fTumbleRadius = cs->fTumbleRadius;
	m_fMaxDrawDist = cs->fMaxDrawDist;
	m_fMaxDrawDistSq = m_fMaxDrawDist * m_fMaxDrawDist;
	m_vAmbientColor = cs->vAmbientColor;
	m_nAmbientColor  = (uint32(m_vAmbientColor.x) & 0xff) << 16;
	m_nAmbientColor |= (uint32(m_vAmbientColor.y) & 0xff) << 8;
	m_nAmbientColor |= (uint32(m_vAmbientColor.z) & 0xff);
	m_bUseLighting = cs->bUseLighting;
	m_bUseSaturate = cs->bUseSaturate;
	m_hstrTextureName = cs->hstrTextureName;

	// setup console variables
	if( !g_cvarSnowEnable.IsInitted() )
		g_cvarSnowEnable.Init( g_pLTClient, "SnowEnable", LTNULL, 1.0f );
	if( !g_cvarSnowDensityScale.IsInitted() )
		g_cvarSnowDensityScale.Init( g_pLTClient, "SnowDensityScale", LTNULL, 1.0f );
	if( !g_cvarSnowParticleScale.IsInitted() )
		g_cvarSnowParticleScale.Init( g_pLTClient, "SnowParticleScale", LTNULL, 1.0f );

	return LTTRUE;
}
Exemplo n.º 2
0
bool CPerformanceTest::Start(uint32 nMin /*=kDefaultMin*/, uint32 nMax /*=kDefaultMax*/)
{
	Reset();

	if (nMin < nMax)
	{
		m_nMinTestFPS = nMin;
		m_nMaxTestFPS = nMax;
	}
	else
	{
		return false;
	}

	if (!g_vtPerformanceSmoothFPSTime.IsInitted())
	{
		g_vtPerformanceSmoothFPSTime.Init(g_pLTClient, "PerformanceFPSSmoothTime", NULL, 0.5f);
	}
	if (!g_vtPerformanceMinSampleFPS.IsInitted())
	{
		g_vtPerformanceMinSampleFPS.Init(g_pLTClient, "PerformanceMinSampleFrameRate", NULL, 0.00001f);
	}
	if (!g_vtPerformanceMaxSampleFPS.IsInitted())
	{
		g_vtPerformanceMaxSampleFPS.Init(g_pLTClient, "PerformanceMaxSampleFrameRate", NULL, 1.0f);
	}
	if (!g_vtPerformanceThrowAwaySamples.IsInitted())
	{
		g_vtPerformanceThrowAwaySamples.Init(g_pLTClient, "PerformanceThrowAwaySamples", NULL, 5.0f);
	}

	return true;
}
Exemplo n.º 3
0
void CLeanMgr::Init( )
{
	g_vtLeanOutTime.Init( g_pLTClient, "LeanOutTime", LTNULL, 0.5f );
	g_vtLeanCenterTime.Init( g_pLTClient, "LeanCenterTime", LTNULL, 0.5f );
	g_vtLeanRadius.Init( g_pLTClient, "LeanRadius", LTNULL, 250.0f );
	g_vtLeanAngle.Init( g_pLTClient, "LeanAngle", LTNULL, 3.0f );
	g_vtLeanCamClipDist.Init( g_pLTClient, "LeanCamClipDist", LTNULL, 20.0f );
}
Exemplo n.º 4
0
LTBOOL CNodeController::Init(CCharacterFX* pCharacterFX)
{
	_ASSERT(pCharacterFX);
    if ( !pCharacterFX ) return LTFALSE;

	if (!g_vtLipSyncMaxRot.IsInitted())
	{
        g_vtLipSyncMaxRot.Init(g_pLTClient, "LipSyncMaxRot", NULL, 25.0f);
	}

	if (!g_vtLipSyncFreq.IsInitted())
	{
        g_vtLipSyncFreq.Init(g_pLTClient, "LipSyncFreq", NULL, 20.0f);
	}

	// Store our backpointer

	m_pCharacterFX = pCharacterFX;

	// Map all the nodes in our skeleton in the bute file to the nodes in the actual .abc model file

	int iNode = 0;
	HMODELNODE hCurNode = INVALID_MODEL_NODE;
    while ( g_pLTClient->GetNextModelNode(GetCFX()->GetServerObj(), hCurNode, &hCurNode) == LT_OK)
	{
		_ASSERT(m_cNodes < MAX_NODES);

		char szName[64] = "";
        g_pLTClient->GetModelNodeName(GetCFX()->GetServerObj(), hCurNode, szName, 64);

		ModelNode eModelNode = g_pModelButeMgr->GetSkeletonNode(m_pCharacterFX->GetModelSkeleton(), szName);

		if ( eModelNode != eModelNodeInvalid )
		{
			m_aNodes[eModelNode].eModelNode = eModelNode;
			m_aNodes[eModelNode].hModelNode = hCurNode;
		}

		m_cNodes++;
	}

	// Find our "rotor" nodes

	int cNodes = g_pModelButeMgr->GetSkeletonNumNodes(m_pCharacterFX->GetModelSkeleton());

	for ( iNode = 0 ; iNode < cNodes ; iNode++ )
	{
		if ( NODEFLAG_ROTOR & g_pModelButeMgr->GetSkeletonNodeFlags(m_pCharacterFX->GetModelSkeleton(), (ModelNode)iNode) )
		{
            AddNodeControlRotationTimed((ModelNode)iNode, LTVector(0,1,0), 40000.0f, 20000.0f);
		}
	}

    return LTTRUE;
}
Exemplo n.º 5
0
LTBOOL CDynamicLightFX::CreateObject(ILTClient *pClientDE)
{
    if (!CSpecialFX::CreateObject(pClientDE)) return LTFALSE;

	if (!g_vtDLightOffsetX.IsInitted())
	{
		g_vtDLightOffsetX.Init(pClientDE, "DLightOffsetX", "", 0.0f);
	}

	if (!g_vtDLightOffsetY.IsInitted())
	{
		g_vtDLightOffsetY.Init(pClientDE, "DLightOffsetY", "", 0.0f);
	}

	if (!g_vtDLightOffsetZ.IsInitted())
	{
		g_vtDLightOffsetZ.Init(pClientDE, "DLightOffsetZ", "", 0.0f);
	}

	// Allow create object to be called to re-init object...

	if (m_hObject)
	{
		g_pCommonLT->SetObjectFlags(m_hObject, OFT_Flags, m_dwFlags, FLAGMASK_ALL);
		m_pClientDE->SetObjectPos(m_hObject, &m_vPos);
	}
	else
	{
		ObjectCreateStruct createStruct;
		INIT_OBJECTCREATESTRUCT(createStruct);

		createStruct.m_ObjectType = OT_LIGHT;
		createStruct.m_Flags = m_dwFlags;
		createStruct.m_Pos = m_vPos;

		// TESTING FOR MUZZLE FLASH!!!!
		createStruct.m_Pos.x += g_vtDLightOffsetX.GetFloat();
		createStruct.m_Pos.y += g_vtDLightOffsetY.GetFloat();
		createStruct.m_Pos.z += g_vtDLightOffsetZ.GetFloat();
		// TESTING!!!!

		m_hObject = m_pClientDE->CreateObject(&createStruct);
        if (!m_hObject) return LTFALSE;
	}

	m_pClientDE->SetLightColor(m_hObject, m_vColor.x, m_vColor.y, m_vColor.z);
	m_pClientDE->SetLightRadius(m_hObject, m_fMinRadius);

	m_fStartTime = m_pClientDE->GetTime();

    return LTTRUE;
}
Exemplo n.º 6
0
LTBOOL CTracerFX::Init(SFXCREATESTRUCT* psfxCreateStruct)
{
    if (!CSpecialFX::Init(psfxCreateStruct)) return LTFALSE;

	TRCREATESTRUCT* pTR = (TRCREATESTRUCT*)psfxCreateStruct;
	m_cs = *pTR;

    if (!m_cs.pTracerFX) return LTFALSE;

	m_vDir  = m_cs.vEndPos - m_cs.vStartPos;
	m_fDist = m_vDir.Mag();
	m_vDir.Norm();

	if (!g_cvarTracerSegments.IsInitted())
	{
        g_cvarTracerSegments.Init(g_pLTClient, "TracerSegments", NULL, 1.0f);
	}

	if (!g_cvarTracerLifetime.IsInitted())
	{
        g_cvarTracerLifetime.Init(g_pLTClient, "TracerLifetime", NULL, 0.2f);
	}

	if (!g_cvarTracerVelocity.IsInitted())
	{
        g_cvarTracerVelocity.Init(g_pLTClient, "TracerVeloctity", NULL, -1.0f);
	}

	if (g_cvarTracerVelocity.GetFloat() > 0.0f)
	{
		m_fVelocity = g_cvarTracerVelocity.GetFloat();
	}
	else
	{
		m_fVelocity = m_cs.pTracerFX->fVelocity;
	}


	// Calculate life time...

	if (m_fVelocity > 0.0f)
	{
		m_fLifetime = m_fDist / m_fVelocity;
	}
	else
	{
        return LTFALSE;
	}

    return LTTRUE;
}
Exemplo n.º 7
0
LTBOOL CPolygonDebrisFX::Init(SFXCREATESTRUCT* psfxCreateStruct)
{
    if (!psfxCreateStruct) return LTFALSE;

	m_cs = *(POLYDEBRISCREATESTRUCT*)psfxCreateStruct;

	DEBRISCREATESTRUCT debris;

    g_pLTClient->AlignRotation(&(debris.rRot), &m_cs.vNormal, LTNULL);
	debris.vPos				= m_cs.vPos + (m_cs.vDir * m_cs.PolyDebrisFX.fDirOffset);
	debris.vMinVel			= m_cs.PolyDebrisFX.vMinVel;
	debris.vMaxVel			= m_cs.PolyDebrisFX.vMaxVel;
	debris.fMinLifeTime		= m_cs.PolyDebrisFX.fMinDuration;
	debris.fMaxLifeTime		= m_cs.PolyDebrisFX.fMaxDuration;
	debris.nNumDebris		= GetRandom(m_cs.PolyDebrisFX.nMinDebris, m_cs.PolyDebrisFX.nMaxDebris);
	debris.nMinBounce		= m_cs.PolyDebrisFX.nMinBounce;
	debris.nMaxBounce		= m_cs.PolyDebrisFX.nMaxBounce;
	debris.fGravityScale	= m_cs.PolyDebrisFX.fGravityScale;
	debris.vMinDOffset		= m_cs.PolyDebrisFX.vMinDOffset;
	debris.vMaxDOffset		= m_cs.PolyDebrisFX.vMaxDOffset;
	debris.bDirOffsetOnly	= m_cs.PolyDebrisFX.bDirOffsetOnly;

    if (!CDebrisFX::Init(&debris)) return LTFALSE;

	// Too expensive to have poly debris bouncing...

	m_ds.bBounce = LTFALSE;

	if (!g_cvarPolyDebrisTrailTime.IsInitted())
	{
		g_cvarPolyDebrisTrailTime.Init(g_pLTClient, "PolyDebrisTrailTime", LTNULL, 0.25f);
	}

	if (!g_cvarPolyDebrisScaleDist.IsInitted())
	{
		g_cvarPolyDebrisScaleDist.Init(g_pLTClient, "PolyDebrisScaleDist", LTNULL, 150.0f);
	}

	if (!g_cvarPolyDebrisMinDistScale.IsInitted())
	{
		g_cvarPolyDebrisMinDistScale.Init(g_pLTClient, "PolyDebrisMinDistScale", LTNULL, 1.0f);
	}

	if (!g_cvarPolyDebrisMaxDistScale.IsInitted())
	{
		g_cvarPolyDebrisMaxDistScale.Init(g_pLTClient, "PolyDebrisMaxDistScale", LTNULL, 1.0f);
	}

    return LTTRUE;
}
Exemplo n.º 8
0
LTBOOL CParticleSystemFX::CreateObject(ILTClient *pClientDE)
{
    if (!pClientDE ) return LTFALSE;

	if (m_cs.hstrTextureName)
	{
		m_pTextureName = pClientDE->GetStringData(m_cs.hstrTextureName);
	}

    LTBOOL bRet = CBaseParticleSystemFX::CreateObject(pClientDE);

	if (bRet && m_hObject && m_hServerObject)
	{
        LTRotation rRot;
		g_pLTClient->GetObjectRotation(m_hServerObject, &rRot);
		g_pLTClient->SetObjectRotation(m_hObject, &rRot);

        uint32 dwUserFlags;
		g_pCommonLT->GetObjectFlags(m_hServerObject, OFT_User, dwUserFlags);
		if (!(dwUserFlags & USRFLG_VISIBLE))
		{
			g_pCommonLT->SetObjectFlags(m_hObject, OFT_Flags, 0, FLAG_VISIBLE);
		}
	}

    s_cvarTweak.Init(g_pLTClient, "TweakParticles", NULL, 0.0f);

	return bRet;
}
Exemplo n.º 9
0
LTBOOL CScatterFX::Init( SFXCREATESTRUCT* psfxCreateStruct )
{
	if( !psfxCreateStruct )
		return LTFALSE;

	CSpecialFX::Init( psfxCreateStruct );

	SCATTERCREATESTRUCT* cs = (SCATTERCREATESTRUCT*)psfxCreateStruct;

	m_vDims = cs->vDims;
	m_nBlindDataIndex = cs->nBlindDataIndex;
	m_fWidth = cs->fWidth * 0.5f;
	m_fHeight = cs->fHeight;
	m_fMaxScale = cs->fMaxScale;
	m_fTilt = cs->fTilt;
	m_fWaveRate = cs->fWaveRate;
	m_fWaveDist = cs->fWaveDist;
	m_fMaxDrawDist = cs->fMaxDrawDist;
	m_fMaxDrawDistSq = m_fMaxDrawDist * m_fMaxDrawDist;
	m_hstrTextureName = cs->hstrTextureName;
	m_bUseSaturate = cs->bUseSaturate;

	LTVector pos;
	g_pLTClient->GetObjectPos( m_hServerObject, &pos );
	AdjustBounds( pos, m_vDims );

	// setup console variables
	if( !g_cvarScatterEnable.IsInitted() )
		g_cvarScatterEnable.Init( g_pLTClient, "ScatterEnable", LTNULL, 1.0f );

	return LTTRUE;
}
Exemplo n.º 10
0
LTBOOL CLineSystemFX::CreateObject(ILTClient *pClientDE)
{
    if (!pClientDE ) return LTFALSE;

    LTBOOL bRet = CBaseLineSystemFX::CreateObject(pClientDE);

	if (bRet && m_hObject && m_hServerObject)
	{
        uint32 dwUserFlags;
		g_pCommonLT->GetObjectFlags(m_hServerObject, OFT_User, dwUserFlags);
		if (!(dwUserFlags & USRFLG_VISIBLE))
		{
			g_pCommonLT->SetObjectFlags(m_hObject, OFT_Flags, 0, FLAG_VISIBLE);
		}
	}


	// Create lines...

	m_nTotalNumLines = int(m_cs.fLinesPerSecond * m_cs.fLineLifetime);
	if (m_nTotalNumLines > MAX_SYSTEM_LINES)
	{
		m_nTotalNumLines = MAX_SYSTEM_LINES;
	}

	m_pLines = debug_newa(LSLineStruct, m_nTotalNumLines);

	SetupSystem();

    s_cvarTweak.Init(g_pLTClient, "TweakLines", NULL, 0.0f);

	return bRet;
}
Exemplo n.º 11
0
void CHUDDamageDir::UpdateLayout()
{
	//if we haven't initialized our layout info
	if (!m_hLayout)
	{
		m_hLayout = g_pLayoutDB->GetHUDRecord("HUDDamageDir");
	}

	CHUDItem::UpdateLayout();

	m_nInnerRadius = g_pLayoutDB->GetInt32(m_hLayout,LDB_HUDAddInt,0);
	m_nOuterRadius = g_pLayoutDB->GetInt32(m_hLayout,LDB_HUDAddInt,1);

	for (int i =0; i < kNumDamageSectors; i++)
	{
		DrawPrimSetRGBA(m_Poly[i],argbWhite);
		SetupQuadUVs(m_Poly[i], m_hIconTexture, 0.0f,0.0f,1.0f,1.0f);
	}

	m_fMinAlpha = g_pLayoutDB->GetFloat(m_hLayout,LDB_HUDAddFloat,0);
	m_fMaxAlpha = g_pLayoutDB->GetFloat(m_hLayout,LDB_HUDAddFloat,1);

	g_vtDamageShowAll.Init(g_pLTClient, "DamageShowAll", NULL, 0.0f);

	ScaleChanged();

}
LTBOOL CClientSoundMgr::Init(ILTCSBase *pInterface, const char* szAttributeFile)
{
	g_pClientSoundMgr = this;

	g_vtSoundPlayOnlyIfHeard.Init(g_pLTClient, "SoundPlayOnlyIfHeard", NULL, 1.0f);

	return CGameSoundMgr::Init(pInterface, szAttributeFile);
}
Exemplo n.º 13
0
LTBOOL CClientSoundMgr::Init(const char* szAttributeFile)
{
	g_pClientSoundMgr = this;

	g_vtSoundPlayOnlyIfHeard.Init(g_pLTClient, "SoundPlayOnlyIfHeard", NULL, 0.0f);

	return CGameSoundMgr::Init(szAttributeFile);
}
Exemplo n.º 14
0
void CFlashLight::CreateLight()
{
	if (m_hLight) return;

    g_cvarFLMinLightRadius.Init(g_pLTClient, "FLMinRadius", NULL, 75.0f);
    g_cvarFLMaxLightRadius.Init(g_pLTClient, "FLMaxtRadius", NULL, 150.0f);
    g_cvarFLMinLightColor.Init(g_pLTClient, "FLMinColor", NULL, 100.0f);
    g_cvarFLMaxLightColor.Init(g_pLTClient, "FLMaxColor", NULL, 105.0f);
    g_cvarFLLightOffsetUp.Init(g_pLTClient, "FLOffsetUp", NULL, 5.0f);
    g_cvarFLLightOffsetRight.Init(g_pLTClient, "FLOffsetRight", NULL, 0.0f);
    g_cvarFLLightOffsetForward.Init(g_pLTClient, "FLOffsetForward", NULL, 1.0f);

	HOBJECT hCamera = g_pPlayerMgr->GetCamera();
	if (!hCamera) return;

	ObjectCreateStruct createStruct;
	INIT_OBJECTCREATESTRUCT(createStruct);

	createStruct.m_ObjectType = OT_LIGHT;
	createStruct.m_Flags	= FLAG_VISIBLE;

	//we want to make sure that this dynamically lights the world regardless of
	//performance settings
	createStruct.m_Flags2	= FLAG2_FORCEDYNAMICLIGHTWORLD;

	g_pLTClient->GetObjectPos(hCamera, &(createStruct.m_Pos));

    m_hLight = g_pLTClient->CreateObject(&createStruct);
}
Exemplo n.º 15
0
LTBOOL CHUDDamageDir::Init()
{
	m_hArrow = g_pInterfaceResMgr->GetTexture("interface\\hud\\damagearrow.dtx");

	for (int i =0; i < kNumDamageSectors; i++)
	{
		g_pDrawPrim->SetRGBA(&m_Poly[i],argbWhite);
		SetupQuadUVs(m_Poly[i], m_hArrow, 0.0f,0.0f,1.0f,1.0f);
	}

	g_vtDamageMinAlpha.Init(g_pLTClient, "DamageMinAlpha", NULL, 0.25f);
	g_vtDamageMaxAlpha.Init(g_pLTClient, "DamageMaxAlpha", NULL, 0.9f);
	g_vtDamageShowAll.Init(g_pLTClient, "DamageShowAll", NULL, 0.0f);

	UpdateLayout();

	return LTTRUE;
}
Exemplo n.º 16
0
LTBOOL CGameSettings::Init (ILTClient* pClientDE, CGameClientShell* pClientShell)
{
    if (!pClientDE || !pClientShell) return LTFALSE;

	m_pClientDE = pClientDE;
	m_pClientShell = pClientShell;

	g_vtMouseScaleBase.Init(g_pLTClient, "MouseScaleBase", NULL, 0.00125f);
	g_vtMouseScaleInc.Init(g_pLTClient, "MouseScaleIncrement", NULL, 0.001125f);

	// check if gore is allowed

    uint32 dwAdvancedOptions = g_pInterfaceMgr->GetAdvancedOptions();

	if (dwAdvancedOptions & AO_MUSIC)
	{
		m_pClientDE->RunConsoleString("musicenable 1");
	}
	else
	{
		m_pClientDE->RunConsoleString("musicenable 0");
	}
	if (dwAdvancedOptions & AO_SOUND)
	{
		m_pClientDE->RunConsoleString("soundenable 1");
	}
	else
	{
		m_pClientDE->RunConsoleString("soundenable 0");
	}

	// implement settings that need implementing

    ImplementMouseSensitivity();

	// hack to keep sound volume reasonable
	if (SoundVolume() > 100.0f)
		SetFloatVar("SoundVolume",100.0f);

  	ImplementSoundVolume();
	ImplementSoundQuality();

    return LTTRUE;
}
CFolderJoin::CFolderJoin()
{
	m_nState             = FSS_IDLE;
    m_bForceNextUpdate   = LTFALSE;
    m_bNeedServerSorting = LTFALSE;

	m_nNumServers       = 0;
	m_nNumServersListed = 0;
	m_nPopFilter        = POP_FILTER_ALL;
	m_nGameFilter       = NGT_FILTER_ALL;


	m_nServerSort = FSS_SORT_PING;
	m_nPlayerSort = FSS_SORT_FRAGS;

    m_pServerList = LTNULL;
    m_pPlayerList = LTNULL;
    m_pOptionList = LTNULL;

    m_pRefresh = LTNULL;
    m_pRePing = LTNULL;
    m_pVersionFilter = LTNULL;
    m_pGameFilter = LTNULL;
    m_pPopFilter = LTNULL;
    m_pResort = LTNULL;
    m_pJoin = LTNULL;

    g_vtNetVersionFilter.Init(g_pLTClient,"NetVersionFilter",LTNULL,0.0f);
    g_vtNetGameFilter.Init(g_pLTClient,"NetGameFilter",LTNULL,(float)m_nGameFilter);
    g_vtNetPopFilter.Init(g_pLTClient,"NetPopFilter",LTNULL,(float)m_nPopFilter);
    g_vtNetServerSortKey.Init(g_pLTClient,"NetServerSortKey",LTNULL,(float)m_nServerSort);
    g_vtNetPlayerSortKey.Init(g_pLTClient,"NetPlayerSortKey",LTNULL,(float)m_nPlayerSort);

	m_bAskingForPassword = LTFALSE;
	m_szPassword[0] = LTNULL;
	m_pPassEdit = LTNULL;
	m_pPassLabel = LTNULL;
	m_pPassBack = LTNULL;

	m_hServersShown = LTNULL;
	m_hDummyStatus = LTNULL;
	m_hStatus = LTNULL;

}
Exemplo n.º 18
0
bool CClientWeaponMgr::Init()
{
	// Determine m_nMaxWeapons
	
	m_nMaxWeapons = g_pWeaponDB->GetNumPlayerWeapons();

	// Allocate space for our array...

	m_apClientWeapon = debug_newa( CClientWeapon*, m_nMaxWeapons );
	if( !m_apClientWeapon )
	{
		ASSERT( !"CClientWeaponMgr::Init.  Could not allocate clientweapon array." );
		return false;
	}

	// Clear us out.
	memset( m_apClientWeapon, 0, m_nMaxWeapons * sizeof( CClientWeapon* ));

	for( uint8 nWeapon = 0; nWeapon < m_nMaxWeapons; ++nWeapon )
	{
		// Get the weapon datadase record...
		
		HWEAPON hWeapon = g_pWeaponDB->GetPlayerWeapon( nWeapon );
		if( !hWeapon )
		{
			ASSERT( !"CClientWeaponMgr::Init.  Could not get HWEAPON." );
			return false;
		}

		m_apClientWeapon[nWeapon] = debug_new( CClientWeapon );
		if( !m_apClientWeapon[nWeapon] )
		{
			ASSERT( !"CClientWeaponMgr::Init.  Could not create clientweapon." );
			return false;
		}

		// init the weapon
		if( !m_apClientWeapon[nWeapon]->Init( hWeapon ))
		{
			ASSERT( !"CClientWeaponMgr::Init.  Could not init clientweapon." );
			return false;
		}
	}

	m_pCurrentWeapon		= NULL;
	m_nCurClientWeaponIndex	= CWM_NO_WEAPON;
	m_hLastWeapon			= NULL;

	g_vtKeepCurrentAmmo.Init( g_pLTClient, "KeepCurrentAmmo", NULL, 1.0f );


	HRECORD hShared = ClientDB::Instance( ).GetClientSharedRecord( );

	// for now, always succeed
	return true;
}
Exemplo n.º 19
0
void CTargetMgr::FirstUpdate()
{
	if (!g_vtActivationDistance.IsInitted())
	{
		float f = g_pClientButeMgr->GetInterfaceAttributeFloat("ActivationDistance",100.0f);
		g_vtActivationDistance.Init(g_pLTClient, "ActivationDistance", LTNULL, f);
	}

	if (!g_vtReviveDistance.IsInitted())
	{
		float f = g_pClientButeMgr->GetInterfaceAttributeFloat("ReviveDistance",200.0f);
		g_vtReviveDistance.Init(g_pLTClient, "ReviveDistance", LTNULL, f);
	}

	if( !g_vtTargetDistance.IsInitted() )
	{
		float f = g_pClientButeMgr->GetInterfaceAttributeFloat("TargetDistance",1000.0f);
		g_vtTargetDistance.Init(g_pLTClient, "TargetDistance", LTNULL, f);
	}
}
Exemplo n.º 20
0
//called to initialize a group and create the appropriate objects
bool CParticleSystemGroup::Init(IClientFXMgr* pFxMgr, HMATERIAL hMaterial, const LTRigidTransform& tObjTrans, 
								bool* pVisibleFlag, const CParticleSystemProps* pProps)
{
	//make sure our console variable is initialized
	if(!g_vtParticleBounceScale.IsInitted())
		g_vtParticleBounceScale.Init(g_pLTClient, "ParticleBounceScale", NULL, 1.0f);

	//make sure we are in a valid state
	Term();

	ObjectCreateStruct	ocs;

	// Create Particle System
	ocs.m_ObjectType	= OT_CUSTOMRENDER;
	ocs.m_Flags			|= FLAG_VISIBLE;

	if(!pProps->m_bSolid)
		ocs.m_Flags2 |= FLAG2_FORCETRANSLUCENT;

	if(!pProps->m_bTranslucentLight)
		ocs.m_Flags |= FLAG_NOLIGHT;

	//setup whether or not it is in the sky
	ocs.m_Flags2 |= GetSkyFlags(pProps->m_eInSky);

	ocs.m_Pos = tObjTrans.m_vPos;
	ocs.m_Rotation = tObjTrans.m_rRot;

	m_hCustomRender = g_pLTClient->CreateObject( &ocs );
	if( !m_hCustomRender )
		return false;

	//setup our rendering layer
	if(pProps->m_bPlayerView)
		g_pLTClient->GetRenderer()->SetObjectDepthBiasTableIndex(m_hCustomRender, eRenderLayer_Player);

	LTVector vTempBBox(1.0f, 1.0f, 1.0f);

	g_pLTClient->GetCustomRender()->SetRenderingSpace(m_hCustomRender, pProps->m_bObjectSpace ? eRenderSpace_Object : eRenderSpace_World);
	g_pLTClient->GetCustomRender()->SetVisBoundingBox(m_hCustomRender, -vTempBBox, vTempBBox);
	g_pLTClient->GetCustomRender()->SetRenderCallback(m_hCustomRender, CustomRenderCallback);
	g_pLTClient->GetCustomRender()->SetCallbackUserData(m_hCustomRender, this);

	//assign the material to the object
	g_pLTClient->GetCustomRender()->SetMaterial(m_hCustomRender, hMaterial);

	//and save our other values passed in
	m_pProps		= pProps;
	m_pFxMgr		= pFxMgr;
	m_pVisibleFlag	= pVisibleFlag;

	//success
	return true;
}
Exemplo n.º 21
0
LTBOOL CMineFX::CreateObject(ILTClient* pClientDE)
{
    if (!CSpecialFX::CreateObject(pClientDE) || !m_hServerObject) return LTFALSE;

	if (!g_vtMineShit.IsInitted())
	{
        g_vtMineShit.Init(g_pLTClient, "MineShit", NULL, 0.01f);
	}

    return LTTRUE;
}
LTBOOL CMuzzleFlashFX::CreateObject(ILTClient *pClientDE)
{
    if (!pClientDE || !CSpecialFX::CreateObject(pClientDE)) return LTFALSE;

	if (!g_vtReallyClose.IsInitted())
	{
	    g_vtReallyClose.Init(pClientDE, "MFReallyClose", NULL, 1.0f);
	}

	return ResetFX();
}
Exemplo n.º 23
0
bool CHUDArmor::Init()
{
	g_vtHUDArmorRender.Init( g_pLTClient, "HUDArmorRender", NULL, 1.0f );

	m_nFadeThreshold = 0;
	m_nLastValue = 0;
	UpdateLayout();
	ScaleChanged();
	SetSourceString( LoadString("HUD_Number_Chars"));

	return true;
}
Exemplo n.º 24
0
LTBOOL CParticleTrailSegmentFX::Init(SFXCREATESTRUCT* psfxCreateStruct)
{
    if (!CBaseParticleSystemFX::Init(psfxCreateStruct)) return LTFALSE;

    g_cvarSmokeTrailStartScale.Init(g_pLTClient, "SmokeTrailStartScale", LTNULL, 1.0f);
    g_cvarSmokeTrailLWEndScale.Init(g_pLTClient, "SmokeTrailLWEndScale", LTNULL, 15.0f);
    g_cvarSmokeTrailSWEndScale.Init(g_pLTClient, "SmokeTrailSWEndScale", LTNULL, 15.0f);
    g_cvarSmokeTrailSBEndScale.Init(g_pLTClient, "SmokeTrailSBEndScale", LTNULL, 15.0f);
    g_cvarSmokeTrailStartAlpha.Init(g_pLTClient, "SmokeTrailStartAlpha", LTNULL, 0.9f);
    g_cvarSmokeTrailEndAlpha.Init(g_pLTClient, "SmokeTrailEndAlpha", LTNULL, 0.0f);

	PTSCREATESTRUCT* pPTS = (PTSCREATESTRUCT*)psfxCreateStruct;
	VEC_COPY(m_vColor1, pPTS->vColor1);
	VEC_COPY(m_vColor2, pPTS->vColor2);
	VEC_COPY(m_vDriftOffset, pPTS->vDriftOffset);
	m_nType			= pPTS->nType;
	m_fLifeTime		= pPTS->fLifeTime;
	m_fFadeTime		= pPTS->fFadeTime;
	m_fOffsetTime	= pPTS->fOffsetTime;
	m_fRadius		= pPTS->fRadius;
	m_fGravity		= pPTS->fGravity;
	m_nNumPerPuff	= pPTS->nNumPerPuff;

    m_bIgnoreWind   = LTFALSE;

	// We'll control the particle system's position...

    m_basecs.bClientControlsPos = LTTRUE;

    return LTTRUE;
}
Exemplo n.º 25
0
void CLaserBeam::Init()
{
    g_cvarLaserBeamThickness.Init(g_pLTClient, "LaserBeamThickness", NULL, 1.0f);
    g_cvarLaserBeamAlpha.Init(g_pLTClient, "LaserBeamAlpha", NULL, 0.5f);
    g_cvarLaserBeamUOffset.Init(g_pLTClient, "LaserBeamUOffset", NULL, 0.0f);
    g_cvarLaserBeamROffset.Init(g_pLTClient, "LaserBeamROffset", NULL, 0.0f);
    g_cvarLaserBeamFOffset.Init(g_pLTClient, "LaserBeamFOffset", NULL, 0.0f);
    g_cvarLaserBeamNumSegments.Init(g_pLTClient, "LaserBeamNumSegments", NULL, 2.0f);

    g_cvarLaserBeamDebug.Init(g_pLTClient, "LaserBeamDebug", NULL, 2.0f);
}
Exemplo n.º 26
0
bool CHUDAmmo::Init()
{
	g_vtHUDAmmoRender.Init( g_pLTClient, "HUDAmmoRender", NULL, 1.0f );

	UpdateLayout();

	m_Text.SetDropShadow(2);

	ScaleChanged();

	SetSourceString(LoadString("HUD_Ammo_Chars"));

	return true;
}
Exemplo n.º 27
0
bool CClientFXMgr::Init(ILTClient *pClientDE, EngineTimer& timer )
{
	m_pClientDE = pClientDE;

	//setup our console variable if it isn't already
	if(!g_vtClientFXDetailLevel.IsInitted())
		g_vtClientFXDetailLevel.Init(pClientDE, "ClientFXDetailLevel", NULL, 2.0f);

	// This is the timer we will use with all calculations.  Since
	// there can be multiple clientfxmgr's, we take it from our "mgr".
	m_Timer = timer;

	return true;
}
Exemplo n.º 28
0
// ----------------------------------------------------------------------- //
// initialize item
// ----------------------------------------------------------------------- //
bool CHUDWeapon::Init()
{
	g_vtHUDWeaponRender.Init( g_pLTClient, "HUDWeaponRender", NULL, 1.0f );

	UpdateLayout();

	SetSourceString( LoadString("HUD_Number_Chars"));

	m_bSelected = false;
	m_nCount = -1;
	EnableFade( true );

	return true;
}
Exemplo n.º 29
0
bool CHUDSubtitles::Init()
{
    g_pLTClient->RegisterConsoleProgram("TestSubtitle", TestSubtitleFn);

	if (!g_vtAdjustedRadius.IsInitted())
	{
		g_vtAdjustedRadius.Init(g_pLTClient, "SubtitleSoundRadiusPercent", NULL, 0.77f);
	}


	UpdateLayout();

	return true;

}
LTBOOL CCameraOffsetMgr::Init()
{
	m_vPitchYawRollDelta.Init();
	m_vPosDelta.Init();

    g_vtCamMaxPitchOffset.Init(g_pLTClient, "CamMaxPitchOffset", NULL, 15.0);
    g_vtCamMaxYawOffset.Init(g_pLTClient, "CamMaxYawOffset", NULL, 15.0);
    g_vtCamMaxRollOffset.Init(g_pLTClient, "CamMaxRollOffset", NULL, 15.0);
    g_vtCamMaxPosXOffset.Init(g_pLTClient, "CamMaxPosXOffset", NULL, 200.0);
    g_vtCamMaxPosYOffset.Init(g_pLTClient, "CamMaxPosYOffset", NULL, 200.0);
    g_vtCamMaxPosZOffset.Init(g_pLTClient, "CamMaxPosZOffset", NULL, 200.0);
	g_vtCamInfo.Init(g_pLTClient, "CamInfo", NULL, 0.0f);

    g_vtCamWeaponImpact.Init(g_pLTClient, "CamWeaponImpact", NULL, 0.0);

    return LTTRUE;
}