mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
Remove extra whitespace
--HG-- branch : minor
This commit is contained in:
@@ -203,7 +203,7 @@ std::vector<StringMap<Effect::Parameter>::Entry> Effect::chorusParameters =
|
||||
{"delay", Effect::CHORUS_DELAY}
|
||||
};
|
||||
|
||||
std::vector<StringMap<Effect::Parameter>::Entry> Effect::distortionParameters =
|
||||
std::vector<StringMap<Effect::Parameter>::Entry> Effect::distortionParameters =
|
||||
{
|
||||
{"gain", Effect::DISTORTION_GAIN},
|
||||
{"edge", Effect::DISTORTION_EDGE},
|
||||
@@ -212,7 +212,7 @@ std::vector<StringMap<Effect::Parameter>::Entry> Effect::distortionParameters =
|
||||
{"bandwidth", Effect::DISTORTION_EQBAND}
|
||||
};
|
||||
|
||||
std::vector<StringMap<Effect::Parameter>::Entry> Effect::echoParameters =
|
||||
std::vector<StringMap<Effect::Parameter>::Entry> Effect::echoParameters =
|
||||
{
|
||||
{"delay", Effect::ECHO_DELAY},
|
||||
{"tapdelay", Effect::ECHO_LRDELAY},
|
||||
@@ -221,7 +221,7 @@ std::vector<StringMap<Effect::Parameter>::Entry> Effect::echoParameters =
|
||||
{"spread", Effect::ECHO_SPREAD}
|
||||
};
|
||||
|
||||
std::vector<StringMap<Effect::Parameter>::Entry> Effect::flangerParameters =
|
||||
std::vector<StringMap<Effect::Parameter>::Entry> Effect::flangerParameters =
|
||||
{
|
||||
{"waveform", Effect::FLANGER_WAVEFORM},
|
||||
{"phase", Effect::FLANGER_PHASE},
|
||||
@@ -231,14 +231,14 @@ std::vector<StringMap<Effect::Parameter>::Entry> Effect::flangerParameters =
|
||||
{"delay", Effect::FLANGER_DELAY}
|
||||
};
|
||||
/*
|
||||
std::vector<StringMap<Effect::Parameter>::Entry> Effect::freqshifterParameters =
|
||||
std::vector<StringMap<Effect::Parameter>::Entry> Effect::freqshifterParameters =
|
||||
{
|
||||
{"frequency", Effect::FREQSHIFTER_FREQ},
|
||||
{"leftdirection", Effect::FREQSHIFTER_LEFTDIR},
|
||||
{"rightdirection", Effect::FREQSHIFTER_RIGHTDIR}
|
||||
};
|
||||
|
||||
std::vector<StringMap<Effect::Parameter>::Entry> Effect::morpherParameters =
|
||||
std::vector<StringMap<Effect::Parameter>::Entry> Effect::morpherParameters =
|
||||
{
|
||||
{"waveform", Effect::MORPHER_WAVEFORM},
|
||||
{"rate", Effect::MORPHER_RATE},
|
||||
@@ -248,19 +248,19 @@ std::vector<StringMap<Effect::Parameter>::Entry> Effect::morpherParameters =
|
||||
{"tuneb", Effect::MORPHER_COARSEB}
|
||||
}
|
||||
;
|
||||
std::vector<StringMap<Effect::Parameter>::Entry> Effect::pitchshifterParameters =
|
||||
std::vector<StringMap<Effect::Parameter>::Entry> Effect::pitchshifterParameters =
|
||||
{
|
||||
{"pitch", Effect::PITCHSHIFTER_PITCH}
|
||||
};
|
||||
*/
|
||||
std::vector<StringMap<Effect::Parameter>::Entry> Effect::modulatorParameters =
|
||||
std::vector<StringMap<Effect::Parameter>::Entry> Effect::modulatorParameters =
|
||||
{
|
||||
{"waveform", Effect::MODULATOR_WAVEFORM},
|
||||
{"frequency", Effect::MODULATOR_FREQ},
|
||||
{"highcut", Effect::MODULATOR_HIGHCUT}
|
||||
};
|
||||
/*
|
||||
std::vector<StringMap<Effect::Parameter>::Entry> Effect::autowahParameters =
|
||||
std::vector<StringMap<Effect::Parameter>::Entry> Effect::autowahParameters =
|
||||
{
|
||||
{"attack", Effect::AUTOWAH_ATTACK},
|
||||
{"release", Effect::AUTOWAH_RELEASE},
|
||||
@@ -268,12 +268,12 @@ std::vector<StringMap<Effect::Parameter>::Entry> Effect::autowahParameters =
|
||||
{"peakgain", Effect::AUTOWAH_PEAKGAIN}
|
||||
};
|
||||
*/
|
||||
std::vector<StringMap<Effect::Parameter>::Entry> Effect::compressorParameters =
|
||||
std::vector<StringMap<Effect::Parameter>::Entry> Effect::compressorParameters =
|
||||
{
|
||||
{"enable", Effect::COMPRESSOR_ENABLE}
|
||||
};
|
||||
|
||||
std::vector<StringMap<Effect::Parameter>::Entry> Effect::equalizerParameters =
|
||||
std::vector<StringMap<Effect::Parameter>::Entry> Effect::equalizerParameters =
|
||||
{
|
||||
{"lowgain", Effect::EQUALIZER_LOWGAIN},
|
||||
{"lowcut", Effect::EQUALIZER_LOWCUT},
|
||||
@@ -287,7 +287,7 @@ std::vector<StringMap<Effect::Parameter>::Entry> Effect::equalizerParameters =
|
||||
{"highcut", Effect::EQUALIZER_HIGHCUT}
|
||||
};
|
||||
|
||||
std::map<Effect::Type, StringMap<Effect::Parameter>> Effect::parameterNames =
|
||||
std::map<Effect::Type, StringMap<Effect::Parameter>> Effect::parameterNames =
|
||||
{
|
||||
{Effect::TYPE_BASIC, Effect::basicParameters},
|
||||
{Effect::TYPE_REVERB, Effect::reverbParameters},
|
||||
@@ -305,7 +305,7 @@ std::map<Effect::Type, StringMap<Effect::Parameter>> Effect::parameterNames =
|
||||
};
|
||||
#undef StringMap
|
||||
|
||||
std::map<Effect::Parameter, Effect::ParameterType> Effect::parameterTypes =
|
||||
std::map<Effect::Parameter, Effect::ParameterType> Effect::parameterTypes =
|
||||
{
|
||||
{Effect::EFFECT_TYPE, Effect::PARAM_TYPE},
|
||||
{Effect::EFFECT_VOLUME, Effect::PARAM_FLOAT},
|
||||
|
||||
@@ -50,13 +50,13 @@ public:
|
||||
|
||||
bool find(const char *key, T &t)
|
||||
{
|
||||
if (forward.find(key) == forward.end())
|
||||
if (forward.find(key) == forward.end())
|
||||
return false;
|
||||
t = forward[key];
|
||||
return true;
|
||||
}
|
||||
|
||||
bool find(T key, const char *&str)
|
||||
bool find(T key, const char *&str)
|
||||
{
|
||||
if (reverse.find(key) == reverse.end())
|
||||
return false;
|
||||
|
||||
@@ -95,7 +95,7 @@ std::vector<StringMap<Filter::Parameter>::Entry> Filter::bandpassParameters =
|
||||
{"highgain", Filter::FILTER_HIGHGAIN}
|
||||
};
|
||||
|
||||
std::map<Filter::Type, StringMap<Filter::Parameter>> Filter::parameterNames =
|
||||
std::map<Filter::Type, StringMap<Filter::Parameter>> Filter::parameterNames =
|
||||
{
|
||||
{Filter::TYPE_BASIC, Filter::basicParameters},
|
||||
{Filter::TYPE_LOWPASS, Filter::lowpassParameters},
|
||||
@@ -104,7 +104,7 @@ std::map<Filter::Type, StringMap<Filter::Parameter>> Filter::parameterNames =
|
||||
};
|
||||
#undef StringMap
|
||||
|
||||
std::map<Filter::Parameter, Filter::ParameterType> Filter::parameterTypes =
|
||||
std::map<Filter::Parameter, Filter::ParameterType> Filter::parameterTypes =
|
||||
{
|
||||
{Filter::FILTER_TYPE, Filter::PARAM_TYPE},
|
||||
{Filter::FILTER_VOLUME, Filter::PARAM_FLOAT},
|
||||
|
||||
@@ -49,13 +49,13 @@ public:
|
||||
|
||||
bool find(const char *key, T &t)
|
||||
{
|
||||
if (forward.find(key) == forward.end())
|
||||
if (forward.find(key) == forward.end())
|
||||
return false;
|
||||
t = forward[key];
|
||||
return true;
|
||||
}
|
||||
|
||||
bool find(T key, const char *&str)
|
||||
bool find(T key, const char *&str)
|
||||
{
|
||||
if (reverse.find(key) == reverse.end())
|
||||
return false;
|
||||
|
||||
@@ -77,7 +77,7 @@ ALenum Audio::getFormat(int bitDepth, int channels)
|
||||
return bitDepth == 8 ? AL_FORMAT_MONO8 : AL_FORMAT_MONO16;
|
||||
else if (channels == 2)
|
||||
return bitDepth == 8 ? AL_FORMAT_STEREO8 : AL_FORMAT_STEREO16;
|
||||
#ifdef AL_EXT_MCFORMATS
|
||||
#ifdef AL_EXT_MCFORMATS
|
||||
else if (alIsExtensionPresent("AL_EXT_MCFORMATS"))
|
||||
{
|
||||
if (channels == 6)
|
||||
@@ -85,7 +85,7 @@ ALenum Audio::getFormat(int bitDepth, int channels)
|
||||
else if (channels == 8)
|
||||
return bitDepth == 8 ? AL_FORMAT_71CHN8 : AL_FORMAT_71CHN16;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
return AL_NONE;
|
||||
}
|
||||
|
||||
@@ -102,11 +102,11 @@ Audio::Audio()
|
||||
if (device == nullptr)
|
||||
throw love::Exception("Could not open device.");
|
||||
|
||||
#ifdef ALC_EXT_EFX
|
||||
ALint attribs[4] = { ALC_MAX_AUXILIARY_SENDS, MAX_SOURCE_EFFECTS, 0, 0 };
|
||||
#else
|
||||
#ifdef ALC_EXT_EFX
|
||||
ALint attribs[4] = { ALC_MAX_AUXILIARY_SENDS, MAX_SOURCE_EFFECTS, 0, 0 };
|
||||
#else
|
||||
ALint *attribs = nullptr;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
context = alcCreateContext(device, attribs);
|
||||
|
||||
@@ -116,12 +116,12 @@ Audio::Audio()
|
||||
if (!alcMakeContextCurrent(context) || alcGetError(device) != ALC_NO_ERROR)
|
||||
throw love::Exception("Could not make context current.");
|
||||
|
||||
#ifdef ALC_EXT_EFX
|
||||
#ifdef ALC_EXT_EFX
|
||||
initializeEFX();
|
||||
|
||||
alcGetIntegerv(device, ALC_MAX_AUXILIARY_SENDS, 1, &MAX_SOURCE_EFFECTS);
|
||||
|
||||
alGetError();
|
||||
alGetError();
|
||||
if (alGenAuxiliaryEffectSlots)
|
||||
{
|
||||
for (int i = 0; i < MAX_SCENE_EFFECTS; i++)
|
||||
@@ -143,9 +143,9 @@ Audio::Audio()
|
||||
}
|
||||
else
|
||||
MAX_SCENE_EFFECTS = MAX_SOURCE_EFFECTS = 0;
|
||||
#else
|
||||
#else
|
||||
MAX_SCENE_EFFECTS = MAX_SOURCE_EFFECTS = 0;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
try
|
||||
{
|
||||
@@ -155,11 +155,11 @@ Audio::Audio()
|
||||
{
|
||||
for (auto c : capture)
|
||||
delete c;
|
||||
#ifdef ALC_EXT_EFX
|
||||
#ifdef ALC_EXT_EFX
|
||||
if (alDeleteAuxiliaryEffectSlots)
|
||||
for (auto slot : effectSlots)
|
||||
alDeleteAuxiliaryEffectSlots(1, &slot);
|
||||
#endif
|
||||
#endif
|
||||
alcMakeContextCurrent(nullptr);
|
||||
alcDestroyContext(context);
|
||||
alcCloseDevice(device);
|
||||
@@ -179,14 +179,14 @@ Audio::~Audio()
|
||||
delete pool;
|
||||
for (auto c : capture)
|
||||
delete c;
|
||||
#ifdef ALC_EXT_EFX
|
||||
#ifdef ALC_EXT_EFX
|
||||
for (auto e : effects)
|
||||
if (e != nullptr)
|
||||
delete e;
|
||||
if (alDeleteAuxiliaryEffectSlots)
|
||||
for (auto slot : effectSlots)
|
||||
alDeleteAuxiliaryEffectSlots(1, &slot);
|
||||
#endif
|
||||
#endif
|
||||
alcMakeContextCurrent(nullptr);
|
||||
alcDestroyContext(context);
|
||||
alcCloseDevice(device);
|
||||
@@ -320,9 +320,9 @@ void Audio::setMeter(float scale)
|
||||
if (scale >= 0.0f)
|
||||
{
|
||||
metersPerUnit = scale;
|
||||
#ifdef ALC_EXT_EFX
|
||||
#ifdef ALC_EXT_EFX
|
||||
alListenerf(AL_METERS_PER_UNIT, scale);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -455,7 +455,7 @@ bool Audio::setSceneEffect(int slot, std::map<Effect::Parameter, float> ¶ms)
|
||||
|
||||
bool result = effects[slot]->setParams(params);
|
||||
|
||||
#ifdef ALC_EXT_EFX
|
||||
#ifdef ALC_EXT_EFX
|
||||
if (alAuxiliaryEffectSloti)
|
||||
{
|
||||
if (result == true)
|
||||
@@ -468,7 +468,7 @@ bool Audio::setSceneEffect(int slot, std::map<Effect::Parameter, float> ¶ms)
|
||||
alAuxiliaryEffectSloti(effectSlots[slot], AL_EFFECTSLOT_EFFECT, AL_EFFECT_NULL);
|
||||
alGetError();
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -483,10 +483,10 @@ bool Audio::setSceneEffect(int slot)
|
||||
|
||||
effects[slot] = nullptr;
|
||||
|
||||
#ifdef ALC_EXT_EFX
|
||||
#ifdef ALC_EXT_EFX
|
||||
if (alAuxiliaryEffectSloti)
|
||||
alAuxiliaryEffectSloti(effectSlots[slot], AL_EFFECTSLOT_EFFECT, AL_EFFECT_NULL);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -516,11 +516,11 @@ int Audio::getMaxSourceEffects() const
|
||||
|
||||
bool Audio::isEFXsupported() const
|
||||
{
|
||||
#ifdef ALC_EXT_EFX
|
||||
#ifdef ALC_EXT_EFX
|
||||
return (alGenEffects != nullptr);
|
||||
#else
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
ALuint Audio::getSceneEffectID(int slot)
|
||||
@@ -574,7 +574,7 @@ LPALGETAUXILIARYEFFECTSLOTFV alGetAuxiliaryEffectSlotfv = nullptr;
|
||||
|
||||
void Audio::initializeEFX()
|
||||
{
|
||||
#ifdef ALC_EXT_EFX
|
||||
#ifdef ALC_EXT_EFX
|
||||
if (alcIsExtensionPresent(device, "ALC_EXT_EFX") == AL_FALSE)
|
||||
return;
|
||||
|
||||
@@ -636,7 +636,7 @@ void Audio::initializeEFX()
|
||||
alGetAuxiliaryEffectSlotf = nullptr; alGetAuxiliaryEffectSlotfv = nullptr;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
} // openal
|
||||
|
||||
@@ -55,7 +55,7 @@ Effect *Effect::clone()
|
||||
|
||||
bool Effect::generateEffect()
|
||||
{
|
||||
#ifdef ALC_EXT_EFX
|
||||
#ifdef ALC_EXT_EFX
|
||||
if (!alGenEffects)
|
||||
return false;
|
||||
|
||||
@@ -67,17 +67,17 @@ bool Effect::generateEffect()
|
||||
throw love::Exception("Failed to create sound Effect.");
|
||||
|
||||
return true;
|
||||
#else
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void Effect::deleteEffect()
|
||||
{
|
||||
#ifdef ALC_EXT_EFX
|
||||
#ifdef ALC_EXT_EFX
|
||||
if (effect != AL_EFFECT_NULL)
|
||||
alDeleteEffects(1, &effect);
|
||||
#endif
|
||||
#endif
|
||||
effect = AL_EFFECT_NULL;
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ bool Effect::setParams(const std::map<Parameter, float> ¶ms)
|
||||
if (!generateEffect())
|
||||
return false;
|
||||
|
||||
#ifdef ALC_EXT_EFX
|
||||
#ifdef ALC_EXT_EFX
|
||||
//parameter table without EFFECT_TYPE entry is illegal
|
||||
switch (type)
|
||||
{
|
||||
@@ -150,8 +150,8 @@ bool Effect::setParams(const std::map<Parameter, float> ¶ms)
|
||||
return false;
|
||||
}
|
||||
|
||||
#define clampf(v,l,h) fmax(fmin((v),(h)),(l))
|
||||
#define PARAMSTR(i,e,v) effect,AL_##e##_##v,clampf(getValue(i,AL_##e##_DEFAULT_##v),AL_##e##_MIN_##v,AL_##e##_MAX_##v)
|
||||
#define clampf(v,l,h) fmax(fmin((v),(h)),(l))
|
||||
#define PARAMSTR(i,e,v) effect,AL_##e##_##v,clampf(getValue(i,AL_##e##_DEFAULT_##v),AL_##e##_MIN_##v,AL_##e##_MAX_##v)
|
||||
switch (type)
|
||||
{
|
||||
case TYPE_REVERB:
|
||||
@@ -224,7 +224,7 @@ bool Effect::setParams(const std::map<Parameter, float> ¶ms)
|
||||
/*
|
||||
case TYPE_FREQSHIFTER:
|
||||
{
|
||||
alEffectf(PARAMSTR(FREQSHIFTER_FREQ,FREQUENCY_SHIFTER,FREQUENCY));
|
||||
alEffectf(PARAMSTR(FREQSHIFTER_FREQ,FREQUENCY_SHIFTER,FREQUENCY));
|
||||
|
||||
Direction dir = static_cast<Direction>(getValue(FREQSHIFTER_LEFTDIR, static_cast<int>(DIR_MAX_ENUM)));
|
||||
if (dir == DIR_NONE)
|
||||
@@ -233,7 +233,7 @@ bool Effect::setParams(const std::map<Parameter, float> ¶ms)
|
||||
alEffecti(effect, AL_FREQUENCY_SHIFTER_LEFT_DIRECTION, AL_FREQUENCY_SHIFTER_DIRECTION_UP);
|
||||
else if(dir == DIR_DOWN)
|
||||
alEffecti(effect, AL_FREQUENCY_SHIFTER_LEFT_DIRECTION, AL_FREQUENCY_SHIFTER_DIRECTION_DOWN);
|
||||
else
|
||||
else
|
||||
alEffecti(effect, AL_FREQUENCY_SHIFTER_LEFT_DIRECTION, AL_FREQUENCY_SHIFTER_DEFAULT_LEFT_DIRECTION);
|
||||
|
||||
dir = static_cast<Direction>(getValue(FREQSHIFTER_RIGHTDIR, static_cast<int>(DIR_MAX_ENUM)));
|
||||
@@ -243,7 +243,7 @@ bool Effect::setParams(const std::map<Parameter, float> ¶ms)
|
||||
alEffecti(effect, AL_FREQUENCY_SHIFTER_RIGHT_DIRECTION, AL_FREQUENCY_SHIFTER_DIRECTION_UP);
|
||||
else if(dir == DIR_DOWN)
|
||||
alEffecti(effect, AL_FREQUENCY_SHIFTER_RIGHT_DIRECTION, AL_FREQUENCY_SHIFTER_DIRECTION_DOWN);
|
||||
else
|
||||
else
|
||||
alEffecti(effect, AL_FREQUENCY_SHIFTER_RIGHT_DIRECTION, AL_FREQUENCY_SHIFTER_DEFAULT_RIGHT_DIRECTION);
|
||||
break;
|
||||
}
|
||||
@@ -351,14 +351,14 @@ bool Effect::setParams(const std::map<Parameter, float> ¶ms)
|
||||
case TYPE_MAX_ENUM:
|
||||
break;
|
||||
}
|
||||
#undef PARAMSTR
|
||||
#undef clampf
|
||||
#undef PARAMSTR
|
||||
#undef clampf
|
||||
//alGetError();
|
||||
|
||||
return true;
|
||||
#else
|
||||
#else
|
||||
return false;
|
||||
#endif //ALC_EXT_EFX
|
||||
#endif //ALC_EXT_EFX
|
||||
}
|
||||
|
||||
const std::map<Effect::Parameter, float> &Effect::getParams() const
|
||||
@@ -377,7 +377,7 @@ int Effect::getValue(Parameter in, int def) const
|
||||
}
|
||||
|
||||
/*
|
||||
std::map<Effect::Phoneme, ALint> Effect::phonemeMap =
|
||||
std::map<Effect::Phoneme, ALint> Effect::phonemeMap =
|
||||
{
|
||||
{Effect::PHONEME_A, AL_VOCAL_MORPHER_PHONEME_A},
|
||||
{Effect::PHONEME_E, AL_VOCAL_MORPHER_PHONEME_E},
|
||||
|
||||
@@ -54,7 +54,7 @@ Filter *Filter::clone()
|
||||
|
||||
bool Filter::generateFilter()
|
||||
{
|
||||
#ifdef ALC_EXT_EFX
|
||||
#ifdef ALC_EXT_EFX
|
||||
if (!alGenFilters)
|
||||
return false;
|
||||
|
||||
@@ -66,17 +66,17 @@ bool Filter::generateFilter()
|
||||
throw love::Exception("Failed to create sound Filter.");
|
||||
|
||||
return true;
|
||||
#else
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void Filter::deleteFilter()
|
||||
{
|
||||
#ifdef ALC_EXT_EFX
|
||||
#ifdef ALC_EXT_EFX
|
||||
if (filter != AL_FILTER_NULL)
|
||||
alDeleteFilters(1, &filter);
|
||||
#endif
|
||||
#endif
|
||||
filter = AL_FILTER_NULL;
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ bool Filter::setParams(const std::map<Parameter, float> ¶ms)
|
||||
if (!generateFilter())
|
||||
return false;
|
||||
|
||||
#ifdef ALC_EXT_EFX
|
||||
#ifdef ALC_EXT_EFX
|
||||
switch (type)
|
||||
{
|
||||
case TYPE_LOWPASS:
|
||||
@@ -117,8 +117,8 @@ bool Filter::setParams(const std::map<Parameter, float> ¶ms)
|
||||
return false;
|
||||
}
|
||||
|
||||
#define clampf(v,l,h) fmax(fmin((v),(h)),(l))
|
||||
#define PARAMSTR(i,e,v) filter,AL_##e##_##v,clampf(getValue(i,AL_##e##_DEFAULT_##v),AL_##e##_MIN_##v,AL_##e##_MAX_##v)
|
||||
#define clampf(v,l,h) fmax(fmin((v),(h)),(l))
|
||||
#define PARAMSTR(i,e,v) filter,AL_##e##_##v,clampf(getValue(i,AL_##e##_DEFAULT_##v),AL_##e##_MIN_##v,AL_##e##_MAX_##v)
|
||||
switch (type)
|
||||
{
|
||||
case TYPE_LOWPASS:
|
||||
@@ -138,14 +138,14 @@ bool Filter::setParams(const std::map<Parameter, float> ¶ms)
|
||||
case TYPE_MAX_ENUM:
|
||||
break;
|
||||
}
|
||||
#undef clampf
|
||||
#undef PARAMSTR
|
||||
#undef clampf
|
||||
#undef PARAMSTR
|
||||
//alGetError();
|
||||
|
||||
return true;
|
||||
#else
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
const std::map<Filter::Parameter, float> &Filter::getParams() const
|
||||
|
||||
@@ -341,7 +341,7 @@ bool Source::update()
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
case TYPE_QUEUE:
|
||||
case TYPE_QUEUE:
|
||||
{
|
||||
ALint processed;
|
||||
ALuint buffers[MAX_BUFFERS];
|
||||
@@ -648,9 +648,9 @@ void Source::setCone(float innerAngle, float outerAngle, float outerVolume, floa
|
||||
alSourcei(source, AL_CONE_INNER_ANGLE, cone.innerAngle);
|
||||
alSourcei(source, AL_CONE_OUTER_ANGLE, cone.outerAngle);
|
||||
alSourcef(source, AL_CONE_OUTER_GAIN, cone.outerVolume);
|
||||
#ifdef ALC_EXT_EFX
|
||||
#ifdef ALC_EXT_EFX
|
||||
alSourcef(source, AL_CONE_OUTER_GAINHF, cone.outerHighGain);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -748,14 +748,14 @@ int Source::getFreeBufferCount() const
|
||||
{
|
||||
switch (sourceType) //why not :^)
|
||||
{
|
||||
case TYPE_STATIC:
|
||||
case TYPE_STATIC:
|
||||
return 0;
|
||||
case TYPE_STREAM:
|
||||
return unusedBufferTop + 1;
|
||||
case TYPE_QUEUE:
|
||||
return valid ? unusedBufferTop + 1 : (int)MAX_BUFFERS - unusedBufferTop - 1;
|
||||
case TYPE_MAX_ENUM:
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -887,7 +887,7 @@ bool Source::playAtomic(ALuint source)
|
||||
|
||||
//this is set to success state afterwards anyway, but setting it here
|
||||
//to true preemptively avoids race condition with update bug
|
||||
valid = true;
|
||||
valid = true;
|
||||
|
||||
return success;
|
||||
}
|
||||
@@ -1014,7 +1014,7 @@ void Source::reset()
|
||||
alSourcei(source, AL_CONE_INNER_ANGLE, cone.innerAngle);
|
||||
alSourcei(source, AL_CONE_OUTER_ANGLE, cone.outerAngle);
|
||||
alSourcef(source, AL_CONE_OUTER_GAIN, cone.outerVolume);
|
||||
#ifdef ALC_EXT_EFX
|
||||
#ifdef ALC_EXT_EFX
|
||||
alSourcef(source, AL_AIR_ABSORPTION_FACTOR, absorptionFactor);
|
||||
alSourcef(source, AL_CONE_OUTER_GAINHF, cone.outerHighGain);
|
||||
alSourcef(source, AL_ROOM_ROLLOFF_FACTOR, rolloffFactor); //reverb-specific rolloff
|
||||
@@ -1022,7 +1022,7 @@ void Source::reset()
|
||||
for (unsigned int i = 0; i < sendtargets.size(); i++)
|
||||
alSource3i(source, AL_AUXILIARY_SEND_FILTER, sendtargets[i], i, sendfilters[i] ? sendfilters[i]->getFilter() : AL_FILTER_NULL);
|
||||
//alGetError();
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void Source::setFloatv(float *dst, const float *src) const
|
||||
@@ -1230,13 +1230,13 @@ void Source::setAirAbsorptionFactor(float factor)
|
||||
throw SpatialSupportException();
|
||||
|
||||
absorptionFactor = factor;
|
||||
#ifdef ALC_EXT_EFX
|
||||
#ifdef ALC_EXT_EFX
|
||||
if (valid)
|
||||
{
|
||||
alSourcef(source, AL_AIR_ABSORPTION_FACTOR, absorptionFactor);
|
||||
//alGetError();
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
float Source::getAirAbsorptionFactor() const
|
||||
@@ -1259,14 +1259,14 @@ bool Source::setFilter(std::map<Filter::Parameter, float> ¶ms)
|
||||
|
||||
bool result = directfilter->setParams(params);
|
||||
|
||||
#ifdef ALC_EXT_EFX
|
||||
#ifdef ALC_EXT_EFX
|
||||
if (valid)
|
||||
{
|
||||
//in case of failure contains AL_FILTER_NULL, a valid non-filter
|
||||
alSourcei(source, AL_DIRECT_FILTER, directfilter->getFilter());
|
||||
//alGetError();
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -1278,13 +1278,13 @@ bool Source::setFilter()
|
||||
|
||||
directfilter = nullptr;
|
||||
|
||||
#ifdef ALC_EXT_EFX
|
||||
#ifdef ALC_EXT_EFX
|
||||
if (valid)
|
||||
{
|
||||
alSourcei(source, AL_DIRECT_FILTER, AL_FILTER_NULL);
|
||||
//alGetError();
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1311,13 +1311,13 @@ bool Source::setSceneEffect(int slot, int effect)
|
||||
|
||||
sendfilters[slot] = nullptr;
|
||||
|
||||
#ifdef ALC_EXT_EFX
|
||||
#ifdef ALC_EXT_EFX
|
||||
if (valid)
|
||||
{
|
||||
alSource3i(source, AL_AUXILIARY_SEND_FILTER, sendtargets[slot], slot, AL_FILTER_NULL);
|
||||
//alGetError();
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1334,14 +1334,14 @@ bool Source::setSceneEffect(int slot, int effect, std::map<Filter::Parameter, fl
|
||||
|
||||
sendfilters[slot]->setParams(params);
|
||||
|
||||
#ifdef ALC_EXT_EFX
|
||||
#ifdef ALC_EXT_EFX
|
||||
if (valid)
|
||||
{
|
||||
//in case of failure contains AL_FILTER_NULL, a valid non-filter
|
||||
alSource3i(source, AL_AUXILIARY_SEND_FILTER, sendtargets[slot], slot, sendfilters[slot]->getFilter());
|
||||
//alGetError();
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1356,13 +1356,13 @@ bool Source::setSceneEffect(int slot)
|
||||
delete sendfilters[slot];
|
||||
sendfilters[slot] = nullptr;
|
||||
|
||||
#ifdef ALC_EXT_EFX
|
||||
#ifdef ALC_EXT_EFX
|
||||
if (valid)
|
||||
{
|
||||
alSource3i(source, AL_AUXILIARY_SEND_FILTER, AL_EFFECTSLOT_NULL, slot, AL_FILTER_NULL);
|
||||
//alGetError();
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -344,7 +344,7 @@ int w_setSceneEffect(lua_State *L)
|
||||
|
||||
if(Effect::getConstant(keystr, param, type) || Effect::getConstant(keystr, param, Effect::TYPE_BASIC))
|
||||
{
|
||||
#define luax_effecterror(l,t) luaL_error(l,"Bad parameter type for %s %s: " t " expected, got %s", typestr, keystr, lua_typename(L, -1))
|
||||
#define luax_effecterror(l,t) luaL_error(l,"Bad parameter type for %s %s: " t " expected, got %s", typestr, keystr, lua_typename(L, -1))
|
||||
switch(Effect::getParameterType(param))
|
||||
{
|
||||
case Effect::PARAM_FLOAT:
|
||||
@@ -355,7 +355,7 @@ int w_setSceneEffect(lua_State *L)
|
||||
case Effect::PARAM_BOOL:
|
||||
if (!lua_isboolean(L, -1))
|
||||
return luax_effecterror(L, "boolean");
|
||||
params[param] = lua_toboolean(L, -1) ? 1.0 : 0.0;
|
||||
params[param] = lua_toboolean(L, -1) ? 1.0 : 0.0;
|
||||
break;
|
||||
case Effect::PARAM_WAVEFORM:
|
||||
{
|
||||
@@ -396,7 +396,7 @@ int w_setSceneEffect(lua_State *L)
|
||||
case Effect::PARAM_MAX_ENUM:
|
||||
break;
|
||||
}
|
||||
#undef luax_effecterror
|
||||
#undef luax_effecterror
|
||||
}
|
||||
else
|
||||
luaL_error(L, "Invalid '%s' Effect parameter: %s", typestr, keystr);
|
||||
|
||||
@@ -376,7 +376,7 @@ int setFilterReadFilter(lua_State *L, int idx, std::map<Filter::Parameter, float
|
||||
|
||||
if(Filter::getConstant(keystr, param, type) || Filter::getConstant(keystr, param, Filter::TYPE_BASIC))
|
||||
{
|
||||
#define luax_effecterror(l,t) luaL_error(l,"Bad parameter type for %s %s: " t " expected, got %s", typestr, keystr, lua_typename(L, -1))
|
||||
#define luax_effecterror(l,t) luaL_error(l,"Bad parameter type for %s %s: " t " expected, got %s", typestr, keystr, lua_typename(L, -1))
|
||||
switch(Filter::getParameterType(param))
|
||||
{
|
||||
case Filter::PARAM_FLOAT:
|
||||
@@ -388,7 +388,7 @@ int setFilterReadFilter(lua_State *L, int idx, std::map<Filter::Parameter, float
|
||||
case Filter::PARAM_MAX_ENUM:
|
||||
break;
|
||||
}
|
||||
#undef luax_effecterror
|
||||
#undef luax_effecterror
|
||||
}
|
||||
else
|
||||
luaL_error(L, "Invalid '%s' Effect parameter: %s", typestr, keystr);
|
||||
|
||||
Reference in New Issue
Block a user