mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-04-25 11:01:36 +00:00
- add checking in S_StartSound for startTime length
This commit is contained in:
parent
1b80b7bf2f
commit
5dfdac62ab
1 changed files with 6 additions and 1 deletions
|
@ -36,6 +36,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "templates.h"
|
||||||
#include "s_soundinternal.h"
|
#include "s_soundinternal.h"
|
||||||
#include "m_swap.h"
|
#include "m_swap.h"
|
||||||
#include "superfasthash.h"
|
#include "superfasthash.h"
|
||||||
|
@ -566,6 +567,10 @@ FSoundChan *SoundEngine::StartSound(int type, const void *source,
|
||||||
if (chanflags & (CHANF_UI|CHANF_NOPAUSE)) startflags |= SNDF_NOPAUSE;
|
if (chanflags & (CHANF_UI|CHANF_NOPAUSE)) startflags |= SNDF_NOPAUSE;
|
||||||
if (chanflags & CHANF_UI) startflags |= SNDF_NOREVERB;
|
if (chanflags & CHANF_UI) startflags |= SNDF_NOREVERB;
|
||||||
|
|
||||||
|
startTime = (startflags & SNDF_LOOP)
|
||||||
|
? fmod(startTime, (float)GSnd->GetMSLength(sfx->data) / 1000.f)
|
||||||
|
: clamp<float>(startTime, 0.f, (float)GSnd->GetMSLength(sfx->data) / 1000.f);
|
||||||
|
|
||||||
if (attenuation > 0 && type != SOURCE_None)
|
if (attenuation > 0 && type != SOURCE_None)
|
||||||
{
|
{
|
||||||
chan = (FSoundChan*)GSnd->StartSound3D (sfx->data, &listener, float(volume), rolloff, float(attenuation), pitch, basepriority, pos, vel, channel, startflags, NULL, startTime);
|
chan = (FSoundChan*)GSnd->StartSound3D (sfx->data, &listener, float(volume), rolloff, float(attenuation), pitch, basepriority, pos, vel, channel, startflags, NULL, startTime);
|
||||||
|
|
Loading…
Reference in a new issue