]> git.jsancho.org Git - lugaru.git/commitdiff
Drop MinMaxDistance
authorAlexander Monakov <amonakov@gmail.com>
Fri, 17 Dec 2010 22:37:02 +0000 (01:37 +0300)
committerAlexander Monakov <amonakov@gmail.com>
Fri, 17 Dec 2010 22:37:02 +0000 (01:37 +0300)
Source/Game.cpp
Source/GameInitDispose.cpp
Source/GameTick.cpp
Source/openal_wrapper.cpp
Source/openal_wrapper.h

index a64803fe605e762101920485f6adcb21eafd69e5..d68ee1154e7320edde2216daa4e90067d06f0871 100644 (file)
@@ -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) {
index 02b0c93cf1124638a1cfb341bcb612991cb039ca..6c9cf0f7c86430e544cac7b2d7f8fb3624cdd54c 100644 (file)
@@ -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;
index 0a6d464d221d1e551ce1cc7cfdb6617d8f506acf..cf67c1a75f498872ac8c38cb4f7ab51f105cc0ea 100644 (file)
@@ -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);
 
index cc4d45fc126fd07d03ff0e1d2c201ba2b41ada3b..e3757172536a15d416a72b7b2d7f4704504c4086 100644 (file)
@@ -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;
index 9f1a590b2b401d3fe2e59c7efebbc095d09d9c19..a15a6dedecd131b8573f9523ef2e8cd6c0683a7f 100644 (file)
@@ -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);