aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-03-22 16:04:13 -0700
committerChris Robinson <[email protected]>2019-03-22 16:04:13 -0700
commitea8b02dead8f7b35f0fe2c2fa3b0aa0f8d258828 (patch)
treea25ab46a278d491291e6bb65739df75e380adfb7 /OpenAL32
parente7e585f65c43e2ccd2ae71c36c4940f4b2efa80a (diff)
Pass ALeffectProps directly to the get/setParam* methods
Diffstat (limited to 'OpenAL32')
-rw-r--r--OpenAL32/Include/alEffect.h8
-rw-r--r--OpenAL32/alEffect.cpp27
2 files changed, 27 insertions, 8 deletions
diff --git a/OpenAL32/Include/alEffect.h b/OpenAL32/Include/alEffect.h
index fdd1b017..005478c6 100644
--- a/OpenAL32/Include/alEffect.h
+++ b/OpenAL32/Include/alEffect.h
@@ -151,14 +151,6 @@ struct ALeffect {
/* Self ID */
ALuint id{0u};
};
-#define ALeffect_setParami(o, c, p, v) ((o)->vtab->setParami(o, c, p, v))
-#define ALeffect_setParamf(o, c, p, v) ((o)->vtab->setParamf(o, c, p, v))
-#define ALeffect_setParamiv(o, c, p, v) ((o)->vtab->setParamiv(o, c, p, v))
-#define ALeffect_setParamfv(o, c, p, v) ((o)->vtab->setParamfv(o, c, p, v))
-#define ALeffect_getParami(o, c, p, v) ((o)->vtab->getParami(o, c, p, v))
-#define ALeffect_getParamf(o, c, p, v) ((o)->vtab->getParamf(o, c, p, v))
-#define ALeffect_getParamiv(o, c, p, v) ((o)->vtab->getParamiv(o, c, p, v))
-#define ALeffect_getParamfv(o, c, p, v) ((o)->vtab->getParamfv(o, c, p, v))
inline ALboolean IsReverbEffect(ALenum type)
{ return type == AL_EFFECT_REVERB || type == AL_EFFECT_EAXREVERB; }
diff --git a/OpenAL32/alEffect.cpp b/OpenAL32/alEffect.cpp
index 275ac34c..8b89fd45 100644
--- a/OpenAL32/alEffect.cpp
+++ b/OpenAL32/alEffect.cpp
@@ -79,6 +79,33 @@ constexpr struct FactoryItem {
};
+template<typename... T>
+void ALeffect_setParami(ALeffect *effect, T&& ...args)
+{ effect->vtab->setParami(&effect->Props, std::forward<T>(args)...); }
+template<typename... T>
+void ALeffect_setParamiv(ALeffect *effect, T&& ...args)
+{ effect->vtab->setParamiv(&effect->Props, std::forward<T>(args)...); }
+template<typename... T>
+void ALeffect_setParamf(ALeffect *effect, T&& ...args)
+{ effect->vtab->setParamf(&effect->Props, std::forward<T>(args)...); }
+template<typename... T>
+void ALeffect_setParamfv(ALeffect *effect, T&& ...args)
+{ effect->vtab->setParamfv(&effect->Props, std::forward<T>(args)...); }
+
+template<typename... T>
+void ALeffect_getParami(const ALeffect *effect, T&& ...args)
+{ effect->vtab->getParami(&effect->Props, std::forward<T>(args)...); }
+template<typename... T>
+void ALeffect_getParamiv(const ALeffect *effect, T&& ...args)
+{ effect->vtab->getParamiv(&effect->Props, std::forward<T>(args)...); }
+template<typename... T>
+void ALeffect_getParamf(const ALeffect *effect, T&& ...args)
+{ effect->vtab->getParamf(&effect->Props, std::forward<T>(args)...); }
+template<typename... T>
+void ALeffect_getParamfv(const ALeffect *effect, T&& ...args)
+{ effect->vtab->getParamfv(&effect->Props, std::forward<T>(args)...); }
+
+
void InitEffectParams(ALeffect *effect, ALenum type)
{
EffectStateFactory *factory = getFactoryByType(type);