mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 23:01:50 +00:00
- Added actors' BounceSound, WallBounceSound, and CrushPainSound to preloading.
- Moved marking of actor sounds for precaching into a virtual Actor function. SVN r3838 (trunk)
This commit is contained in:
parent
9d82c7fa0e
commit
625482aaeb
4 changed files with 28 additions and 15 deletions
15
src/actor.h
15
src/actor.h
|
@ -583,15 +583,14 @@ public:
|
||||||
bool AdjustReflectionAngle (AActor *thing, angle_t &angle);
|
bool AdjustReflectionAngle (AActor *thing, angle_t &angle);
|
||||||
|
|
||||||
// Returns true if this actor is within melee range of its target
|
// Returns true if this actor is within melee range of its target
|
||||||
bool CheckMeleeRange ();
|
bool CheckMeleeRange();
|
||||||
|
|
||||||
// BeginPlay: Called just after the actor is created
|
virtual void BeginPlay(); // Called immediately after the actor is created
|
||||||
virtual void BeginPlay ();
|
virtual void PostBeginPlay(); // Called immediately before the actor's first tick
|
||||||
virtual void PostBeginPlay ();
|
virtual void LevelSpawned(); // Called after BeginPlay if this actor was spawned by the world
|
||||||
// LevelSpawned: Called after BeginPlay if this actor was spawned by the world
|
virtual void HandleSpawnFlags(); // Translates SpawnFlags into in-game flags.
|
||||||
virtual void LevelSpawned ();
|
|
||||||
// Translates SpawnFlags into in-game flags.
|
virtual void MarkPrecacheSounds() const; // Marks sounds used by this actor for precaching.
|
||||||
virtual void HandleSpawnFlags ();
|
|
||||||
|
|
||||||
virtual void Activate (AActor *activator);
|
virtual void Activate (AActor *activator);
|
||||||
virtual void Deactivate (AActor *activator);
|
virtual void Deactivate (AActor *activator);
|
||||||
|
|
|
@ -3993,6 +3993,19 @@ void AActor::PostBeginPlay ()
|
||||||
PrevAngle = angle;
|
PrevAngle = angle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AActor::MarkPrecacheSounds() const
|
||||||
|
{
|
||||||
|
SeeSound.MarkUsed();
|
||||||
|
AttackSound.MarkUsed();
|
||||||
|
PainSound.MarkUsed();
|
||||||
|
DeathSound.MarkUsed();
|
||||||
|
ActiveSound.MarkUsed();
|
||||||
|
UseSound.MarkUsed();
|
||||||
|
BounceSound.MarkUsed();
|
||||||
|
WallBounceSound.MarkUsed();
|
||||||
|
CrushPainSound.MarkUsed();
|
||||||
|
}
|
||||||
|
|
||||||
bool AActor::isFast()
|
bool AActor::isFast()
|
||||||
{
|
{
|
||||||
if (flags5&MF5_ALWAYSFAST) return true;
|
if (flags5&MF5_ALWAYSFAST) return true;
|
||||||
|
|
|
@ -480,17 +480,12 @@ void S_PrecacheLevel ()
|
||||||
// Precache all sounds known to be used by the currently spawned actors.
|
// Precache all sounds known to be used by the currently spawned actors.
|
||||||
while ( (actor = iterator.Next()) != NULL )
|
while ( (actor = iterator.Next()) != NULL )
|
||||||
{
|
{
|
||||||
S_sfx[actor->SeeSound].bUsed = true;
|
actor->MarkPrecacheSounds();
|
||||||
S_sfx[actor->AttackSound].bUsed = true;
|
|
||||||
S_sfx[actor->PainSound].bUsed = true;
|
|
||||||
S_sfx[actor->DeathSound].bUsed = true;
|
|
||||||
S_sfx[actor->ActiveSound].bUsed = true;
|
|
||||||
S_sfx[actor->UseSound].bUsed = true;
|
|
||||||
}
|
}
|
||||||
// Precache all extra sounds requested by this map.
|
// Precache all extra sounds requested by this map.
|
||||||
for (i = 0; i < level.info->PrecacheSounds.Size(); ++i)
|
for (i = 0; i < level.info->PrecacheSounds.Size(); ++i)
|
||||||
{
|
{
|
||||||
S_sfx[level.info->PrecacheSounds[i]].bUsed = true;
|
level.info->PrecacheSounds[i].MarkUsed();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 1; i < S_sfx.Size(); ++i)
|
for (i = 1; i < S_sfx.Size(); ++i)
|
||||||
|
|
|
@ -65,6 +65,8 @@ struct sfxinfo_t
|
||||||
|
|
||||||
FRolloffInfo Rolloff;
|
FRolloffInfo Rolloff;
|
||||||
float Attenuation; // Multiplies the attenuation passed to S_Sound.
|
float Attenuation; // Multiplies the attenuation passed to S_Sound.
|
||||||
|
|
||||||
|
void MarkUsed(); // Marks this sound as used.
|
||||||
};
|
};
|
||||||
|
|
||||||
// Rolloff types
|
// Rolloff types
|
||||||
|
@ -132,6 +134,10 @@ public:
|
||||||
{
|
{
|
||||||
return ID ? S_sfx[ID].name.GetChars() : NULL;
|
return ID ? S_sfx[ID].name.GetChars() : NULL;
|
||||||
}
|
}
|
||||||
|
void MarkUsed() const
|
||||||
|
{
|
||||||
|
S_sfx[ID].MarkUsed();
|
||||||
|
}
|
||||||
private:
|
private:
|
||||||
int ID;
|
int ID;
|
||||||
protected:
|
protected:
|
||||||
|
|
Loading…
Reference in a new issue