mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 23:01:50 +00:00
Remove FSoundLoadBuffer since it wasn't doing anything
This commit is contained in:
parent
3c975f18bc
commit
5b4c9eb7f6
8 changed files with 12 additions and 37 deletions
|
@ -127,7 +127,7 @@ public:
|
|||
void SetMusicVolume (float volume)
|
||||
{
|
||||
}
|
||||
SoundHandle LoadSound(uint8_t *sfxdata, int length, FSoundLoadBuffer *pBuffer)
|
||||
SoundHandle LoadSound(uint8_t *sfxdata, int length)
|
||||
{
|
||||
SoundHandle retval = { NULL };
|
||||
return retval;
|
||||
|
|
|
@ -88,16 +88,6 @@ typedef bool (*SoundStreamCallback)(SoundStream *stream, void *buff, int len, vo
|
|||
struct SoundDecoder;
|
||||
class MIDIDevice;
|
||||
|
||||
struct FSoundLoadBuffer
|
||||
{
|
||||
std::vector<uint8_t> mBuffer;
|
||||
uint32_t loop_start;
|
||||
uint32_t loop_end;
|
||||
ChannelConfig chans;
|
||||
SampleType type;
|
||||
int srate;
|
||||
};
|
||||
|
||||
class SoundRenderer
|
||||
{
|
||||
public:
|
||||
|
@ -107,7 +97,7 @@ public:
|
|||
virtual bool IsNull() { return false; }
|
||||
virtual void SetSfxVolume (float volume) = 0;
|
||||
virtual void SetMusicVolume (float volume) = 0;
|
||||
virtual SoundHandle LoadSound(uint8_t *sfxdata, int length, FSoundLoadBuffer *pBuffer = nullptr) = 0;
|
||||
virtual SoundHandle LoadSound(uint8_t *sfxdata, int length) = 0;
|
||||
SoundHandle LoadSoundVoc(uint8_t *sfxdata, int length);
|
||||
virtual SoundHandle LoadSoundRaw(uint8_t *sfxdata, int length, int frequency, int channels, int bits, int loopstart, int loopend = -1) = 0;
|
||||
virtual void UnloadSound (SoundHandle sfx) = 0; // unloads a sound from memory
|
||||
|
|
|
@ -1046,7 +1046,7 @@ SoundHandle OpenALSoundRenderer::LoadSoundRaw(uint8_t *sfxdata, int length, int
|
|||
return retval;
|
||||
}
|
||||
|
||||
SoundHandle OpenALSoundRenderer::LoadSound(uint8_t *sfxdata, int length, FSoundLoadBuffer *pBuffer)
|
||||
SoundHandle OpenALSoundRenderer::LoadSound(uint8_t *sfxdata, int length)
|
||||
{
|
||||
SoundHandle retval = { NULL };
|
||||
ALenum format = AL_NONE;
|
||||
|
@ -1122,15 +1122,6 @@ SoundHandle OpenALSoundRenderer::LoadSound(uint8_t *sfxdata, int length, FSoundL
|
|||
}
|
||||
|
||||
retval.data = MAKE_PTRID(buffer);
|
||||
if (pBuffer != nullptr)
|
||||
{
|
||||
pBuffer->mBuffer = std::move(data);
|
||||
pBuffer->loop_start = loop_start;
|
||||
pBuffer->loop_end = loop_end;
|
||||
pBuffer->chans = chans;
|
||||
pBuffer->type = type;
|
||||
pBuffer->srate = srate;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
|
|
@ -125,7 +125,7 @@ public:
|
|||
|
||||
virtual void SetSfxVolume(float volume);
|
||||
virtual void SetMusicVolume(float volume);
|
||||
virtual SoundHandle LoadSound(uint8_t *sfxdata, int length, FSoundLoadBuffer *buffer);
|
||||
virtual SoundHandle LoadSound(uint8_t *sfxdata, int length);
|
||||
virtual SoundHandle LoadSoundRaw(uint8_t *sfxdata, int length, int frequency, int channels, int bits, int loopstart, int loopend = -1);
|
||||
virtual void UnloadSound(SoundHandle sfx);
|
||||
virtual unsigned int GetMSLength(SoundHandle sfx);
|
||||
|
|
|
@ -413,7 +413,7 @@ unsigned int S_GetMSLength(FSoundID sound)
|
|||
}
|
||||
}
|
||||
|
||||
sfx = soundEngine->LoadSound(sfx, nullptr);
|
||||
sfx = soundEngine->LoadSound(sfx);
|
||||
if (sfx != NULL) return GSnd->GetMSLength(sfx->data);
|
||||
else return 0;
|
||||
}
|
||||
|
|
|
@ -171,9 +171,7 @@ void SoundEngine::CacheSound (sfxinfo_t *sfx)
|
|||
}
|
||||
else
|
||||
{
|
||||
// Since we do not know in what format the sound will be used, we have to cache both.
|
||||
FSoundLoadBuffer SoundBuffer;
|
||||
LoadSound(sfx, &SoundBuffer);
|
||||
LoadSound(sfx);
|
||||
sfx->bUsed = true;
|
||||
}
|
||||
}
|
||||
|
@ -383,7 +381,6 @@ FSoundChan *SoundEngine::StartSound(int type, const void *source,
|
|||
FSoundChan *chan;
|
||||
FVector3 pos, vel;
|
||||
FRolloffInfo *rolloff;
|
||||
FSoundLoadBuffer SoundBuffer;
|
||||
|
||||
if (sound_id <= 0 || volume <= 0 || nosfx || nosound )
|
||||
return NULL;
|
||||
|
@ -481,7 +478,7 @@ FSoundChan *SoundEngine::StartSound(int type, const void *source,
|
|||
}
|
||||
|
||||
// Make sure the sound is loaded.
|
||||
sfx = LoadSound(sfx, &SoundBuffer);
|
||||
sfx = LoadSound(sfx);
|
||||
|
||||
// The empty sound never plays.
|
||||
if (sfx->lumpnum == sfx_empty)
|
||||
|
@ -638,13 +635,12 @@ void SoundEngine::RestartChannel(FSoundChan *chan)
|
|||
|
||||
FSoundChan *ochan;
|
||||
sfxinfo_t *sfx = &S_sfx[chan->SoundID];
|
||||
FSoundLoadBuffer SoundBuffer;
|
||||
|
||||
// If this is a singular sound, don't play it if it's already playing.
|
||||
if (sfx->bSingular && CheckSingular(chan->SoundID))
|
||||
return;
|
||||
|
||||
sfx = LoadSound(sfx, &SoundBuffer);
|
||||
sfx = LoadSound(sfx);
|
||||
|
||||
// The empty sound never plays.
|
||||
if (sfx->lumpnum == sfx_empty)
|
||||
|
@ -702,7 +698,7 @@ void SoundEngine::RestartChannel(FSoundChan *chan)
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
sfxinfo_t *SoundEngine::LoadSound(sfxinfo_t *sfx, FSoundLoadBuffer *pBuffer)
|
||||
sfxinfo_t *SoundEngine::LoadSound(sfxinfo_t *sfx)
|
||||
{
|
||||
if (GSnd->IsNull()) return sfx;
|
||||
|
||||
|
@ -760,7 +756,7 @@ sfxinfo_t *SoundEngine::LoadSound(sfxinfo_t *sfx, FSoundLoadBuffer *pBuffer)
|
|||
// If that fails, let the sound system try and figure it out.
|
||||
else
|
||||
{
|
||||
sfx->data = GSnd->LoadSound(sfxdata.Data(), size, pBuffer);
|
||||
sfx->data = GSnd->LoadSound(sfxdata.Data(), size);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1600,7 +1596,7 @@ unsigned int SoundEngine::GetMSLength(FSoundID sound)
|
|||
}
|
||||
}
|
||||
|
||||
sfx = LoadSound(sfx, nullptr);
|
||||
sfx = LoadSound(sfx);
|
||||
if (sfx != NULL) return GSnd->GetMSLength(sfx->data);
|
||||
else return 0;
|
||||
}
|
||||
|
|
|
@ -44,8 +44,6 @@ struct FLevelLocals;
|
|||
|
||||
// Called after a level is loaded. Ensures that most sounds are loaded.
|
||||
|
||||
struct FSoundLoadBuffer;
|
||||
|
||||
// [RH] S_sfx "maintenance" routines
|
||||
void S_ClearSoundData();
|
||||
void S_ParseSndInfo (bool redefine);
|
||||
|
|
|
@ -274,7 +274,7 @@ public:
|
|||
void EvictAllChannels();
|
||||
|
||||
void StopChannel(FSoundChan* chan);
|
||||
sfxinfo_t* LoadSound(sfxinfo_t* sfx, FSoundLoadBuffer* pBuffer);
|
||||
sfxinfo_t* LoadSound(sfxinfo_t* sfx);
|
||||
|
||||
// Initializes sound stuff, including volume
|
||||
// Sets channels, SFX and music volume,
|
||||
|
|
Loading…
Reference in a new issue