snddefault: fix valgrind uninitialized memory warnings
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9430 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 26196acb3ebd2f874c1e306989907c60520ff90f Former-commit-id: 857a0f63be2f3cc56ea303a3bc945d1cfef63d47
This commit is contained in:
parent
4cab08adcd
commit
0017228cd0
4 changed files with 28 additions and 51 deletions
|
@ -26,23 +26,9 @@
|
|||
OpenalSound::OpenalSound(const char* filename, OpenalSoundInterface* sitf,
|
||||
int flags, bool loop, bool static_pool)
|
||||
: Sound(flags, loop)
|
||||
, static_pool(static_pool)
|
||||
, itf(sitf)
|
||||
{
|
||||
this->static_pool = static_pool;
|
||||
poolindex = -1;
|
||||
itf = sitf;
|
||||
|
||||
MAX_DISTANCE = 10000.0f;
|
||||
MAX_DISTANCE_LOW = 5.0f;
|
||||
REFERENCE_DISTANCE = 5.0f;
|
||||
ROLLOFF_FACTOR = 0.5f;
|
||||
|
||||
int i;
|
||||
for (i = 0; i<3; i++) {
|
||||
source_position[i] = 0.0f;
|
||||
source_velocity[i] = 0.0f;
|
||||
zeroes[i] = 0.0f;
|
||||
}
|
||||
|
||||
GfLogTrace("OpenAL : Creating %s source from %s\n",
|
||||
static_pool ? "static" : "dynamic", filename);
|
||||
|
||||
|
|
|
@ -34,21 +34,21 @@ class OpenalSoundInterface;
|
|||
|
||||
class OpenalSound : public Sound {
|
||||
protected:
|
||||
ALuint buffer; ///< buffer id
|
||||
ALuint source; ///< source id
|
||||
ALfloat source_position[3]; ///< source position
|
||||
ALfloat source_velocity[3]; ///< source velocity
|
||||
ALfloat zeroes[3]; ///< just a vector of 0s
|
||||
ALuint buffer = 0; ///< buffer id
|
||||
ALuint source = 0; ///< source id
|
||||
ALfloat source_position[3] = { 0.0f, 0.0f, 0.0f }; ///< source position
|
||||
ALfloat source_velocity[3] = { 0.0f, 0.0f, 0.0f }; ///< source velocity
|
||||
const ALfloat zeroes[3] = { 0.0f, 0.0f, 0.0f }; ///< just a vector of 0s
|
||||
ALfloat back[6]; ///< direction of back
|
||||
ALfloat front[6]; ///< direction of front
|
||||
ALfloat MAX_DISTANCE; ///< maximum allowed distance
|
||||
ALfloat MAX_DISTANCE_LOW; ///< maximum allowed distance
|
||||
ALfloat REFERENCE_DISTANCE; ///< reference distance for sound
|
||||
ALfloat ROLLOFF_FACTOR; ///< how fast we need to roll off
|
||||
int poolindex; ///< which pool the sound is assigned to
|
||||
OpenalSoundInterface* itf; ///< Handle to the interface
|
||||
bool static_pool; ///< dynamic or static source assignment?
|
||||
bool is_enabled; ///< is it available at all?
|
||||
ALfloat MAX_DISTANCE = 10000.0f; ///< maximum allowed distance
|
||||
ALfloat MAX_DISTANCE_LOW = 5.0f; ///< maximum allowed distance
|
||||
ALfloat REFERENCE_DISTANCE = 5.0f; ///< reference distance for sound
|
||||
ALfloat ROLLOFF_FACTOR = 0.5f; ///< how fast we need to roll off
|
||||
int poolindex = -1; ///< which pool the sound is assigned to
|
||||
OpenalSoundInterface* itf = nullptr; ///< Handle to the interface
|
||||
bool static_pool = true; ///< dynamic or static source assignment?
|
||||
bool is_enabled = false; ///< is it available at all?
|
||||
public:
|
||||
OpenalSound(const char* filename,
|
||||
OpenalSoundInterface* sitf,
|
||||
|
|
|
@ -23,17 +23,8 @@
|
|||
|
||||
|
||||
/// Construct a sound.
|
||||
Sound::Sound(int flags, bool loop)
|
||||
Sound::Sound(int flags, bool loop) : flags(flags), loop(loop)
|
||||
{
|
||||
iface = nullptr;
|
||||
this->flags = flags;
|
||||
MAX_VOL = 1.0f;
|
||||
volume = 0.0f;
|
||||
pitch = 1.0f;
|
||||
lowpass = 1.0f;
|
||||
this->loop = loop;
|
||||
playing = false;
|
||||
paused = false;
|
||||
}
|
||||
|
||||
/// Destructor
|
||||
|
|
|
@ -51,15 +51,15 @@ class Sound
|
|||
{
|
||||
protected:
|
||||
|
||||
class SoundInterface* iface; ///< Handler to the interface
|
||||
int flags; ///< Flags relating to what effects are to be used.
|
||||
float MAX_VOL; ///< Maximum volume
|
||||
float volume; ///< Current volume
|
||||
float pitch; ///< Current pitch
|
||||
float lowpass; ///< Current low pass filter
|
||||
bool loop; ///< Whether it's a looping sound
|
||||
bool playing; ///< Sound is playing
|
||||
bool paused; ///< sound is paused
|
||||
class SoundInterface* iface = nullptr; ///< Handler to the interface
|
||||
int flags = 0; ///< Flags relating to what effects are to be used.
|
||||
float MAX_VOL = 1.0f; ///< Maximum volume
|
||||
float volume = 0.0f; ///< Current volume
|
||||
float pitch = 1.0f; ///< Current pitch
|
||||
float lowpass = 1.0f; ///< Current low pass filter
|
||||
bool loop = false; ///< Whether it's a looping sound
|
||||
bool playing = false; ///< Sound is playing
|
||||
bool paused = false; ///< sound is paused
|
||||
|
||||
public:
|
||||
|
||||
|
|
Loading…
Reference in a new issue