From e53162c9fcac138207c3221ec3bd4cab367f72ef Mon Sep 17 00:00:00 2001 From: driAn Date: Tue, 26 Aug 2008 19:42:45 +0000 Subject: [PATCH] sound distancemodel tweakings git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@2395 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/sound.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/source/src/sound.cpp b/source/src/sound.cpp index 1f195dc8..7f241ef4 100644 --- a/source/src/sound.cpp +++ b/source/src/sound.cpp @@ -113,7 +113,11 @@ struct source { alclearerr(); alGenSources(1, &id); - alSourcef(id, AL_REFERENCE_DISTANCE, 1.0f); + + // fit into distance model + alSourcef(id, AL_REFERENCE_DISTANCE, 3.0f); + alSourcef(id, AL_ROLLOFF_FACTOR, 1.0f); + return !alerr(false); } @@ -236,13 +240,6 @@ struct source return !alerr(); } - bool referencedistance(float r) - { - alclearerr(); - alSourcef(id, AL_REFERENCE_DISTANCE, 80); - return !alerr(); - } - void printposition() { alclearerr(); @@ -1228,6 +1225,7 @@ void initsound() if(context) { alcMakeContextCurrent(context); + alDistanceModel(AL_EXPONENT_DISTANCE_CLAMPED); // backend infos @@ -1619,3 +1617,6 @@ void soundtest() } COMMAND(soundtest, ARG_NONE); + +void t1() { conoutf("%f", player1->o.x); } +COMMAND(t1, ARG_NONE); \ No newline at end of file