-void F_API OPENAL_3D_Listener_SetAttributes(const float *pos, const float *vel, float fx, float fy, float fz, float tx, float ty, float tz)
+static void set_channel_position(const int channel, const float x,
+ const float y, const float z)
+{
+ OPENAL_Channels *chan = &channels[channel];
+
+ chan->position[0] = x;
+ chan->position[1] = y;
+ chan->position[2] = z;
+
+ OPENAL_SAMPLE *sptr = chan->sample;
+ if (sptr == NULL)
+ return;
+
+ const ALuint sid = chan->sid;
+ const bool no_attenuate = ((sptr->is2d) || (source_too_close(channel)));
+
+ if (no_attenuate)
+ {
+ alSourcei(sid, AL_SOURCE_RELATIVE, AL_TRUE);
+ alSource3f(sid, AL_POSITION, 0.0f, 0.0f, 0.0f);
+ }
+ else
+ {
+ alSourcei(sid, AL_SOURCE_RELATIVE, AL_FALSE);
+ alSource3f(sid, AL_POSITION, x, y, z);
+ }
+}
+
+
+AL_API void OPENAL_3D_Listener_SetAttributes(const float *pos, const float *vel, float fx, float fy, float fz, float tx, float ty, float tz)