mirror of
https://github.com/ZDoom/Raze.git
synced 2025-02-22 11:31:11 +00:00
- consolidated the 4 ReadSound functions.
This commit is contained in:
parent
3c695a5abd
commit
2095a2120c
7 changed files with 14 additions and 35 deletions
|
@ -83,6 +83,18 @@ void FX_SetReverb(int strength)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//==========================================================================
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//==========================================================================
|
||||||
|
|
||||||
|
std::vector<uint8_t> RazeSoundEngine::ReadSound(int lumpnum)
|
||||||
|
{
|
||||||
|
auto wlump = fileSystem.OpenFileReader(lumpnum);
|
||||||
|
return wlump.Read();
|
||||||
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
//
|
//
|
||||||
// S_NoiseDebug
|
// S_NoiseDebug
|
||||||
|
|
|
@ -47,4 +47,5 @@ public:
|
||||||
virtual bool SourceIsActor(FSoundChan* chan) { return chan->SourceType == SOURCE_Actor; }
|
virtual bool SourceIsActor(FSoundChan* chan) { return chan->SourceType == SOURCE_Actor; }
|
||||||
virtual int SoundSourceIndex(FSoundChan* chan) { return 0; }
|
virtual int SoundSourceIndex(FSoundChan* chan) { return 0; }
|
||||||
virtual void SetSource(FSoundChan* chan, int index) {}
|
virtual void SetSource(FSoundChan* chan, int index) {}
|
||||||
|
std::vector<uint8_t> ReadSound(int lumpnum) override;
|
||||||
};
|
};
|
||||||
|
|
|
@ -85,7 +85,7 @@ bool RTS_IsInitialized()
|
||||||
auto fr = fileSystem.OpenFileReader(RTSName);
|
auto fr = fileSystem.OpenFileReader(RTSName);
|
||||||
RTSName = ""; // don't try ever again.
|
RTSName = ""; // don't try ever again.
|
||||||
if (!fr.isOpen()) return false;
|
if (!fr.isOpen()) return false;
|
||||||
RTSFile.Resize(fr.GetLength());
|
RTSFile.Resize((unsigned)fr.GetLength());
|
||||||
fr.Read(RTSFile.Data(), fr.GetLength());
|
fr.Read(RTSFile.Data(), fr.GetLength());
|
||||||
if (RTSFile.Size() >= 28) // minimum size for one entry
|
if (RTSFile.Size() >= 28) // minimum size for one entry
|
||||||
{
|
{
|
||||||
|
|
|
@ -33,7 +33,6 @@ class BloodSoundEngine : public RazeSoundEngine
|
||||||
{
|
{
|
||||||
// client specific parts of the sound engine go in this class.
|
// client specific parts of the sound engine go in this class.
|
||||||
void CalcPosVel(int type, const void* source, const float pt[3], int channum, int chanflags, FSoundID chanSound, FVector3* pos, FVector3* vel, FSoundChan* channel) override;
|
void CalcPosVel(int type, const void* source, const float pt[3], int channum, int chanflags, FSoundID chanSound, FVector3* pos, FVector3* vel, FSoundChan* channel) override;
|
||||||
std::vector<uint8_t> ReadSound(int lumpnum) override;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BloodSoundEngine()
|
BloodSoundEngine()
|
||||||
|
@ -63,12 +62,6 @@ public:
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
std::vector<uint8_t> BloodSoundEngine::ReadSound(int lumpnum)
|
|
||||||
{
|
|
||||||
auto wlump = fileSystem.OpenFileReader(lumpnum);
|
|
||||||
return wlump.Read();
|
|
||||||
}
|
|
||||||
|
|
||||||
void BloodSoundEngine::CalcPosVel(int type, const void* source, const float pt[3], int channum, int chanflags, FSoundID chanSound, FVector3* pos, FVector3* vel, FSoundChan*)
|
void BloodSoundEngine::CalcPosVel(int type, const void* source, const float pt[3], int channum, int chanflags, FSoundID chanSound, FVector3* pos, FVector3* vel, FSoundChan*)
|
||||||
{
|
{
|
||||||
if (pos != nullptr && type != SOURCE_None)
|
if (pos != nullptr && type != SOURCE_None)
|
||||||
|
|
|
@ -145,18 +145,6 @@ static FSoundID GetReplacementSound(FSoundID soundNum)
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
std::vector<uint8_t> DukeSoundEngine::ReadSound(int lumpnum)
|
|
||||||
{
|
|
||||||
auto wlump = fileSystem.OpenFileReader(lumpnum);
|
|
||||||
return wlump.Read();
|
|
||||||
}
|
|
||||||
|
|
||||||
//==========================================================================
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//==========================================================================
|
|
||||||
|
|
||||||
int S_GetUserFlags(FSoundID soundid)
|
int S_GetUserFlags(FSoundID soundid)
|
||||||
{
|
{
|
||||||
if (!soundEngine->isValidSoundId(soundid)) return 0;
|
if (!soundEngine->isValidSoundId(soundid)) return 0;
|
||||||
|
|
|
@ -137,7 +137,6 @@ class EXSoundEngine : public RazeSoundEngine
|
||||||
{
|
{
|
||||||
// client specific parts of the sound engine go in this class.
|
// client specific parts of the sound engine go in this class.
|
||||||
void CalcPosVel(int type, const void* source, const float pt[3], int channum, int chanflags, FSoundID chanSound, FVector3* pos, FVector3* vel, FSoundChan* chan) override;
|
void CalcPosVel(int type, const void* source, const float pt[3], int channum, int chanflags, FSoundID chanSound, FVector3* pos, FVector3* vel, FSoundChan* chan) override;
|
||||||
std::vector<uint8_t> ReadSound(int lumpnum) override;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
EXSoundEngine()
|
EXSoundEngine()
|
||||||
|
@ -159,19 +158,6 @@ public:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//==========================================================================
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//==========================================================================
|
|
||||||
|
|
||||||
std::vector<uint8_t> EXSoundEngine::ReadSound(int lumpnum)
|
|
||||||
{
|
|
||||||
auto wlump = fileSystem.OpenFileReader(lumpnum);
|
|
||||||
return wlump.Read();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
|
|
@ -363,7 +363,6 @@ class SWSoundEngine : public RazeSoundEngine
|
||||||
{
|
{
|
||||||
// client specific parts of the sound engine go in this class.
|
// client specific parts of the sound engine go in this class.
|
||||||
void CalcPosVel(int type, const void* source, const float pt[3], int channum, int chanflags, FSoundID chanSound, FVector3* pos, FVector3* vel, FSoundChan* chan) override;
|
void CalcPosVel(int type, const void* source, const float pt[3], int channum, int chanflags, FSoundID chanSound, FVector3* pos, FVector3* vel, FSoundChan* chan) override;
|
||||||
std::vector<uint8_t> ReadSound(int lumpnum) override;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SWSoundEngine()
|
SWSoundEngine()
|
||||||
|
|
Loading…
Reference in a new issue