mirror of
https://github.com/DrBeef/Doom3Quest.git
synced 2024-11-10 06:41:36 +00:00
Fix for repeating patterns loaded from a save game file
This commit is contained in:
parent
de8c6056fa
commit
b2c8d1320d
3 changed files with 20 additions and 4 deletions
|
@ -1649,10 +1649,6 @@ void idEntity::StopSound( const s_channelType channel, bool broadcast ) {
|
|||
|
||||
if ( refSound.referenceSound ) {
|
||||
refSound.referenceSound->StopSound( channel );
|
||||
|
||||
if (refSound.shader) {
|
||||
common->HapticStopEvent(refSound.shader->GetName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -151,6 +151,7 @@ idSoundChannel::idSoundChannel
|
|||
*/
|
||||
idSoundChannel::idSoundChannel( void ) {
|
||||
decoder = NULL;
|
||||
soundShader = NULL;
|
||||
Clear();
|
||||
}
|
||||
|
||||
|
@ -212,6 +213,12 @@ idSoundChannel::Stop
|
|||
void idSoundChannel::Stop( void ) {
|
||||
triggerState = false;
|
||||
stopped = true;
|
||||
|
||||
if (soundShader != NULL)
|
||||
{
|
||||
common->HapticStopEvent(soundShader->GetName());
|
||||
}
|
||||
|
||||
if ( decoder != NULL ) {
|
||||
idSampleDecoder::Free( decoder );
|
||||
decoder = NULL;
|
||||
|
@ -971,6 +978,8 @@ void idSoundEmitterLocal::StopSound( const s_channelType channel ) {
|
|||
|
||||
Sys_EnterCriticalSection();
|
||||
|
||||
const char* soundShaderName = NULL;
|
||||
|
||||
for( i = 0; i < SOUND_MAX_CHANNELS; i++ ) {
|
||||
idSoundChannel *chan = &channels[i];
|
||||
|
||||
|
|
|
@ -1356,6 +1356,17 @@ void idSoundWorldLocal::ReadFromSaveGame( idFile *savefile ) {
|
|||
chan->channelFade.fadeEnd44kHz += soundTimeOffset;
|
||||
}
|
||||
|
||||
//Only concerned with registering looping sounds with the haptics service
|
||||
if (cvarSystem->GetCVarBool("vr_useHapticsService"))
|
||||
{
|
||||
bool looping = (def->parms.soundShaderFlags & SSF_LOOPING) != 0;
|
||||
if (looping)
|
||||
{
|
||||
common->Printf("Start Looping: %s", chan->soundShader->GetName());
|
||||
common->HapticEvent(chan->soundShader->GetName(), 4, 1, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
// next command
|
||||
savefile->ReadInt( channel );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue