From 5c8be15962d6b02d7fdfdb16acc10f55267bea0f Mon Sep 17 00:00:00 2001 From: Alexander Monakov Date: Sat, 18 Dec 2010 01:58:20 +0300 Subject: [PATCH] Drop remains of Sample_load --- Source/GameTick.cpp | 36 ++++++++++++------------------------ Source/Sounds.cpp | 6 ++++++ Source/Sounds.def | 10 ++++++---- Source/Sounds.h | 2 ++ 4 files changed, 26 insertions(+), 28 deletions(-) diff --git a/Source/GameTick.cpp b/Source/GameTick.cpp index cf67c1a..e9c2461 100644 --- a/Source/GameTick.cpp +++ b/Source/GameTick.cpp @@ -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); diff --git a/Source/Sounds.cpp b/Source/Sounds.cpp index 9bf927b..365c6d3 100644 --- a/Source/Sounds.cpp +++ b/Source/Sounds.cpp @@ -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); } diff --git a/Source/Sounds.def b/Source/Sounds.def index bd18779..d0e2744 100644 --- a/Source/Sounds.def +++ b/Source/Sounds.def @@ -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") diff --git a/Source/Sounds.h b/Source/Sounds.h index eef2b50..8feac33 100644 --- a/Source/Sounds.h +++ b/Source/Sounds.h @@ -32,4 +32,6 @@ sounds_count extern struct OPENAL_SAMPLE *samp[sounds_count]; extern void loadAllSounds(); + +extern int footstepsound, footstepsound2, footstepsound3, footstepsound4; #endif -- 2.39.5