From 46a32dd3ee0fc95926d880856510a320c8e59980 Mon Sep 17 00:00:00 2001 From: mfranz Date: Sun, 22 Jul 2007 13:58:26 +0000 Subject: [PATCH] coding style fixes --- simgear/sound/sample_openal.cxx | 20 ++++++++++---------- simgear/sound/sample_openal.hxx | 8 ++++---- simgear/sound/soundmgr_openal.cxx | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/simgear/sound/sample_openal.cxx b/simgear/sound/sample_openal.cxx index 7d112b24..0d62cac4 100644 --- a/simgear/sound/sample_openal.cxx +++ b/simgear/sound/sample_openal.cxx @@ -85,7 +85,7 @@ SGSoundSample::SGSoundSample() : } // constructor -SGSoundSample::SGSoundSample( const char *path, const char *file , bool _no_Doppler_effect ) : +SGSoundSample::SGSoundSample( const char *path, const char *file, bool _no_Doppler_effect ) : buffer(0), source(0), pitch(1.0), @@ -99,7 +99,7 @@ SGSoundSample::SGSoundSample( const char *path, const char *file , bool _no_Dopp #endif playing(false), no_Doppler_effect(_no_Doppler_effect) - { +{ SGPath samplepath( path ); if ( strlen(file) ) { samplepath.append( file ); @@ -155,7 +155,7 @@ SGSoundSample::SGSoundSample( const char *path, const char *file , bool _no_Dopp } // constructor -SGSoundSample::SGSoundSample( unsigned char *_data, int len, int _freq , bool _no_Doppler_effect ) : +SGSoundSample::SGSoundSample( unsigned char *_data, int len, int _freq, bool _no_Doppler_effect ) : buffer(0), source(0), pitch(1.0), @@ -267,9 +267,9 @@ SGSoundSample::bind_source() { alSourcef( source, AL_GAIN, volume ); #else print_openal_error("bind_sources return"); - alSourcef( source, AL_PITCH, pitch *doppler_pitch_factor ); - alGetError(); //ignore if the pitch is clamped by the driver - alSourcef( source, AL_GAIN, volume *doppler_volume_factor ); + alSourcef( source, AL_PITCH, pitch * doppler_pitch_factor ); + alGetError(); // ignore if the pitch is clamped by the driver + alSourcef( source, AL_GAIN, volume * doppler_volume_factor ); #endif alSourcefv( source, AL_POSITION, source_pos ); alSourcefv( source, AL_DIRECTION, direction ); @@ -302,7 +302,7 @@ SGSoundSample::set_pitch( double p ) { print_openal_error("set_pitch"); #else alSourcef( source, AL_PITCH, pitch * doppler_pitch_factor ); - alGetError(); //ignore if the pitch is clamped by the driver + alGetError(); // ignore if the pitch is clamped by the driver #endif } } @@ -385,7 +385,7 @@ SGSoundSample::set_orientation( ALfloat *dir, ALfloat inner_angle, } void -SGSoundSample::set_source_vel( ALfloat *vel , ALfloat *listener_vel ) { +SGSoundSample::set_source_vel( ALfloat *vel, ALfloat *listener_vel ) { if (no_Doppler_effect) { source_vel[0] = listener_vel[0]; source_vel[1] = listener_vel[1]; @@ -416,8 +416,8 @@ SGSoundSample::set_source_vel( ALfloat *vel , ALfloat *listener_vel ) { sgAddVec3( final_pos, source_pos, offset_pos ); mfp = sgLengthVec3(final_pos); if (mfp > 1e-6) { - double vls = - sgScalarProductVec3( listener_vel, final_pos ) / mfp; - double vss = - sgScalarProductVec3( source_vel, final_pos ) / mfp; + double vls = -sgScalarProductVec3( listener_vel, final_pos ) / mfp; + double vss = -sgScalarProductVec3( source_vel, final_pos ) / mfp; if (fabs(340 - vss) > 1e-6) { doppler = (340 - vls) / (340 - vss); diff --git a/simgear/sound/sample_openal.hxx b/simgear/sound/sample_openal.hxx index 861dfb55..7e8693e3 100644 --- a/simgear/sound/sample_openal.hxx +++ b/simgear/sound/sample_openal.hxx @@ -59,7 +59,7 @@ #define USE_OPEN_AL_DOPPLER_WITH_FIXED_LISTENER better than nothing #endif #else -//the Open_AL Doppler calculation seem to be buggy on windows + // the Open_AL Doppler calculation seems to be buggy on windows #define USE_SOFTWARE_DOPPLER seem to be necessary #endif @@ -128,7 +128,7 @@ public: should usually be true unless you want to manipulate the data later.) */ - SGSoundSample( const char *path, const char *file , bool no_Doppler_effect = true ); + SGSoundSample( const char *path, const char *file, bool no_Doppler_effect = true ); /** * Constructor. @@ -139,7 +139,7 @@ public: should usually be true unless you want to manipulate the data later.) */ - SGSoundSample( unsigned char *_data, int len, int _freq , bool no_Doppler_effect = true ); + SGSoundSample( unsigned char *_data, int len, int _freq, bool no_Doppler_effect = true ); ~SGSoundSample(); @@ -224,7 +224,7 @@ public: /** * Set velocity of sound source (uses same coordinate system as opengl) */ - void set_source_vel( ALfloat *vel , ALfloat *listener_vel ); + void set_source_vel( ALfloat *vel, ALfloat *listener_vel ); /** diff --git a/simgear/sound/soundmgr_openal.cxx b/simgear/sound/soundmgr_openal.cxx index 0a85fcce..0d59961e 100644 --- a/simgear/sound/soundmgr_openal.cxx +++ b/simgear/sound/soundmgr_openal.cxx @@ -345,6 +345,6 @@ void SGSoundMgr::set_source_vel_all( ALfloat *vel ) { sample_map_iterator sample_end = samples.end(); for ( ; sample_current != sample_end; ++sample_current ) { SGSoundSample *sample = sample_current->second; - sample->set_source_vel( vel , listener_vel ); + sample->set_source_vel( vel, listener_vel ); } } -- 2.39.5