#include "Genesis.h"Go to the source code of this file.
Compounds | |
| struct | ElectricBolt |
| struct | ElectricBoltTerminus |
Defines | |
| #define | ELECTRIC_BOLT_REDDOMINANT 0 |
| #define | ELECTRIC_BOLT_GREENDOMINANT 1 |
| #define | ELECTRIC_BOLT_BLUEDOMINANT 2 |
Typedefs | |
| typedef ElectricBoltTerminus | ElectricBoltTerminus |
| typedef Electric_BoltEffect | Electric_BoltEffect |
| typedef ElectricBolt | ElectricBolt |
Functions | |
| geBoolean | Electric_Init (geEngine *Engine, geWorld *World, geVFile *MainFS, geSound_System *SoundSystem) |
| geBoolean | Electric_Reset (geWorld *World) |
| geBoolean | Electric_Frame (geWorld *World, const geXForm3d *ViewPoint, geFloat Time) |
| geBoolean | Electric_Shutdown (void) |
|
|
Definition at line 12 of file Genesis3d/src/FX/electric.h. Referenced by _Electric_BoltEffectCreate(), and Electric_BoltEffectCreate(). |
|
|
Definition at line 11 of file Genesis3d/src/FX/electric.h. |
|
|
Definition at line 10 of file Genesis3d/src/FX/electric.h. |
|
|
Definition at line 25 of file Genesis3d/src/FX/electric.h. |
|
|
|
|
|
|
|
||||||||||||||||
|
Definition at line 646 of file Genesis3d/src/FX/electric.c. References ElectricBolt::Bolt, Electric_BoltEffectAnimate(), Electric_BoltEffectRender(), frand(), GE_FALSE, GE_TRUE, geBoolean, geEntity_EntitySetGetNextEntity(), geEntity_GetUserData(), geFloat, geSound3D_GetConfig(), geSound_ModifySound(), geSound_PlaySoundDef(), geVec3d_AddScaled(), geVec3d_Subtract(), geWorld_GetEntitySet(), geWorld_GetLeaf(), geWorld_MightSeeLeaf(), int32, ElectricBolt::Intermittent, ElectricBolt::LastBoltTime, ElectricBolt::LastTime, LIGHTNINGSTROKEDURATION, ElectricBolt::LoopingSound, ElectricBolt::MaxFrequency, ElectricBolt::MinFrequency, NULL, ElectricBolt::origin, ElectricBoltTerminus::origin, SingleDef, SoundSys, and ElectricBolt::Terminus. Referenced by RenderWorld().
00647 {
00648 geEntity_EntitySet * Set;
00649 geEntity * Entity;
00650
00651 if (!World)
00652 return GE_TRUE;
00653
00654 Set = geWorld_GetEntitySet(World, "ElectricBolt");
00655 if (Set == NULL)
00656 return GE_TRUE;
00657
00658 Entity = geEntity_EntitySetGetNextEntity(Set, NULL);
00659 while (Entity)
00660 {
00661 ElectricBolt * Bolt;
00662 geFloat Volume;
00663 geFloat Pan;
00664 geFloat Frequency;
00665 geVec3d MidPoint;
00666 int32 Leaf;
00667
00668 Bolt = geEntity_GetUserData(Entity);
00669
00670 geVec3d_Subtract(&Bolt->Terminus->origin, &Bolt->origin, &MidPoint);
00671 geVec3d_AddScaled(&Bolt->origin, &MidPoint, 0.5f, &MidPoint);
00672
00673 geWorld_GetLeaf(World, &MidPoint, &Leaf);
00674
00675 if (geWorld_MightSeeLeaf(World, Leaf))
00676 {
00677 geSound3D_GetConfig(World,
00678 XForm,
00679 &MidPoint,
00680 600.0f,
00681 2.0f,
00682 &Volume,
00683 &Pan,
00684 &Frequency);
00685
00686 Bolt->LastTime += DeltaTime;
00687
00688 if (!Bolt->Intermittent ||
00689 (Bolt->LastTime - Bolt->LastBoltTime > frand(Bolt->MaxFrequency, Bolt->MinFrequency)))
00690 {
00691 Electric_BoltEffectAnimate(Bolt->Bolt,
00692 &Bolt->origin,
00693 &Bolt->Terminus->origin);
00694
00695 if (Bolt->Intermittent && SoundSys)
00696 geSound_PlaySoundDef(SoundSys, SingleDef, Volume, Pan, Frequency, GE_FALSE);
00697
00698 Bolt->LastBoltTime = Bolt->LastTime;
00699 }
00700
00701 if (!Bolt->Intermittent && SoundSys)
00702 geSound_ModifySound(SoundSys, Bolt->LoopingSound, Volume, Pan, Frequency);
00703
00704 if (Bolt->LastTime - Bolt->LastBoltTime <= LIGHTNINGSTROKEDURATION)
00705 Electric_BoltEffectRender(World, Bolt->Bolt, XForm);
00706 }
00707
00708 Entity = geEntity_EntitySetGetNextEntity(Set, Entity);
00709 }
00710
00711 return GE_TRUE;
00712 }
|
|
||||||||||||||||||||
|
Definition at line 462 of file Genesis3d/src/FX/electric.c. References Electric_SetWorld(), Engine, GE_FALSE, GE_TRUE, GE_VFILE_OPEN_READONLY, geBoolean, geSound_LoadSoundDef(), geVFile_Close(), geVFile_Open(), LoopingDef, MainFS, SingleDef, and SoundSys. Referenced by GameMgr_SetWorld().
00463 {
00464 Engine;
00465
00466 if (SoundSystem)
00467 {
00468 geVFile * File;
00469
00470 SoundSys = SoundSystem;
00471 assert(SoundSys);
00472 File = geVFile_Open(MainFS, "wav\\loopbzzt.wav", GE_VFILE_OPEN_READONLY);
00473 if (!File)
00474 return GE_FALSE;
00475 LoopingDef = geSound_LoadSoundDef(SoundSys, File);
00476 geVFile_Close(File);
00477 File = geVFile_Open(MainFS, "wav\\onebzzt.wav", GE_VFILE_OPEN_READONLY);
00478 if (!File)
00479 return GE_FALSE;
00480
00481 SingleDef = geSound_LoadSoundDef(SoundSys, File);
00482
00483 geVFile_Close(File);
00484 if (!LoopingDef || !SingleDef)
00485 return GE_FALSE;
00486 }
00487
00488 if (!Electric_SetWorld(World, MainFS))
00489 {
00490 // FIXME: Free more stuff
00491 return GE_FALSE;
00492 }
00493
00494 return GE_TRUE;
00495 }
|
|
|
Definition at line 497 of file Genesis3d/src/FX/electric.c. References GE_TRUE, geBoolean, geEntity_EntitySetGetNextEntity(), geEntity_GetUserData(), geWorld_GetEntitySet(), ElectricBolt::LastBoltTime, ElectricBolt::LastTime, and NULL.
00498 {
00499 geEntity_EntitySet * Set;
00500 geEntity * Entity;
00501
00502 if (!World)
00503 return GE_TRUE;
00504
00505 Set = geWorld_GetEntitySet(World, "ElectricBolt");
00506 if (Set == NULL)
00507 return GE_TRUE;
00508
00509 Entity = geEntity_EntitySetGetNextEntity(Set, NULL);
00510 while (Entity)
00511 {
00512 ElectricBolt * Bolt;
00513
00514 Bolt = geEntity_GetUserData(Entity);
00515 Bolt->LastTime = 0.0f;
00516 Bolt->LastBoltTime = 0.0f;
00517
00518 Entity = geEntity_EntitySetGetNextEntity(Set, Entity);
00519 }
00520
00521 return GE_TRUE;
00522 }
|
|
|
Definition at line 609 of file Genesis3d/src/FX/electric.c. References Bitmap, GE_TRUE, geBitmap_Destroy(), geBoolean, geSound_FreeSoundDef(), LoopingDef, NULL, SingleDef, and SoundSys. Referenced by GameMgr_FreeWorld().
00610 {
00611 if (LoopingDef)
00612 {
00613 geSound_FreeSoundDef(SoundSys, LoopingDef);
00614 LoopingDef = NULL;
00615 }
00616
00617 if (SingleDef)
00618 {
00619 geSound_FreeSoundDef(SoundSys, SingleDef);
00620 SingleDef = NULL;
00621 }
00622
00623 if (Bitmap)
00624 {
00625 //geWorld_RemoveBitmap(World, Bitmap);
00626 geBitmap_Destroy(&Bitmap);
00627 Bitmap = NULL;
00628 }
00629
00630 return GE_TRUE;
00631 }
|
1.3.2