1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-10-15 07:26:33 +00:00

appease clang + docs

This commit is contained in:
epochwon 2025-05-02 21:41:37 -04:00
parent c541cb96cc
commit d29c01be26
6 changed files with 28 additions and 18 deletions

View file

@ -1185,8 +1185,8 @@ namespace MWSound
alSourcefv(source, AL_VELOCITY, vel.ptr());
}
void OpenALOutput::updateCommon(
ALuint source, const osg::Vec3f& pos, const osg::Vec3f& vel, ALfloat maxdist, ALfloat gain, ALfloat pitch, bool useenv)
void OpenALOutput::updateCommon(ALuint source, const osg::Vec3f& pos, const osg::Vec3f& vel, ALfloat maxdist,
ALfloat gain, ALfloat pitch, bool useenv)
{
if (useenv && mListenerEnv == Env_Underwater && !mWaterFilter)
{
@ -1315,8 +1315,8 @@ namespace MWSound
return;
ALuint source = GET_PTRID(sound->mHandle);
updateCommon(source, sound->getPosition(), sound->getVelocity(), sound->getMaxDistance(), sound->getRealVolume(),
getTimeScaledPitch(sound), sound->getUseEnv());
updateCommon(source, sound->getPosition(), sound->getVelocity(), sound->getMaxDistance(),
sound->getRealVolume(), getTimeScaledPitch(sound), sound->getUseEnv());
getALError();
}
@ -1363,8 +1363,8 @@ namespace MWSound
if (sound->getIsLooping())
Log(Debug::Warning) << "Warning: cannot loop stream \"" << decoder->getName() << "\"";
initCommon3D(source, sound->getPosition(), sound->getVelocity(), sound->getMinDistance(), sound->getMaxDistance(),
sound->getRealVolume(), getTimeScaledPitch(sound), false, sound->getUseEnv());
initCommon3D(source, sound->getPosition(), sound->getVelocity(), sound->getMinDistance(),
sound->getMaxDistance(), sound->getRealVolume(), getTimeScaledPitch(sound), false, sound->getUseEnv());
if (getALError() != AL_NO_ERROR)
return false;
@ -1446,8 +1446,8 @@ namespace MWSound
OpenAL_SoundStream* stream = reinterpret_cast<OpenAL_SoundStream*>(sound->mHandle);
ALuint source = stream->mSource;
updateCommon(source, sound->getPosition(), sound->getVelocity(), sound->getMaxDistance(), sound->getRealVolume(),
getTimeScaledPitch(sound), sound->getUseEnv());
updateCommon(source, sound->getPosition(), sound->getVelocity(), sound->getMaxDistance(),
sound->getRealVolume(), getTimeScaledPitch(sound), sound->getUseEnv());
getALError();
}

View file

@ -65,11 +65,11 @@ namespace MWSound
std::unique_ptr<DefaultDeviceThread> mDefaultDeviceThread;
void initCommon2D(ALuint source, const osg::Vec3f& pos, ALfloat gain, ALfloat pitch, bool loop, bool useenv);
void initCommon3D(ALuint source, const osg::Vec3f& pos, const osg::Vec3f& vel, ALfloat mindist, ALfloat maxdist, ALfloat gain,
ALfloat pitch, bool loop, bool useenv);
void initCommon3D(ALuint source, const osg::Vec3f& pos, const osg::Vec3f& vel, ALfloat mindist, ALfloat maxdist,
ALfloat gain, ALfloat pitch, bool loop, bool useenv);
void updateCommon(
ALuint source, const osg::Vec3f& pos, const osg::Vec3f& vel, ALfloat maxdist, ALfloat gain, ALfloat pitch, bool useenv);
void updateCommon(ALuint source, const osg::Vec3f& pos, const osg::Vec3f& vel, ALfloat maxdist, ALfloat gain,
ALfloat pitch, bool useenv);
float getTimeScaledPitch(SoundBase* sound);
@ -109,8 +109,8 @@ namespace MWSound
void startUpdate() override;
void finishUpdate() override;
void updateListener(
const osg::Vec3f& pos, const osg::Vec3f& atdir, const osg::Vec3f& updir, const osg::Vec3f& vel, Environment env) override;
void updateListener(const osg::Vec3f& pos, const osg::Vec3f& atdir, const osg::Vec3f& updir,
const osg::Vec3f& vel, Environment env) override;
void pauseSounds(int types) override;
void resumeSounds(int types) override;

View file

@ -155,7 +155,7 @@ namespace MWSound
const osg::Vec3f& getPosition() const { return mParams.mPos; }
const osg::Vec3f& getLastPosition() const { return mParams.mLastPos; }
const osg::Vec3f& getVelocity() const {return mParams.mVel; }
const osg::Vec3f& getVelocity() const { return mParams.mVel; }
float getRealVolume() const { return mParams.mVolume * mParams.mBaseVolume * mParams.mFadeVolume; }
float getPitch() const { return mParams.mPitch; }
float getMinDistance() const { return mParams.mMinDistance; }

View file

@ -61,8 +61,8 @@ namespace MWSound
virtual void startUpdate() = 0;
virtual void finishUpdate() = 0;
virtual void updateListener(
const osg::Vec3f& pos, const osg::Vec3f& atdir, const osg::Vec3f& updir, const osg::Vec3f& vel, Environment env)
virtual void updateListener(const osg::Vec3f& pos, const osg::Vec3f& atdir, const osg::Vec3f& updir,
const osg::Vec3f& vel, Environment env)
= 0;
virtual void pauseSounds(int types) = 0;

View file

@ -1467,7 +1467,7 @@ namespace MWWorld
void World::queueMovement(const Ptr& ptr, const osg::Vec3f& velocity)
{
mPhysics->queueObjectMovement(ptr, velocity);
if(ptr == MWMechanics::getPlayer())
if (ptr == MWMechanics::getPlayer())
MWBase::Environment::get().getSoundManager()->setListenerVel(velocity);
}

View file

@ -121,3 +121,13 @@ Sound Settings
When true, uses the camera position and direction for audio instead of the player position.
This makes audio in third person sound relative to camera instead of the player.
False is vanilla Morrowind behaviour.
.. omw-setting::
:title: doppler factor
:type: float32
:range: 0.0 (disabled), 1.0 (maximum strength)
:default: 0.25
:location: :bdg-success:`Launcher > Settings > Audio`
This setting controls the strength of the doppler effect. Doppler effect increases or decreases the pitch of sounds
relative to the velocity of the source and the listener.