]> git.jsancho.org Git - lugaru.git/commitdiff
Drop remains of Sample_load
authorAlexander Monakov <amonakov@gmail.com>
Fri, 17 Dec 2010 22:58:20 +0000 (01:58 +0300)
committerAlexander Monakov <amonakov@gmail.com>
Fri, 17 Dec 2010 22:58:20 +0000 (01:58 +0300)
Source/GameTick.cpp
Source/Sounds.cpp
Source/Sounds.def
Source/Sounds.h

index cf67c1a75f498872ac8c38cb4f7ab51f105cc0ea..e9c2461999a92aa3a01c2bba8844f9b2313e1b3f 100644 (file)
@@ -1398,14 +1398,10 @@ void    Game::Setenvironment(int which)
                LoadTexture(":Data:Textures:bouldersnow.jpg",&objects.rocktextureptr,1,0);
                LoadTexture(":Data:Textures:snowbox.jpg",&objects.boxtextureptr,1,0);
 
-               OPENAL_Sample_Free(samp[footstepsound]);
-               OPENAL_Sample_Free(samp[footstepsound2]);
-               OPENAL_Sample_Free(samp[footstepsound3]);
-               OPENAL_Sample_Free(samp[footstepsound4]);
-               samp[footstepsound] = OPENAL_Sample_Load(OPENAL_FREE, ConvertFileName(":Data:Sounds:footstepsnow1.ogg"), OPENAL_HW3D, 0, 0);
-               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);
+               footstepsound = footstepsn1;
+               footstepsound2 = footstepsn2;
+               footstepsound3 = footstepst1;
+               footstepsound4 = footstepst2;
 
                LoadTexture(":Data:Textures:snow.jpg",&terraintexture,1,0);
 
@@ -1448,14 +1444,10 @@ void    Game::Setenvironment(int which)
                        OPENAL_SetVolume(channels[stream_desertambient], 256);
                }
 
-               OPENAL_Sample_Free(samp[footstepsound]);
-               OPENAL_Sample_Free(samp[footstepsound2]);
-               OPENAL_Sample_Free(samp[footstepsound3]);
-               OPENAL_Sample_Free(samp[footstepsound4]);
-               samp[footstepsound] = OPENAL_Sample_Load(OPENAL_FREE, ConvertFileName(":Data:Sounds:footstepsnow1.ogg"), OPENAL_HW3D, 0, 0);
-               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);
+               footstepsound = footstepsn1;
+               footstepsound2 = footstepsn2;
+               footstepsound3 = footstepsn1;
+               footstepsound4 = footstepsn2;
 
                LoadTexture(":Data:Textures:sand.jpg",&terraintexture,1,0);
 
@@ -1495,14 +1487,10 @@ void    Game::Setenvironment(int which)
                        OPENAL_SetVolume(channels[stream_wind], 100);
                }
 
-               OPENAL_Sample_Free(samp[footstepsound]);
-               OPENAL_Sample_Free(samp[footstepsound2]);
-               OPENAL_Sample_Free(samp[footstepsound3]);
-               OPENAL_Sample_Free(samp[footstepsound4]);
-               samp[footstepsound] = OPENAL_Sample_Load(OPENAL_FREE, ConvertFileName(":Data:Sounds:footstepgrass1.ogg"), OPENAL_HW3D, 0, 0);
-               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);
+               footstepsound = footstepgr1;
+               footstepsound2 = footstepgr2;
+               footstepsound3 = footstepst1;
+               footstepsound4 = footstepst2;
 
                LoadTexture(":Data:Textures:grassdirt.jpg",&terraintexture,1,0);
 
index 9bf927befb0ecb9af377938be83fa279b87753d7..365c6d36cb1c3a6d6c693418940a9c2afa8b30d8 100644 (file)
@@ -24,6 +24,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 struct OPENAL_SAMPLE *samp[sounds_count];
 
+int footstepsound, footstepsound2, footstepsound3, footstepsound4;
+
 static const char *sound_data[sounds_count] = {
 #define DECLARE_SOUND(id, filename) filename,
 #include "Sounds.def"
@@ -58,6 +60,10 @@ void loadAllSounds()
                                   snd_mode(i),
                                   0, 0);
     }
+  footstepsound = footstepsn1;
+  footstepsound2 = footstepsn2;
+  footstepsound3 = footstepst1;
+  footstepsound4 = footstepst2;
   // Huh?
   // OPENAL_Sample_SetMode(samp[whooshsound], OPENAL_LOOP_NORMAL);
 }
index bd18779c888bbba7e9dfdb4cef3da75b1d652077..d0e2744d553f8d01578d506cf7ed4aa62c56af43 100644 (file)
@@ -19,10 +19,12 @@ along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
 
-DECLARE_SOUND(footstepsound, "footstepsnow1.ogg")
-DECLARE_SOUND(footstepsound2, "footstepsnow2.ogg")
-DECLARE_SOUND(footstepsound3, "footstepstone1.ogg")
-DECLARE_SOUND(footstepsound4, "footstepstone2.ogg")
+DECLARE_SOUND(footstepsn1, "footstepsnow1.ogg")
+DECLARE_SOUND(footstepsn2, "footstepsnow2.ogg")
+DECLARE_SOUND(footstepst1, "footstepstone1.ogg")
+DECLARE_SOUND(footstepst2, "footstepstone2.ogg")
+DECLARE_SOUND(footstepgr1, "footstepgrass1.ogg")
+DECLARE_SOUND(footstepgr2, "footstepgrass2.ogg")
 DECLARE_SOUND(landsound, "land.ogg")
 DECLARE_SOUND(jumpsound, "jump.ogg")
 DECLARE_SOUND(hawksound, "hawk.ogg")
index eef2b5078f05352bc50705b25bbbc4c0a1fbc897..8feac33951dcf4d0d113f2e7281f442eed627133 100644 (file)
@@ -32,4 +32,6 @@ sounds_count
 extern struct OPENAL_SAMPLE *samp[sounds_count];
 
 extern void loadAllSounds();
+
+extern int footstepsound, footstepsound2, footstepsound3, footstepsound4;
 #endif