mirror of
https://github.com/ZDoom/Raze.git
synced 2025-02-20 18:42:26 +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
|
||||
|
|
|
@ -47,4 +47,5 @@ public:
|
|||
virtual bool SourceIsActor(FSoundChan* chan) { return chan->SourceType == SOURCE_Actor; }
|
||||
virtual int SoundSourceIndex(FSoundChan* chan) { return 0; }
|
||||
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);
|
||||
RTSName = ""; // don't try ever again.
|
||||
if (!fr.isOpen()) return false;
|
||||
RTSFile.Resize(fr.GetLength());
|
||||
RTSFile.Resize((unsigned)fr.GetLength());
|
||||
fr.Read(RTSFile.Data(), fr.GetLength());
|
||||
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.
|
||||
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:
|
||||
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*)
|
||||
{
|
||||
if (pos != nullptr && type != SOURCE_None)
|
||||
|
|
|
@ -139,18 +139,6 @@ static FSoundID GetReplacementSound(FSoundID soundNum)
|
|||
return soundNum;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
std::vector<uint8_t> DukeSoundEngine::ReadSound(int lumpnum)
|
||||
{
|
||||
auto wlump = fileSystem.OpenFileReader(lumpnum);
|
||||
return wlump.Read();
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
|
|
|
@ -137,7 +137,6 @@ class EXSoundEngine : public RazeSoundEngine
|
|||
{
|
||||
// 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;
|
||||
std::vector<uint8_t> ReadSound(int lumpnum) override;
|
||||
|
||||
public:
|
||||
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.
|
||||
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:
|
||||
SWSoundEngine()
|
||||
|
|
Loading…
Reference in a new issue