| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- /*
- ** Command & Conquer Renegade(tm)
- ** Copyright 2025 Electronic Arts Inc.
- **
- ** This program is free software: you can redistribute it and/or modify
- ** it under the terms of the GNU General Public License as published by
- ** the Free Software Foundation, either version 3 of the License, or
- ** (at your option) any later version.
- **
- ** This program is distributed in the hope that it will be useful,
- ** but WITHOUT ANY WARRANTY; without even the implied warranty of
- ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- ** GNU General Public License for more details.
- **
- ** You should have received a copy of the GNU General Public License
- ** along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
- /***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : Combat *
- * *
- * $Archive:: /Commando/Code/Combat/combatmaterialeffectmanager.cpp $*
- * *
- * Original Author:: Greg Hjelstrom *
- * *
- * $Author:: Greg_h $*
- * *
- * $Modtime:: 10/19/01 10:16a $*
- * *
- * $Revision:: 3 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
- #include "combatmaterialeffectmanager.h"
- #include "materialeffect.h"
- #include "transitioneffect.h"
- #include "assetmgr.h"
- #include "texture.h"
- #include "humanstate.h"
- const char * DEATH_TRANSITION_TEXTURE = "REN_death.tga";
- const char * SPAWN_TRANSITION_TEXTURE = "REN_spawn.tga";
- const char * HEALTH_TEXTURE = "REN_repair.tga";
- const char * ELECTROCUTION_TEXTURE = "REN_shock.tga";
- const float SPAWN_TRANSITION_TIME = 2.0f;
- TransitionEffectClass *
- CombatMaterialEffectManager::Get_Spawn_Effect(void)
- {
- TransitionEffectClass * effect = NEW_REF(TransitionEffectClass,());
- effect->Set_Parameter(1.0f);
- effect->Set_Target_Parameter(0.0f);
- effect->Set_Transition_Time(SPAWN_TRANSITION_TIME);
- effect->Enable_Remove_On_Complete(true);
- effect->Set_Max_Intensity(0.25f);
- TextureClass * tex = WW3DAssetManager::Get_Instance()->Get_Texture(SPAWN_TRANSITION_TEXTURE);
- effect->Set_Texture(tex);
- REF_PTR_RELEASE(tex);
- return effect;
- }
- TransitionEffectClass *
- CombatMaterialEffectManager::Get_Death_Effect(void)
- {
- TransitionEffectClass * effect = NEW_REF(TransitionEffectClass,());
- effect->Set_Parameter(0.0f);
- effect->Set_Target_Parameter(1.0f);
- effect->Set_Start_Delay(0.75f * CORPSE_PERSIST_TIME);
- effect->Set_Transition_Time(0.25f * CORPSE_PERSIST_TIME);
- effect->Set_Max_Intensity(0.5f);
- effect->Set_Max_UV_Velocity(Vector2(3.75f,-6.0f));
- TextureClass * tex = WW3DAssetManager::Get_Instance()->Get_Texture(DEATH_TRANSITION_TEXTURE);
- effect->Set_Texture(tex);
- REF_PTR_RELEASE(tex);
-
- return effect;
- }
- TransitionEffectClass *
- CombatMaterialEffectManager::Get_Health_Effect(void)
- {
- TransitionEffectClass * effect = NEW_REF(TransitionEffectClass,());
- effect->Set_Parameter(0.0f);
- effect->Set_Target_Parameter(0.49f);
- effect->Set_Transition_Time(1.0f);
- effect->Set_Max_Intensity(0.5f);
- effect->Set_Min_UV_Velocity(Vector2(0.0f,-3.0f));
- effect->Set_Max_UV_Velocity(Vector2(0.0f,-3.0f));
- TextureClass * tex = WW3DAssetManager::Get_Instance()->Get_Texture(HEALTH_TEXTURE);
- effect->Set_Texture(tex);
- REF_PTR_RELEASE(tex);
- return effect;
- }
- TransitionEffectClass *
- CombatMaterialEffectManager::Get_Electrocution_Effect(void)
- {
- TransitionEffectClass * effect = NEW_REF(TransitionEffectClass,());
- effect->Set_Parameter(0.0f);
- effect->Set_Target_Parameter(0.49f);
- effect->Set_Transition_Time(1.0f);
- effect->Set_Max_Intensity(0.5f);
- effect->Set_Min_UV_Velocity(Vector2(0.0f,-3.0f));
- effect->Set_Max_UV_Velocity(Vector2(0.0f,-3.0f));
- TextureClass * tex = WW3DAssetManager::Get_Instance()->Get_Texture(ELECTROCUTION_TEXTURE);
- effect->Set_Texture(tex);
- REF_PTR_RELEASE(tex);
- return effect;
- }
|