Exemple #1
0
void GameBase::MakeTransitionable( )
{
	// Only want one per object

	ASSERT( m_pTransAgg == NULL );

	// Create it and add it...

	m_pTransAgg = s_bankCTransAggs.New();
	if( !m_pTransAgg )
	{
		g_pLTServer->CPrint( "new TransAgg FAILED!!!" );
		return;
	}
	AddAggregate( (LPAGGREGATE)m_pTransAgg );
}
Exemple #2
0
CBaseFX* fxCreateFlareSpriteFX()
{
	return g_FlareSpriteFX_Bank.New();
}
Exemple #3
0
CBaseFX* fxCreateCreateFX()
{
	return g_CreateFX_Bank.New();
}
Exemple #4
0
CBaseFX* fxCreateSpriteSystem()
{
	return g_SpriteSystem_Bank.New();
}
Exemple #5
0
CBaseFX* fxCreatePlayRandomSound()
{
	return g_PlayRandomSoundFX_Bank.New();
}
Exemple #6
0
CBaseFX* fxCreatePolyTube()
{
	return g_PolyTubeFX_Bank.New();
}
Exemple #7
0
CBaseFX* fxCreateNull()
{
	return g_NullFX_Bank.New();
}
Exemple #8
0
CSpecialFX* CSFXMgr::CreateSFX(uint8 nId, SFXCREATESTRUCT *psfxCreateStruct,
							   ILTMessage_Read *pMsg, HOBJECT hServerObj)
{
    CSpecialFX* pSFX = NULL;

	switch (nId)
	{
		case SFX_WEAPON_ID :
		{
			pSFX = &s_WeaponFX;
		}
		break;

		case SFX_PLAYERLURE_ID :
		{
			pSFX = debug_new( PlayerLureFX );
		}
		break;

		case SFX_PLAYERSOUND_ID :
		{
			pSFX = g_SFXBank_PlayerSound.New();
		}
		break;

		case SFX_PROJECTILE_ID :
		{
			pSFX = g_SFXBank_Projectile.New();
		}
		break;

		case SFX_SEARCHLIGHT_ID :
		{
			pSFX = g_SFXBank_SearchLight.New();
		}
		break;

		case SFX_MARK_ID :
		{
			pSFX = g_SFXBank_Mark.New();
		}
		break;

		case SFX_SHELLCASING_ID :
		{
			pSFX = g_SFXBank_ShellCasing.New();
		}
		break;

		case SFX_CAMERA_ID :
		{
			pSFX = g_SFXBank_Camera.New();
			if (pSFX)
			{
				if (pSFX->Init(psfxCreateStruct))
				{
					if (g_pLTClient->IsConnected())
					{
						if (pSFX->CreateObject(g_pLTClient))
						{
							m_cameraSFXList.Add(pSFX);
						}
						else
						{
							DeleteSFX(pSFX);
                            pSFX = NULL;
						}
					}
					else
					{
						DeleteSFX(pSFX);
                        pSFX = NULL;
					}
				}
			}

			return pSFX;
		}
		break;

		case SFX_POLYGRID_ID :
		{
			pSFX = g_SFXBank_PolyGrid.New();
		}
		break;

		case SFX_RENDERTARGET_ID :
		{
			pSFX = g_SFXBank_RenderTarget.New();
		}
		break;

		case SFX_RENDERTARGETGROUP_ID :
		{
			pSFX = g_SFXBank_RenderTargetGroup.New();
		}
		break;

		case SFX_EXPLOSION_ID :
		{
			pSFX = g_SFXBank_Explosion.New();
		}
		break;

		case SFX_VOLUMEBRUSH_ID :
		{
			pSFX = g_SFXBank_VolumeBrush.New();
		}
		break;

		case SFX_PICKUPITEM_ID :
		{
			pSFX = g_SFXBank_PickupItem.New();
		}
		break;

		case SFX_AIMMAGNET_ID :
		{
			pSFX = g_SFXBank_AimMagnet.New();
		}
		break;

		case SFX_NAVMARKER_ID :
		{
			pSFX = g_SFXBank_NavMarker.New();
		}
		break;

		case SFX_LADDER_ID :
		{
			pSFX = g_SFXBank_Ladder.New();
		}
		break;

		case SFX_SPECIALMOVE_ID :
		{
			pSFX = g_SFXBank_SpecialMove.New();
		}
		break;

		case SFX_FINISHINGMOVE_ID :
		{
			pSFX = g_SFXBank_FinishingMove.New();
		}
		break;

		case SFX_CHARACTER_ID :
		{
			pSFX = g_SFXBank_Character.New();
		}
		break;

		case SFX_DEBUGLINE_ID:
		{
			pSFX = g_SFXBank_DebugLine.New();
		}
		break;

		case SFX_SNOW_ID:
		{
			pSFX = g_SFXBank_Snow.New();
		}
		break;
 
		case SFX_JUMPVOLUME_ID:
		{
			pSFX = g_SFXBank_JumpVolume.New();
		}
		break;

		case SFX_DYNAMIC_SECTOR_ID:
		{
			pSFX = g_SFXBank_DynamicSectorVolume.New();
		}
		break;

		case SFX_SCATTER_ID:
		{
			pSFX = g_SFXBank_Scatter.New();
		}
		break;

		case SFX_TRIGGER_ID:
		{
			pSFX = g_SFXBank_Trigger.New();
		}
		break;

		case SFX_FORENSICOBJECT_ID :
		{
			pSFX = g_SFXBank_ForensicObject.New();
		}
		break;

		case SFX_TURRET_ID:
		{
			pSFX = g_SFXBank_Turret.New( );
		}
		break;

		case SFX_TEAMCLIENTFX_ID:
		{
			pSFX = g_SFXBank_TeamClientFx.New( );
		}
		break;

		case SFX_CTFFLAGBASE_ID:
		{
			LT_MEM_TRACK_ALLOC(pSFX = new CTFFlagBaseSFX, LT_MEM_TYPE_GAMECODE);
		}
		break;

		case SFX_CTFFLAG_ID:
		{
			LT_MEM_TRACK_ALLOC(pSFX = new CTFFlagSFX, LT_MEM_TYPE_GAMECODE);
		}
		break;

		case SFX_CONTROLPOINT_ID:
		{
			LT_MEM_TRACK_ALLOC(pSFX = new ControlPointSFX, LT_MEM_TYPE_GAMECODE);
		}
		break;

		case SFX_SOUND_NONPOINT_ID :
		{
			pSFX = g_SFXBank_SoundNonPoint.New();
		}
		break;

		case SFX_VOLUMETRICLIGHT_ID :
		{
			pSFX = g_SFXBank_VolumetricLight.New();
		}
		break;

		case SFX_ENTRYTOOLLOCK_ID :
		{
			pSFX = g_SFXBank_EntryToolLock.New();
		}
		break;

		case SFX_SCREENEFFECT_ID :
		{
			pSFX = g_SFXBank_ScreenEffect.New();
		}
		break;

		case SFX_ACTIVATEOBJECT_ID:
		{
			pSFX = g_SFXBank_ActivateObject.New();
		}
		break;

		case SFX_PHYSICS_CONSTRAINT_ID:
		{
			pSFX = g_SFXBank_PhysicsConstraintFX.New( );
		}
		break;

		case SFX_PHYSICS_COLLISION_SYSTEM_ID:
		{
			pSFX = g_SFXBank_PhysicsCollisionSystemFX.New( );
		}
		break;

		default :
            return NULL;
		break;
	}


	// Initialize the sfx, and add it to the appropriate array...

    if (!pSFX) return NULL;


	// First initialize with the create struct...

	if (psfxCreateStruct)
	{
		if (!pSFX->Init(psfxCreateStruct))
		{
			DeleteSFX(pSFX);
            return NULL;
		}
	}
	else if (pMsg)  // Initialize using the hMessage
	{
		if (!pSFX->Init(hServerObj, pMsg))
		{
			DeleteSFX(pSFX);
            return NULL;
		}
	}
	else
	{
		DeleteSFX(pSFX);
        return NULL;
	}

	if (!pSFX->CreateObject(g_pLTClient))
	{
		DeleteSFX(pSFX);
        return NULL;
	}

	if( !AddDynamicSpecialFX(pSFX, nId))
	{
		DeleteSFX( pSFX );
		return NULL;
	}

	return pSFX;
}
Exemple #9
0
CBaseFX* fxCreateCamWobble()
{
	return g_CamWobbleFX_Bank.New();
}
Exemple #10
0
CBaseFX* fxCreateCamJitter()
{
	return g_CamJitterFX_Bank.New();
}
Exemple #11
0
CBaseFX* fxCreateDynaLight()
{
	return g_DynaLightFX_Bank.New();
}
Exemple #12
0
CBaseFX* fxCreateLTBModel()
{
	return g_LTBModelFX_Bank.New();
}
Exemple #13
0
CBaseFX* fxCreateSprite()
{
	return g_SpriteFX_Bank.New();
}
Exemple #14
0
CBaseFX* fxCreateParticleSystem()
{
	return g_ParticleSystemFX_Bank.New();
}
Exemple #15
0
CBaseFX* fxCreateLightningFX()
{
	return g_LightningFX_Bank.New();
}
CAnimationContext* CAnimationMgr::CreateAnimationContext(HOBJECT hObject)
{
	CAnimationContext* pAnimationContext = s_bankCAnimationContext.New();
	pAnimationContext->Init(m_cAnimations, m_cTransitions);
	pAnimationContext->m_pAnimationMgr = this;
	pAnimationContext->m_hObject = hObject;

	for ( uint32 iAnimation = 0 ; iAnimation < m_cAnimations ; iAnimation++ )
	{
		pAnimationContext->m_aAnimationInstances[iAnimation].m_iIndex = iAnimation;
		HMODELANIM hAni = GetAnimationInstance(hObject, m_aAnimations[iAnimation].m_szName);
		pAnimationContext->m_aAnimationInstances[iAnimation].m_hAni = hAni;
		if ( INVALID_MODEL_ANIM == hAni )
		{
            //g_pLTServer->CPrint("Could not find animation: %s", m_aAnimations[iAnimation].m_szName);
		}

		// Check for pitched pair of ani

		char szNamePitched[128];

		HMODELANIM hAniPitchDown;
		sprintf(szNamePitched, "%s*d", m_aAnimations[iAnimation].m_szName);
		hAniPitchDown = GetAnimationInstance(hObject, szNamePitched);
		pAnimationContext->m_aAnimationInstances[iAnimation].m_hAniPitchDown = hAniPitchDown;

		HMODELANIM hAniPitchUp;
		sprintf(szNamePitched, "%s*u", m_aAnimations[iAnimation].m_szName);
		hAniPitchUp = GetAnimationInstance(hObject, szNamePitched);
		pAnimationContext->m_aAnimationInstances[iAnimation].m_hAniPitchUp = hAniPitchUp;

		pAnimationContext->m_aAnimationInstances[iAnimation].m_bPitched = (INVALID_MODEL_ANIM != hAniPitchDown && INVALID_MODEL_ANIM != hAniPitchUp);

		if ( pAnimationContext->m_aAnimationInstances[iAnimation].m_bPitched )
		{
//			g_pLTServer->CPrint("animation ''%s'' is pitched", m_aAnimations[iAnimation].GetName());
		}
	}

	for ( uint32 iTransition = 0 ; iTransition < m_cTransitions ; iTransition++ )
	{
		pAnimationContext->m_aTransitionInstances[iTransition].m_iIndex = iTransition;
		HMODELANIM hAni = GetAnimationInstance(hObject, m_aTransitions[iTransition].m_szName);
		pAnimationContext->m_aTransitionInstances[iTransition].m_hAni = hAni;
		if ( INVALID_MODEL_ANIM == hAni )
		{
            //g_pLTServer->CPrint("Could not find transition: %s", m_aTransitions[iTransition].m_szName);
		}
	}

	pAnimationContext->m_fPitchTarget = 0.5f;
	pAnimationContext->m_fPitch = 0.5f;

	if ( LT_OK != g_pModelLT->AddTracker(hObject, &pAnimationContext->m_trkPitchDown) )
		_ASSERT(LTFALSE);

	if ( LT_OK != g_pModelLT->AddTracker(hObject, &pAnimationContext->m_trkPitchUp) )
		_ASSERT(LTFALSE);

	for ( uint32 iPitchWeightset = 0 ; iPitchWeightset < CAnimationContext::kNumPitchWeightsets ; iPitchWeightset++ )
	{
		char szPitchWeightset[512];
		LTFLOAT fWeightsetAmount = 100.0f/(LTFLOAT)(CAnimationContext::kNumPitchWeightsets-1);
		sprintf(szPitchWeightset, "Morph%d", (int32)(iPitchWeightset*fWeightsetAmount));

		if ( LT_OK != g_pModelLT->FindWeightSet(hObject, szPitchWeightset, pAnimationContext->m_ahPitchWeightsets[iPitchWeightset]) )
		{
//			g_pLTServer->CPrint("could not find pitch weightset %s", szPitchWeightset);
		}
	}

	pAnimationContext->DisablePitch();

	return pAnimationContext;
}
Exemple #17
0
CBaseFX* fxCreateLTBBouncyChunk()
{
	return g_LTBBouncyChunkFX_Bank.New();
}