From 39ff34645fc90ac43194eb7947a72d4b21abae17 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Wed, 22 Aug 2012 23:51:23 +0000 Subject: [PATCH] - Precache PickupSound, UpSound, and ReadySound. SVN r3842 (trunk) --- src/g_shared/a_pickups.cpp | 12 ++++++++++++ src/g_shared/a_pickups.h | 2 ++ src/g_shared/a_weapons.cpp | 13 +++++++++++++ 3 files changed, 27 insertions(+) diff --git a/src/g_shared/a_pickups.cpp b/src/g_shared/a_pickups.cpp index 6613677532..f071171a73 100644 --- a/src/g_shared/a_pickups.cpp +++ b/src/g_shared/a_pickups.cpp @@ -459,6 +459,18 @@ void AInventory::Serialize (FArchive &arc) arc << Owner << Amount << MaxAmount << RespawnTics << ItemFlags << Icon << PickupSound << SpawnPointClass; } +//=========================================================================== +// +// AInventory :: MarkPrecacheSounds +// +//=========================================================================== + +void AInventory::MarkPrecacheSounds() const +{ + Super::MarkPrecacheSounds(); + PickupSound.MarkUsed(); +} + //=========================================================================== // // AInventory :: SpecialDropAction diff --git a/src/g_shared/a_pickups.h b/src/g_shared/a_pickups.h index 52c2b6d13c..beaa658724 100644 --- a/src/g_shared/a_pickups.h +++ b/src/g_shared/a_pickups.h @@ -143,6 +143,7 @@ public: virtual void Touch (AActor *toucher); virtual void Serialize (FArchive &arc); + virtual void MarkPrecacheSounds() const; virtual void BeginPlay (); virtual void Destroy (); virtual void Tick (); @@ -276,6 +277,7 @@ public: bool bAltFire; // Set when this weapon's alternate fire is used. + virtual void MarkPrecacheSounds() const; virtual void Serialize (FArchive &arc); virtual bool ShouldStay (); virtual void AttachToOwner (AActor *other); diff --git a/src/g_shared/a_weapons.cpp b/src/g_shared/a_weapons.cpp index 8f45d892a2..a59e8f564f 100644 --- a/src/g_shared/a_weapons.cpp +++ b/src/g_shared/a_weapons.cpp @@ -67,6 +67,19 @@ void AWeapon::Serialize (FArchive &arc) << Crosshair; } +//=========================================================================== +// +// AWeapon :: MarkPrecacheSounds +// +//=========================================================================== + +void AWeapon::MarkPrecacheSounds() const +{ + Super::MarkPrecacheSounds(); + UpSound.MarkUsed(); + ReadySound.MarkUsed(); +} + //=========================================================================== // // AWeapon :: TryPickup