mirror of
https://github.com/alliedmodders/hl2sdk.git
synced 2025-01-04 00:23:25 +08:00
Update (#97)
This commit is contained in:
parent
e2e62c5185
commit
9195ab7a62
@ -53,6 +53,9 @@ struct CSoundParameters
|
||||
m_pOperatorsKV = NULL;
|
||||
m_nRandomSeed = -1;
|
||||
|
||||
m_bHRTFFollowEntity = false;
|
||||
m_bHRTFBilinear = false;
|
||||
|
||||
}
|
||||
|
||||
int channel;
|
||||
@ -70,8 +73,11 @@ struct CSoundParameters
|
||||
KeyValues *m_pOperatorsKV;
|
||||
int m_nRandomSeed;
|
||||
|
||||
bool m_bHRTFFollowEntity;
|
||||
bool m_bHRTFBilinear;
|
||||
};
|
||||
|
||||
|
||||
// A bit of a hack, but these are just utility function which are implemented in the SouneParametersInternal.cpp file which all users of this lib also compile
|
||||
const char *SoundLevelToString( soundlevel_t level );
|
||||
const char *ChannelToString( int channel );
|
||||
@ -151,20 +157,30 @@ struct CSoundParametersInternal
|
||||
const pitch_interval_t &GetPitch() const { return pitch; }
|
||||
const soundlevel_interval_t &GetSoundLevel() const { return soundlevel; }
|
||||
int GetDelayMsec() const { return delay_msec; }
|
||||
int GetSoundEntryVersion() const { return m_nSoundEntryVersion; }
|
||||
bool OnlyPlayToOwner() const { return play_to_owner_only; }
|
||||
bool HadMissingWaveFiles() const { return had_missing_wave_files; }
|
||||
bool UsesGenderToken() const { return uses_gender_token; }
|
||||
bool ShouldPreload() const { return m_bShouldPreload; }
|
||||
bool ShouldAutoCache() const { return m_bShouldAutoCache; }
|
||||
bool HasCached() const { return m_bHasCached; }
|
||||
bool HasHRTFFollowEntity() const { return m_bHRTFFollowEntity; }
|
||||
bool HasHRTFBilinear() const { return m_bHRTFBilinear; }
|
||||
|
||||
void SetChannel( int newChannel ) { channel = newChannel; }
|
||||
void SetVolume( float start, float range = 0.0 ) { volume.start = start; volume.range = range; }
|
||||
void SetPitch( float start, float range = 0.0 ) { pitch.start = start; pitch.range = range; }
|
||||
void SetSoundLevel( float start, float range = 0.0 ) { soundlevel.start = start; soundlevel.range = range; }
|
||||
void SetVolume( float start, float range = 0.0 ) { volume.start = ( uint8 )start; volume.range = ( uint8 )range; }
|
||||
void SetPitch( float start, float range = 0.0 ) { pitch.start = ( uint8 )start; pitch.range = ( uint8 )range; }
|
||||
void SetSoundLevel( float start, float range = 0.0 ) { soundlevel.start = ( uint16 )start; soundlevel.range = ( uint16 )range; }
|
||||
void SetDelayMsec( int delay ) { delay_msec = delay; }
|
||||
void SetSoundEntryVersion( int gameSoundVersion ) { m_nSoundEntryVersion = gameSoundVersion; }
|
||||
void SetShouldPreload( bool bShouldPreload ) { m_bShouldPreload = bShouldPreload; }
|
||||
void SetShouldAutoCache( bool bShouldAutoCache ) { m_bShouldAutoCache = bShouldAutoCache; }
|
||||
void SetOnlyPlayToOwner( bool b ) { play_to_owner_only = b; }
|
||||
void SetHadMissingWaveFiles( bool b ) { had_missing_wave_files = b; }
|
||||
void SetUsesGenderToken( bool b ) { uses_gender_token = b; }
|
||||
void SetCached( bool b ) { m_bHasCached = b; }
|
||||
void SetHRTFFollowEntity( bool b ) { m_bHRTFFollowEntity = b; }
|
||||
void SetHRTFBilinear( bool b ) { m_bHRTFBilinear = b; }
|
||||
|
||||
void AddSoundName( const SoundFile &soundFile ) { AddToTail( &m_pSoundNames, &m_nSoundNames, soundFile ); }
|
||||
int NumSoundNames() const { return m_nSoundNames; }
|
||||
@ -176,6 +192,10 @@ struct CSoundParametersInternal
|
||||
SoundFile * GetConvertedNames() { return ( m_nConvertedNames == 1 ) ? (SoundFile *)&m_pConvertedNames : m_pConvertedNames; }
|
||||
const SoundFile *GetConvertedNames() const { return ( m_nConvertedNames == 1 ) ? (SoundFile *)&m_pConvertedNames : m_pConvertedNames; }
|
||||
|
||||
// Sound Operator System: this should be optimized into something less heavy
|
||||
KeyValues *GetOperatorsKV( void ) const { return m_pOperatorsKV; }
|
||||
void SetOperatorsKV( KeyValues *src );
|
||||
|
||||
private:
|
||||
void operator=( const CSoundParametersInternal& src ); // disallow implicit copies
|
||||
CSoundParametersInternal( const CSoundParametersInternal& src );
|
||||
@ -192,16 +212,23 @@ private:
|
||||
pitch_interval_t pitch; // 22
|
||||
uint16 channel; // 24
|
||||
uint16 delay_msec; // 26
|
||||
uint16 m_nSoundEntryVersion; // 28
|
||||
|
||||
bool play_to_owner_only:1; // For weapon sounds... // 27
|
||||
bool play_to_owner_only:1; // For weapon sounds... // 29
|
||||
// Internal use, for warning about missing .wav files
|
||||
bool had_missing_wave_files:1;
|
||||
bool uses_gender_token:1;
|
||||
bool m_bShouldPreload:1;
|
||||
bool m_bHasCached:1;
|
||||
bool m_bShouldAutoCache:1;
|
||||
bool m_bHRTFFollowEntity : 1;
|
||||
bool m_bHRTFBilinear : 1;
|
||||
|
||||
byte reserved; // 28
|
||||
byte reserved; // 30
|
||||
|
||||
KeyValues * m_pGameData; // 34
|
||||
KeyValues * m_pOperatorsKV; // 38
|
||||
|
||||
KeyValues * m_pGameData; // 32
|
||||
};
|
||||
#pragma pack()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user