medfall

A super great game engine
Log | Files | Refs

commit e2aebdd5427ecd0f3b4f776a55eb715862e73db6
parent 5686c8af0e98d01a2819f84baddd5ad92da083d1
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Sat Aug 19 17:01:58 +0300

clamp01 -> saturate

Diffstat:
audio.cc | 4++--
intrinsics.h | 2+-
mixer.cc | 2+-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/audio.cc b/audio.cc @@ -70,11 +70,11 @@ int main( int argc, char ** argv ) { getline( &line, &n, stdin ); if( strcmp( line, "+\n" ) == 0 ) { - volume = clamp01( volume + 0.1f ); + volume = saturate( volume + 0.1f ); mixer_volume( sound_sin, volume ); } else if( strcmp( line, "-\n" ) == 0 ) { - volume = clamp01( volume - 0.1f ); + volume = saturate( volume - 0.1f ); mixer_volume( sound_sin, volume ); } else if( strcmp( line, "s\n" ) == 0 ) { diff --git a/intrinsics.h b/intrinsics.h @@ -116,7 +116,7 @@ inline T clamp( T x, T lo, T hi ) { } template< typename T > -inline T clamp01( T x ) { +inline T saturate( T x ) { return clamp( x, T( 0 ), T( 1 ) ); } diff --git a/mixer.cc b/mixer.cc @@ -158,7 +158,7 @@ void mixer_volume( PlayingSoundID sound_id, float volume ) { MixerCommand cmd; cmd.type = MIXER_VOLUME; cmd.sound_id = sound_id; - cmd.volume = clamp01( volume ); + cmd.volume = saturate( volume ); command_queue.enqueue_spin( cmd ); }