Main Page | Alphabetical List | Compound List | File List | Compound Members | File Members

Fx.c File Reference

#include <Windows.h>
#include <Assert.h>
#include "Genesis.h"
#include "Errorlog.h"
#include "Ram.h"
#include "Fx.h"
#include "..\\Procedurals\gebmutil.h"

Go to the source code of this file.

Defines

#define POLY_FLAGS   (GE_RENDER_DEPTH_SORT_BF)

Functions

geBoolean ControlParticleAnim (Fx_System *Fx, Fx_TempPlayer *Player, float Time)
geBoolean StartupSmokeTrail (Fx_System *Fx, Fx_Player *Player)
geBoolean ShutdownSmokeTrail (Fx_System *Fx, Fx_Player *Player)
geBoolean LoadFxTextures (Fx_System *Fx)
geBoolean FreeFxTextures (Fx_System *Fx)
geBoolean ControlExplode1Anim (Fx_System *Fx, Fx_TempPlayer *Player, float Time)
geBoolean ControlExplode2Anim (Fx_System *Fx, Fx_TempPlayer *Player, float Time)
geBoolean ControlParticleTrail (Fx_System *Fx, Fx_Player *Player, float Time)
geBoolean ControlSmokeTrail (Fx_System *Fx, Fx_Player *Player, float Time)
geBoolean ControlShredderFx (Fx_System *Fx, Fx_Player *Player, float Time)
Fx_SystemFx_SystemCreate (geWorld *World, Console_Console *Console)
void Fx_SystemDestroy (Fx_System *Fx)
geBoolean Fx_SystemFrame (Fx_System *Fx, float Time)
geBoolean Fx_SpawnFx (Fx_System *Fx, geVec3d *Pos, uint8 Type)
Fx_TempPlayerFx_SystemAddTempPlayer (Fx_System *Fx)
void Fx_SystemRemoveTempPlayer (Fx_System *Fx, Fx_TempPlayer *Player)
geBoolean Fx_PlayerSetFxFlags (Fx_System *Fx, Fx_Player *Player, uint16 FxFlags)
geBoolean Fx_PlayerFrame (Fx_System *Fx, Fx_Player *Player, const geXForm3d *XForm, float Time)
geBoolean ControlSmokeAnim (Fx_System *Fx, Fx_TempPlayer *Player, float Time)
geBoolean ControlShredderAnim (Fx_System *Fx, Fx_TempPlayer *Player, float Time)

Variables

geFloat EffectScale
char SmokeBitmapNames [NUM_SMOKE_TEXTURES][32]
char SmokeBitmapANames [NUM_SMOKE_TEXTURES][32]
char ExplodeBitmapNames [NUM_EXPLODE_TEXTURES][32]
char ExplodeBitmapANames [NUM_EXPLODE_TEXTURES][32]
char ParticleBitmapNames [NUM_PARTICLE_TEXTURES][32]
char ParticleBitmapANames [NUM_PARTICLE_TEXTURES][32]
geVFileMainFS


Define Documentation

#define POLY_FLAGS   (GE_RENDER_DEPTH_SORT_BF)
 

Definition at line 28 of file Fx.c.

Referenced by ControlExplode1Anim(), ControlExplode2Anim(), ControlParticleAnim(), ControlShredderAnim(), and ControlSmokeAnim().


Function Documentation

geBoolean ControlExplode1Anim Fx_System Fx,
Fx_TempPlayer Player,
float  Time
[static]
 

Definition at line 326 of file Fx.c.

References GE_LVertex::a, GE_LVertex::b, EffectScale, Fx_System::ExplodeBitmaps, Fx_SystemRemoveTempPlayer(), GE_LVertex::g, GE_RENDER_DEPTH_SORT_BF, GE_TEXTURED_POINT, GE_TRUE, geBoolean, geWorld_AddPolyOnce(), int32, NUM_EXPLODE_TEXTURES, POLY_FLAGS, Fx_TempPlayer::Pos, GE_LVertex::r, Fx_TempPlayer::Time, GE_LVertex::u, GE_LVertex::v, Fx_System::World, geVec3d::X, GE_LVertex::X, geVec3d::Y, GE_LVertex::Y, geVec3d::Z, and GE_LVertex::Z.

Referenced by Fx_SpawnFx().

00327 {
00328         GE_LVertex              Vert;
00329         int32                   Frame;
00330 
00331         Player->Time += Time;
00332 
00333         Vert.X = Player->Pos.X;
00334         Vert.Y = Player->Pos.Y;
00335         Vert.Z = Player->Pos.Z;
00336         Vert.r = Vert.g = Vert.b = Vert.a = 255.0f;
00337         Vert.u = Vert.v = 0.0f;
00338 
00339         Frame = (int32)(Player->Time*20.0f);
00340 
00341         if (Frame >= NUM_EXPLODE_TEXTURES)
00342         {
00343                 // Make sure we draw the last frame...
00344                 Frame = NUM_EXPLODE_TEXTURES-1;
00345                 geWorld_AddPolyOnce(Fx->World, &Vert, 1, Fx->ExplodeBitmaps[Frame], GE_TEXTURED_POINT, GE_RENDER_DEPTH_SORT_BF, 10.0f * EffectScale);
00346                 Fx_SystemRemoveTempPlayer(Fx, Player);          // Smoke is done...
00347         }
00348         else
00349                 geWorld_AddPolyOnce(Fx->World, &Vert, 1, Fx->ExplodeBitmaps[Frame], GE_TEXTURED_POINT, POLY_FLAGS, 10.0f * EffectScale);
00350 
00351         return GE_TRUE;
00352 }

geBoolean ControlExplode2Anim Fx_System Fx,
Fx_TempPlayer Player,
float  Time
[static]
 

Definition at line 357 of file Fx.c.

References GE_LVertex::a, GE_LVertex::b, EffectScale, Fx_SystemRemoveTempPlayer(), GE_LVertex::g, GE_TEXTURED_POINT, GE_TRUE, geBoolean, geWorld_AddPolyOnce(), int32, NUM_PARTICLE_TEXTURES, Fx_System::ParticleBitmaps, POLY_FLAGS, Fx_TempPlayer::Pos, GE_LVertex::r, Fx_TempPlayer::Time, GE_LVertex::u, GE_LVertex::v, Fx_System::World, geVec3d::X, GE_LVertex::X, geVec3d::Y, GE_LVertex::Y, geVec3d::Z, and GE_LVertex::Z.

Referenced by Fx_SpawnFx().

00358 {
00359         GE_LVertex              Vert;
00360         int32                   Frame;
00361 
00362         Player->Time += Time;
00363 
00364         Vert.X = Player->Pos.X;
00365         Vert.Y = Player->Pos.Y;
00366         Vert.Z = Player->Pos.Z;
00367         Vert.r = Vert.g = 255.0f;
00368         Vert.b = 100.0f;
00369         Vert.a = 255.0f;
00370         Vert.u = Vert.v = 0.0f;
00371 
00372         Frame = (int32)(Player->Time*20.0f);
00373 
00374         if (Frame >= NUM_PARTICLE_TEXTURES)
00375         {
00376                 // Make sure we draw the last frame...
00377                 Frame = NUM_PARTICLE_TEXTURES-1;
00378                 geWorld_AddPolyOnce(Fx->World, &Vert, 1, Fx->ParticleBitmaps[Frame], GE_TEXTURED_POINT, POLY_FLAGS, 8.0f * EffectScale);
00379                 Fx_SystemRemoveTempPlayer(Fx, Player);          // Smoke is done...
00380         }
00381         else
00382                 geWorld_AddPolyOnce(Fx->World, &Vert, 1, Fx->ParticleBitmaps[Frame], GE_TEXTURED_POINT, POLY_FLAGS, 8.0f * EffectScale);
00383 
00384         return GE_TRUE;
00385 }

geBoolean ControlParticleAnim Fx_System Fx,
Fx_TempPlayer Player,
float  Time
[static]
 

Definition at line 515 of file Fx.c.

References GE_LVertex::a, GE_LVertex::b, EffectScale, Fx_SystemRemoveTempPlayer(), GE_LVertex::g, GE_TEXTURED_POINT, GE_TRUE, geBoolean, geWorld_AddPolyOnce(), int32, NUM_PARTICLE_TEXTURES, Fx_System::ParticleBitmaps, POLY_FLAGS, Fx_TempPlayer::Pos, GE_LVertex::r, Fx_TempPlayer::Time, GE_LVertex::u, GE_LVertex::v, Fx_System::World, geVec3d::X, GE_LVertex::X, geVec3d::Y, GE_LVertex::Y, geVec3d::Z, and GE_LVertex::Z.

Referenced by ControlParticleTrail().

00516 {
00517         GE_LVertex              Vert;
00518         int32                   Frame;
00519 
00520         Player->Time += Time;
00521 
00522         Vert.X = Player->Pos.X;
00523         Vert.Y = Player->Pos.Y;
00524         Vert.Z = Player->Pos.Z;
00525         Vert.r = Vert.g = Vert.b = Vert.a = 255.0f;
00526         Vert.u = Vert.v = 0.0f;
00527 
00528         Frame = (int32)(Player->Time*20.0f);
00529 
00530         if (Frame >= NUM_PARTICLE_TEXTURES)
00531         {
00532                 // Make sure we draw the last frame...
00533                 Frame = NUM_PARTICLE_TEXTURES-1;
00534                 geWorld_AddPolyOnce(Fx->World, &Vert, 1, Fx->ParticleBitmaps[Frame], GE_TEXTURED_POINT, POLY_FLAGS, 2.3f * EffectScale);
00535                 Fx_SystemRemoveTempPlayer(Fx, Player);          // Smoke is done...
00536         }
00537         else
00538                 geWorld_AddPolyOnce(Fx->World, &Vert, 1, Fx->ParticleBitmaps[Frame], GE_TEXTURED_POINT, POLY_FLAGS, 2.3f * EffectScale);
00539 
00540         return GE_TRUE;
00541 }

geBoolean ControlParticleTrail Fx_System Fx,
Fx_Player Player,
float  Time
[static]
 

Definition at line 546 of file Fx.c.

References Fx_TempPlayer::Control, ControlParticleAnim(), Fx_SystemAddTempPlayer(), GE_TRUE, geBoolean, Fx_TempPlayer::Pos, Fx_TempPlayer::Time, Fx_Player::Time, geXForm3d::Translation, and Fx_Player::XForm.

Referenced by Fx_PlayerFrame().

00547 {
00548         Fx_TempPlayer   *TempPlayer;
00549 
00550         Player->Time += Time;
00551 
00552         if (Player->Time >= 0.04f)
00553         {
00554                 TempPlayer = Fx_SystemAddTempPlayer(Fx);
00555 
00556                 if (!TempPlayer)
00557                         return GE_TRUE;         // Oh well, they just won't see any smoke...
00558 
00559                 TempPlayer->Control = ControlParticleAnim;
00560                 TempPlayer->Pos = Player->XForm.Translation;
00561                 TempPlayer->Time = 0.0f;
00562 
00563                 Player->Time = 0.0f;
00564         }
00565 
00566         return GE_TRUE;
00567 }

geBoolean ControlShredderAnim Fx_System Fx,
Fx_TempPlayer Player,
float  Time
[static]
 

Definition at line 629 of file Fx.c.

References GE_LVertex::a, GE_LVertex::b, EffectScale, Fx_SystemRemoveTempPlayer(), GE_LVertex::g, GE_TEXTURED_POINT, GE_TRUE, geBoolean, geWorld_AddPolyOnce(), int32, NUM_SMOKE_TEXTURES, POLY_FLAGS, Fx_TempPlayer::Pos, GE_LVertex::r, Fx_System::SmokeBitmaps, Fx_TempPlayer::Time, GE_LVertex::u, GE_LVertex::v, Fx_System::World, geVec3d::X, GE_LVertex::X, geVec3d::Y, GE_LVertex::Y, geVec3d::Z, and GE_LVertex::Z.

Referenced by ControlShredderFx().

00630 {
00631         GE_LVertex              Vert;
00632         int32                   Frame;
00633 
00634         Player->Time += Time;
00635 
00636         Vert.X = Player->Pos.X;
00637         Vert.Y = Player->Pos.Y;
00638         Vert.Z = Player->Pos.Z;
00639         Vert.r = Vert.g = Vert.b = Vert.a = 255.0f;
00640         Vert.u = Vert.v = 0.0f;
00641 
00642         Frame = (int32)(Player->Time*20.0f);
00643 
00644         if (Frame >= NUM_SMOKE_TEXTURES)
00645         {
00646                 // Make sure we draw the last frame...
00647                 Frame = NUM_SMOKE_TEXTURES-1;
00648                 geWorld_AddPolyOnce(Fx->World, &Vert, 1, Fx->SmokeBitmaps[Frame], GE_TEXTURED_POINT, POLY_FLAGS, 0.6f * EffectScale);   // 2,6
00649                 Fx_SystemRemoveTempPlayer(Fx, Player);          // Smoke is done...
00650         }
00651         else
00652                 geWorld_AddPolyOnce(Fx->World, &Vert, 1, Fx->SmokeBitmaps[Frame], GE_TEXTURED_POINT, POLY_FLAGS, 0.6f * EffectScale);
00653 
00654         return GE_TRUE;
00655 }

geBoolean ControlShredderFx Fx_System Fx,
Fx_Player Player,
float  Time
[static]
 

Definition at line 660 of file Fx.c.

References Fx_TempPlayer::Control, ControlShredderAnim(), Fx_SystemAddTempPlayer(), GE_COLLIDE_ACTORS, GE_COLLIDE_MODELS, GE_CONTENTS_CANNOT_OCCUPY, GE_TRUE, geBoolean, geVec3d_AddScaled(), geWorld_Collision(), geXForm3d_GetIn(), GE_Collision::Impact, NULL, Fx_TempPlayer::Pos, Fx_TempPlayer::Time, Fx_Player::Time, geXForm3d::Translation, Fx_System::World, geVec3d::X, Fx_Player::XForm, geVec3d::Y, and geVec3d::Z.

Referenced by Fx_PlayerFrame().

00661 {
00662         assert(Fx);
00663         assert(Player);
00664 
00665         Player->Time += Time;
00666 
00667         if (Player->Time >= 0.03f)
00668         {
00669                 Fx_TempPlayer   *TempPlayer;
00670                 GE_Collision    Collision;
00671                 geVec3d                 Front, Back, In;
00672                 geVec3d                 Mins = {-1.0f, -1.0f, -1.0f};
00673                 geVec3d                 Maxs = { 1.0f,  1.0f,  1.0f};
00674 
00675                 TempPlayer = Fx_SystemAddTempPlayer(Fx);
00676 
00677                 if (!TempPlayer)
00678                         return GE_TRUE;         // Oh well...
00679 
00680                 TempPlayer->Control = ControlShredderAnim;
00681                 TempPlayer->Time = 0.0f;
00682 
00683                 Front = Player->XForm.Translation;
00684 
00685                 geXForm3d_GetIn(&Player->XForm, &In);
00686                 geVec3d_AddScaled(&Front, &In, 10000.0f, &Back);
00687                 
00688                 if (geWorld_Collision(Fx->World, NULL, NULL, &Front, &Back, GE_CONTENTS_CANNOT_OCCUPY, GE_COLLIDE_ACTORS | GE_COLLIDE_MODELS, 0xffffffff, NULL, NULL, &Collision))
00689                 {
00690                         // Move it back a little from the wall
00691                         geVec3d_AddScaled(&Collision.Impact, &In, -50.0f, &Collision.Impact);
00692                         
00693                         // Randomize the impact point
00694                         Collision.Impact.X += (float)(rand()%15);
00695                         Collision.Impact.Y += (float)(rand()%15);
00696                         Collision.Impact.Z += (float)(rand()%15);
00697 
00698                         TempPlayer->Pos = Collision.Impact;
00699                 }
00700                 else
00701                         TempPlayer->Pos = Player->XForm.Translation;
00702 
00703                 Player->Time = 0.0f;
00704         }
00705         return GE_TRUE;
00706 }

geBoolean ControlSmokeAnim Fx_System Fx,
Fx_TempPlayer Player,
float  Time
[static]
 

Definition at line 572 of file Fx.c.

References GE_LVertex::a, GE_LVertex::b, EffectScale, Fx_SystemRemoveTempPlayer(), GE_LVertex::g, GE_TEXTURED_POINT, GE_TRUE, geBoolean, geWorld_AddPolyOnce(), int32, NUM_SMOKE_TEXTURES, POLY_FLAGS, Fx_TempPlayer::Pos, GE_LVertex::r, Fx_System::SmokeBitmaps, Fx_TempPlayer::Time, GE_LVertex::u, GE_LVertex::v, Fx_System::World, geVec3d::X, GE_LVertex::X, geVec3d::Y, GE_LVertex::Y, geVec3d::Z, and GE_LVertex::Z.

Referenced by ControlSmokeTrail().

00573 {
00574         GE_LVertex              Vert;
00575         int32                   Frame;
00576 
00577         Player->Time += Time + ((float)(rand()%1000) * (1.0f/1000.0f)* 0.1f);
00578 
00579         Vert.X = Player->Pos.X;
00580         Vert.Y = Player->Pos.Y;
00581         Vert.Z = Player->Pos.Z;
00582         Vert.r = Vert.g = Vert.b = Vert.a = 255.0f;
00583         Vert.u = Vert.v = 0.0f;
00584 
00585         Frame = (int32)(Player->Time*15.0f);
00586 
00587         if (Frame >= NUM_SMOKE_TEXTURES)
00588         {
00589                 // Make sure we draw the last frame...
00590                 Frame = NUM_SMOKE_TEXTURES-1;
00591                 geWorld_AddPolyOnce(Fx->World, &Vert, 1, Fx->SmokeBitmaps[Frame], GE_TEXTURED_POINT, POLY_FLAGS, 2.6f * EffectScale);   // 2,6
00592                 Fx_SystemRemoveTempPlayer(Fx, Player);          // Smoke is done...
00593         }
00594         else
00595                 geWorld_AddPolyOnce(Fx->World, &Vert, 1, Fx->SmokeBitmaps[Frame], GE_TEXTURED_POINT, POLY_FLAGS, 2.6f * EffectScale);
00596 
00597         return GE_TRUE;
00598 }

geBoolean ControlSmokeTrail Fx_System Fx,
Fx_Player Player,
float  Time
[static]
 

Definition at line 603 of file Fx.c.

References Fx_TempPlayer::Control, ControlSmokeAnim(), Fx_SystemAddTempPlayer(), GE_TRUE, geBoolean, Fx_TempPlayer::Pos, Fx_TempPlayer::Time, Fx_Player::Time, geXForm3d::Translation, and Fx_Player::XForm.

Referenced by Fx_PlayerFrame().

00604 {
00605         Fx_TempPlayer   *TempPlayer;
00606 
00607         Player->Time += Time;
00608 
00609         if (Player->Time >= 0.04f)
00610         {
00611                 TempPlayer = Fx_SystemAddTempPlayer(Fx);
00612 
00613                 if (!TempPlayer)
00614                         return GE_TRUE;         // Oh well, they just won't see any smoke...
00615 
00616                 TempPlayer->Control = ControlSmokeAnim;
00617                 TempPlayer->Pos = Player->XForm.Translation;
00618                 TempPlayer->Time = 0.0f;
00619 
00620                 Player->Time = 0.0f;
00621         }
00622 
00623         return GE_TRUE;
00624 }

geBoolean FreeFxTextures Fx_System Fx  )  [static]
 

Definition at line 468 of file Fx.c.

References Fx_System::ExplodeBitmaps, GE_TRUE, geBitmap_Destroy(), geBoolean, geWorld_RemoveBitmap(), int32, NULL, NUM_EXPLODE_TEXTURES, NUM_PARTICLE_TEXTURES, NUM_SMOKE_TEXTURES, Fx_System::ParticleBitmaps, Fx_System::SmokeBitmaps, and Fx_System::World.

Referenced by Fx_SystemDestroy(), and LoadFxTextures().

00469 {
00470         int32           i;
00471 
00472         assert(Fx);
00473         assert(Fx->World);
00474                 
00475         for (i=0; i< NUM_SMOKE_TEXTURES; i++)
00476         {
00477                 if (Fx->SmokeBitmaps[i])
00478                 {
00479                         geWorld_RemoveBitmap(Fx->World, Fx->SmokeBitmaps[i]);
00480                         geBitmap_Destroy(&Fx->SmokeBitmaps[i]);
00481                         Fx->SmokeBitmaps[i] = NULL;
00482                 }
00483         }
00484 
00485         for (i=0; i< NUM_PARTICLE_TEXTURES; i++)
00486         {
00487                 if (Fx->ParticleBitmaps[i])
00488                 {
00489                         geWorld_RemoveBitmap(Fx->World, Fx->ParticleBitmaps[i]);
00490                         geBitmap_Destroy(&Fx->ParticleBitmaps[i]);
00491                         Fx->ParticleBitmaps[i] = NULL;
00492                 }
00493         }
00494 
00495         for (i=0; i< NUM_EXPLODE_TEXTURES; i++)
00496         {
00497                 if (Fx->ExplodeBitmaps[i])
00498                 {
00499                         geWorld_RemoveBitmap(Fx->World, Fx->ExplodeBitmaps[i]);
00500                         geBitmap_Destroy(&Fx->ExplodeBitmaps[i]);
00501                         Fx->ExplodeBitmaps[i] = NULL;
00502                 }
00503         }
00504 
00505         return GE_TRUE;
00506 }

geBoolean Fx_PlayerFrame Fx_System Fx,
Fx_Player Player,
const geXForm3d XForm,
float  Time
 

Definition at line 287 of file Fx.c.

References ControlParticleTrail(), ControlShredderFx(), ControlSmokeTrail(), FX_PARTICLE_TRAIL, FX_SHREDDER, FX_SMOKE_TRAIL, Fx_Player::FxFlags, GE_TRUE, geBoolean, and Fx_Player::XForm.

Referenced by Client_UpdateSinglePlayer().

00288 {
00289         Player->XForm = *XForm;
00290 
00291         if (Player->FxFlags & FX_SMOKE_TRAIL)
00292                 ControlSmokeTrail(Fx, Player, Time);
00293 
00294         if (Player->FxFlags & FX_PARTICLE_TRAIL)
00295                 ControlParticleTrail(Fx, Player, Time);
00296 
00297         if (Player->FxFlags & FX_SHREDDER)
00298                 ControlShredderFx(Fx, Player, Time);
00299 
00300         return GE_TRUE;
00301 }

geBoolean Fx_PlayerSetFxFlags Fx_System Fx,
Fx_Player Player,
uint16  FxFlags
 

Definition at line 267 of file Fx.c.

References FX_SMOKE_TRAIL, Fx_Player::FxFlags, GE_TRUE, geBoolean, ShutdownSmokeTrail(), and StartupSmokeTrail().

Referenced by Client_DestroyPlayer(), Client_ParsePlayerData(), ControlTempPlayers(), and UpdatePlayers().

00268 {
00269         if (FxFlags == Player->FxFlags)
00270                 return GE_TRUE;         // Nothing to change...
00271 
00272         //Console_Printf(Fx->Console, "Flags changed.\n");
00273 
00274         if ((Player->FxFlags & FX_SMOKE_TRAIL) && !(FxFlags & FX_SMOKE_TRAIL))
00275                 ShutdownSmokeTrail(Fx, Player);
00276         else if (!(Player->FxFlags & FX_SMOKE_TRAIL) && (FxFlags & FX_SMOKE_TRAIL))
00277                 StartupSmokeTrail(Fx, Player);
00278 
00279         Player->FxFlags = FxFlags;                              // The flags are now current
00280 
00281         return GE_TRUE;
00282 }

geBoolean Fx_SpawnFx Fx_System Fx,
geVec3d Pos,
uint8  Type
 

Definition at line 189 of file Fx.c.

References Fx_TempPlayer::Control, ControlExplode1Anim(), ControlExplode2Anim(), FX_EXPLODE1, FX_EXPLODE2, Fx_SystemAddTempPlayer(), GE_FALSE, GE_TRUE, geBoolean, Fx_TempPlayer::Pos, and Fx_TempPlayer::Time.

Referenced by ReadServerMessages().

00190 {
00191         Fx_TempPlayer   *TempPlayer;
00192 
00193         TempPlayer = Fx_SystemAddTempPlayer(Fx);
00194 
00195         if (!TempPlayer)
00196                 return GE_TRUE;         // Oh well, they just won't see any smoke...
00197 
00198         TempPlayer->Pos = *Pos;
00199         TempPlayer->Time = 0.0f;
00200 
00201         switch(Type)
00202         {
00203                 case FX_EXPLODE1:
00204                         TempPlayer->Control = ControlExplode1Anim;
00205                         break;
00206 
00207                 case FX_EXPLODE2:
00208                         TempPlayer->Control = ControlExplode2Anim;
00209                         break;
00210 
00211                 default:
00212                         return GE_FALSE;
00213         }
00214 
00215         return GE_TRUE;
00216 }

Fx_TempPlayer* Fx_SystemAddTempPlayer Fx_System Fx  ) 
 

Definition at line 221 of file Fx.c.

References Fx_TempPlayer::Active, Fx_System::CurrentTempPlayer, FX_MAX_TEMP_PLAYERS, GE_TRUE, int32, NULL, and Fx_System::TempPlayers.

Referenced by ControlParticleTrail(), ControlShredderFx(), ControlSmokeTrail(), and Fx_SpawnFx().

00222 {
00223         Fx_TempPlayer   *Player, *End;
00224         int32                   i;
00225 
00226 
00227         Player = Fx->CurrentTempPlayer;
00228 
00229         if (!Player)
00230                 Player = Fx->TempPlayers;
00231 
00232         End = &Fx->TempPlayers[FX_MAX_TEMP_PLAYERS-1];
00233         
00234         for (i=0; i< FX_MAX_TEMP_PLAYERS; i++)
00235         {
00236                 if (!Player->Active)            // Look for a non active player
00237                 {
00238                         Fx->CurrentTempPlayer = Player;
00239 
00240                         memset(Player, 0, sizeof(Fx_TempPlayer));
00241                         Player->Active = GE_TRUE;
00242                         return Player;
00243                 }
00244 
00245                 Player++;
00246 
00247                 if (Player >= End)              // Wrap player at end of structure to beginning
00248                         Player = Fx->TempPlayers;
00249         }
00250 
00251 return NULL;
00252 }

Fx_System* Fx_SystemCreate geWorld World,
Console_Console Console
 

Definition at line 117 of file Fx.c.

References Fx_System::Console, Fx_SystemDestroy(), GE_RAM_ALLOCATE_STRUCT, LoadFxTextures(), NULL, and Fx_System::World.

Referenced by GameMgr_SetWorld().

00118 {
00119         Fx_System       *Fx;
00120 
00121         assert(World);
00122         //assert(Console);
00123 
00124         Fx = GE_RAM_ALLOCATE_STRUCT(Fx_System);
00125 
00126         if (!Fx)
00127                 return NULL;
00128 
00129         memset(Fx, 0, sizeof(Fx_System));
00130 
00131         Fx->World = World;
00132         Fx->Console = Console;
00133 
00134         if (!LoadFxTextures(Fx))
00135         {
00136                 Fx_SystemDestroy(Fx);
00137                 return NULL;
00138         }
00139 
00140         return Fx;
00141 }

void Fx_SystemDestroy Fx_System Fx  ) 
 

Definition at line 146 of file Fx.c.

References FreeFxTextures(), GE_TRUE, geBoolean, and geRam_Free.

Referenced by Fx_SystemCreate(), GameMgr_FreeAllObjects(), and GameMgr_FreeWorld().

00147 {
00148         geBoolean               Ret;
00149 
00150         assert(Fx);
00151 
00152         Ret = FreeFxTextures(Fx);
00153 
00154         assert(Ret == GE_TRUE);
00155 
00156         geRam_Free(Fx);
00157 }

geBoolean Fx_SystemFrame Fx_System Fx,
float  Time
 

Definition at line 162 of file Fx.c.

References Fx_TempPlayer::Active, Fx_TempPlayer::Control, FX_MAX_TEMP_PLAYERS, GE_FALSE, GE_TRUE, geBoolean, int32, and Fx_System::TempPlayers.

Referenced by GameMgr_Frame().

00163 {
00164         Fx_TempPlayer   *Player;
00165         int32                   i;
00166 
00167         // Control the temp players
00168         Player = Fx->TempPlayers;
00169         
00170         for (i=0; i< FX_MAX_TEMP_PLAYERS; i++, Player++)
00171         {
00172                 if (!Player->Active)
00173                         continue;
00174 
00175                 if (!Player->Control)
00176                         continue;
00177 
00178                 // Call the players control routine...
00179                 if (!Player->Control(Fx, Player, Time))
00180                         return GE_FALSE;
00181         }
00182 
00183         return GE_TRUE;
00184 }

void Fx_SystemRemoveTempPlayer Fx_System Fx,
Fx_TempPlayer Player
 

Definition at line 257 of file Fx.c.

References Fx_TempPlayer::Active, Fx_System::CurrentTempPlayer, and GE_FALSE.

Referenced by ControlExplode1Anim(), ControlExplode2Anim(), ControlParticleAnim(), ControlShredderAnim(), and ControlSmokeAnim().

00258 {
00259         Player->Active = GE_FALSE;
00260 
00261         Fx->CurrentTempPlayer = Player;         // Easy steal for any one who wants to create a temp player
00262 }

geBoolean LoadFxTextures Fx_System Fx  )  [static]
 

Definition at line 391 of file Fx.c.

References ExplodeBitmapANames, ExplodeBitmapNames, Fx_System::ExplodeBitmaps, FreeFxTextures(), GE_FALSE, GE_TRUE, geBitmapUtil_CreateFromFileAndAlphaNames(), geBoolean, geErrorLog_AddString, geWorld_AddBitmap(), int32, MainFS, NULL, NUM_EXPLODE_TEXTURES, NUM_PARTICLE_TEXTURES, NUM_SMOKE_TEXTURES, ParticleBitmapANames, ParticleBitmapNames, Fx_System::ParticleBitmaps, SmokeBitmapANames, SmokeBitmapNames, Fx_System::SmokeBitmaps, and Fx_System::World.

Referenced by Fx_SystemCreate().

00392 {
00393         int32           i;
00394 
00395         assert(Fx);
00396         assert(Fx->World);
00397 
00398         for (i=0; i< NUM_SMOKE_TEXTURES; i++)
00399         {
00400                 Fx->SmokeBitmaps[i] = geBitmapUtil_CreateFromFileAndAlphaNames(MainFS, SmokeBitmapNames[i], SmokeBitmapANames[i]);
00401 
00402                 if (!Fx->SmokeBitmaps[i])
00403                 {
00404                         char    Str[1024];
00405                         sprintf(Str, "%s, %s", SmokeBitmapNames[i], SmokeBitmapANames[i]);
00406                         geErrorLog_AddString(-1, "Fx_LoadFxTextures:  geBitmapUtil_CreateFromFileAndAlphaNames failed:", Str);
00407                         goto ExitWithError;
00408                 }
00409 
00410                 if (!geWorld_AddBitmap(Fx->World, Fx->SmokeBitmaps[i]))
00411                 {
00412                         geErrorLog_AddString(-1, "Fx_LoadFxTextures: geWorld_AddBItmap failed.", NULL);
00413                         goto ExitWithError;
00414                 }
00415         }
00416 
00417         for (i=0; i< NUM_PARTICLE_TEXTURES; i++)
00418         {
00419                 Fx->ParticleBitmaps[i] = geBitmapUtil_CreateFromFileAndAlphaNames(MainFS, ParticleBitmapNames[i], ParticleBitmapANames[i]);
00420 
00421                 if (!Fx->ParticleBitmaps[i])
00422                 {
00423                         char    Str[1024];
00424                         sprintf(Str, "%s, %s", ParticleBitmapNames[i], ParticleBitmapANames[i]);
00425                         geErrorLog_AddString(-1, "Fx_LoadFxTextures:  geBitmapUtil_CreateFromFileAndAlphaNames failed:", Str);
00426                         goto ExitWithError;
00427                 }
00428 
00429                 if (!geWorld_AddBitmap(Fx->World, Fx->ParticleBitmaps[i]))
00430                 {
00431                         geErrorLog_AddString(-1, "Fx_LoadFxTextures: geWorld_AddBItmap failed.", NULL);
00432                         goto ExitWithError;
00433                 }
00434         }
00435 
00436         for (i=0; i< NUM_EXPLODE_TEXTURES; i++)
00437         {
00438                 Fx->ExplodeBitmaps[i] = geBitmapUtil_CreateFromFileAndAlphaNames(MainFS, ExplodeBitmapNames[i], ExplodeBitmapANames[i]);
00439 
00440                 if (!Fx->ExplodeBitmaps[i])
00441                 {
00442                         char    Str[1024];
00443                         sprintf(Str, "%s, %s", ExplodeBitmapNames[i], ExplodeBitmapANames[i]);
00444                         geErrorLog_AddString(-1, "Fx_LoadFxTextures:  geBitmapUtil_CreateFromFileAndAlphaNames failed:", Str);
00445                         goto ExitWithError;
00446                 }
00447 
00448                 if (!geWorld_AddBitmap(Fx->World, Fx->ExplodeBitmaps[i]))
00449                 {
00450                         geErrorLog_AddString(-1, "Fx_LoadFxTextures: geWorld_AddBItmap failed.", NULL);
00451                         goto ExitWithError;
00452                 }
00453         }
00454 
00455         return GE_TRUE;
00456 
00457         ExitWithError:
00458         {
00459                 FreeFxTextures(Fx);
00460 
00461                 return GE_FALSE;
00462         }
00463 }

geBoolean ShutdownSmokeTrail Fx_System Fx,
Fx_Player Player
[static]
 

Definition at line 316 of file Fx.c.

References GE_TRUE, and geBoolean.

Referenced by Fx_PlayerSetFxFlags().

00317 {
00318         //Console_Printf(Fx->Console, "Smoke trail stopped.\n");
00319 
00320         return GE_TRUE;
00321 }

geBoolean StartupSmokeTrail Fx_System Fx,
Fx_Player Player
[static]
 

Definition at line 306 of file Fx.c.

References GE_TRUE, and geBoolean.

Referenced by Fx_PlayerSetFxFlags().

00307 {
00308         //Console_Printf(Fx->Console, "Smoke trail started.\n");
00309 
00310         return GE_TRUE;
00311 }


Variable Documentation

geFloat EffectScale
 

Definition at line 31 of file Fx.c.

char ExplodeBitmapANames[NUM_EXPLODE_TEXTURES][32] [static]
 

Initial value:

 {
        "Bmp\\Explode\\A_1EXP01.Bmp",
        "Bmp\\Explode\\A_1EXP02.Bmp",
        "Bmp\\Explode\\A_1EXP03.Bmp",
        "Bmp\\Explode\\A_1EXP04.Bmp",
        "Bmp\\Explode\\A_1EXP05.Bmp",
        "Bmp\\Explode\\A_1EXP06.Bmp"
}

Definition at line 68 of file Fx.c.

Referenced by LoadFxTextures().

char ExplodeBitmapNames[NUM_EXPLODE_TEXTURES][32] [static]
 

Initial value:

 {
        "Bmp\\Explode\\1EXP01.Bmp",
        "Bmp\\Explode\\1EXP02.Bmp",
        "Bmp\\Explode\\1EXP03.Bmp",
        "Bmp\\Explode\\1EXP04.Bmp",
        "Bmp\\Explode\\1EXP05.Bmp",
        "Bmp\\Explode\\1EXP06.Bmp"
}

Definition at line 59 of file Fx.c.

Referenced by LoadFxTextures().

geVFile* MainFS
 

Definition at line 390 of file Fx.c.

char ParticleBitmapANames[NUM_PARTICLE_TEXTURES][32] [static]
 

Initial value:

 {
        "Bmp\\Fx\\Parti1.Bmp",
        "Bmp\\Fx\\Parti2.Bmp",
        "Bmp\\Fx\\Parti3.Bmp",
        "Bmp\\Fx\\Parti4.Bmp",
        "Bmp\\Fx\\Parti5.Bmp",
        "Bmp\\Fx\\Parti6.Bmp",
        "Bmp\\Fx\\Parti7.Bmp",
        "Bmp\\Fx\\Parti8.Bmp",
}

Definition at line 88 of file Fx.c.

Referenced by LoadFxTextures().

char ParticleBitmapNames[NUM_PARTICLE_TEXTURES][32] [static]
 

Initial value:

 {
        "Bmp\\Fx\\Parti1.Bmp",
        "Bmp\\Fx\\Parti2.Bmp",
        "Bmp\\Fx\\Parti3.Bmp",
        "Bmp\\Fx\\Parti4.Bmp",
        "Bmp\\Fx\\Parti5.Bmp",
        "Bmp\\Fx\\Parti6.Bmp",
        "Bmp\\Fx\\Parti7.Bmp",
        "Bmp\\Fx\\Parti8.Bmp",
}

Definition at line 77 of file Fx.c.

Referenced by LoadFxTextures().

char SmokeBitmapANames[NUM_SMOKE_TEXTURES][32] [static]
 

Initial value:

 {
        "Bmp\\Fx\\A_Smk01.Bmp",
        "Bmp\\Fx\\A_Smk02.Bmp",
        "Bmp\\Fx\\A_Smk03.Bmp",
        "Bmp\\Fx\\A_Smk04.Bmp",
        "Bmp\\Fx\\A_Smk05.Bmp",
        "Bmp\\Fx\\A_Smk06.Bmp",
        "Bmp\\Fx\\A_Smk07.Bmp",
        "Bmp\\Fx\\A_Smk08.Bmp",
        "Bmp\\Fx\\A_Smk09.Bmp",
        "Bmp\\Fx\\A_Smk10.Bmp",
}

Definition at line 46 of file Fx.c.

Referenced by LoadFxTextures().

char SmokeBitmapNames[NUM_SMOKE_TEXTURES][32] [static]
 

Initial value:

 {
        "Bmp\\Fx\\Smoke_01.Bmp",
        "Bmp\\Fx\\Smoke_02.Bmp",
        "Bmp\\Fx\\Smoke_03.Bmp",
        "Bmp\\Fx\\Smoke_04.Bmp",
        "Bmp\\Fx\\Smoke_05.Bmp",
        "Bmp\\Fx\\Smoke_06.Bmp",
        "Bmp\\Fx\\Smoke_07.Bmp",
        "Bmp\\Fx\\Smoke_08.Bmp",
        "Bmp\\Fx\\Smoke_09.Bmp",
        "Bmp\\Fx\\Smoke_10.Bmp"
}

Definition at line 33 of file Fx.c.

Referenced by LoadFxTextures().


Generated on Tue Sep 30 12:37:33 2003 for GTestAndEngine by doxygen 1.3.2