From: Alexander Monakov Date: Fri, 17 Dec 2010 22:37:02 +0000 (+0300) Subject: Drop MinMaxDistance X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=71128f2976d474e055fdc68887d9403e9b5e3fc6;p=lugaru.git Drop MinMaxDistance --- diff --git a/Source/Game.cpp b/Source/Game.cpp index a64803f..d68ee11 100644 --- a/Source/Game.cpp +++ b/Source/Game.cpp @@ -220,12 +220,10 @@ typedef struct { void Game::fireSound(int sound) { float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - OPENAL_Sample_SetMinMaxDistance(samp[sound], 9999.0f, 99999.0f); PlaySoundEx( sound, samp[sound], NULL, true); OPENAL_3D_SetAttributes(channels[sound], gLoc, vel); OPENAL_SetVolume(channels[sound], 256); OPENAL_SetPaused(channels[sound], false); - OPENAL_Sample_SetMinMaxDistance(samp[sound], 8.0f, 2000.0f); } void Game::inputText(char* str, int* charselected, int* nb_chars) { diff --git a/Source/GameInitDispose.cpp b/Source/GameInitDispose.cpp index 02b0c93..6c9cf0f 100644 --- a/Source/GameInitDispose.cpp +++ b/Source/GameInitDispose.cpp @@ -1351,12 +1351,10 @@ void Game::LoadStuff() if(targetlevel!=7){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); OPENAL_3D_SetAttributes(channels[fireendsound], gLoc, vel); OPENAL_SetVolume(channels[fireendsound], 256); OPENAL_SetPaused(channels[fireendsound], false); - OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); } stillloading=0; diff --git a/Source/GameTick.cpp b/Source/GameTick.cpp index 0a6d464..cf67c1a 100644 --- a/Source/GameTick.cpp +++ b/Source/GameTick.cpp @@ -1406,10 +1406,6 @@ void Game::Setenvironment(int which) samp[footstepsound2] = OPENAL_Sample_Load(OPENAL_FREE, ConvertFileName(":Data:Sounds:footstepsnow2.ogg"), OPENAL_HW3D, 0, 0); samp[footstepsound3] = OPENAL_Sample_Load(OPENAL_FREE, ConvertFileName(":Data:Sounds:footstepstone1.ogg"), OPENAL_HW3D, 0, 0); samp[footstepsound4] = OPENAL_Sample_Load(OPENAL_FREE, ConvertFileName(":Data:Sounds:footstepstone2.ogg"), OPENAL_HW3D, 0, 0); - OPENAL_Sample_SetMinMaxDistance(samp[footstepsound], 4.0f, 1000.0f); - OPENAL_Sample_SetMinMaxDistance(samp[footstepsound2], 4.0f, 1000.0f); - OPENAL_Sample_SetMinMaxDistance(samp[footstepsound3], 4.0f, 1000.0f); - OPENAL_Sample_SetMinMaxDistance(samp[footstepsound4], 4.0f, 1000.0f); LoadTexture(":Data:Textures:snow.jpg",&terraintexture,1,0); @@ -1460,10 +1456,6 @@ void Game::Setenvironment(int which) samp[footstepsound2] = OPENAL_Sample_Load(OPENAL_FREE, ConvertFileName(":Data:Sounds:footstepsnow2.ogg"), OPENAL_HW3D, 0, 0); samp[footstepsound3] = OPENAL_Sample_Load(OPENAL_FREE, ConvertFileName(":Data:Sounds:footstepsnow1.ogg"), OPENAL_HW3D, 0, 0); samp[footstepsound4] = OPENAL_Sample_Load(OPENAL_FREE, ConvertFileName(":Data:Sounds:footstepsnow2.ogg"), OPENAL_HW3D, 0, 0); - OPENAL_Sample_SetMinMaxDistance(samp[footstepsound], 4.0f, 1000.0f); - OPENAL_Sample_SetMinMaxDistance(samp[footstepsound2], 4.0f, 1000.0f); - OPENAL_Sample_SetMinMaxDistance(samp[footstepsound3], 4.0f, 1000.0f); - OPENAL_Sample_SetMinMaxDistance(samp[footstepsound4], 4.0f, 1000.0f); LoadTexture(":Data:Textures:sand.jpg",&terraintexture,1,0); @@ -1511,10 +1503,6 @@ void Game::Setenvironment(int which) samp[footstepsound2] = OPENAL_Sample_Load(OPENAL_FREE, ConvertFileName(":Data:Sounds:footstepgrass2.ogg"), OPENAL_HW3D, 0, 0); samp[footstepsound3] = OPENAL_Sample_Load(OPENAL_FREE, ConvertFileName(":Data:Sounds:footstepstone1.ogg"), OPENAL_HW3D, 0, 0); samp[footstepsound4] = OPENAL_Sample_Load(OPENAL_FREE, ConvertFileName(":Data:Sounds:footstepstone2.ogg"), OPENAL_HW3D, 0, 0); - OPENAL_Sample_SetMinMaxDistance(samp[footstepsound], 4.0f, 1000.0f); - OPENAL_Sample_SetMinMaxDistance(samp[footstepsound2], 4.0f, 1000.0f); - OPENAL_Sample_SetMinMaxDistance(samp[footstepsound3], 4.0f, 1000.0f); - OPENAL_Sample_SetMinMaxDistance(samp[footstepsound4], 4.0f, 1000.0f); LoadTexture(":Data:Textures:grassdirt.jpg",&terraintexture,1,0); diff --git a/Source/openal_wrapper.cpp b/Source/openal_wrapper.cpp index cc4d45f..e375717 100644 --- a/Source/openal_wrapper.cpp +++ b/Source/openal_wrapper.cpp @@ -509,26 +509,6 @@ AL_API signed char OPENAL_Sample_SetMode(OPENAL_SAMPLE *sptr, unsigned int mode) return true; } -AL_API signed char OPENAL_Sample_SetMinMaxDistance(OPENAL_SAMPLE *sptr, float mindist, float maxdist) -{ - if (!initialized) return false; - if (sptr == NULL) return false; - // we ignore maxdist. It's not really important to this game, and the - // FMOD docs suggest that it's worthless anyhow. - - // recalc sources to see if we need to adjust attenuation. - for (int i = 0; i < num_channels; i++) - { - if (channels[i].sample == sptr) - { - const float *p = channels[i].position; - set_channel_position(i, p[0], p[1], p[2]); - } - } - - return 0; -} - AL_API signed char OPENAL_SetFrequency(int channel, int freq) { if (!initialized) return false; diff --git a/Source/openal_wrapper.h b/Source/openal_wrapper.h index 9f1a590..a15a6de 100644 --- a/Source/openal_wrapper.h +++ b/Source/openal_wrapper.h @@ -81,7 +81,6 @@ AL_API int OPENAL_PlaySoundEx(int channel, OPENAL_SAMPLE *sptr, OPENAL_DSPUNIT * AL_API OPENAL_SAMPLE *OPENAL_Sample_Load(int index, const char *name_or_data, unsigned int mode, int offset, int length); AL_API void OPENAL_Sample_Free(OPENAL_SAMPLE *sptr); AL_API signed char OPENAL_Sample_SetMode(OPENAL_SAMPLE *sptr, unsigned int mode); -AL_API signed char OPENAL_Sample_SetMinMaxDistance(OPENAL_SAMPLE *sptr, float mindist, float maxdist); AL_API signed char OPENAL_SetFrequency(int channel, int freq); AL_API signed char OPENAL_SetVolume(int channel, int vol); AL_API signed char OPENAL_SetPaused(int channel, signed char paused);