mirror of
https://github.com/OpenMW/openmw.git
synced 2025-10-15 14:26:35 +00:00
appease clang + docs
This commit is contained in:
parent
c541cb96cc
commit
d29c01be26
6 changed files with 28 additions and 18 deletions
|
@ -1185,8 +1185,8 @@ namespace MWSound
|
||||||
alSourcefv(source, AL_VELOCITY, vel.ptr());
|
alSourcefv(source, AL_VELOCITY, vel.ptr());
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenALOutput::updateCommon(
|
void OpenALOutput::updateCommon(ALuint source, const osg::Vec3f& pos, const osg::Vec3f& vel, ALfloat maxdist,
|
||||||
ALuint source, const osg::Vec3f& pos, const osg::Vec3f& vel, ALfloat maxdist, ALfloat gain, ALfloat pitch, bool useenv)
|
ALfloat gain, ALfloat pitch, bool useenv)
|
||||||
{
|
{
|
||||||
if (useenv && mListenerEnv == Env_Underwater && !mWaterFilter)
|
if (useenv && mListenerEnv == Env_Underwater && !mWaterFilter)
|
||||||
{
|
{
|
||||||
|
@ -1315,8 +1315,8 @@ namespace MWSound
|
||||||
return;
|
return;
|
||||||
ALuint source = GET_PTRID(sound->mHandle);
|
ALuint source = GET_PTRID(sound->mHandle);
|
||||||
|
|
||||||
updateCommon(source, sound->getPosition(), sound->getVelocity(), sound->getMaxDistance(), sound->getRealVolume(),
|
updateCommon(source, sound->getPosition(), sound->getVelocity(), sound->getMaxDistance(),
|
||||||
getTimeScaledPitch(sound), sound->getUseEnv());
|
sound->getRealVolume(), getTimeScaledPitch(sound), sound->getUseEnv());
|
||||||
getALError();
|
getALError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1363,8 +1363,8 @@ namespace MWSound
|
||||||
if (sound->getIsLooping())
|
if (sound->getIsLooping())
|
||||||
Log(Debug::Warning) << "Warning: cannot loop stream \"" << decoder->getName() << "\"";
|
Log(Debug::Warning) << "Warning: cannot loop stream \"" << decoder->getName() << "\"";
|
||||||
|
|
||||||
initCommon3D(source, sound->getPosition(), sound->getVelocity(), sound->getMinDistance(), sound->getMaxDistance(),
|
initCommon3D(source, sound->getPosition(), sound->getVelocity(), sound->getMinDistance(),
|
||||||
sound->getRealVolume(), getTimeScaledPitch(sound), false, sound->getUseEnv());
|
sound->getMaxDistance(), sound->getRealVolume(), getTimeScaledPitch(sound), false, sound->getUseEnv());
|
||||||
if (getALError() != AL_NO_ERROR)
|
if (getALError() != AL_NO_ERROR)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -1446,8 +1446,8 @@ namespace MWSound
|
||||||
OpenAL_SoundStream* stream = reinterpret_cast<OpenAL_SoundStream*>(sound->mHandle);
|
OpenAL_SoundStream* stream = reinterpret_cast<OpenAL_SoundStream*>(sound->mHandle);
|
||||||
ALuint source = stream->mSource;
|
ALuint source = stream->mSource;
|
||||||
|
|
||||||
updateCommon(source, sound->getPosition(), sound->getVelocity(), sound->getMaxDistance(), sound->getRealVolume(),
|
updateCommon(source, sound->getPosition(), sound->getVelocity(), sound->getMaxDistance(),
|
||||||
getTimeScaledPitch(sound), sound->getUseEnv());
|
sound->getRealVolume(), getTimeScaledPitch(sound), sound->getUseEnv());
|
||||||
getALError();
|
getALError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -65,11 +65,11 @@ namespace MWSound
|
||||||
std::unique_ptr<DefaultDeviceThread> mDefaultDeviceThread;
|
std::unique_ptr<DefaultDeviceThread> mDefaultDeviceThread;
|
||||||
|
|
||||||
void initCommon2D(ALuint source, const osg::Vec3f& pos, ALfloat gain, ALfloat pitch, bool loop, bool useenv);
|
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,
|
void initCommon3D(ALuint source, const osg::Vec3f& pos, const osg::Vec3f& vel, ALfloat mindist, ALfloat maxdist,
|
||||||
ALfloat pitch, bool loop, bool useenv);
|
ALfloat gain, ALfloat pitch, bool loop, bool useenv);
|
||||||
|
|
||||||
void updateCommon(
|
void updateCommon(ALuint source, const osg::Vec3f& pos, const osg::Vec3f& vel, ALfloat maxdist, ALfloat gain,
|
||||||
ALuint source, const osg::Vec3f& pos, const osg::Vec3f& vel, ALfloat maxdist, ALfloat gain, ALfloat pitch, bool useenv);
|
ALfloat pitch, bool useenv);
|
||||||
|
|
||||||
float getTimeScaledPitch(SoundBase* sound);
|
float getTimeScaledPitch(SoundBase* sound);
|
||||||
|
|
||||||
|
@ -109,8 +109,8 @@ namespace MWSound
|
||||||
void startUpdate() override;
|
void startUpdate() override;
|
||||||
void finishUpdate() override;
|
void finishUpdate() override;
|
||||||
|
|
||||||
void updateListener(
|
void updateListener(const osg::Vec3f& pos, const osg::Vec3f& atdir, const osg::Vec3f& updir,
|
||||||
const osg::Vec3f& pos, const osg::Vec3f& atdir, const osg::Vec3f& updir, const osg::Vec3f& vel, Environment env) override;
|
const osg::Vec3f& vel, Environment env) override;
|
||||||
|
|
||||||
void pauseSounds(int types) override;
|
void pauseSounds(int types) override;
|
||||||
void resumeSounds(int types) override;
|
void resumeSounds(int types) override;
|
||||||
|
|
|
@ -155,7 +155,7 @@ namespace MWSound
|
||||||
|
|
||||||
const osg::Vec3f& getPosition() const { return mParams.mPos; }
|
const osg::Vec3f& getPosition() const { return mParams.mPos; }
|
||||||
const osg::Vec3f& getLastPosition() const { return mParams.mLastPos; }
|
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 getRealVolume() const { return mParams.mVolume * mParams.mBaseVolume * mParams.mFadeVolume; }
|
||||||
float getPitch() const { return mParams.mPitch; }
|
float getPitch() const { return mParams.mPitch; }
|
||||||
float getMinDistance() const { return mParams.mMinDistance; }
|
float getMinDistance() const { return mParams.mMinDistance; }
|
||||||
|
|
|
@ -61,8 +61,8 @@ namespace MWSound
|
||||||
virtual void startUpdate() = 0;
|
virtual void startUpdate() = 0;
|
||||||
virtual void finishUpdate() = 0;
|
virtual void finishUpdate() = 0;
|
||||||
|
|
||||||
virtual void updateListener(
|
virtual void updateListener(const osg::Vec3f& pos, const osg::Vec3f& atdir, const osg::Vec3f& updir,
|
||||||
const osg::Vec3f& pos, const osg::Vec3f& atdir, const osg::Vec3f& updir, const osg::Vec3f& vel, Environment env)
|
const osg::Vec3f& vel, Environment env)
|
||||||
= 0;
|
= 0;
|
||||||
|
|
||||||
virtual void pauseSounds(int types) = 0;
|
virtual void pauseSounds(int types) = 0;
|
||||||
|
|
|
@ -1467,7 +1467,7 @@ namespace MWWorld
|
||||||
void World::queueMovement(const Ptr& ptr, const osg::Vec3f& velocity)
|
void World::queueMovement(const Ptr& ptr, const osg::Vec3f& velocity)
|
||||||
{
|
{
|
||||||
mPhysics->queueObjectMovement(ptr, velocity);
|
mPhysics->queueObjectMovement(ptr, velocity);
|
||||||
if(ptr == MWMechanics::getPlayer())
|
if (ptr == MWMechanics::getPlayer())
|
||||||
MWBase::Environment::get().getSoundManager()->setListenerVel(velocity);
|
MWBase::Environment::get().getSoundManager()->setListenerVel(velocity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -121,3 +121,13 @@ Sound Settings
|
||||||
When true, uses the camera position and direction for audio instead of the player position.
|
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.
|
This makes audio in third person sound relative to camera instead of the player.
|
||||||
False is vanilla Morrowind behaviour.
|
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.
|
Loading…
Reference in a new issue