Skip to content

Commit

Permalink
Break up a long line
Browse files Browse the repository at this point in the history
  • Loading branch information
kcat committed Apr 18, 2023
1 parent 17aa05a commit 63d7ad2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1470,7 +1470,9 @@ HRESULT STDMETHODCALLTYPE Buffer::Buffer3D::SetMode(DWORD mode, DWORD apply) noe
{
if(mode == DS3DMODE_DISABLE)
{
const float x{static_cast<float>(self->mPan-DSBPAN_LEFT)/(DSBPAN_RIGHT-DSBPAN_LEFT) - 0.5f};
const float pandiff{static_cast<float>(self->mPan - DSBPAN_LEFT)};
const float x{pandiff/(DSBPAN_RIGHT-DSBPAN_LEFT) - 0.5f};

alSource3f(self->mSource, AL_POSITION, x, 0.0f, -std::sqrt(1.0f - x*x));
alSource3f(self->mSource, AL_VELOCITY, 0.0f, 0.0f, 0.0f);
alSource3f(self->mSource, AL_DIRECTION, 0.0f, 0.0f, 0.0f);
Expand Down

0 comments on commit 63d7ad2

Please sign in to comment.