From: Harley Laue Date: Thu, 13 May 2010 22:41:02 +0000 (-0500) Subject: Removed FMod from the source. X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=612415ff494c29cf2fc7ea560da9908eaff7d847;p=lugaru.git Removed FMod from the source. * This isn't the best fix yet, but it works and should be a good starting point in the future. --- diff --git a/Source/Game.h b/Source/Game.h index 45d9eb8..727b998 100644 --- a/Source/Game.h +++ b/Source/Game.h @@ -55,7 +55,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "Lights.h" #include "Person.h" #include "Constants.h" -#include "fmod.h" #include "Sprites.h" //#include #include "Text.h" diff --git a/Source/GameDraw.cpp b/Source/GameDraw.cpp index 1275a45..015a4d5 100644 --- a/Source/GameDraw.cpp +++ b/Source/GameDraw.cpp @@ -19,7 +19,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "Game.h" +#include "Game.h" +#include "openal_wrapper.h" using namespace std; @@ -174,9 +175,9 @@ extern float accountcampaigntime[10]; extern bool gamestarted; -extern FSOUND_SAMPLE *samp[100]; +extern OPENAL_SAMPLE *samp[100]; extern int channels[100]; -extern "C" void PlaySoundEx(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused); +extern "C" void PlaySoundEx(int channel, OPENAL_SAMPLE *sptr, OPENAL_DSPUNIT *dsp, signed char startpaused); /*********************> DrawGLScene() <*****/ long long Game::MD5_string (char *string){ @@ -1093,9 +1094,9 @@ int Game::DrawGLScene(void) if(dialogueboxsound[whichdialogue][indialogue]==-3)whichsoundplay=consolesuccesssound; if(dialogueboxsound[whichdialogue][indialogue]==-4)whichsoundplay=consolefailsound; PlaySoundEx( whichsoundplay, samp[whichsoundplay], NULL, true); - FSOUND_3D_SetAttributes(channels[whichsoundplay], gLoc, vel); - FSOUND_SetVolume(channels[whichsoundplay], 256); - FSOUND_SetPaused(channels[whichsoundplay], false); + OPENAL_3D_SetAttributes(channels[whichsoundplay], gLoc, vel); + OPENAL_SetVolume(channels[whichsoundplay], 256); + OPENAL_SetPaused(channels[whichsoundplay], false); } } } diff --git a/Source/GameInitDispose.cpp b/Source/GameInitDispose.cpp index 0378282..ddd7b22 100644 --- a/Source/GameInitDispose.cpp +++ b/Source/GameInitDispose.cpp @@ -20,6 +20,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "Game.h" +#include "openal_wrapper.h" + extern float screenwidth,screenheight; extern float viewdistance; extern XYZ viewer; @@ -32,7 +34,7 @@ extern Light light; extern Animation animation[animation_count]; extern Skeleton testskeleton; extern int numsounds; -extern FSOUND_SAMPLE *samp[100]; +extern OPENAL_SAMPLE *samp[100]; extern int channels[100]; extern Terrain terrain; extern Sprites sprites; @@ -110,10 +112,10 @@ extern float accountcampaigntime[10]; extern int accountcampaignchoicesmade[10]; extern int accountcampaignchoices[10][5000]; -extern FSOUND_STREAM * strm[20]; +extern OPENAL_STREAM * strm[20]; -extern "C" void PlaySoundEx(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused); -extern "C" void PlayStreamEx(int chan, FSOUND_STREAM *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused); +extern "C" void PlaySoundEx(int channel, OPENAL_SAMPLE *sptr, OPENAL_DSPUNIT *dsp, signed char startpaused); +extern "C" void PlayStreamEx(int chan, OPENAL_STREAM *sptr, OPENAL_DSPUNIT *dsp, signed char startpaused); void LOG(const std::string &fmt, ...) { @@ -194,7 +196,7 @@ void Game::Dispose() LOG("Shutting down sound system..."); - FSOUND_StopSound(FSOUND_ALL); + OPENAL_StopSound(OPENAL_ALL); // this is causing problems on Linux, but we'll force an _exit() a little // later in the shutdown process. --ryan. @@ -204,15 +206,15 @@ void Game::Dispose() for (i=0; i < samplecount; ++i) { - FSOUND_Sample_Free(samp[i]); + OPENAL_Sample_Free(samp[i]); } for (i=0; i < streamcount; ++i) { - FSOUND_Stream_Close(strm[i]); + OPENAL_Stream_Close(strm[i]); } - FSOUND_Close(); + OPENAL_Close(); if (texture.data) { free(texture.data); @@ -229,196 +231,193 @@ void Game::LoadSounds() LOG(std::string("Loading sounds...")); - FSOUND_3D_SetDopplerFactor(0); + OPENAL_3D_SetDopplerFactor(0); - FSOUND_SetSFXMasterVolume((int)(volume*255)); + OPENAL_SetSFXMasterVolume((int)(volume*255)); - samp[footstepsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:footstepsnow1.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[footstepsound], 4.0f, 1000.0f); + samp[footstepsound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:footstepsnow1.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[footstepsound], 4.0f, 1000.0f); - samp[footstepsound2] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:footstepsnow2.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[footstepsound2], 4.0f, 1000.0f); + samp[footstepsound2] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:footstepsnow2.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[footstepsound2], 4.0f, 1000.0f); - samp[footstepsound3] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:footstepstone1.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[footstepsound3], 4.0f, 1000.0f); + samp[footstepsound3] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:footstepstone1.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[footstepsound3], 4.0f, 1000.0f); - samp[footstepsound4] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:footstepstone2.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[footstepsound4], 4.0f, 1000.0f); + samp[footstepsound4] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:footstepstone2.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[footstepsound4], 4.0f, 1000.0f); - samp[landsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:land.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[landsound], 4.0f, 1000.0f); + samp[landsound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:land.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[landsound], 4.0f, 1000.0f); - samp[jumpsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:jump.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[jumpsound], 4.0f, 1000.0f); + samp[jumpsound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:jump.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[jumpsound], 4.0f, 1000.0f); - samp[hawksound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:hawk.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[hawksound], 40.0f, 10000.0f); + samp[hawksound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:hawk.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[hawksound], 40.0f, 10000.0f); - samp[whooshsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:whoosh.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[whooshsound], 4.0f, 1000.0f); - FSOUND_Sample_SetMode(samp[whooshsound], FSOUND_LOOP_NORMAL); + samp[whooshsound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:whoosh.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[whooshsound], 4.0f, 1000.0f); + OPENAL_Sample_SetMode(samp[whooshsound], OPENAL_LOOP_NORMAL); - samp[landsound1] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:land1.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[landsound1], 4.0f, 1000.0f); + samp[landsound1] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:land1.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[landsound1], 4.0f, 1000.0f); - samp[landsound2] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:land2.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[landsound2], 4.0f, 1000.0f); + samp[landsound2] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:land2.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[landsound2], 4.0f, 1000.0f); - samp[breaksound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:broken.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[breaksound], 8.0f, 2000.0f); + samp[breaksound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:broken.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[breaksound], 8.0f, 2000.0f); - samp[lowwhooshsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:Lowwhoosh.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[lowwhooshsound], 8.0f, 2000.0f); + samp[lowwhooshsound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:Lowwhoosh.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[lowwhooshsound], 8.0f, 2000.0f); - samp[midwhooshsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:midwhoosh.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[midwhooshsound], 8.0f, 2000.0f); + samp[midwhooshsound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:midwhoosh.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[midwhooshsound], 8.0f, 2000.0f); - samp[highwhooshsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:highwhoosh.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[highwhooshsound], 8.0f, 2000.0f); + samp[highwhooshsound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:highwhoosh.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[highwhooshsound], 8.0f, 2000.0f); - samp[movewhooshsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:movewhoosh.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[movewhooshsound], 8.0f, 2000.0f); + samp[movewhooshsound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:movewhoosh.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[movewhooshsound], 8.0f, 2000.0f); - samp[heavyimpactsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:heavyimpact.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[heavyimpactsound], 8.0f, 2000.0f); + samp[heavyimpactsound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:heavyimpact.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[heavyimpactsound], 8.0f, 2000.0f); - samp[whooshhitsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:Whooshhit.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[whooshhitsound], 8.0f, 2000.0f); + samp[whooshhitsound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:Whooshhit.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[whooshhitsound], 8.0f, 2000.0f); - samp[thudsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:thud.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[thudsound], 8.0f, 2000.0f); + samp[thudsound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:thud.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[thudsound], 8.0f, 2000.0f); - samp[alarmsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:alarm.ogg", FSOUND_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[alarmsound], 8.0f, 2000.0f); + samp[alarmsound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:alarm.ogg", OPENAL_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[alarmsound], 8.0f, 2000.0f); - samp[breaksound2] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:break.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[breaksound2], 8.0f, 2000.0f); + samp[breaksound2] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:break.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[breaksound2], 8.0f, 2000.0f); - samp[knifedrawsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:knifedraw.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[knifedrawsound], 8.0f, 2000.0f); + samp[knifedrawsound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:knifedraw.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[knifedrawsound], 8.0f, 2000.0f); - samp[knifesheathesound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:knifesheathe.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[knifesheathesound], 8.0f, 2000.0f); + samp[knifesheathesound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:knifesheathe.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[knifesheathesound], 8.0f, 2000.0f); - samp[fleshstabsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:Fleshstab.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[fleshstabsound], 8.0f, 2000.0f); + samp[fleshstabsound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:Fleshstab.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[fleshstabsound], 8.0f, 2000.0f); - samp[fleshstabremovesound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:Fleshstabremove.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[fleshstabremovesound], 8.0f, 2000.0f); + samp[fleshstabremovesound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:Fleshstabremove.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[fleshstabremovesound], 8.0f, 2000.0f); - samp[knifeswishsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:knifeswish.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[knifeswishsound], 8.0f, 2000.0f); + samp[knifeswishsound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:knifeswish.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[knifeswishsound], 8.0f, 2000.0f); - samp[knifeslicesound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:knifeslice.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[knifeslicesound], 8.0f, 2000.0f); + samp[knifeslicesound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:knifeslice.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[knifeslicesound], 8.0f, 2000.0f); - samp[swordslicesound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:swordslice.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[swordslicesound], 8.0f, 2000.0f); + samp[swordslicesound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:swordslice.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[swordslicesound], 8.0f, 2000.0f); - samp[skidsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:skid.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[skidsound], 8.0f, 2000.0f); + samp[skidsound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:skid.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[skidsound], 8.0f, 2000.0f); - samp[snowskidsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:snowskid.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[snowskidsound], 8.0f, 2000.0f); + samp[snowskidsound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:snowskid.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[snowskidsound], 8.0f, 2000.0f); - samp[bushrustle] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:bushrustle.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[bushrustle], 4.0f, 1000.0f); + samp[bushrustle] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:bushrustle.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[bushrustle], 4.0f, 1000.0f); - samp[clank1sound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:clank1.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[clank1sound], 8.0f, 2000.0f); + samp[clank1sound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:clank1.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[clank1sound], 8.0f, 2000.0f); - samp[clank2sound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:clank2.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[clank2sound], 8.0f, 2000.0f); + samp[clank2sound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:clank2.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[clank2sound], 8.0f, 2000.0f); - samp[clank3sound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:clank3.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[clank3sound], 8.0f, 2000.0f); + samp[clank3sound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:clank3.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[clank3sound], 8.0f, 2000.0f); - samp[clank4sound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:clank4.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[clank4sound], 8.0f, 2000.0f); + samp[clank4sound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:clank4.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[clank4sound], 8.0f, 2000.0f); - samp[consolesuccesssound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:consolesuccess.ogg", FSOUND_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[consolesuccesssound], 4.0f, 1000.0f); + samp[consolesuccesssound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:consolesuccess.ogg", OPENAL_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[consolesuccesssound], 4.0f, 1000.0f); - samp[consolefailsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:consolefail.ogg", FSOUND_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[consolefailsound], 4.0f, 1000.0f); + samp[consolefailsound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:consolefail.ogg", OPENAL_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[consolefailsound], 4.0f, 1000.0f); - samp[metalhitsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:MetalHit.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[metalhitsound], 8.0f, 2000.0f); + samp[metalhitsound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:MetalHit.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[metalhitsound], 8.0f, 2000.0f); - samp[clawslicesound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:clawslice.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[clawslicesound], 8.0f, 2000.0f); + samp[clawslicesound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:clawslice.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[clawslicesound], 8.0f, 2000.0f); - samp[splattersound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:splatter.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[splattersound], 8.0f, 2000.0f); + samp[splattersound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:splatter.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[splattersound], 8.0f, 2000.0f); - samp[growlsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:Growl.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[growlsound], 1000.0f, 2000.0f); + samp[growlsound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:Growl.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[growlsound], 1000.0f, 2000.0f); - samp[growl2sound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:Growl2.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[growl2sound], 1000.0f, 2000.0f); + samp[growl2sound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:Growl2.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[growl2sound], 1000.0f, 2000.0f); - samp[barksound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:bark.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[barksound], 1000.0f, 2000.0f); + samp[barksound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:bark.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[barksound], 1000.0f, 2000.0f); - samp[bark2sound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:bark2.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[bark2sound], 1000.0f, 2000.0f); + samp[bark2sound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:bark2.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[bark2sound], 1000.0f, 2000.0f); - samp[bark3sound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:bark3.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[bark3sound], 1000.0f, 2000.0f); + samp[bark3sound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:bark3.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[bark3sound], 1000.0f, 2000.0f); - samp[snarlsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:snarl.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[snarlsound], 1000.0f, 2000.0f); + samp[snarlsound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:snarl.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[snarlsound], 1000.0f, 2000.0f); - samp[snarl2sound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:snarl2.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[snarl2sound], 1000.0f, 2000.0f); + samp[snarl2sound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:snarl2.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[snarl2sound], 1000.0f, 2000.0f); - samp[barkgrowlsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:barkgrowl.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[barkgrowlsound], 1000.0f, 2000.0f); + samp[barkgrowlsound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:barkgrowl.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[barkgrowlsound], 1000.0f, 2000.0f); - samp[rabbitattacksound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:rabbitattack.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[rabbitattacksound], 1000.0f, 2000.0f); + samp[rabbitattacksound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:rabbitattack.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[rabbitattacksound], 1000.0f, 2000.0f); - samp[rabbitattack2sound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:rabbitattack2.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[rabbitattack2sound], 1000.0f, 2000.0f); + samp[rabbitattack2sound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:rabbitattack2.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[rabbitattack2sound], 1000.0f, 2000.0f); - samp[rabbitattack3sound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:rabbitattack3.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[rabbitattack3sound], 1000.0f, 2000.0f); + samp[rabbitattack3sound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:rabbitattack3.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[rabbitattack3sound], 1000.0f, 2000.0f); - samp[rabbitattack4sound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:rabbitattack4.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[rabbitattack4sound], 1000.0f, 2000.0f); + samp[rabbitattack4sound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:rabbitattack4.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[rabbitattack4sound], 1000.0f, 2000.0f); - samp[rabbitpainsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:rabbitpain.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[rabbitpainsound], 1000.0f, 2000.0f); + samp[rabbitpainsound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:rabbitpain.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[rabbitpainsound], 1000.0f, 2000.0f); - samp[rabbitpain1sound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:rabbitpain2.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[rabbitpain1sound], 1000.0f, 2000.0f); + samp[rabbitpain1sound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:rabbitpain2.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[rabbitpain1sound], 1000.0f, 2000.0f); - /*samp[rabbitpain2sound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:rabbitpain2.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[rabbitpain2sound], 1000.0f, 2000.0f); + /*samp[rabbitpain2sound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:rabbitpain2.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[rabbitpain2sound], 1000.0f, 2000.0f); */ - samp[rabbitchitter] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:rabbitchitter.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[rabbitchitter], 1000.0f, 2000.0f); - - samp[rabbitchitter2] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:rabbitchitter2.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[rabbitchitter2], 1000.0f, 2000.0f); - - samp[swordstaffsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:swordstaff.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[swordstaffsound], 8.0f, 2000.0f); - - samp[staffbodysound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:staffbody.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[staffbodysound], 8.0f, 2000.0f); + samp[rabbitchitter] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:rabbitchitter.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[rabbitchitter], 1000.0f, 2000.0f); - samp[staffheadsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:staffhead.ogg", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[staffheadsound], 8.0f, 2000.0f); + samp[rabbitchitter2] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:rabbitchitter2.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[rabbitchitter2], 1000.0f, 2000.0f); - samp[staffbreaksound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:staffbreak.wav", FSOUND_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[staffbreaksound], 8.0f, 2000.0f); + samp[swordstaffsound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:swordstaff.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[swordstaffsound], 8.0f, 2000.0f); + samp[staffbodysound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:staffbody.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[staffbodysound], 8.0f, 2000.0f); + samp[staffheadsound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:staffhead.ogg", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[staffheadsound], 8.0f, 2000.0f); + samp[staffbreaksound] = OPENAL_Sample_LoadEx(OPENAL_FREE, ":Data:Sounds:staffbreak.wav", OPENAL_HW3D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[staffbreaksound], 8.0f, 2000.0f); } void Game::LoadTexture(const char *fileName, GLuint *textureid,int mipmap, bool hasalpha) @@ -1233,96 +1232,96 @@ void Game::InitGame() #if PLATFORM_LINUX extern bool cmdline(const char *cmd); unsigned char rc = 0; - output = FSOUND_OUTPUT_ALSA; // Try alsa first... + output = OPENAL_OUTPUT_ALSA; // Try alsa first... if (cmdline("forceoss")) // ...but let user override that. - output = FSOUND_OUTPUT_OSS; + output = OPENAL_OUTPUT_OSS; else if (cmdline("nosound")) - output = FSOUND_OUTPUT_NOSOUND; + output = OPENAL_OUTPUT_NOSOUND; - FSOUND_SetOutput(output); - if ((rc = FSOUND_Init(44100, 32, 0)) == false) + OPENAL_SetOutput(output); + if ((rc = OPENAL_Init(44100, 32, 0)) == false) { // if we tried ALSA and failed, fall back to OSS. - if ( (output == FSOUND_OUTPUT_ALSA) && (!cmdline("forcealsa")) ) + if ( (output == OPENAL_OUTPUT_ALSA) && (!cmdline("forcealsa")) ) { - FSOUND_Close(); - output = FSOUND_OUTPUT_OSS; - FSOUND_SetOutput(output); - rc = FSOUND_Init(44100, 32, 0); + OPENAL_Close(); + output = OPENAL_OUTPUT_OSS; + OPENAL_SetOutput(output); + rc = OPENAL_Init(44100, 32, 0); } } if (rc == false) { - FSOUND_Close(); - output = FSOUND_OUTPUT_NOSOUND; // we tried! just do silence. - FSOUND_SetOutput(output); - rc = FSOUND_Init(44100, 32, 0); + OPENAL_Close(); + output = OPENAL_OUTPUT_NOSOUND; // we tried! just do silence. + OPENAL_SetOutput(output); + rc = OPENAL_Init(44100, 32, 0); } #else - FSOUND_Init(44100, 32, 0); + OPENAL_Init(44100, 32, 0); #endif - FSOUND_SetSFXMasterVolume((int)(volume*255)); + OPENAL_SetSFXMasterVolume((int)(volume*255)); - strm[stream_music3] = FSOUND_Stream_Open(ConvertFileName(":Data:Sounds:music3.mp3"), FSOUND_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=0;} -// FSOUND_Sample_SetMinMaxDistance(strm[stream_music3], 4.0f, 1000.0f); - FSOUND_Stream_SetMode(strm[stream_music3], FSOUND_LOOP_NORMAL); + strm[stream_music3] = OPENAL_Stream_Open(ConvertFileName(":Data:Sounds:music3.mp3"), OPENAL_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=0;} +// OPENAL_Sample_SetMinMaxDistance(strm[stream_music3], 4.0f, 1000.0f); + OPENAL_Stream_SetMode(strm[stream_music3], OPENAL_LOOP_NORMAL); if(musictoggle){ // PlaySoundEx( stream_music3, strm[stream_music3], NULL, true); PlayStreamEx(stream_music3, strm[stream_music3], 0, true); - FSOUND_SetPaused(channels[stream_music3], false); - FSOUND_SetVolume(channels[stream_music3], 256); + OPENAL_SetPaused(channels[stream_music3], false); + OPENAL_SetVolume(channels[stream_music3], 256); } FadeLoadingScreen(20); if(ambientsound){ - strm[stream_wind] = FSOUND_Stream_Open(ConvertFileName(":Data:Sounds:wind.mp3"), FSOUND_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} -// FSOUND_Sample_SetMinMaxDistance(strm[stream_wind], 4.0f, 1000.0f); - FSOUND_Stream_SetMode(strm[stream_wind], FSOUND_LOOP_NORMAL); + strm[stream_wind] = OPENAL_Stream_Open(ConvertFileName(":Data:Sounds:wind.mp3"), OPENAL_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} +// OPENAL_Sample_SetMinMaxDistance(strm[stream_wind], 4.0f, 1000.0f); + OPENAL_Stream_SetMode(strm[stream_wind], OPENAL_LOOP_NORMAL); FadeLoadingScreen(30); - strm[stream_desertambient] = FSOUND_Stream_Open(ConvertFileName(":Data:Sounds:desertambient.mp3"), FSOUND_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} -// FSOUND_Sample_SetMinMaxDistance(strm[stream_desertambient], 4.0f, 1000.0f); - FSOUND_Stream_SetMode(strm[stream_desertambient], FSOUND_LOOP_NORMAL); + strm[stream_desertambient] = OPENAL_Stream_Open(ConvertFileName(":Data:Sounds:desertambient.mp3"), OPENAL_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} +// OPENAL_Sample_SetMinMaxDistance(strm[stream_desertambient], 4.0f, 1000.0f); + OPENAL_Stream_SetMode(strm[stream_desertambient], OPENAL_LOOP_NORMAL); } FadeLoadingScreen(40); - samp[firestartsound] = FSOUND_Sample_Load(FSOUND_FREE, ConvertFileName(":Data:Sounds:firestart.ogg"), FSOUND_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + samp[firestartsound] = OPENAL_Sample_Load(OPENAL_FREE, ConvertFileName(":Data:Sounds:firestart.ogg"), OPENAL_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); - strm[stream_firesound] = FSOUND_Stream_Open(":Data:Sounds:fire.ogg", FSOUND_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} -// FSOUND_Sample_SetMinMaxDistance(strm[stream_firesound], 8.0f, 2000.0f); - FSOUND_Stream_SetMode(strm[stream_firesound], FSOUND_LOOP_NORMAL); + strm[stream_firesound] = OPENAL_Stream_Open(":Data:Sounds:fire.ogg", OPENAL_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} +// OPENAL_Sample_SetMinMaxDistance(strm[stream_firesound], 8.0f, 2000.0f); + OPENAL_Stream_SetMode(strm[stream_firesound], OPENAL_LOOP_NORMAL); FadeLoadingScreen(50); - samp[fireendsound] = FSOUND_Sample_Load(FSOUND_FREE, ConvertFileName(":Data:Sounds:fireend.ogg"), FSOUND_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + samp[fireendsound] = OPENAL_Sample_Load(OPENAL_FREE, ConvertFileName(":Data:Sounds:fireend.ogg"), OPENAL_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;} + OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); //if(musictoggle){ - strm[stream_music1grass] = FSOUND_Stream_Open(ConvertFileName(":Data:Sounds:music1grass.mp3"), FSOUND_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=1;} -// FSOUND_Sample_SetMinMaxDistance(strm[stream_music1grass], 4.0f, 1000.0f); - FSOUND_Stream_SetMode(strm[stream_music1grass], FSOUND_LOOP_NORMAL); + strm[stream_music1grass] = OPENAL_Stream_Open(ConvertFileName(":Data:Sounds:music1grass.mp3"), OPENAL_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=1;} +// OPENAL_Sample_SetMinMaxDistance(strm[stream_music1grass], 4.0f, 1000.0f); + OPENAL_Stream_SetMode(strm[stream_music1grass], OPENAL_LOOP_NORMAL); - strm[stream_music1snow] = FSOUND_Stream_Open(ConvertFileName(":Data:Sounds:music1snow.mp3"), FSOUND_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=2;} -// FSOUND_Sample_SetMinMaxDistance(strm[stream_music1snow], 4.0f, 1000.0f); - FSOUND_Stream_SetMode(strm[stream_music1snow], FSOUND_LOOP_NORMAL); + strm[stream_music1snow] = OPENAL_Stream_Open(ConvertFileName(":Data:Sounds:music1snow.mp3"), OPENAL_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=2;} +// OPENAL_Sample_SetMinMaxDistance(strm[stream_music1snow], 4.0f, 1000.0f); + OPENAL_Stream_SetMode(strm[stream_music1snow], OPENAL_LOOP_NORMAL); FadeLoadingScreen(60); - strm[stream_music1desert] = FSOUND_Stream_Open(ConvertFileName(":Data:Sounds:music1desert.mp3"), FSOUND_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=3;} -// FSOUND_Sample_SetMinMaxDistance(strm[stream_music1desert], 4.0f, 1000.0f); - FSOUND_Stream_SetMode(strm[stream_music1desert], FSOUND_LOOP_NORMAL); + strm[stream_music1desert] = OPENAL_Stream_Open(ConvertFileName(":Data:Sounds:music1desert.mp3"), OPENAL_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=3;} +// OPENAL_Sample_SetMinMaxDistance(strm[stream_music1desert], 4.0f, 1000.0f); + OPENAL_Stream_SetMode(strm[stream_music1desert], OPENAL_LOOP_NORMAL); FadeLoadingScreen(80); - strm[stream_music2] = FSOUND_Stream_Open(ConvertFileName(":Data:Sounds:music2.ogg"), FSOUND_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=4;} -// FSOUND_Sample_SetMinMaxDistance(strm[stream_music2], 4.0f, 1000.0f); - FSOUND_Stream_SetMode(strm[stream_music2], FSOUND_LOOP_NORMAL); + strm[stream_music2] = OPENAL_Stream_Open(ConvertFileName(":Data:Sounds:music2.ogg"), OPENAL_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=4;} +// OPENAL_Sample_SetMinMaxDistance(strm[stream_music2], 4.0f, 1000.0f); + OPENAL_Stream_SetMode(strm[stream_music2], OPENAL_LOOP_NORMAL); //} @@ -1369,12 +1368,12 @@ void Game::InitGame() /* float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); - FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); - FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + OPENAL_3D_SetAttributes(channels[firestartsound], gLoc, vel); + OPENAL_SetVolume(channels[firestartsound], 256); + OPENAL_SetPaused(channels[firestartsound], false); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); flashr=1; flashg=0; @@ -1398,8 +1397,8 @@ void Game::LoadStuff() /*musicvolume[3]=512; PlaySoundEx( music4, samp[music4], NULL, true); - FSOUND_SetPaused(channels[music4], false); - FSOUND_SetVolume(channels[music4], 512); + OPENAL_SetPaused(channels[music4], false); + OPENAL_SetVolume(channels[music4], 512); */ loadtime=0; @@ -1854,18 +1853,18 @@ void Game::LoadStuff() LoadSounds(); /*PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, true); - FSOUND_SetVolume(channels[consolesuccesssound], 256); - FSOUND_SetPaused(channels[consolesuccesssound], false); + OPENAL_SetVolume(channels[consolesuccesssound], 256); + OPENAL_SetPaused(channels[consolesuccesssound], false); */ if(targetlevel!=7){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); - FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + 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 1212558..b6378d1 100644 --- a/Source/GameTick.cpp +++ b/Source/GameTick.cpp @@ -29,6 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include "Game.h" +#include "openal_wrapper.h" using namespace std; @@ -37,7 +38,7 @@ extern XYZ viewer; extern int environment; extern float texscale; extern Terrain terrain; -extern FSOUND_SAMPLE *samp[100]; +extern OPENAL_SAMPLE *samp[100]; extern int channels[100]; extern Sprites sprites; extern int kTextureSize; @@ -224,9 +225,9 @@ extern float accountcampaigntime[10]; extern int accountcampaignchoicesmade[10]; extern int accountcampaignchoices[10][5000]; /********************> Tick() <*****/ -extern FSOUND_STREAM * strm[20]; -extern "C" void PlaySoundEx(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused); -extern "C" void PlayStreamEx(int chan, FSOUND_STREAM *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused); +extern OPENAL_STREAM * strm[20]; +extern "C" void PlaySoundEx(int channel, OPENAL_SAMPLE *sptr, OPENAL_DSPUNIT *dsp, signed char startpaused); +extern "C" void PlayStreamEx(int chan, OPENAL_STREAM *sptr, OPENAL_DSPUNIT *dsp, signed char startpaused); extern void ScreenShot(const char * fname); void Screenshot (void) @@ -625,17 +626,17 @@ void Game::Setenvironment(int which) float temptexdetail; environment=which; /* - FSOUND_SetPaused(channels[music1snow], true); - FSOUND_SetPaused(channels[music1grass], true); - FSOUND_SetPaused(channels[music1desert], true); - FSOUND_SetPaused(channels[wind], true); - FSOUND_SetPaused(channels[desertambient], true); + OPENAL_SetPaused(channels[music1snow], true); + OPENAL_SetPaused(channels[music1grass], true); + OPENAL_SetPaused(channels[music1desert], true); + OPENAL_SetPaused(channels[wind], true); + OPENAL_SetPaused(channels[desertambient], true); */ - FSOUND_SetPaused(channels[stream_music1snow], true); - FSOUND_SetPaused(channels[stream_music1grass], true); - FSOUND_SetPaused(channels[stream_music1desert], true); - FSOUND_SetPaused(channels[stream_wind], true); - FSOUND_SetPaused(channels[stream_desertambient], true); + OPENAL_SetPaused(channels[stream_music1snow], true); + OPENAL_SetPaused(channels[stream_music1grass], true); + OPENAL_SetPaused(channels[stream_music1desert], true); + OPENAL_SetPaused(channels[stream_wind], true); + OPENAL_SetPaused(channels[stream_desertambient], true); if(environment==snowyenvironment){ @@ -644,8 +645,8 @@ void Game::Setenvironment(int which) if(ambientsound){ //PlaySoundEx( wind, samp[wind], NULL, true); PlayStreamEx(stream_wind, strm[stream_wind], 0, true); - FSOUND_SetPaused(channels[stream_wind], false); - FSOUND_SetVolume(channels[stream_wind], 256); + OPENAL_SetPaused(channels[stream_wind], false); + OPENAL_SetVolume(channels[stream_wind], 256); } LoadTexture(":Data:Textures:snowtree.png",&objects.treetextureptr,0,1); @@ -653,18 +654,18 @@ void Game::Setenvironment(int which) LoadTexture(":Data:Textures:bouldersnow.jpg",&objects.rocktextureptr,1,0); LoadTexture(":Data:Textures:snowbox.jpg",&objects.boxtextureptr,1,0); - FSOUND_Sample_Free(samp[footstepsound]); - FSOUND_Sample_Free(samp[footstepsound2]); - FSOUND_Sample_Free(samp[footstepsound3]); - FSOUND_Sample_Free(samp[footstepsound4]); - samp[footstepsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:footstepsnow1.ogg", FSOUND_HW3D, 0, 0); - samp[footstepsound2] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:footstepsnow2.ogg", FSOUND_HW3D, 0, 0); - samp[footstepsound3] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:footstepstone1.ogg", FSOUND_HW3D, 0, 0); - samp[footstepsound4] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:footstepstone2.ogg", FSOUND_HW3D, 0, 0); - FSOUND_Sample_SetMinMaxDistance(samp[footstepsound], 4.0f, 1000.0f); - FSOUND_Sample_SetMinMaxDistance(samp[footstepsound2], 4.0f, 1000.0f); - FSOUND_Sample_SetMinMaxDistance(samp[footstepsound3], 4.0f, 1000.0f); - FSOUND_Sample_SetMinMaxDistance(samp[footstepsound4], 4.0f, 1000.0f); + 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, ":Data:Sounds:footstepsnow1.ogg", OPENAL_HW3D, 0, 0); + samp[footstepsound2] = OPENAL_Sample_Load(OPENAL_FREE, ":Data:Sounds:footstepsnow2.ogg", OPENAL_HW3D, 0, 0); + samp[footstepsound3] = OPENAL_Sample_Load(OPENAL_FREE, ":Data:Sounds:footstepstone1.ogg", OPENAL_HW3D, 0, 0); + samp[footstepsound4] = OPENAL_Sample_Load(OPENAL_FREE, ":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); @@ -703,22 +704,22 @@ void Game::Setenvironment(int which) if(ambientsound){ //PlaySoundEx( desertambient, samp[desertambient], NULL, true); PlayStreamEx( stream_desertambient, strm[stream_desertambient], NULL, true); - FSOUND_SetPaused(channels[stream_desertambient], false); - FSOUND_SetVolume(channels[stream_desertambient], 256); + OPENAL_SetPaused(channels[stream_desertambient], false); + OPENAL_SetVolume(channels[stream_desertambient], 256); } - FSOUND_Sample_Free(samp[footstepsound]); - FSOUND_Sample_Free(samp[footstepsound2]); - FSOUND_Sample_Free(samp[footstepsound3]); - FSOUND_Sample_Free(samp[footstepsound4]); - samp[footstepsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:footstepsnow1.ogg", FSOUND_HW3D, 0, 0); - samp[footstepsound2] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:footstepsnow2.ogg", FSOUND_HW3D, 0, 0); - samp[footstepsound3] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:footstepsnow1.ogg", FSOUND_HW3D, 0, 0); - samp[footstepsound4] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:footstepsnow2.ogg", FSOUND_HW3D, 0, 0); - FSOUND_Sample_SetMinMaxDistance(samp[footstepsound], 4.0f, 1000.0f); - FSOUND_Sample_SetMinMaxDistance(samp[footstepsound2], 4.0f, 1000.0f); - FSOUND_Sample_SetMinMaxDistance(samp[footstepsound3], 4.0f, 1000.0f); - FSOUND_Sample_SetMinMaxDistance(samp[footstepsound4], 4.0f, 1000.0f); + 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, ":Data:Sounds:footstepsnow1.ogg", OPENAL_HW3D, 0, 0); + samp[footstepsound2] = OPENAL_Sample_Load(OPENAL_FREE, ":Data:Sounds:footstepsnow2.ogg", OPENAL_HW3D, 0, 0); + samp[footstepsound3] = OPENAL_Sample_Load(OPENAL_FREE, ":Data:Sounds:footstepsnow1.ogg", OPENAL_HW3D, 0, 0); + samp[footstepsound4] = OPENAL_Sample_Load(OPENAL_FREE, ":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); @@ -754,22 +755,22 @@ void Game::Setenvironment(int which) if(ambientsound){ PlayStreamEx( stream_wind, strm[stream_wind], NULL, true); - FSOUND_SetPaused(channels[stream_wind], false); - FSOUND_SetVolume(channels[stream_wind], 100); + OPENAL_SetPaused(channels[stream_wind], false); + OPENAL_SetVolume(channels[stream_wind], 100); } - FSOUND_Sample_Free(samp[footstepsound]); - FSOUND_Sample_Free(samp[footstepsound2]); - FSOUND_Sample_Free(samp[footstepsound3]); - FSOUND_Sample_Free(samp[footstepsound4]); - samp[footstepsound] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:footstepgrass1.ogg", FSOUND_HW3D, 0, 0); - samp[footstepsound2] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:footstepgrass2.ogg", FSOUND_HW3D, 0, 0); - samp[footstepsound3] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:footstepstone1.ogg", FSOUND_HW3D, 0, 0); - samp[footstepsound4] = FSOUND_Sample_Load(FSOUND_FREE, ":Data:Sounds:footstepstone2.ogg", FSOUND_HW3D, 0, 0); - FSOUND_Sample_SetMinMaxDistance(samp[footstepsound], 4.0f, 1000.0f); - FSOUND_Sample_SetMinMaxDistance(samp[footstepsound2], 4.0f, 1000.0f); - FSOUND_Sample_SetMinMaxDistance(samp[footstepsound3], 4.0f, 1000.0f); - FSOUND_Sample_SetMinMaxDistance(samp[footstepsound4], 4.0f, 1000.0f); + 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, ":Data:Sounds:footstepgrass1.ogg", OPENAL_HW3D, 0, 0); + samp[footstepsound2] = OPENAL_Sample_Load(OPENAL_FREE, ":Data:Sounds:footstepgrass2.ogg", OPENAL_HW3D, 0, 0); + samp[footstepsound3] = OPENAL_Sample_Load(OPENAL_FREE, ":Data:Sounds:footstepstone1.ogg", OPENAL_HW3D, 0, 0); + samp[footstepsound4] = OPENAL_Sample_Load(OPENAL_FREE, ":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); @@ -881,15 +882,15 @@ void Game::Loadlevel(char *name){ if(!firstload){ oldlevel=50; } - FSOUND_SetPaused(channels[whooshsound], true); - FSOUND_SetPaused(channels[stream_firesound], true); + OPENAL_SetPaused(channels[whooshsound], true); + OPENAL_SetPaused(channels[stream_firesound], true); int mapvers; FILE *tfile; tfile=fopen( name, "rb" ); if(tfile) { - FSOUND_SetPaused(channels[stream_firesound], true); + OPENAL_SetPaused(channels[stream_firesound], true); scoreadded=0; @@ -961,8 +962,8 @@ void Game::Loadlevel(char *name){ if(console) { PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, true); - FSOUND_SetVolume(channels[consolesuccesssound], 256); - FSOUND_SetPaused(channels[consolesuccesssound], false); + OPENAL_SetVolume(channels[consolesuccesssound], 256); + OPENAL_SetPaused(channels[consolesuccesssound], false); freeze=0; console=0; } @@ -1607,19 +1608,19 @@ void Game::Loadlevel(char *name){ /* for(i=0;i<32;i++){ //if(i<16||i>20) - FSOUND_StopSound(i); + OPENAL_StopSound(i); } */ LOG("Starting background music..."); - FSOUND_StopSound(FSOUND_ALL); + OPENAL_StopSound(OPENAL_ALL); if(environment==snowyenvironment) { if(ambientsound) { PlayStreamEx(stream_wind, strm[stream_wind], NULL, true); - FSOUND_SetPaused(channels[stream_wind], false); - FSOUND_SetVolume(channels[stream_wind], 256); + OPENAL_SetPaused(channels[stream_wind], false); + OPENAL_SetVolume(channels[stream_wind], 256); } } else if(environment==desertenvironment) @@ -1630,8 +1631,8 @@ void Game::Loadlevel(char *name){ // samp[desertambient], NULL, true); PlayStreamEx(stream_desertambient, strm[stream_desertambient], NULL, true); - FSOUND_SetPaused(channels[stream_desertambient], false); - FSOUND_SetVolume(channels[stream_desertambient], 256); + OPENAL_SetPaused(channels[stream_desertambient], false); + OPENAL_SetVolume(channels[stream_desertambient], 256); } } else if(environment==grassyenvironment) @@ -1640,8 +1641,8 @@ void Game::Loadlevel(char *name){ { //PlaySoundEx(wind, samp[wind], NULL, true); PlayStreamEx(stream_wind, strm[stream_wind], NULL, true); - FSOUND_SetPaused(channels[stream_wind], false); - FSOUND_SetVolume(channels[stream_wind], 100); + OPENAL_SetPaused(channels[stream_wind], false); + OPENAL_SetVolume(channels[stream_wind], 100); } } oldmusicvolume[0]=0; @@ -1693,8 +1694,8 @@ void Game::Tick() if(newnetmessages){ newnetmessages=0; PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, true); - FSOUND_SetVolume(channels[consolesuccesssound], 256); - FSOUND_SetPaused(channels[consolesuccesssound], false); + OPENAL_SetVolume(channels[consolesuccesssound], 256); + OPENAL_SetPaused(channels[consolesuccesssound], false); for(k=14;k>=2;k--){ for(j=0;j<255;j++){ @@ -1755,12 +1756,12 @@ void Game::Tick() if(!stealthloading){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); - FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); - FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + OPENAL_3D_SetAttributes(channels[firestartsound], gLoc, vel); + OPENAL_SetVolume(channels[firestartsound], 256); + OPENAL_SetPaused(channels[firestartsound], false); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); flashr=1; flashg=0; @@ -1833,34 +1834,34 @@ void Game::Tick() campaign=1; mainmenu=0; gameon=1; - FSOUND_SetPaused(channels[music3], true); + OPENAL_SetPaused(channels[music3], true); stealthloading=0;*/ } else if(mainmenu==1||mainmenu==2)mainmenu=0; if(mainmenu&&musictoggle){ if(mainmenu==1||mainmenu==2||mainmenu==100){ - FSOUND_SetFrequency(FSOUND_ALL, 0.001); + OPENAL_SetFrequency(OPENAL_ALL, 0.001); PlayStreamEx( stream_music3, strm[stream_music3], NULL, true); - FSOUND_SetPaused(channels[stream_music3], false); - FSOUND_SetVolume(channels[stream_music3], 256); - FSOUND_SetPaused(channels[music1], true); + OPENAL_SetPaused(channels[stream_music3], false); + OPENAL_SetVolume(channels[stream_music3], 256); + OPENAL_SetPaused(channels[music1], true); } } if(!mainmenu){ - FSOUND_SetPaused(channels[stream_music3], true); - FSOUND_SetPaused(channels[music1], false); + OPENAL_SetPaused(channels[stream_music3], true); + OPENAL_SetPaused(channels[music1], false); } } if(mainmenu==3){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); - FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + 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); flashr=1; flashg=0; @@ -1956,12 +1957,12 @@ void Game::Tick() if(mainmenu==4||mainmenu==5||mainmenu==6||mainmenu==7||mainmenu==9||mainmenu==12||mainmenu==13||mainmenu==14||mainmenu==10||mainmenu==11||mainmenu==100){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); - FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + 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); flashr=1; flashg=0; @@ -2009,8 +2010,8 @@ void Game::Tick() if(tutorialstage!=51) tutorialstagetime=tutorialmaxtime; PlaySoundEx( consolefailsound, samp[consolefailsound], NULL, true); - FSOUND_SetVolume(channels[consolefailsound], 128); - FSOUND_SetPaused(channels[consolefailsound], false); + OPENAL_SetVolume(channels[consolefailsound], 128); + OPENAL_SetPaused(channels[consolefailsound], false); minimaptogglekeydown=1; } if(!IsKeyDown(theKeyMap, MAC_TAB_KEY)){ @@ -2024,12 +2025,12 @@ void Game::Tick() if(!gameon){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); - FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); - FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + OPENAL_3D_SetAttributes(channels[firestartsound], gLoc, vel); + OPENAL_SetVolume(channels[firestartsound], 256); + OPENAL_SetPaused(channels[firestartsound], false); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); flashr=1; flashg=0; @@ -2052,26 +2053,26 @@ void Game::Tick() } mainmenu=0; gameon=1; - FSOUND_SetPaused(channels[music3], true); */ + OPENAL_SetPaused(channels[music3], true); */ } else { //resume mainmenu=0; - FSOUND_SetPaused(channels[stream_music3], true); - FSOUND_SetPaused(channels[music1], false); + OPENAL_SetPaused(channels[stream_music3], true); + OPENAL_SetPaused(channels[music1], false); } } if(Button()&&!oldbutton&&selected==2){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); - FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); - FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + OPENAL_3D_SetAttributes(channels[firestartsound], gLoc, vel); + OPENAL_SetVolume(channels[firestartsound], 256); + OPENAL_SetPaused(channels[firestartsound], false); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); flashr=1; flashg=0; @@ -2094,12 +2095,12 @@ void Game::Tick() if(Button()&&!oldbutton&&selected==3){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); - FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + 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); flashr=1; flashg=0; @@ -2110,7 +2111,7 @@ void Game::Tick() if(!gameon){ //quit tryquit=1; - if(registered)FSOUND_SetPaused(channels[stream_music3], true); + if(registered)OPENAL_SetPaused(channels[stream_music3], true); } else{ //end game @@ -2126,12 +2127,12 @@ void Game::Tick() if(Button()&&!oldbutton&&selected!=-1){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); - FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); - FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + OPENAL_3D_SetAttributes(channels[firestartsound], gLoc, vel); + OPENAL_SetVolume(channels[firestartsound], 256); + OPENAL_SetPaused(channels[firestartsound], false); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); } if(Button()&&!oldbutton&&selected==0){ #if USE_SDL @@ -2252,9 +2253,9 @@ void Game::Tick() musictoggle=1-musictoggle; if(!musictoggle){ - FSOUND_SetPaused(channels[music1], true); - FSOUND_SetPaused(channels[stream_music2], true); - FSOUND_SetPaused(channels[stream_music3], true); + OPENAL_SetPaused(channels[music1], true); + OPENAL_SetPaused(channels[stream_music2], true); + OPENAL_SetPaused(channels[stream_music3], true); for(i=0;i<4;i++){ oldmusicvolume[i]=0; @@ -2264,8 +2265,8 @@ void Game::Tick() if(musictoggle){ PlayStreamEx( stream_music3, strm[stream_music3], NULL, true); - FSOUND_SetPaused(channels[stream_music3], false); - FSOUND_SetVolume(channels[stream_music3], 256); + OPENAL_SetPaused(channels[stream_music3], false); + OPENAL_SetVolume(channels[stream_music3], 256); } } if(Button()&&!oldbutton&&selected==9){ @@ -2278,17 +2279,17 @@ void Game::Tick() if(Button()&&!oldbutton&&selected==11){ volume+=.1f; if(volume>1.0001f)volume=0; - FSOUND_SetSFXMasterVolume((int)(volume*255)); + OPENAL_SetSFXMasterVolume((int)(volume*255)); } if(Button()&&!oldbutton&&selected==7){ /*float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); - FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); - FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + OPENAL_3D_SetAttributes(channels[firestartsound], gLoc, vel); + OPENAL_SetVolume(channels[firestartsound], 256); + OPENAL_SetPaused(channels[firestartsound], false); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); */ flashr=1; flashg=0; @@ -2304,12 +2305,12 @@ void Game::Tick() if(Button()&&!oldbutton&&selected==8){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); - FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + 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); flashr=1; flashg=0; @@ -2413,12 +2414,12 @@ void Game::Tick() if(Button()&&!oldbutton&&selected!=-1&&keyselect==-1){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); - FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); - FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + OPENAL_3D_SetAttributes(channels[firestartsound], gLoc, vel); + OPENAL_SetVolume(channels[firestartsound], 256); + OPENAL_SetPaused(channels[firestartsound], false); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); } if(Button()&&!oldbutton&&selected<9&&keyselect==-1){ keyselect=selected; @@ -2434,12 +2435,12 @@ void Game::Tick() if(i!=MAC_ESCAPE_KEY&&(strcmp(KeyToChar(i),"unknown")||(buttons[0]&&!oldbuttons[0]&&!oldbutton)||(buttons[1]&&!oldbuttons[1]&&!oldbutton))){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); - FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + 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); int keynum; keynum=i; @@ -2464,12 +2465,12 @@ void Game::Tick() if(Button()&&!oldbutton&&selected==9){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); - FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + 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); flashr=1; flashg=0; @@ -2490,10 +2491,10 @@ void Game::Tick() if(mainmenu==5){ if(accountcampaignchoicesmade[accountactive]>8&&!registered){ - FSOUND_SetFrequency(FSOUND_ALL, 0.001); + OPENAL_SetFrequency(OPENAL_ALL, 0.001); PlayStreamEx( stream_music3, strm[stream_music3], NULL, true); - FSOUND_SetPaused(channels[stream_music3], false); - FSOUND_SetVolume(channels[stream_music3], 256); + OPENAL_SetPaused(channels[stream_music3], false); + OPENAL_SetVolume(channels[stream_music3], 256); gameon=0; mainmenu=12; @@ -2503,12 +2504,12 @@ void Game::Tick() float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); - FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + 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); flashr=1; flashg=0; @@ -2527,12 +2528,12 @@ void Game::Tick() if(Button()&&!oldbutton&&selected==1){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); - FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); - FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + OPENAL_3D_SetAttributes(channels[firestartsound], gLoc, vel); + OPENAL_SetVolume(channels[firestartsound], 256); + OPENAL_SetPaused(channels[firestartsound], false); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); flashr=1; flashg=0; @@ -2553,17 +2554,17 @@ void Game::Tick() mainmenu=0; gameon=1; - FSOUND_SetPaused(channels[stream_music3], true); + OPENAL_SetPaused(channels[stream_music3], true); } if(Button()&&!oldbutton&&selected-7>=accountcampaignchoicesmade[accountactive]){//selected>=7&&(selected-7<=campaignnumchoices)){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); - FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); - FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + OPENAL_3D_SetAttributes(channels[firestartsound], gLoc, vel); + OPENAL_SetVolume(channels[firestartsound], 256); + OPENAL_SetPaused(channels[firestartsound], false); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); flashr=1; flashg=0; @@ -2603,17 +2604,17 @@ void Game::Tick() campaign=1; mainmenu=0; gameon=1; - FSOUND_SetPaused(channels[stream_music3], true); + OPENAL_SetPaused(channels[stream_music3], true); } if(Button()&&!oldbutton&&selected==4){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); - FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + 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); flashr=1; flashg=0; @@ -2627,12 +2628,12 @@ void Game::Tick() if(Button()&&!oldbutton&&selected==5){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); - FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + 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); flashr=1; flashg=0; @@ -2645,12 +2646,12 @@ void Game::Tick() if(Button()&&!oldbutton&&selected==3){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); - FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); - FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + OPENAL_3D_SetAttributes(channels[firestartsound], gLoc, vel); + OPENAL_SetVolume(channels[firestartsound], 256); + OPENAL_SetPaused(channels[firestartsound], false); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); flashr=1; flashg=0; @@ -2663,12 +2664,12 @@ void Game::Tick() if(Button()&&!oldbutton&&selected==2){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); - FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); - FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + OPENAL_3D_SetAttributes(channels[firestartsound], gLoc, vel); + OPENAL_SetVolume(channels[firestartsound], 256); + OPENAL_SetPaused(channels[firestartsound], false); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); flashr=1; flashg=0; @@ -2685,12 +2686,12 @@ void Game::Tick() if(Button()&&!oldbutton&&selected=0&&selected<=accountprogress[accountactive]){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); - FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); - FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + OPENAL_3D_SetAttributes(channels[firestartsound], gLoc, vel); + OPENAL_SetVolume(channels[firestartsound], 256); + OPENAL_SetPaused(channels[firestartsound], false); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); flashr=1; flashg=0; @@ -2712,17 +2713,17 @@ void Game::Tick() mainmenu=0; gameon=1; - FSOUND_SetPaused(channels[stream_music3], true); + OPENAL_SetPaused(channels[stream_music3], true); } if(Button()&&!oldbutton&&selected==numchallengelevels){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); - FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + 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); flashr=1; flashg=0; @@ -2739,12 +2740,12 @@ void Game::Tick() if(Button()&&!oldbutton&&selected=0&&selected<=accountprogress[accountactive]){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); - FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); - FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + OPENAL_3D_SetAttributes(channels[firestartsound], gLoc, vel); + OPENAL_SetVolume(channels[firestartsound], 256); + OPENAL_SetPaused(channels[firestartsound], false); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); flashr=1; flashg=0; @@ -2766,17 +2767,17 @@ void Game::Tick() mainmenu=0; gameon=1; - FSOUND_SetPaused(channels[stream_music3], true); + OPENAL_SetPaused(channels[stream_music3], true); } if(Button()&&!oldbutton&&selected==numchallengelevels){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); - FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + 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); flashr=1; flashg=0; @@ -2794,12 +2795,12 @@ void Game::Tick() if(Button()&&!oldbutton&&selected==3){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); - FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + 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); flashr=1; flashg=0; @@ -2817,12 +2818,12 @@ void Game::Tick() if(Button()&&!oldbutton&&selected==1){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); - FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + 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); flashr=1; flashg=0; @@ -2843,12 +2844,12 @@ void Game::Tick() if(tryquit)quit=1; float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); - FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + 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); flashr=1; flashg=0; @@ -2864,12 +2865,12 @@ void Game::Tick() quit=1; float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); - FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + 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); flashr=1; flashg=0; @@ -2883,12 +2884,12 @@ void Game::Tick() tryquit=0; float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); - FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + 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); flashr=1; flashg=0; @@ -2905,22 +2906,22 @@ void Game::Tick() if(Button()&&!oldbutton&&selected!=-1){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); - FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); - FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + OPENAL_3D_SetAttributes(channels[firestartsound], gLoc, vel); + OPENAL_SetVolume(channels[firestartsound], 256); + OPENAL_SetPaused(channels[firestartsound], false); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); } if(Button()&&!oldbutton&&selected==1){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); - FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + 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); flashr=1; flashg=0; @@ -2961,12 +2962,12 @@ void Game::Tick() if(Button()&&!oldbutton&&selected==2){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); - FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + 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); flashr=1; flashg=0; @@ -2983,12 +2984,12 @@ void Game::Tick() if(Button()&&!oldbutton&&selected!=-1){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); - FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); - FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + OPENAL_3D_SetAttributes(channels[firestartsound], gLoc, vel); + OPENAL_SetVolume(channels[firestartsound], 256); + OPENAL_SetPaused(channels[firestartsound], false); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); } if(Button()&&!oldbutton&&selected==0&&numaccounts<8){ entername=1; @@ -3005,12 +3006,12 @@ void Game::Tick() if(Button()&&!oldbutton&&selected==numaccounts+1){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); - FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + 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); flashr=1; flashg=0; @@ -3034,12 +3035,12 @@ void Game::Tick() if(Button()&&!oldbutton&&selected!=-1){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); - FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); - FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + OPENAL_3D_SetAttributes(channels[firestartsound], gLoc, vel); + OPENAL_SetVolume(channels[firestartsound], 256); + OPENAL_SetPaused(channels[firestartsound], false); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); if(selected==0)accountdifficulty[accountactive]=0; if(selected==1)accountdifficulty[accountactive]=1; @@ -3161,7 +3162,7 @@ void Game::Tick() loaddistrib=0; } } - FSOUND_SetFrequency(channels[stream_music3], 22050); + OPENAL_SetFrequency(channels[stream_music3], 22050); if(entername||mainmenu==13||mainmenu==14){ for(i=0;i<140;i++){ @@ -3233,12 +3234,12 @@ void Game::Tick() float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); - FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); - FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + OPENAL_3D_SetAttributes(channels[firestartsound], gLoc, vel); + OPENAL_SetVolume(channels[firestartsound], 256); + OPENAL_SetPaused(channels[firestartsound], false); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); for(j=0;j<255;j++){ displaytext[0][j]=' '; @@ -3336,12 +3337,12 @@ void Game::Tick() float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); - FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); - FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + OPENAL_3D_SetAttributes(channels[firestartsound], gLoc, vel); + OPENAL_SetVolume(channels[firestartsound], 256); + OPENAL_SetPaused(channels[firestartsound], false); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); for(j=0;j<255;j++){ displaytext[0][j]=' '; @@ -3365,12 +3366,12 @@ void Game::Tick() float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); - FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); - FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + OPENAL_3D_SetAttributes(channels[firestartsound], gLoc, vel); + OPENAL_SetVolume(channels[firestartsound], 256); + OPENAL_SetPaused(channels[firestartsound], false); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); for(j=0;j<255;j++){ displaytext[0][j]=' '; @@ -3502,7 +3503,7 @@ void Game::Tick() if(IsKeyDown(theKeyMap, MAC_V_KEY)&&!freezetogglekeydown&&debugmode){ freeze=1-freeze; if(freeze){ - FSOUND_SetFrequency(FSOUND_ALL, 0.001); + OPENAL_SetFrequency(OPENAL_ALL, 0.001); } freezetogglekeydown=1; } @@ -3515,7 +3516,7 @@ void Game::Tick() console=1-console; if(!console)freeze=0; if(console){ - FSOUND_SetFrequency(FSOUND_ALL, 0.001); + OPENAL_SetFrequency(OPENAL_ALL, 0.001); } consoletogglekeydown=1; } @@ -3587,8 +3588,8 @@ void Game::Tick() donesomething=0; if(Compare(consoletext[0],"quit ",0,4)||Compare(consoletext[0],"exit ",0,4)){ PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, true); - FSOUND_SetVolume(channels[consolesuccesssound], 256); - FSOUND_SetPaused(channels[consolesuccesssound], false); + OPENAL_SetVolume(channels[consolesuccesssound], 256); + OPENAL_SetPaused(channels[consolesuccesssound], false); donesomething=1; tryquit=1; } @@ -3676,8 +3677,8 @@ void Game::Tick() { donesomething=1; PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, true); - FSOUND_SetVolume(channels[consolesuccesssound], 256); - FSOUND_SetPaused(channels[consolesuccesssound], false); + OPENAL_SetVolume(channels[consolesuccesssound], 256); + OPENAL_SetPaused(channels[consolesuccesssound], false); if(consolechars[0]>0){ for(k=14;k>=1;k--){ @@ -3735,8 +3736,8 @@ void Game::Tick() { donesomething=1; PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, true); - FSOUND_SetVolume(channels[consolesuccesssound], 256); - FSOUND_SetPaused(channels[consolesuccesssound], false); + OPENAL_SetVolume(channels[consolesuccesssound], 256); + OPENAL_SetPaused(channels[consolesuccesssound], false); if(consolechars[0]>0){ for(k=14;k>=1;k--){ @@ -3774,8 +3775,8 @@ void Game::Tick() mapname[consolechars[0]-5+11]='\0'; PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, true); - FSOUND_SetVolume(channels[consolesuccesssound], 256); - FSOUND_SetPaused(channels[consolesuccesssound], false); + OPENAL_SetVolume(channels[consolesuccesssound], 256); + OPENAL_SetPaused(channels[consolesuccesssound], false); int mapvers; mapvers=12; @@ -4098,8 +4099,8 @@ void Game::Tick() mapname[consolechars[0]-5+11]='\0'; PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, true); - FSOUND_SetVolume(channels[consolesuccesssound], 256); - FSOUND_SetPaused(channels[consolesuccesssound], false); + OPENAL_SetVolume(channels[consolesuccesssound], 256); + OPENAL_SetPaused(channels[consolesuccesssound], false); FILE *tfile; tfile=fopen( mapname, "wb" ); @@ -4841,9 +4842,9 @@ void Game::Tick() if(dialogueboxsound[whichdialogue][indialogue]==-3)whichsoundplay=consolesuccesssound; if(dialogueboxsound[whichdialogue][indialogue]==-4)whichsoundplay=consolefailsound; PlaySoundEx( whichsoundplay, samp[whichsoundplay], NULL, true); - FSOUND_3D_SetAttributes(channels[whichsoundplay], gLoc, vel); - FSOUND_SetVolume(channels[whichsoundplay], 256); - FSOUND_SetPaused(channels[whichsoundplay], false); + OPENAL_3D_SetAttributes(channels[whichsoundplay], gLoc, vel); + OPENAL_SetVolume(channels[whichsoundplay], 256); + OPENAL_SetPaused(channels[whichsoundplay], false); //} } } @@ -5687,8 +5688,8 @@ void Game::Tick() if(!donesomething){ PlaySoundEx( consolefailsound, samp[consolefailsound], NULL, true); - FSOUND_SetVolume(channels[consolefailsound], 256); - FSOUND_SetPaused(channels[consolefailsound], false); + OPENAL_SetVolume(channels[consolefailsound], 256); + OPENAL_SetPaused(channels[consolefailsound], false); } } } @@ -5800,10 +5801,10 @@ void Game::Tick() static int oldwinfreeze; if(winfreeze&&!oldwinfreeze){ - FSOUND_SetFrequency(FSOUND_ALL, 0.001); + OPENAL_SetFrequency(OPENAL_ALL, 0.001); PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, true); - FSOUND_SetVolume(channels[consolesuccesssound], 256); - FSOUND_SetPaused(channels[consolesuccesssound], false); + OPENAL_SetVolume(channels[consolesuccesssound], 256); + OPENAL_SetPaused(channels[consolesuccesssound], false); } if(winfreeze==0)oldwinfreeze=winfreeze; else oldwinfreeze++; @@ -5910,9 +5911,9 @@ void Game::Tick() if(dialogueboxsound[whichdialogue][indialogue]==-3)whichsoundplay=consolesuccesssound; if(dialogueboxsound[whichdialogue][indialogue]==-4)whichsoundplay=consolefailsound; PlaySoundEx( whichsoundplay, samp[whichsoundplay], NULL, true); - FSOUND_3D_SetAttributes(channels[whichsoundplay], gLoc, vel); - FSOUND_SetVolume(channels[whichsoundplay], 256); - FSOUND_SetPaused(channels[whichsoundplay], false); + OPENAL_3D_SetAttributes(channels[whichsoundplay], gLoc, vel); + OPENAL_SetVolume(channels[whichsoundplay], 256); + OPENAL_SetPaused(channels[whichsoundplay], false); } if(IsKeyDown(theKeyMap, attackkey))oldbuttondialogue=1; } @@ -6021,9 +6022,9 @@ void Game::Tick() vel[1]=0; vel[2]=0; PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); - FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], false); + OPENAL_3D_SetAttributes(channels[fireendsound], gLoc, vel); + OPENAL_SetVolume(channels[fireendsound], 256); + OPENAL_SetPaused(channels[fireendsound], false); for(i=0;i=1){ @@ -6478,15 +6479,15 @@ void Game::Tick() if(tutoriallevel!=1){ if(bonustime==0&&bonus!=solidhit&&bonus!=spinecrusher&&bonus!=tracheotomy&&bonus!=backstab&&bonusvalue>10){ PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, true); - FSOUND_SetVolume(channels[consolesuccesssound], 256); - FSOUND_SetPaused(channels[consolesuccesssound], false); + OPENAL_SetVolume(channels[consolesuccesssound], 256); + OPENAL_SetPaused(channels[consolesuccesssound], false); } } else if(bonustime==0){ PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], false); + OPENAL_SetVolume(channels[fireendsound], 256); + OPENAL_SetPaused(channels[fireendsound], false); } if(bonustime==0){ if(bonus!=solidhit&&bonus!=twoxcombo&&bonus!=threexcombo&&bonus!=fourxcombo&&bonus!=megacombo)bonusnum[bonus]++; @@ -6601,10 +6602,10 @@ void Game::Tick() vel[1]=0; vel[2]=0; PlaySoundEx( movewhooshsound, samp[movewhooshsound], NULL, true); - FSOUND_3D_SetAttributes(channels[movewhooshsound], gLoc, vel); - FSOUND_SetVolume(channels[movewhooshsound], 256); - FSOUND_SetPaused(channels[movewhooshsound], false); - if(k==0)FSOUND_SetPaused(channels[whooshsound], true); + OPENAL_3D_SetAttributes(channels[movewhooshsound], gLoc, vel); + OPENAL_SetVolume(channels[movewhooshsound], 256); + OPENAL_SetPaused(channels[movewhooshsound], false); + if(k==0)OPENAL_SetPaused(channels[whooshsound], true); lowpointtarget=DoRotation(objects.model[i].facenormals[whichhit],0,objects.rotation[i],0); player[k].rotation=-asin(0-lowpointtarget.x); @@ -6632,10 +6633,10 @@ void Game::Tick() vel[1]=0; vel[2]=0; PlaySoundEx( movewhooshsound, samp[movewhooshsound], NULL, true); - FSOUND_3D_SetAttributes(channels[movewhooshsound], gLoc, vel); - FSOUND_SetVolume(channels[movewhooshsound], 256); - FSOUND_SetPaused(channels[movewhooshsound], false); - if(k==0)FSOUND_SetPaused(channels[whooshsound], true); + OPENAL_3D_SetAttributes(channels[movewhooshsound], gLoc, vel); + OPENAL_SetVolume(channels[movewhooshsound], 256); + OPENAL_SetPaused(channels[movewhooshsound], false); + if(k==0)OPENAL_SetPaused(channels[whooshsound], true); lowpointtarget=DoRotation(objects.model[i].facenormals[whichhit],0,objects.rotation[i],0); player[k].rotation=-asin(0-lowpointtarget.x); @@ -6663,10 +6664,10 @@ void Game::Tick() vel[1]=0; vel[2]=0; PlaySoundEx( movewhooshsound, samp[movewhooshsound], NULL, true); - FSOUND_3D_SetAttributes(channels[movewhooshsound], gLoc, vel); - FSOUND_SetVolume(channels[movewhooshsound], 256); - FSOUND_SetPaused(channels[movewhooshsound], false); - if(k==0)FSOUND_SetPaused(channels[whooshsound], true); + OPENAL_3D_SetAttributes(channels[movewhooshsound], gLoc, vel); + OPENAL_SetVolume(channels[movewhooshsound], 256); + OPENAL_SetPaused(channels[movewhooshsound], false); + if(k==0)OPENAL_SetPaused(channels[whooshsound], true); lowpointtarget=DoRotation(objects.model[i].facenormals[whichhit],0,objects.rotation[i],0); player[k].rotation=-asin(0-lowpointtarget.x); @@ -6694,10 +6695,10 @@ void Game::Tick() vel[1]=0; vel[2]=0; PlaySoundEx( movewhooshsound, samp[movewhooshsound], NULL, true); - FSOUND_3D_SetAttributes(channels[movewhooshsound], gLoc, vel); - FSOUND_SetVolume(channels[movewhooshsound], 256); - FSOUND_SetPaused(channels[movewhooshsound], false); - if(k==0)FSOUND_SetPaused(channels[whooshsound], true); + OPENAL_3D_SetAttributes(channels[movewhooshsound], gLoc, vel); + OPENAL_SetVolume(channels[movewhooshsound], 256); + OPENAL_SetPaused(channels[movewhooshsound], false); + if(k==0)OPENAL_SetPaused(channels[whooshsound], true); lowpointtarget=DoRotation(objects.model[i].facenormals[whichhit],0,objects.rotation[i],0); player[k].rotation=-asin(0-lowpointtarget.x); @@ -6732,8 +6733,8 @@ void Game::Tick() player[k].onterrain=1; if(player[k].id==0){ - FSOUND_SetPaused(channels[whooshsound], true); - FSOUND_SetVolume(channels[whooshsound], 0); + OPENAL_SetPaused(channels[whooshsound], true); + OPENAL_SetVolume(channels[whooshsound], 0); } if((player[k].targetanimation==jumpdownanim||player[k].isFlip())&&!player[k].wasLanding()){ @@ -6748,9 +6749,9 @@ void Game::Tick() vel[1]=player[k].velocity.y; vel[2]=player[k].velocity.z; PlaySoundEx( landsound, samp[landsound], NULL, true); - FSOUND_3D_SetAttributes(channels[landsound], gLoc, vel); - FSOUND_SetVolume(channels[landsound], 128); - FSOUND_SetPaused(channels[landsound], false); + OPENAL_3D_SetAttributes(channels[landsound], gLoc, vel); + OPENAL_SetVolume(channels[landsound], 128); + OPENAL_SetPaused(channels[landsound], false); if(k==0){ envsound[numenvsounds]=player[k].coords; envsoundvol[numenvsounds]=16; @@ -6848,7 +6849,7 @@ void Game::Tick() if(j>10||!player[k].isRun()){ if(player[k].targetanimation==jumpdownanim||player[k].targetanimation==jumpupanim){ - if(k==0)FSOUND_SetPaused(channels[whooshsound], true); + if(k==0)OPENAL_SetPaused(channels[whooshsound], true); } float gLoc[3]; float vel[3]; @@ -6859,9 +6860,9 @@ void Game::Tick() vel[1]=player[k].velocity.y; vel[2]=player[k].velocity.z; PlaySoundEx( jumpsound, samp[jumpsound], NULL, true); - FSOUND_3D_SetAttributes(channels[jumpsound], gLoc, vel); - FSOUND_SetVolume(channels[jumpsound], 128); - FSOUND_SetPaused(channels[jumpsound], false); + OPENAL_3D_SetAttributes(channels[jumpsound], gLoc, vel); + OPENAL_SetVolume(channels[jumpsound], 128); + OPENAL_SetPaused(channels[jumpsound], false); lowpointtarget=DoRotation(objects.model[i].facenormals[whichhit],0,objects.rotation[i],0); player[k].rotation=-asin(0-lowpointtarget.x); @@ -6921,9 +6922,9 @@ void Game::Tick() vel[2]=player[k].velocity.z; if(k==0){ PlaySoundEx( whooshsound, samp[whooshsound], NULL, true); - FSOUND_3D_SetAttributes(channels[whooshsound], gLoc, vel); - FSOUND_SetVolume(channels[whooshsound], 128); - FSOUND_SetPaused(channels[whooshsound], false); + OPENAL_3D_SetAttributes(channels[whooshsound], gLoc, vel); + OPENAL_SetVolume(channels[whooshsound], 128); + OPENAL_SetPaused(channels[whooshsound], false); } } player[k].velocity.y+=gravity; @@ -7051,9 +7052,9 @@ void Game::Tick() if(dialogueboxsound[whichdialogue][indialogue]==-3)whichsoundplay=consolesuccesssound; if(dialogueboxsound[whichdialogue][indialogue]==-4)whichsoundplay=consolefailsound; PlaySoundEx( whichsoundplay, samp[whichsoundplay], NULL, true); - FSOUND_3D_SetAttributes(channels[whichsoundplay], gLoc, vel); - FSOUND_SetVolume(channels[whichsoundplay], 256); - FSOUND_SetPaused(channels[whichsoundplay], false); + OPENAL_3D_SetAttributes(channels[whichsoundplay], gLoc, vel); + OPENAL_SetVolume(channels[whichsoundplay], 256); + OPENAL_SetPaused(channels[whichsoundplay], false); } } @@ -7091,7 +7092,7 @@ void Game::Tick() } } if(!directing){ - FSOUND_SetPaused(channels[whooshsound], true); + OPENAL_SetPaused(channels[whooshsound], true); viewer=dialoguecamera[whichdialogue][indialogue]; if(viewer.y1){ player[i].targetanimation=player[i].getLanding(); @@ -10832,8 +10833,8 @@ void Game::Tick() envsound[j]=envsound[numenvsounds]; } } - if(!slomo)FSOUND_SetFrequency(FSOUND_ALL, 22050); - if(slomo)FSOUND_SetFrequency(FSOUND_ALL, slomofreq); + if(!slomo)OPENAL_SetFrequency(OPENAL_ALL, 22050); + if(slomo)OPENAL_SetFrequency(OPENAL_ALL, slomofreq); if(tutoriallevel==1){ XYZ temp; @@ -10854,24 +10855,24 @@ void Game::Tick() oldtemp2=temp2; if(tutorialstage>=51) if(findDistancefast(&temp,&player[0].coords)>=findDistancefast(&temp,&temp2)-1||findDistancefast(&temp3,&player[0].coords)<4){ - FSOUND_StopSound(FSOUND_ALL); // hack...OpenAL renderer isn't stopping music after tutorial goes to level menu... - FSOUND_SetFrequency(FSOUND_ALL, 0.001); + OPENAL_StopSound(OPENAL_ALL); // hack...OpenAL renderer isn't stopping music after tutorial goes to level menu... + OPENAL_SetFrequency(OPENAL_ALL, 0.001); PlayStreamEx( stream_music3, strm[stream_music3], NULL, true); - FSOUND_SetPaused(channels[stream_music3], false); - FSOUND_SetVolume(channels[stream_music3], 256); + OPENAL_SetPaused(channels[stream_music3], false); + OPENAL_SetVolume(channels[stream_music3], 256); gameon=0; mainmenu=5; float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); - FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + 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); flashr=1; flashg=0; @@ -10890,9 +10891,9 @@ void Game::Tick() vel[1]=0; vel[2]=0; PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); - FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], false); + OPENAL_3D_SetAttributes(channels[fireendsound], gLoc, vel); + OPENAL_SetVolume(channels[fireendsound], 256); + OPENAL_SetPaused(channels[fireendsound], false); player[0].coords=(oldtemp+oldtemp2)/2; @@ -10913,9 +10914,9 @@ void Game::Tick() vel[1]=0; vel[2]=0; PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); - FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], false); + OPENAL_3D_SetAttributes(channels[fireendsound], gLoc, vel); + OPENAL_SetVolume(channels[fireendsound], 256); + OPENAL_SetPaused(channels[fireendsound], false); for(int i=0;i0&&oldmusicvolume[0]<=0){ PlayStreamEx( music1, strm[music1], NULL, true); - FSOUND_SetPaused(channels[music1], false); + OPENAL_SetPaused(channels[music1], false); } if(musicvolume[1]>0&&oldmusicvolume[1]<=0){ PlayStreamEx( stream_music2, strm[stream_music2], NULL, true); - FSOUND_SetPaused(channels[stream_music2], false); + OPENAL_SetPaused(channels[stream_music2], false); } if(musicvolume[2]>0&&oldmusicvolume[2]<=0){ PlayStreamEx( stream_music3, strm[stream_music3], NULL, true); - FSOUND_SetPaused(channels[stream_music3], false); + OPENAL_SetPaused(channels[stream_music3], false); } } if(!musictoggle){ - FSOUND_SetPaused(channels[music1], true); - FSOUND_SetPaused(channels[stream_music2], true); - FSOUND_SetPaused(channels[stream_music3], true); + OPENAL_SetPaused(channels[music1], true); + OPENAL_SetPaused(channels[stream_music2], true); + OPENAL_SetPaused(channels[stream_music3], true); for(i=0;i<4;i++){ oldmusicvolume[i]=0; @@ -11170,23 +11171,23 @@ void Game::TickOnceAfter(){ if(musictoggle){ if(musicvolume[0]<=0&&oldmusicvolume[0]>0){ - FSOUND_SetPaused(channels[music1], true); + OPENAL_SetPaused(channels[music1], true); } if(musicvolume[1]<=0&&oldmusicvolume[1]>0){ - FSOUND_SetPaused(channels[stream_music2], true); + OPENAL_SetPaused(channels[stream_music2], true); } if(musicvolume[2]<=0&&oldmusicvolume[2]>0){ - FSOUND_SetPaused(channels[stream_music3], true); + OPENAL_SetPaused(channels[stream_music3], true); } if(musicvolume[0]!=oldmusicvolume[0]){ - FSOUND_SetVolume(channels[music1], musicvolume[0]); + OPENAL_SetVolume(channels[music1], musicvolume[0]); } if(musicvolume[1]!=oldmusicvolume[1]){ - FSOUND_SetVolume(channels[stream_music2], musicvolume[1]); + OPENAL_SetVolume(channels[stream_music2], musicvolume[1]); } if(musicvolume[2]!=oldmusicvolume[2]){ - FSOUND_SetVolume(channels[stream_music3], musicvolume[2]); + OPENAL_SetVolume(channels[stream_music3], musicvolume[2]); } for(i=0;i<3;i++){ @@ -11303,12 +11304,12 @@ void Game::TickOnceAfter(){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); - FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); - FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + OPENAL_3D_SetAttributes(channels[firestartsound], gLoc, vel); + OPENAL_SetVolume(channels[firestartsound], 256); + OPENAL_SetPaused(channels[firestartsound], false); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); if(!player[0].dead&&targetlevel!=whichlevel){ startbonustotal=bonustotal; @@ -11316,12 +11317,12 @@ void Game::TickOnceAfter(){ if(!player[0].dead)Loadlevel(targetlevel); if(player[0].dead)Loadlevel(whichlevel); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); - FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + 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); loading=3; } @@ -11335,12 +11336,12 @@ void Game::TickOnceAfter(){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); - FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); - FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + OPENAL_3D_SetAttributes(channels[firestartsound], gLoc, vel); + OPENAL_SetVolume(channels[firestartsound], 256); + OPENAL_SetPaused(channels[firestartsound], false); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); for(i=0;i<255;i++){ mapname[i]='\0'; @@ -11359,22 +11360,22 @@ void Game::TickOnceAfter(){ strcat(mapname,campaignmapname[levelorder[accountcampaignchoicesmade[accountactive]]]);//[campaignchoicewhich[whichchoice]]); Loadlevel(mapname); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); - FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + 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); loading=3; } if(changedelay<=-999&&whichlevel!=-2&&!loading&&(player[0].dead||(alldead&&maptype==mapkilleveryone)||(winhotspot)||(killhotspot))&&!winfreeze)loading=1; if((player[0].dead||(alldead&&maptype==mapkilleveryone)||(winhotspot)||(windialogue)||(killhotspot))&&changedelay<=0){ if(accountprogress[accountactive]>3&&!registered){ - FSOUND_SetFrequency(FSOUND_ALL, 0.001); + OPENAL_SetFrequency(OPENAL_ALL, 0.001); PlayStreamEx( stream_music3, strm[stream_music3], NULL, true); - FSOUND_SetPaused(channels[stream_music3], false); - FSOUND_SetVolume(channels[stream_music3], 256); + OPENAL_SetPaused(channels[stream_music3], false); + OPENAL_SetVolume(channels[stream_music3], 256); gameon=0; mainmenu=12; @@ -11382,12 +11383,12 @@ void Game::TickOnceAfter(){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); - FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + 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); flashr=1; flashg=0; @@ -11419,12 +11420,12 @@ void Game::TickOnceAfter(){ if(!stealthloading){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); - FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); - FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + OPENAL_3D_SetAttributes(channels[firestartsound], gLoc, vel); + OPENAL_SetVolume(channels[firestartsound], 256); + OPENAL_SetPaused(channels[firestartsound], false); + OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); flashr=1; flashg=0; @@ -11535,7 +11536,7 @@ void Game::TickOnceAfter(){ campaign=1; mainmenu=0; gameon=1; - FSOUND_SetPaused(channels[stream_music3], true); + OPENAL_SetPaused(channels[stream_music3], true); stealthloading=0; } diff --git a/Source/Globals.cpp b/Source/Globals.cpp index b7b4fc9..fe9c136 100644 --- a/Source/Globals.cpp +++ b/Source/Globals.cpp @@ -30,18 +30,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "fmod.h" #include "Terrain.h" #include "Sprites.h" -//#include #include "Frustum.h" #include "Objects.h" #include "Weapons.h" #include "Person.h" #include "TGALoader.h" +#include "openal_wrapper.h" #include "Constants.h" bool visibleloading = 0; -FSOUND_SAMPLE *samp[100] = {0}; -FSOUND_STREAM * strm[20] = {0}; +OPENAL_SAMPLE *samp[100] = {0}; +OPENAL_STREAM * strm[20] = {0}; int channels[100] = {0}; float volume = 0;bool buttons[3] = {0}; diff --git a/Source/OpenGL_Windows.cpp b/Source/OpenGL_Windows.cpp index 7b68b8f..9afd511 100644 --- a/Source/OpenGL_Windows.cpp +++ b/Source/OpenGL_Windows.cpp @@ -54,6 +54,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static bool save_png(const char * fname); #endif +#include "openal_wrapper.h" + // ADDED GWC #ifdef _MSC_VER #pragma comment(lib, "opengl32.lib") @@ -1344,7 +1346,7 @@ void DoUpdate (Game & game) AbsoluteTime currTime = UpTime (); static int num_channels = 0; - num_channels += FSOUND_GetChannelsPlaying(); + num_channels += OPENAL_GetChannelsPlaying(); double deltaTime = (float) AbsoluteDeltaToDuration (currTime, start); if (0 > deltaTime) // if negative microseconds @@ -2421,58 +2423,58 @@ int main(int argc, char **argv) #endif extern int channels[100]; - extern FSOUND_SAMPLE * samp[100]; - extern FSOUND_STREAM * strm[20]; + extern OPENAL_SAMPLE * samp[100]; + extern OPENAL_STREAM * strm[20]; - extern "C" void PlaySoundEx(int chan, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused) + extern "C" void PlaySoundEx(int chan, OPENAL_SAMPLE *sptr, OPENAL_DSPUNIT *dsp, signed char startpaused) { - const FSOUND_SAMPLE * currSample = FSOUND_GetCurrentSample(channels[chan]); + const OPENAL_SAMPLE * currSample = OPENAL_GetCurrentSample(channels[chan]); if (currSample && currSample == samp[chan]) { - if (FSOUND_GetPaused(channels[chan])) + if (OPENAL_GetPaused(channels[chan])) { - FSOUND_StopSound(channels[chan]); - channels[chan] = FSOUND_FREE; + OPENAL_StopSound(channels[chan]); + channels[chan] = OPENAL_FREE; } - else if (FSOUND_IsPlaying(channels[chan])) + else if (OPENAL_IsPlaying(channels[chan])) { - int loop_mode = FSOUND_GetLoopMode(channels[chan]); - if (loop_mode & FSOUND_LOOP_OFF) + int loop_mode = OPENAL_GetLoopMode(channels[chan]); + if (loop_mode & OPENAL_LOOP_OFF) { - channels[chan] = FSOUND_FREE; + channels[chan] = OPENAL_FREE; } } } else { - channels[chan] = FSOUND_FREE; + channels[chan] = OPENAL_FREE; } - channels[chan] = FSOUND_PlaySoundEx(channels[chan], sptr, dsp, startpaused); + channels[chan] = OPENAL_PlaySoundEx(channels[chan], sptr, dsp, startpaused); if (channels[chan] < 0) { - channels[chan] = FSOUND_PlaySoundEx(FSOUND_FREE, sptr, dsp, startpaused); + channels[chan] = OPENAL_PlaySoundEx(OPENAL_FREE, sptr, dsp, startpaused); } } - extern "C" void PlayStreamEx(int chan, FSOUND_STREAM *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused) + extern "C" void PlayStreamEx(int chan, OPENAL_STREAM *sptr, OPENAL_DSPUNIT *dsp, signed char startpaused) { - const FSOUND_SAMPLE * currSample = FSOUND_GetCurrentSample(channels[chan]); - if (currSample && currSample == FSOUND_Stream_GetSample(sptr)) + const OPENAL_SAMPLE * currSample = OPENAL_GetCurrentSample(channels[chan]); + if (currSample && currSample == OPENAL_Stream_GetSample(sptr)) { - FSOUND_StopSound(channels[chan]); - FSOUND_Stream_Stop(sptr); + OPENAL_StopSound(channels[chan]); + OPENAL_Stream_Stop(sptr); } else { - FSOUND_Stream_Stop(sptr); - channels[chan] = FSOUND_FREE; + OPENAL_Stream_Stop(sptr); + channels[chan] = OPENAL_FREE; } - channels[chan] = FSOUND_Stream_PlayEx(channels[chan], sptr, dsp, startpaused); + channels[chan] = OPENAL_Stream_PlayEx(channels[chan], sptr, dsp, startpaused); if (channels[chan] < 0) { - channels[chan] = FSOUND_Stream_PlayEx(FSOUND_FREE, sptr, dsp, startpaused); + channels[chan] = OPENAL_Stream_PlayEx(OPENAL_FREE, sptr, dsp, startpaused); } } diff --git a/Source/Person.cpp b/Source/Person.cpp index e495d77..388f787 100644 --- a/Source/Person.cpp +++ b/Source/Person.cpp @@ -21,10 +21,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /**> HEADER FILES <**/ #include "Person.h" +#include "openal_wrapper.h" extern float multiplier; extern Animation animation[animation_count]; -extern FSOUND_SAMPLE *samp[100]; +extern OPENAL_SAMPLE *samp[100]; extern int channels[100]; extern Terrain terrain; extern float gravity; @@ -108,9 +109,9 @@ extern int indialogue; extern bool gamestarted; -extern FSOUND_STREAM * strm[20]; -extern "C" void PlaySoundEx(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused); -extern "C" void PlayStreamEx(int chan, FSOUND_STREAM *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused); +extern OPENAL_STREAM * strm[20]; +extern "C" void PlaySoundEx(int channel, OPENAL_SAMPLE *sptr, OPENAL_DSPUNIT *dsp, signed char startpaused); +extern "C" void PlayStreamEx(int chan, OPENAL_STREAM *sptr, OPENAL_DSPUNIT *dsp, signed char startpaused); void Person::CheckKick(){ static XYZ relative; @@ -140,9 +141,9 @@ void Person::CheckKick(){ vel[2]=velocity.z; if(tutoriallevel!=1){ PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, true); - FSOUND_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel); - FSOUND_SetVolume(channels[heavyimpactsound], 128); - FSOUND_SetPaused(channels[heavyimpactsound], false); + OPENAL_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel); + OPENAL_SetVolume(channels[heavyimpactsound], 128); + OPENAL_SetPaused(channels[heavyimpactsound], false); } victim->RagDoll(0); relative=velocity; @@ -162,7 +163,7 @@ void Person::CheckKick(){ velocity=facing*-10; velocity.y=5; skeleton.free=0; - if(id==0)FSOUND_SetPaused(channels[whooshsound], false); + if(id==0)OPENAL_SetPaused(channels[whooshsound], false); //if(victim->damage>victim->damagetolerance){ if(id==0){ @@ -215,18 +216,18 @@ void Person::CatchFire(){ vel[1]=0; vel[2]=0; PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); - FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); - FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], false); + OPENAL_3D_SetAttributes(channels[firestartsound], gLoc, vel); + OPENAL_SetVolume(channels[firestartsound], 256); + OPENAL_SetPaused(channels[firestartsound], false); vel[0]=velocity.x; vel[1]=velocity.y; vel[2]=velocity.z; //PlaySoundEx( firesound, samp[firesound], NULL, true); PlayStreamEx( stream_firesound, strm[stream_firesound], NULL, true); - FSOUND_3D_SetAttributes(channels[stream_firesound], gLoc, vel); - FSOUND_SetVolume(channels[stream_firesound], 256); - FSOUND_SetPaused(channels[stream_firesound], false); + OPENAL_3D_SetAttributes(channels[stream_firesound], gLoc, vel); + OPENAL_SetVolume(channels[stream_firesound], 256); + OPENAL_SetPaused(channels[stream_firesound], false); flamedelay=0; @@ -532,9 +533,9 @@ void Person::DoBloodBig(float howmuch,int which){ if(whichsound!=-1){ PlaySoundEx( whichsound, samp[whichsound], NULL, true); - FSOUND_3D_SetAttributes(channels[whichsound], gLoc, vel); - FSOUND_SetVolume(channels[whichsound], 512); - FSOUND_SetPaused(channels[whichsound], false); + OPENAL_3D_SetAttributes(channels[whichsound], gLoc, vel); + OPENAL_SetVolume(channels[whichsound], 512); + OPENAL_SetPaused(channels[whichsound], false); } } @@ -1185,15 +1186,15 @@ void Person::Reverse(){ if(weapons.type[weaponids[0]]==staff)weapons.damage[weaponids[0]]+=.2+float(abs(Random()%100)-50)/250; PlaySoundEx( swordstaffsound, samp[swordstaffsound], NULL, true); - FSOUND_3D_SetAttributes(channels[swordstaffsound], gLoc, vel); - FSOUND_SetVolume(channels[swordstaffsound], 512); - FSOUND_SetPaused(channels[swordstaffsound], false); + OPENAL_3D_SetAttributes(channels[swordstaffsound], gLoc, vel); + OPENAL_SetVolume(channels[swordstaffsound], 512); + OPENAL_SetPaused(channels[swordstaffsound], false); } else{ PlaySoundEx( metalhitsound, samp[metalhitsound], NULL, true); - FSOUND_3D_SetAttributes(channels[metalhitsound], gLoc, vel); - FSOUND_SetVolume(channels[metalhitsound], 512); - FSOUND_SetPaused(channels[metalhitsound], false); + OPENAL_3D_SetAttributes(channels[metalhitsound], gLoc, vel); + OPENAL_SetVolume(channels[metalhitsound], 512); + OPENAL_SetPaused(channels[metalhitsound], false); } } XYZ aim; @@ -1228,9 +1229,9 @@ void Person::Reverse(){ /*PlaySoundEx( metalhitsound, samp[metalhitsound], NULL, true); - FSOUND_3D_SetAttributes(channels[metalhitsound], gLoc, vel); - FSOUND_SetVolume(channels[metalhitsound], 512); - FSOUND_SetPaused(channels[metalhitsound], false);*/ + OPENAL_3D_SetAttributes(channels[metalhitsound], gLoc, vel); + OPENAL_SetVolume(channels[metalhitsound], 512); + OPENAL_SetPaused(channels[metalhitsound], false);*/ } if(abs(Random()%20)==0){ @@ -1248,15 +1249,15 @@ void Person::Reverse(){ if(weapons.type[weaponids[0]]==staff)weapons.damage[weaponids[0]]+=.2+float(abs(Random()%100)-50)/250; PlaySoundEx( swordstaffsound, samp[swordstaffsound], NULL, true); - FSOUND_3D_SetAttributes(channels[swordstaffsound], gLoc, vel); - FSOUND_SetVolume(channels[swordstaffsound], 512); - FSOUND_SetPaused(channels[swordstaffsound], false); + OPENAL_3D_SetAttributes(channels[swordstaffsound], gLoc, vel); + OPENAL_SetVolume(channels[swordstaffsound], 512); + OPENAL_SetPaused(channels[swordstaffsound], false); } else{ PlaySoundEx( metalhitsound, samp[metalhitsound], NULL, true); - FSOUND_3D_SetAttributes(channels[metalhitsound], gLoc, vel); - FSOUND_SetVolume(channels[metalhitsound], 512); - FSOUND_SetPaused(channels[metalhitsound], false); + OPENAL_3D_SetAttributes(channels[metalhitsound], gLoc, vel); + OPENAL_SetVolume(channels[metalhitsound], 512); + OPENAL_SetPaused(channels[metalhitsound], false); } } @@ -1289,9 +1290,9 @@ void Person::Reverse(){ /*PlaySoundEx( metalhitsound, samp[metalhitsound], NULL, true); - FSOUND_3D_SetAttributes(channels[metalhitsound], gLoc, vel); - FSOUND_SetVolume(channels[metalhitsound], 512); - FSOUND_SetPaused(channels[metalhitsound], false);*/ + OPENAL_3D_SetAttributes(channels[metalhitsound], gLoc, vel); + OPENAL_SetVolume(channels[metalhitsound], 512); + OPENAL_SetPaused(channels[metalhitsound], false);*/ } } if(hasvictim) @@ -1398,9 +1399,9 @@ void Person::DoDamage(float howmuch){ vel[1]=0; vel[2]=0; PlaySoundEx( splattersound, samp[splattersound], NULL, true); - FSOUND_3D_SetAttributes(channels[splattersound], gLoc, vel); - FSOUND_SetVolume(channels[splattersound], 256); - FSOUND_SetPaused(channels[splattersound], false); + OPENAL_3D_SetAttributes(channels[splattersound], gLoc, vel); + OPENAL_SetVolume(channels[splattersound], 256); + OPENAL_SetPaused(channels[splattersound], false); skeleton.free=2; DoDamage(10000); @@ -1452,9 +1453,9 @@ void Person::DoDamage(float howmuch){ if(whichsound!=-1){ PlaySoundEx( whichsound, samp[whichsound], NULL, true); - FSOUND_3D_SetAttributes(channels[whichsound], gLoc, vel); - FSOUND_SetVolume(channels[whichsound], 512); - FSOUND_SetPaused(channels[whichsound], false); + OPENAL_3D_SetAttributes(channels[whichsound], gLoc, vel); + OPENAL_SetVolume(channels[whichsound], 512); + OPENAL_SetPaused(channels[whichsound], false); } } speechdelay=.3; @@ -1947,8 +1948,8 @@ void Person::DoAnimations(){ vel[2]=velocity.z; if(id==0){ - FSOUND_3D_SetAttributes(channels[whooshsound], gLoc, vel); - FSOUND_SetVolume(channels[whooshsound], 64*findLength(&velocity)/5); + OPENAL_3D_SetAttributes(channels[whooshsound], gLoc, vel); + OPENAL_SetVolume(channels[whooshsound], 64*findLength(&velocity)/5); } if(((velocity.y<-15)||(crouchkeydown&&velocity.y<-8))&&abs(velocity.y)*4>fast_sqrt(velocity.x*velocity.x*velocity.z*velocity.z))landhard=1; if(!crouchkeydown&&velocity.y>=-15)landhard=0; @@ -1997,10 +1998,10 @@ void Person::DoAnimations(){ vel[1]=0; vel[2]=0; PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); - FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], false); - FSOUND_SetPaused(channels[stream_firesound], true); + OPENAL_3D_SetAttributes(channels[fireendsound], gLoc, vel); + OPENAL_SetVolume(channels[fireendsound], 256); + OPENAL_SetPaused(channels[fireendsound], false); + OPENAL_SetPaused(channels[stream_firesound], true); deathbleeding=0; } @@ -2027,9 +2028,9 @@ void Person::DoAnimations(){ vel[1]=velocity.y; vel[2]=velocity.z; PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, true); - FSOUND_3D_SetAttributes(channels[clawslicesound], gLoc, vel); - FSOUND_SetVolume(channels[clawslicesound], 128); - FSOUND_SetPaused(channels[clawslicesound], false); + OPENAL_3D_SetAttributes(channels[clawslicesound], gLoc, vel); + OPENAL_SetVolume(channels[clawslicesound], 128); + OPENAL_SetPaused(channels[clawslicesound], false); victim->spurt=1; victim->DoBloodBig(1/victim->armorhead,210); } @@ -2058,9 +2059,9 @@ void Person::DoAnimations(){ vel[2]=velocity.z; PlaySoundEx( knifesheathesound, samp[knifesheathesound], NULL, true); - FSOUND_3D_SetAttributes(channels[knifesheathesound], gLoc, vel); - FSOUND_SetVolume(channels[knifesheathesound], 128); - FSOUND_SetPaused(channels[knifesheathesound], false); + OPENAL_3D_SetAttributes(channels[knifesheathesound], gLoc, vel); + OPENAL_SetVolume(channels[knifesheathesound], 128); + OPENAL_SetPaused(channels[knifesheathesound], false); } if(weaponactive!=-1){ float gLoc[3]; @@ -2073,9 +2074,9 @@ void Person::DoAnimations(){ vel[2]=velocity.z; PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, true); - FSOUND_3D_SetAttributes(channels[knifedrawsound], gLoc, vel); - FSOUND_SetVolume(channels[knifedrawsound], 128); - FSOUND_SetPaused(channels[knifedrawsound], false); + OPENAL_3D_SetAttributes(channels[knifedrawsound], gLoc, vel); + OPENAL_SetVolume(channels[knifedrawsound], 128); + OPENAL_SetPaused(channels[knifedrawsound], false); } } drawtogglekeydown=1; @@ -2126,11 +2127,11 @@ void Person::DoAnimations(){ if(animation[targetanimation].label[targetframe]==8&&tutoriallevel!=1)whichsound=landsound2; PlaySoundEx( whichsound, samp[whichsound], NULL, true); - FSOUND_3D_SetAttributes(channels[whichsound], gLoc, vel); - if(whichsound!=knifeswishsound)FSOUND_SetVolume(channels[whichsound], 128); - if(whichsound!=knifeswishsound&&(targetanimation==staffhitanim||targetanimation==staffgroundsmashanim||targetanimation==staffspinhitanim))FSOUND_SetVolume(channels[whichsound], 256); - if(whichsound==knifeswishsound)FSOUND_SetVolume(channels[whichsound], 512); - FSOUND_SetPaused(channels[whichsound], false); + OPENAL_3D_SetAttributes(channels[whichsound], gLoc, vel); + if(whichsound!=knifeswishsound)OPENAL_SetVolume(channels[whichsound], 128); + if(whichsound!=knifeswishsound&&(targetanimation==staffhitanim||targetanimation==staffgroundsmashanim||targetanimation==staffspinhitanim))OPENAL_SetVolume(channels[whichsound], 256); + if(whichsound==knifeswishsound)OPENAL_SetVolume(channels[whichsound], 512); + OPENAL_SetPaused(channels[whichsound], false); if(id==0) if(whichsound==footstepsound||whichsound==footstepsound2||whichsound==footstepsound3||whichsound==footstepsound4){ @@ -2144,9 +2145,9 @@ void Person::DoAnimations(){ if(animation[targetanimation].label[targetframe]==3){ whichsound--; PlaySoundEx( whichsound, samp[whichsound], NULL, true); - FSOUND_3D_SetAttributes(channels[whichsound], gLoc, vel); - FSOUND_SetVolume(channels[whichsound], 128); - FSOUND_SetPaused(channels[whichsound], false); + OPENAL_3D_SetAttributes(channels[whichsound], gLoc, vel); + OPENAL_SetVolume(channels[whichsound], 128); + OPENAL_SetPaused(channels[whichsound], false); } } @@ -2188,9 +2189,9 @@ void Person::DoAnimations(){ if(whichsound!=-1){ PlaySoundEx( whichsound, samp[whichsound], NULL, true); - FSOUND_3D_SetAttributes(channels[whichsound], gLoc, vel); - FSOUND_SetVolume(channels[whichsound], 512); - FSOUND_SetPaused(channels[whichsound], false); + OPENAL_3D_SetAttributes(channels[whichsound], gLoc, vel); + OPENAL_SetVolume(channels[whichsound], 512); + OPENAL_SetPaused(channels[whichsound], false); } } @@ -2222,9 +2223,9 @@ void Person::DoAnimations(){ vel[1]=velocity.y; vel[2]=velocity.z; PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, true); - FSOUND_3D_SetAttributes(channels[knifedrawsound], gLoc, vel); - FSOUND_SetVolume(channels[knifedrawsound], 128); - FSOUND_SetPaused(channels[knifedrawsound], false); + OPENAL_3D_SetAttributes(channels[knifedrawsound], gLoc, vel); + OPENAL_SetVolume(channels[knifedrawsound], 128); + OPENAL_SetPaused(channels[knifedrawsound], false); } weaponactive=0; @@ -2268,16 +2269,16 @@ void Person::DoAnimations(){ if(!fleshstuck){ if(weapons.type[i]!=staff){ PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, true); - FSOUND_3D_SetAttributes(channels[knifedrawsound], gLoc, vel); - FSOUND_SetVolume(channels[knifedrawsound], 128); - FSOUND_SetPaused(channels[knifedrawsound], false); + OPENAL_3D_SetAttributes(channels[knifedrawsound], gLoc, vel); + OPENAL_SetVolume(channels[knifedrawsound], 128); + OPENAL_SetPaused(channels[knifedrawsound], false); } } if(fleshstuck){ PlaySoundEx( fleshstabremovesound, samp[fleshstabremovesound], NULL, true); - FSOUND_3D_SetAttributes(channels[fleshstabremovesound], gLoc, vel); - FSOUND_SetVolume(channels[fleshstabremovesound], 128); - FSOUND_SetPaused(channels[fleshstabremovesound], false); + OPENAL_3D_SetAttributes(channels[fleshstabremovesound], gLoc, vel); + OPENAL_SetVolume(channels[fleshstabremovesound], 128); + OPENAL_SetPaused(channels[fleshstabremovesound], false); } weaponactive=0; if(weapons.owner[i]!=-1){ @@ -2355,9 +2356,9 @@ void Person::DoAnimations(){ vel[2]=velocity.z; PlaySoundEx( knifesheathesound, samp[knifesheathesound], NULL, true); - FSOUND_3D_SetAttributes(channels[knifesheathesound], gLoc, vel); - FSOUND_SetVolume(channels[knifesheathesound], 128); - FSOUND_SetPaused(channels[knifesheathesound], false); + OPENAL_3D_SetAttributes(channels[knifesheathesound], gLoc, vel); + OPENAL_SetVolume(channels[knifesheathesound], 128); + OPENAL_SetPaused(channels[knifesheathesound], false); } if(weaponactive!=-1){ float gLoc[3]; @@ -2370,9 +2371,9 @@ void Person::DoAnimations(){ vel[2]=velocity.z; PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, true); - FSOUND_3D_SetAttributes(channels[knifedrawsound], gLoc, vel); - FSOUND_SetVolume(channels[knifedrawsound], 128); - FSOUND_SetPaused(channels[knifedrawsound], false); + OPENAL_3D_SetAttributes(channels[knifedrawsound], gLoc, vel); + OPENAL_SetVolume(channels[knifedrawsound], 128); + OPENAL_SetPaused(channels[knifedrawsound], false); } } @@ -2407,9 +2408,9 @@ void Person::DoAnimations(){ vel[2]=velocity.z; PlaySoundEx( jumpsound, samp[jumpsound], NULL, true); - FSOUND_3D_SetAttributes(channels[jumpsound], gLoc, vel); - FSOUND_SetVolume(channels[jumpsound], 128); - FSOUND_SetPaused(channels[jumpsound], false); + OPENAL_3D_SetAttributes(channels[jumpsound], gLoc, vel); + OPENAL_SetVolume(channels[jumpsound], 128); + OPENAL_SetPaused(channels[jumpsound], false); } float closestdist; @@ -2455,9 +2456,9 @@ void Person::DoAnimations(){ vel[2]=velocity.z; PlaySoundEx( jumpsound, samp[jumpsound], NULL, true); - FSOUND_3D_SetAttributes(channels[jumpsound], gLoc, vel); - FSOUND_SetVolume(channels[jumpsound], 128); - FSOUND_SetPaused(channels[jumpsound], false); + OPENAL_3D_SetAttributes(channels[jumpsound], gLoc, vel); + OPENAL_SetVolume(channels[jumpsound], 128); + OPENAL_SetPaused(channels[jumpsound], false); } } } @@ -2487,15 +2488,15 @@ void Person::DoAnimations(){ vel[2]=velocity.z; if(tutoriallevel!=1){ PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, true); - FSOUND_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel); - FSOUND_SetVolume(channels[heavyimpactsound], 128); - FSOUND_SetPaused(channels[heavyimpactsound], false); + OPENAL_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel); + OPENAL_SetVolume(channels[heavyimpactsound], 128); + OPENAL_SetPaused(channels[heavyimpactsound], false); } if(creature==wolftype){ PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, true); - FSOUND_3D_SetAttributes(channels[clawslicesound], gLoc, vel); - FSOUND_SetVolume(channels[clawslicesound], 128); - FSOUND_SetPaused(channels[clawslicesound], false); + OPENAL_3D_SetAttributes(channels[clawslicesound], gLoc, vel); + OPENAL_SetVolume(channels[clawslicesound], 128); + OPENAL_SetPaused(channels[clawslicesound], false); victim->spurt=1; victim->DoBloodBig(2/victim->armorhead,175); } @@ -2536,14 +2537,14 @@ void Person::DoAnimations(){ vel[1]=velocity.y; vel[2]=velocity.z; PlaySoundEx( whooshhitsound, samp[whooshhitsound], NULL, true); - FSOUND_3D_SetAttributes(channels[whooshhitsound], gLoc, vel); - FSOUND_SetVolume(channels[whooshhitsound], 512); - FSOUND_SetPaused(channels[whooshhitsound], false); + OPENAL_3D_SetAttributes(channels[whooshhitsound], gLoc, vel); + OPENAL_SetVolume(channels[whooshhitsound], 512); + OPENAL_SetPaused(channels[whooshhitsound], false); if(creature==wolftype){ PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, true); - FSOUND_3D_SetAttributes(channels[clawslicesound], gLoc, vel); - FSOUND_SetVolume(channels[clawslicesound], 128); - FSOUND_SetPaused(channels[clawslicesound], false); + OPENAL_3D_SetAttributes(channels[clawslicesound], gLoc, vel); + OPENAL_SetVolume(channels[clawslicesound], 128); + OPENAL_SetPaused(channels[clawslicesound], false); victim->spurt=1; victim->DoBloodBig(2,175); } @@ -2581,15 +2582,15 @@ void Person::DoAnimations(){ vel[2]=velocity.z; if(tutoriallevel!=1){ PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, true); - FSOUND_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel); - FSOUND_SetVolume(channels[heavyimpactsound], 160); - FSOUND_SetPaused(channels[heavyimpactsound], false); + OPENAL_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel); + OPENAL_SetVolume(channels[heavyimpactsound], 160); + OPENAL_SetPaused(channels[heavyimpactsound], false); } if(creature==wolftype){ PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, true); - FSOUND_3D_SetAttributes(channels[clawslicesound], gLoc, vel); - FSOUND_SetVolume(channels[clawslicesound], 128); - FSOUND_SetPaused(channels[clawslicesound], false); + OPENAL_3D_SetAttributes(channels[clawslicesound], gLoc, vel); + OPENAL_SetVolume(channels[clawslicesound], 128); + OPENAL_SetPaused(channels[clawslicesound], false); victim->spurt=1; victim->DoBloodBig(2/victim->armorhead,175); } @@ -2636,15 +2637,15 @@ void Person::DoAnimations(){ vel[2]=velocity.z; if(tutoriallevel!=1){ PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, true); - FSOUND_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel); - FSOUND_SetVolume(channels[heavyimpactsound], 160); - FSOUND_SetPaused(channels[heavyimpactsound], false); + OPENAL_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel); + OPENAL_SetVolume(channels[heavyimpactsound], 160); + OPENAL_SetPaused(channels[heavyimpactsound], false); } if(creature==wolftype){ PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, true); - FSOUND_3D_SetAttributes(channels[clawslicesound], gLoc, vel); - FSOUND_SetVolume(channels[clawslicesound], 128); - FSOUND_SetPaused(channels[clawslicesound], false); + OPENAL_3D_SetAttributes(channels[clawslicesound], gLoc, vel); + OPENAL_SetVolume(channels[clawslicesound], 128); + OPENAL_SetPaused(channels[clawslicesound], false); victim->spurt=1; victim->DoBloodBig(2/victim->armorhead,175); } @@ -2692,9 +2693,9 @@ void Person::DoAnimations(){ vel[1]=velocity.y; vel[2]=velocity.z; PlaySoundEx( whooshhitsound, samp[whooshhitsound], NULL, true); - FSOUND_3D_SetAttributes(channels[whooshhitsound], gLoc, vel); - FSOUND_SetVolume(channels[whooshhitsound], 512); - FSOUND_SetPaused(channels[whooshhitsound], false); + OPENAL_3D_SetAttributes(channels[whooshhitsound], gLoc, vel); + OPENAL_SetVolume(channels[whooshhitsound], 512); + OPENAL_SetPaused(channels[whooshhitsound], false); victim->RagDoll(0); XYZ relative; relative=victim->coords-coords; @@ -2723,14 +2724,14 @@ void Person::DoAnimations(){ vel[1]=velocity.y; vel[2]=velocity.z; /*PlaySoundEx( landsound2, samp[landsound2], NULL, true); - FSOUND_3D_SetAttributes(channels[landsound2], gLoc, vel); - FSOUND_SetVolume(channels[landsound2], 128); - FSOUND_SetPaused(channels[landsound2], false); + OPENAL_3D_SetAttributes(channels[landsound2], gLoc, vel); + OPENAL_SetVolume(channels[landsound2], 128); + OPENAL_SetPaused(channels[landsound2], false); */ PlaySoundEx( movewhooshsound, samp[movewhooshsound], NULL, true); - FSOUND_3D_SetAttributes(channels[movewhooshsound], gLoc, vel); - FSOUND_SetVolume(channels[movewhooshsound], 128); - FSOUND_SetPaused(channels[movewhooshsound], false); + OPENAL_3D_SetAttributes(channels[movewhooshsound], gLoc, vel); + OPENAL_SetVolume(channels[movewhooshsound], 128); + OPENAL_SetPaused(channels[movewhooshsound], false); victim->skeleton.longdead=0; victim->skeleton.free=1; @@ -2773,9 +2774,9 @@ void Person::DoAnimations(){ vel[2]=velocity.z; if(tutoriallevel!=1){ PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, true); - FSOUND_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel); - FSOUND_SetVolume(channels[heavyimpactsound], 128); - FSOUND_SetPaused(channels[heavyimpactsound], false); + OPENAL_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel); + OPENAL_SetVolume(channels[heavyimpactsound], 128); + OPENAL_SetPaused(channels[heavyimpactsound], false); } XYZ relative; relative=victim->coords-coords; @@ -2808,9 +2809,9 @@ void Person::DoAnimations(){ vel[2]=velocity.z; if(tutoriallevel!=1){ PlaySoundEx( thudsound, samp[thudsound], NULL, true); - FSOUND_3D_SetAttributes(channels[thudsound], gLoc, vel); - FSOUND_SetVolume(channels[thudsound], 400); - FSOUND_SetPaused(channels[thudsound], false); + OPENAL_3D_SetAttributes(channels[thudsound], gLoc, vel); + OPENAL_SetVolume(channels[thudsound], 400); + OPENAL_SetPaused(channels[thudsound], false); } victim->skeleton.longdead=0; @@ -2863,9 +2864,9 @@ void Person::DoAnimations(){ if(!hasvictim){ terrain.MakeDecal(blooddecalfast,(weapons.tippoint[weaponids[weaponactive]]*.8+weapons.position[weaponids[weaponactive]]*.2),.08,.6,Random()%360); PlaySoundEx( knifesheathesound, samp[knifesheathesound], NULL, true); - FSOUND_3D_SetAttributes(channels[knifesheathesound], gLoc, vel); - FSOUND_SetVolume(channels[knifesheathesound], 128); - FSOUND_SetPaused(channels[knifesheathesound], false); + OPENAL_3D_SetAttributes(channels[knifesheathesound], gLoc, vel); + OPENAL_SetVolume(channels[knifesheathesound], 128); + OPENAL_SetPaused(channels[knifesheathesound], false); } if(victim&&hasvictim){ @@ -2929,9 +2930,9 @@ void Person::DoAnimations(){ //victim->skeleton.joints[i].velocity=0; } PlaySoundEx( fleshstabsound, samp[fleshstabsound], NULL, true); - FSOUND_3D_SetAttributes(channels[fleshstabsound], gLoc, vel); - FSOUND_SetVolume(channels[fleshstabsound], 128); - FSOUND_SetPaused(channels[fleshstabsound], false); + OPENAL_3D_SetAttributes(channels[fleshstabsound], gLoc, vel); + OPENAL_SetVolume(channels[fleshstabsound], 128); + OPENAL_SetPaused(channels[fleshstabsound], false); } if(whichtri!=-1||weapons.bloody[weaponids[weaponactive]]){ @@ -2941,9 +2942,9 @@ void Person::DoAnimations(){ if(whichtri==-1){ hasvictim=0; PlaySoundEx( knifesheathesound, samp[knifesheathesound], NULL, true); - FSOUND_3D_SetAttributes(channels[knifesheathesound], gLoc, vel); - FSOUND_SetVolume(channels[knifesheathesound], 128); - FSOUND_SetPaused(channels[knifesheathesound], false); + OPENAL_3D_SetAttributes(channels[knifesheathesound], gLoc, vel); + OPENAL_SetVolume(channels[knifesheathesound], 128); + OPENAL_SetPaused(channels[knifesheathesound], false); } } } @@ -2962,18 +2963,18 @@ void Person::DoAnimations(){ vel[2]=velocity.z; if(!hasvictim){ PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, true); - FSOUND_3D_SetAttributes(channels[knifedrawsound], gLoc, vel); - FSOUND_SetVolume(channels[knifedrawsound], 128); - FSOUND_SetPaused(channels[knifedrawsound], false); + OPENAL_3D_SetAttributes(channels[knifedrawsound], gLoc, vel); + OPENAL_SetVolume(channels[knifedrawsound], 128); + OPENAL_SetPaused(channels[knifedrawsound], false); } if(victim&&hasvictim){ XYZ footvel,footpoint; PlaySoundEx( fleshstabremovesound, samp[fleshstabremovesound], NULL, true); - FSOUND_3D_SetAttributes(channels[fleshstabremovesound], gLoc, vel); - FSOUND_SetVolume(channels[fleshstabremovesound], 128); - FSOUND_SetPaused(channels[fleshstabremovesound], false); + OPENAL_3D_SetAttributes(channels[fleshstabremovesound], gLoc, vel); + OPENAL_SetVolume(channels[fleshstabremovesound], 128); + OPENAL_SetPaused(channels[fleshstabremovesound], false); footvel=0; footpoint=(weapons.tippoint[weaponids[weaponactive]]*.8+weapons.position[weaponids[weaponactive]]*.2); @@ -3079,17 +3080,17 @@ void Person::DoAnimations(){ if(1==1){ if(tutoriallevel!=1){ PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, true); - FSOUND_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel); - FSOUND_SetVolume(channels[heavyimpactsound], 128); - FSOUND_SetPaused(channels[heavyimpactsound], false); + OPENAL_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel); + OPENAL_SetVolume(channels[heavyimpactsound], 128); + OPENAL_SetPaused(channels[heavyimpactsound], false); } } else { if(tutoriallevel!=1){ PlaySoundEx( landsound2, samp[landsound2], NULL, true); - FSOUND_3D_SetAttributes(channels[landsound2], gLoc, vel); - FSOUND_SetVolume(channels[landsound2], 256); - FSOUND_SetPaused(channels[landsound2], false); + OPENAL_3D_SetAttributes(channels[landsound2], gLoc, vel); + OPENAL_SetVolume(channels[landsound2], 256); + OPENAL_SetPaused(channels[landsound2], false); } } @@ -3137,25 +3138,25 @@ void Person::DoAnimations(){ if(victim->damage<=victim->damagetolerance-60&&normaldotproduct(victim->facing,victim->coords-coords)<(scale*5)*(scale*5)*0&&animation[victim->targetanimation].height!=lowheight){ if(tutoriallevel!=1){ PlaySoundEx( thudsound, samp[thudsound], NULL, true); - FSOUND_3D_SetAttributes(channels[thudsound], gLoc, vel); - FSOUND_SetVolume(channels[thudsound], 512); - FSOUND_SetPaused(channels[thudsound], false); + OPENAL_3D_SetAttributes(channels[thudsound], gLoc, vel); + OPENAL_SetVolume(channels[thudsound], 512); + OPENAL_SetPaused(channels[thudsound], false); } } else if(victim->damage<=victim->damagetolerance-60&&normaldotproduct(victim->facing,victim->coords-coords)<(scale*5)*(scale*5)*0&&animation[victim->targetanimation].height==lowheight){ if(tutoriallevel!=1){ PlaySoundEx( whooshhitsound, samp[whooshhitsound], NULL, true); - FSOUND_3D_SetAttributes(channels[whooshhitsound], gLoc, vel); - FSOUND_SetVolume(channels[whooshhitsound], 512); - FSOUND_SetPaused(channels[whooshhitsound], false); + OPENAL_3D_SetAttributes(channels[whooshhitsound], gLoc, vel); + OPENAL_SetVolume(channels[whooshhitsound], 512); + OPENAL_SetPaused(channels[whooshhitsound], false); } } else { if(tutoriallevel!=1){ PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, true); - FSOUND_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel); - FSOUND_SetVolume(channels[heavyimpactsound], 256); - FSOUND_SetPaused(channels[heavyimpactsound], false); + OPENAL_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel); + OPENAL_SetVolume(channels[heavyimpactsound], 256); + OPENAL_SetPaused(channels[heavyimpactsound], false); } } @@ -3200,9 +3201,9 @@ void Person::DoAnimations(){ vel[2]=velocity.z; PlaySoundEx( landsound2, samp[landsound2], NULL, true); - FSOUND_3D_SetAttributes(channels[landsound2], gLoc, vel); - FSOUND_SetVolume(channels[landsound2], 256); - FSOUND_SetPaused(channels[landsound2], false); + OPENAL_3D_SetAttributes(channels[landsound2], gLoc, vel); + OPENAL_SetVolume(channels[landsound2], 256); + OPENAL_SetPaused(channels[landsound2], false); Puff(righthand); } @@ -3226,15 +3227,15 @@ void Person::DoAnimations(){ if(weapons.type[weaponids[0]]==staff)weapons.damage[weaponids[0]]+=.2+float(abs(Random()%100)-50)/250; PlaySoundEx( swordstaffsound, samp[swordstaffsound], NULL, true); - FSOUND_3D_SetAttributes(channels[swordstaffsound], gLoc, vel); - FSOUND_SetVolume(channels[swordstaffsound], 512); - FSOUND_SetPaused(channels[swordstaffsound], false); + OPENAL_3D_SetAttributes(channels[swordstaffsound], gLoc, vel); + OPENAL_SetVolume(channels[swordstaffsound], 512); + OPENAL_SetPaused(channels[swordstaffsound], false); } else{ PlaySoundEx( metalhitsound, samp[metalhitsound], NULL, true); - FSOUND_3D_SetAttributes(channels[metalhitsound], gLoc, vel); - FSOUND_SetVolume(channels[metalhitsound], 512); - FSOUND_SetPaused(channels[metalhitsound], false); + OPENAL_3D_SetAttributes(channels[metalhitsound], gLoc, vel); + OPENAL_SetVolume(channels[metalhitsound], 512); + OPENAL_SetPaused(channels[metalhitsound], false); } } @@ -3290,9 +3291,9 @@ void Person::DoAnimations(){ vel[1]=velocity.y; vel[2]=velocity.z; PlaySoundEx( knifeslicesound, samp[knifeslicesound], NULL, true); - FSOUND_3D_SetAttributes(channels[knifeslicesound], gLoc, vel); - FSOUND_SetVolume(channels[knifeslicesound], 512); - FSOUND_SetPaused(channels[knifeslicesound], false); + OPENAL_3D_SetAttributes(channels[knifeslicesound], gLoc, vel); + OPENAL_SetVolume(channels[knifeslicesound], 512); + OPENAL_SetPaused(channels[knifeslicesound], false); } //victim->skeleton.joints[victim->skeleton.jointlabels[abdomen]].velocity+=relative*damagemult*200; if(animation[victim->targetanimation].attack&&(victim->aitype!=playercontrolled||victim->targetanimation==knifeslashstartanim)&&(victim->creature==rabbittype||victim->deathbleeding<=0)){ @@ -3355,9 +3356,9 @@ void Person::DoAnimations(){ vel[1]=velocity.y; vel[2]=velocity.z; PlaySoundEx( swordslicesound, samp[swordslicesound], NULL, true); - FSOUND_3D_SetAttributes(channels[swordslicesound], gLoc, vel); - FSOUND_SetVolume(channels[swordslicesound], 512); - FSOUND_SetPaused(channels[swordslicesound], false); + OPENAL_3D_SetAttributes(channels[swordslicesound], gLoc, vel); + OPENAL_SetVolume(channels[swordslicesound], 512); + OPENAL_SetPaused(channels[swordslicesound], false); } //victim->skeleton.joints[victim->skeleton.jointlabels[abdomen]].velocity+=relative*damagemult*200; //if(animation[victim->targetanimation].attack){ @@ -3415,15 +3416,15 @@ void Person::DoAnimations(){ if(weapons.type[weaponids[0]]==staff)weapons.damage[weaponids[0]]+=.2+float(abs(Random()%100)-50)/250; PlaySoundEx( swordstaffsound, samp[swordstaffsound], NULL, true); - FSOUND_3D_SetAttributes(channels[swordstaffsound], gLoc, vel); - FSOUND_SetVolume(channels[swordstaffsound], 512); - FSOUND_SetPaused(channels[swordstaffsound], false); + OPENAL_3D_SetAttributes(channels[swordstaffsound], gLoc, vel); + OPENAL_SetVolume(channels[swordstaffsound], 512); + OPENAL_SetPaused(channels[swordstaffsound], false); } else{ PlaySoundEx( metalhitsound, samp[metalhitsound], NULL, true); - FSOUND_3D_SetAttributes(channels[metalhitsound], gLoc, vel); - FSOUND_SetVolume(channels[metalhitsound], 512); - FSOUND_SetPaused(channels[metalhitsound], false); + OPENAL_3D_SetAttributes(channels[metalhitsound], gLoc, vel); + OPENAL_SetVolume(channels[metalhitsound], 512); + OPENAL_SetPaused(channels[metalhitsound], false); } } @@ -3456,9 +3457,9 @@ void Person::DoAnimations(){ } /*PlaySoundEx( metalhitsound, samp[metalhitsound], NULL, true); - FSOUND_3D_SetAttributes(channels[metalhitsound], gLoc, vel); - FSOUND_SetVolume(channels[metalhitsound], 512); - FSOUND_SetPaused(channels[metalhitsound], false);*/ + OPENAL_3D_SetAttributes(channels[metalhitsound], gLoc, vel); + OPENAL_SetVolume(channels[metalhitsound], 512); + OPENAL_SetPaused(channels[metalhitsound], false);*/ } } @@ -3482,9 +3483,9 @@ void Person::DoAnimations(){ vel[1]=velocity.y; vel[2]=velocity.z; PlaySoundEx( staffheadsound, samp[staffheadsound], NULL, true); - FSOUND_3D_SetAttributes(channels[staffheadsound], gLoc, vel); - FSOUND_SetVolume(channels[staffheadsound], 256); - FSOUND_SetPaused(channels[staffheadsound], false); + OPENAL_3D_SetAttributes(channels[staffheadsound], gLoc, vel); + OPENAL_SetVolume(channels[staffheadsound], 256); + OPENAL_SetPaused(channels[staffheadsound], false); } victim->RagDoll(0); XYZ relative; @@ -3531,9 +3532,9 @@ void Person::DoAnimations(){ vel[1]=velocity.y; vel[2]=velocity.z; PlaySoundEx( staffheadsound, samp[staffheadsound], NULL, true); - FSOUND_3D_SetAttributes(channels[staffheadsound], gLoc, vel); - FSOUND_SetVolume(channels[staffheadsound], 256); - FSOUND_SetPaused(channels[staffheadsound], false); + OPENAL_3D_SetAttributes(channels[staffheadsound], gLoc, vel); + OPENAL_SetVolume(channels[staffheadsound], 256); + OPENAL_SetPaused(channels[staffheadsound], false); } victim->RagDoll(0); XYZ relative; @@ -3577,9 +3578,9 @@ void Person::DoAnimations(){ vel[1]=velocity.y; vel[2]=velocity.z; PlaySoundEx( staffbodysound, samp[staffbodysound], NULL, true); - FSOUND_3D_SetAttributes(channels[staffbodysound], gLoc, vel); - FSOUND_SetVolume(channels[staffbodysound], 256); - FSOUND_SetPaused(channels[staffbodysound], false); + OPENAL_3D_SetAttributes(channels[staffbodysound], gLoc, vel); + OPENAL_SetVolume(channels[staffbodysound], 256); + OPENAL_SetPaused(channels[staffbodysound], false); } victim->skeleton.longdead=0; victim->skeleton.free=1; @@ -3661,18 +3662,18 @@ void Person::DoAnimations(){ victim->skeleton.joints[victim->skeleton.jointlabels[head]].velocity+=relative*damagemult*200; if(tutoriallevel!=1){ PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, true); - FSOUND_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel); - FSOUND_SetVolume(channels[heavyimpactsound], 128); - FSOUND_SetPaused(channels[heavyimpactsound], false); + OPENAL_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel); + OPENAL_SetVolume(channels[heavyimpactsound], 128); + OPENAL_SetPaused(channels[heavyimpactsound], false); } victim->Puff(head); victim->DoDamage(damagemult*100/victim->protectionhead); if(victim->howactive==typesleeping)victim->DoDamage(damagemult*150/victim->protectionhead); if(creature==wolftype){ PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, true); - FSOUND_3D_SetAttributes(channels[clawslicesound], gLoc, vel); - FSOUND_SetVolume(channels[clawslicesound], 128); - FSOUND_SetPaused(channels[clawslicesound], false); + OPENAL_3D_SetAttributes(channels[clawslicesound], gLoc, vel); + OPENAL_SetVolume(channels[clawslicesound], 128); + OPENAL_SetPaused(channels[clawslicesound], false); victim->spurt=1; victim->DoBloodBig(2/victim->armorhead,175); } @@ -3689,17 +3690,17 @@ void Person::DoAnimations(){ victim->target=0; if(tutoriallevel!=1){ PlaySoundEx( landsound2, samp[landsound2], NULL, true); - FSOUND_3D_SetAttributes(channels[landsound2], gLoc, vel); - FSOUND_SetVolume(channels[landsound2], 128); - FSOUND_SetPaused(channels[landsound2], false); + OPENAL_3D_SetAttributes(channels[landsound2], gLoc, vel); + OPENAL_SetVolume(channels[landsound2], 128); + OPENAL_SetPaused(channels[landsound2], false); } victim->Puff(abdomen); victim->DoDamage(damagemult*30/victim->protectionhigh); if(creature==wolftype){ PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, true); - FSOUND_3D_SetAttributes(channels[clawslicesound], gLoc, vel); - FSOUND_SetVolume(channels[clawslicesound], 128); - FSOUND_SetPaused(channels[clawslicesound], false); + OPENAL_3D_SetAttributes(channels[clawslicesound], gLoc, vel); + OPENAL_SetVolume(channels[clawslicesound], 128); + OPENAL_SetPaused(channels[clawslicesound], false); victim->spurt=1; victim->DoBloodBig(2/victim->armorhigh,170); } @@ -3722,9 +3723,9 @@ void Person::DoAnimations(){ vel[2]=velocity.z; if(tutoriallevel!=1){ PlaySoundEx( landsound2, samp[landsound2], NULL, true); - FSOUND_3D_SetAttributes(channels[landsound2], gLoc, vel); - FSOUND_SetVolume(channels[landsound2], 128); - FSOUND_SetPaused(channels[landsound2], false); + OPENAL_3D_SetAttributes(channels[landsound2], gLoc, vel); + OPENAL_SetVolume(channels[landsound2], 128); + OPENAL_SetPaused(channels[landsound2], false); } XYZ relative; relative=victim->coords-coords; @@ -3764,9 +3765,9 @@ void Person::DoAnimations(){ victim->target=0; if(tutoriallevel!=1){ PlaySoundEx( landsound2, samp[landsound2], NULL, true); - FSOUND_3D_SetAttributes(channels[landsound2], gLoc, vel); - FSOUND_SetVolume(channels[landsound2], 128); - FSOUND_SetPaused(channels[landsound2], false); + OPENAL_3D_SetAttributes(channels[landsound2], gLoc, vel); + OPENAL_SetVolume(channels[landsound2], 128); + OPENAL_SetPaused(channels[landsound2], false); } victim->Puff(abdomen); victim->DoDamage(damagemult*30/victim->protectionlow); @@ -3797,15 +3798,15 @@ void Person::DoAnimations(){ vel[2]=velocity.z; if(tutoriallevel!=1){ PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, true); - FSOUND_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel); - FSOUND_SetVolume(channels[heavyimpactsound], 128); - FSOUND_SetPaused(channels[heavyimpactsound], false); + OPENAL_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel); + OPENAL_SetVolume(channels[heavyimpactsound], 128); + OPENAL_SetPaused(channels[heavyimpactsound], false); } if(creature==wolftype){ PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, true); - FSOUND_3D_SetAttributes(channels[clawslicesound], gLoc, vel); - FSOUND_SetVolume(channels[clawslicesound], 128); - FSOUND_SetPaused(channels[clawslicesound], false); + OPENAL_3D_SetAttributes(channels[clawslicesound], gLoc, vel); + OPENAL_SetVolume(channels[clawslicesound], 128); + OPENAL_SetPaused(channels[clawslicesound], false); victim->spurt=1; victim->DoBloodBig(2/victim->armorhigh,170); } @@ -3866,9 +3867,9 @@ void Person::DoAnimations(){ vel[1]=velocity.y; vel[2]=velocity.z; PlaySoundEx( whooshhitsound, samp[whooshhitsound], NULL, true); - FSOUND_3D_SetAttributes(channels[whooshhitsound], gLoc, vel); - FSOUND_SetVolume(channels[whooshhitsound], 128); - FSOUND_SetPaused(channels[whooshhitsound], false); + OPENAL_3D_SetAttributes(channels[whooshhitsound], gLoc, vel); + OPENAL_SetVolume(channels[whooshhitsound], 128); + OPENAL_SetPaused(channels[whooshhitsound], false); victim->RagDoll(0); XYZ relative; relative=victim->coords-oldcoords; @@ -3908,9 +3909,9 @@ void Person::DoAnimations(){ if(tutoriallevel!=1){ PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, true); - FSOUND_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel); - FSOUND_SetVolume(channels[heavyimpactsound], 128); - FSOUND_SetPaused(channels[heavyimpactsound], false); + OPENAL_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel); + OPENAL_SetVolume(channels[heavyimpactsound], 128); + OPENAL_SetPaused(channels[heavyimpactsound], false); } victim->RagDoll(0); if(id==0){ @@ -3979,17 +3980,17 @@ void Person::DoAnimations(){ if(weaponactive!=-1){ victim->DoBloodBig(2/victim->armorhigh,225); PlaySoundEx( knifeslicesound, samp[knifeslicesound], NULL, true); - FSOUND_3D_SetAttributes(channels[knifeslicesound], gLoc, vel); - FSOUND_SetVolume(channels[knifeslicesound], 512); - FSOUND_SetPaused(channels[knifeslicesound], false); + OPENAL_3D_SetAttributes(channels[knifeslicesound], gLoc, vel); + OPENAL_SetVolume(channels[knifeslicesound], 512); + OPENAL_SetPaused(channels[knifeslicesound], false); if(bloodtoggle&&!weapons.bloody[weaponids[weaponactive]])weapons.bloody[weaponids[weaponactive]]=1; weapons.blooddrip[weaponids[weaponactive]]+=3; } if(weaponactive==-1&&creature==wolftype){ PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, true); - FSOUND_3D_SetAttributes(channels[clawslicesound], gLoc, vel); - FSOUND_SetVolume(channels[clawslicesound], 128); - FSOUND_SetPaused(channels[clawslicesound], false); + OPENAL_3D_SetAttributes(channels[clawslicesound], gLoc, vel); + OPENAL_SetVolume(channels[clawslicesound], 128); + OPENAL_SetPaused(channels[clawslicesound], false); victim->spurt=1; victim->DoBloodBig(2/victim->armorhigh,175); } @@ -4037,9 +4038,9 @@ void Person::DoAnimations(){ vel[2]=velocity.z; victim->DoBloodBig(2,225); PlaySoundEx( knifeslicesound, samp[knifeslicesound], NULL, true); - FSOUND_3D_SetAttributes(channels[knifeslicesound], gLoc, vel); - FSOUND_SetVolume(channels[knifeslicesound], 512); - FSOUND_SetPaused(channels[knifeslicesound], false); + OPENAL_3D_SetAttributes(channels[knifeslicesound], gLoc, vel); + OPENAL_SetVolume(channels[knifeslicesound], 512); + OPENAL_SetPaused(channels[knifeslicesound], false); if(bloodtoggle&&!weapons.bloody[weaponids[weaponactive]])weapons.bloody[weaponids[weaponactive]]=1; weapons.blooddrip[weaponids[weaponactive]]+=3; }*/ @@ -4062,9 +4063,9 @@ void Person::DoAnimations(){ vel[2]=velocity.z; if(tutoriallevel!=1){ PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, true); - FSOUND_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel); - FSOUND_SetVolume(channels[heavyimpactsound], 128); - FSOUND_SetPaused(channels[heavyimpactsound], false); + OPENAL_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel); + OPENAL_SetVolume(channels[heavyimpactsound], 128); + OPENAL_SetPaused(channels[heavyimpactsound], false); } victim->RagDoll(0); XYZ relative; @@ -4118,18 +4119,18 @@ void Person::DoAnimations(){ if(weaponactive!=-1){ victim->DoBloodBig(200,225); PlaySoundEx( knifeslicesound, samp[knifeslicesound], NULL, true); - FSOUND_3D_SetAttributes(channels[knifeslicesound], gLoc, vel); - FSOUND_SetVolume(channels[knifeslicesound], 512); - FSOUND_SetPaused(channels[knifeslicesound], false); + OPENAL_3D_SetAttributes(channels[knifeslicesound], gLoc, vel); + OPENAL_SetVolume(channels[knifeslicesound], 512); + OPENAL_SetPaused(channels[knifeslicesound], false); if(bloodtoggle)weapons.bloody[weaponids[weaponactive]]=2; weapons.blooddrip[weaponids[weaponactive]]+=5; } if(creature==wolftype&&weaponactive==-1){ PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, true); - FSOUND_3D_SetAttributes(channels[clawslicesound], gLoc, vel); - FSOUND_SetVolume(channels[clawslicesound], 128); - FSOUND_SetPaused(channels[clawslicesound], false); + OPENAL_3D_SetAttributes(channels[clawslicesound], gLoc, vel); + OPENAL_SetVolume(channels[clawslicesound], 128); + OPENAL_SetPaused(channels[clawslicesound], false); victim->spurt=1; victim->DoBloodBig(2,175); } @@ -4200,9 +4201,9 @@ void Person::DoAnimations(){ vel[1]=velocity.y; vel[2]=velocity.z; PlaySoundEx( fleshstabsound, samp[fleshstabsound], NULL, true); - FSOUND_3D_SetAttributes(channels[fleshstabsound], gLoc, vel); - FSOUND_SetVolume(channels[fleshstabsound], 512); - FSOUND_SetPaused(channels[fleshstabsound], false); + OPENAL_3D_SetAttributes(channels[fleshstabsound], gLoc, vel); + OPENAL_SetVolume(channels[fleshstabsound], 512); + OPENAL_SetPaused(channels[fleshstabsound], false); if(bloodtoggle)weapons.bloody[weaponids[weaponactive]]=2; weapons.blooddrip[weaponids[weaponactive]]+=5; } @@ -4230,9 +4231,9 @@ void Person::DoAnimations(){ vel[1]=velocity.y; vel[2]=velocity.z; PlaySoundEx( fleshstabremovesound, samp[fleshstabremovesound], NULL, true); - FSOUND_3D_SetAttributes(channels[fleshstabremovesound], gLoc, vel); - FSOUND_SetVolume(channels[fleshstabremovesound], 512); - FSOUND_SetPaused(channels[fleshstabremovesound], false); + OPENAL_3D_SetAttributes(channels[fleshstabremovesound], gLoc, vel); + OPENAL_SetVolume(channels[fleshstabremovesound], 512); + OPENAL_SetPaused(channels[fleshstabremovesound], false); if(bloodtoggle)weapons.bloody[weaponids[weaponactive]]=2; weapons.blooddrip[weaponids[weaponactive]]+=5; @@ -4280,9 +4281,9 @@ void Person::DoAnimations(){ vel[1]=velocity.y; vel[2]=velocity.z; PlaySoundEx( fleshstabsound, samp[fleshstabsound], NULL, true); - FSOUND_3D_SetAttributes(channels[fleshstabsound], gLoc, vel); - FSOUND_SetVolume(channels[fleshstabsound], 512); - FSOUND_SetPaused(channels[fleshstabsound], false); + OPENAL_3D_SetAttributes(channels[fleshstabsound], gLoc, vel); + OPENAL_SetVolume(channels[fleshstabsound], 512); + OPENAL_SetPaused(channels[fleshstabsound], false); if(bloodtoggle)weapons.bloody[weaponids[weaponactive]]=2; weapons.blooddrip[weaponids[weaponactive]]+=5; } @@ -4304,9 +4305,9 @@ void Person::DoAnimations(){ vel[1]=velocity.y; vel[2]=velocity.z; PlaySoundEx( fleshstabremovesound, samp[fleshstabremovesound], NULL, true); - FSOUND_3D_SetAttributes(channels[fleshstabremovesound], gLoc, vel); - FSOUND_SetVolume(channels[fleshstabremovesound], 512); - FSOUND_SetPaused(channels[fleshstabremovesound], false); + OPENAL_3D_SetAttributes(channels[fleshstabremovesound], gLoc, vel); + OPENAL_SetVolume(channels[fleshstabremovesound], 512); + OPENAL_SetPaused(channels[fleshstabremovesound], false); if(bloodtoggle)weapons.bloody[weaponids[weaponactive]]=2; weapons.blooddrip[weaponids[weaponactive]]+=5; @@ -4340,9 +4341,9 @@ void Person::DoAnimations(){ if(weaponactive==-1){ if(tutoriallevel!=1){ PlaySoundEx( heavyimpactsound, samp[heavyimpactsound], NULL, true); - FSOUND_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel); - FSOUND_SetVolume(channels[heavyimpactsound], 128); - FSOUND_SetPaused(channels[heavyimpactsound], false); + OPENAL_3D_SetAttributes(channels[heavyimpactsound], gLoc, vel); + OPENAL_SetVolume(channels[heavyimpactsound], 128); + OPENAL_SetPaused(channels[heavyimpactsound], false); } } bool doslice; @@ -4353,17 +4354,17 @@ void Person::DoAnimations(){ if(weaponactive!=-1){ victim->DoBloodBig(2/victim->armorhead,225); PlaySoundEx( knifeslicesound, samp[knifeslicesound], NULL, true); - FSOUND_3D_SetAttributes(channels[knifeslicesound], gLoc, vel); - FSOUND_SetVolume(channels[knifeslicesound], 512); - FSOUND_SetPaused(channels[knifeslicesound], false); + OPENAL_3D_SetAttributes(channels[knifeslicesound], gLoc, vel); + OPENAL_SetVolume(channels[knifeslicesound], 512); + OPENAL_SetPaused(channels[knifeslicesound], false); if(bloodtoggle&&!weapons.bloody[weaponids[weaponactive]])weapons.bloody[weaponids[weaponactive]]=1; weapons.blooddrip[weaponids[weaponactive]]+=3; } if(weaponactive==-1&&creature==wolftype){ PlaySoundEx( clawslicesound, samp[clawslicesound], NULL, true); - FSOUND_3D_SetAttributes(channels[clawslicesound], gLoc, vel); - FSOUND_SetVolume(channels[clawslicesound], 128); - FSOUND_SetPaused(channels[clawslicesound], false); + OPENAL_3D_SetAttributes(channels[clawslicesound], gLoc, vel); + OPENAL_SetVolume(channels[clawslicesound], 128); + OPENAL_SetPaused(channels[clawslicesound], false); victim->spurt=1; victim->DoBloodBig(2/victim->armorhead,175); } @@ -4443,9 +4444,9 @@ void Person::DoAnimations(){ vel[2]=velocity.z; PlaySoundEx( movewhooshsound, samp[movewhooshsound], NULL, true); - FSOUND_3D_SetAttributes(channels[movewhooshsound], gLoc, vel); - FSOUND_SetVolume(channels[movewhooshsound], 128); - FSOUND_SetPaused(channels[movewhooshsound], false); + OPENAL_3D_SetAttributes(channels[movewhooshsound], gLoc, vel); + OPENAL_SetVolume(channels[movewhooshsound], 128); + OPENAL_SetPaused(channels[movewhooshsound], false); } if(currentanimation==staggerbackhighanim){ targetanimation=getIdle(); @@ -4495,9 +4496,9 @@ void Person::DoAnimations(){ vel[2]=velocity.z; PlaySoundEx( knifesheathesound, samp[knifesheathesound], NULL, true); - FSOUND_3D_SetAttributes(channels[knifesheathesound], gLoc, vel); - FSOUND_SetVolume(channels[knifesheathesound], 128); - FSOUND_SetPaused(channels[knifesheathesound], false); + OPENAL_3D_SetAttributes(channels[knifesheathesound], gLoc, vel); + OPENAL_SetVolume(channels[knifesheathesound], 128); + OPENAL_SetPaused(channels[knifesheathesound], false); } if(weaponactive!=-1){ float gLoc[3]; @@ -4510,9 +4511,9 @@ void Person::DoAnimations(){ vel[2]=velocity.z; PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, true); - FSOUND_3D_SetAttributes(channels[knifedrawsound], gLoc, vel); - FSOUND_SetVolume(channels[knifedrawsound], 128); - FSOUND_SetPaused(channels[knifedrawsound], false); + OPENAL_3D_SetAttributes(channels[knifedrawsound], gLoc, vel); + OPENAL_SetVolume(channels[knifedrawsound], 128); + OPENAL_SetPaused(channels[knifedrawsound], false); } } if(currentanimation==rollanim){ @@ -4587,7 +4588,7 @@ void Person::DoAnimations(){ targetframe=3; velocity=facing*-8; velocity.y=4; - if(id==0)FSOUND_SetPaused(channels[whooshsound], false); + if(id==0)OPENAL_SetPaused(channels[whooshsound], false); } if(targetanimation==walljumprightanim){ targetanimation=rightflipanim; @@ -4605,7 +4606,7 @@ void Person::DoAnimations(){ velocity=facing*8; velocity.y=4; } - if(id==0)FSOUND_SetPaused(channels[whooshsound], false); + if(id==0)OPENAL_SetPaused(channels[whooshsound], false); } if(targetanimation==walljumpleftanim){ if(attackkeydown){ @@ -4645,7 +4646,7 @@ void Person::DoAnimations(){ velocity=DoRotation(facing,0,-30,0)*-8; velocity.y=4; } - if(id==0)FSOUND_SetPaused(channels[whooshsound], false); + if(id==0)OPENAL_SetPaused(channels[whooshsound], false); } if(targetanimation==sneakattackanim){ float ycoords=oldcoords.y; @@ -4741,9 +4742,9 @@ void Person::DoAnimations(){ vel[1]=velocity.y; vel[2]=velocity.z; PlaySoundEx( landsound, samp[landsound], NULL, true); - FSOUND_3D_SetAttributes(channels[landsound], gLoc, vel); - FSOUND_SetVolume(channels[landsound], 128); - FSOUND_SetPaused(channels[landsound], false); + OPENAL_3D_SetAttributes(channels[landsound], gLoc, vel); + OPENAL_SetVolume(channels[landsound], 128); + OPENAL_SetPaused(channels[landsound], false); if(currentanimation==upunchreversedanim||currentanimation==swordslashreversedanim){ targetanimation=rollanim; @@ -4809,7 +4810,7 @@ void Person::DoAnimations(){ escapednum++; targetanimation=rollanim; coords+=facing; - if(id==0)FSOUND_SetPaused(channels[whooshsound], true); + if(id==0)OPENAL_SetPaused(channels[whooshsound], true); } lastfeint=0; } @@ -4832,7 +4833,7 @@ void Person::DoAnimations(){ escapednum++; targetanimation=rollanim; coords+=facing*2; - if(id==0)FSOUND_SetPaused(channels[whooshsound], true); + if(id==0)OPENAL_SetPaused(channels[whooshsound], true); } lastfeint=0; } @@ -5072,7 +5073,7 @@ void Person::DoStuff(){ /*if(aitype!=playercontrolled)*/ deathbleeding=1; if(burnt>.6)burnt=.6; - FSOUND_SetVolume(channels[stream_firesound], 256+256*findLength(&velocity)/3); + OPENAL_SetVolume(channels[stream_firesound], 256+256*findLength(&velocity)/3); if(targetanimation==jumpupanim||targetanimation==jumpdownanim||isFlip()){ float gLoc[3]; @@ -5085,8 +5086,8 @@ void Person::DoStuff(){ vel[2]=velocity.z; if(id==0){ - FSOUND_3D_SetAttributes(channels[whooshsound], gLoc, vel); - FSOUND_SetVolume(channels[whooshsound], 64*findLength(&velocity)/5); + OPENAL_3D_SetAttributes(channels[whooshsound], gLoc, vel); + OPENAL_SetVolume(channels[whooshsound], 64*findLength(&velocity)/5); } } } @@ -5700,9 +5701,9 @@ void Person::DoStuff(){ vel[1]=velocity.y; vel[2]=velocity.z; PlaySoundEx( breaksound, samp[breaksound], NULL, true); - FSOUND_3D_SetAttributes(channels[breaksound], gLoc, vel); - FSOUND_SetVolume(channels[breaksound], 512); - FSOUND_SetPaused(channels[breaksound], false); + OPENAL_3D_SetAttributes(channels[breaksound], gLoc, vel); + OPENAL_SetVolume(channels[breaksound], 512); + OPENAL_SetPaused(channels[breaksound], false); /*if(id==0||findDistancefast(&coords,&viewer)<50){ slomo=1; slomodelay=.2; @@ -5710,7 +5711,7 @@ void Person::DoStuff(){ } if(skeleton.free==1){ - if(id==0)FSOUND_SetPaused(channels[whooshsound], true); + if(id==0)OPENAL_SetPaused(channels[whooshsound], true); if(!dead){ //If knocked over, open hands and close mouth @@ -5776,7 +5777,7 @@ void Person::DoStuff(){ skeleton.longdead+=(2000-findLength(&average))*multiplier+multiplier; if(skeleton.longdead>2000){ if(skeleton.longdead>6000){ - if(id==0)FSOUND_SetPaused(channels[whooshsound], true); + if(id==0)OPENAL_SetPaused(channels[whooshsound], true); skeleton.free=3; DrawSkeleton(); skeleton.free=2; @@ -5889,7 +5890,7 @@ void Person::DoStuff(){ if(findLength(&average)<10&&!dead&&skeleton.free){ skeleton.longdead+=(2000-findLength(&average))*multiplier+multiplier; if(skeleton.longdead>(damage+500)*1.5){ - if(id==0)FSOUND_SetPaused(channels[whooshsound], true); + if(id==0)OPENAL_SetPaused(channels[whooshsound], true); skeleton.free=0; velocity=0; XYZ middle; @@ -6017,9 +6018,9 @@ void Person::DoStuff(){ vel[1]=velocity.y; vel[2]=velocity.z; PlaySoundEx( movewhooshsound, samp[movewhooshsound], NULL, true); - FSOUND_3D_SetAttributes(channels[movewhooshsound], gLoc, vel); - FSOUND_SetVolume(channels[movewhooshsound], 128); - FSOUND_SetPaused(channels[movewhooshsound], false); + OPENAL_3D_SetAttributes(channels[movewhooshsound], gLoc, vel); + OPENAL_SetVolume(channels[movewhooshsound], 128); + OPENAL_SetPaused(channels[movewhooshsound], false); currentanimation=targetanimation; currentframe=targetframe-1; @@ -6057,9 +6058,9 @@ void Person::DoStuff(){ vel[1]=0; vel[2]=0; PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); - FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); - FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], false); + OPENAL_3D_SetAttributes(channels[firestartsound], gLoc, vel); + OPENAL_SetVolume(channels[firestartsound], 256); + OPENAL_SetPaused(channels[firestartsound], false); } objects.onfire[i]=1; } @@ -6082,9 +6083,9 @@ void Person::DoStuff(){ vel[1]=0; vel[2]=0; PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); - FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); - FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], false); + OPENAL_3D_SetAttributes(channels[firestartsound], gLoc, vel); + OPENAL_SetVolume(channels[firestartsound], 256); + OPENAL_SetPaused(channels[firestartsound], false); } objects.onfire[i]=1; } @@ -6107,9 +6108,9 @@ void Person::DoStuff(){ vel[1]=velocity.y; vel[2]=velocity.z; PlaySoundEx( bushrustle, samp[bushrustle], NULL, true); - FSOUND_3D_SetAttributes(channels[bushrustle], gLoc, vel); - FSOUND_SetVolume(channels[bushrustle], 40*findLength(&velocity)); - FSOUND_SetPaused(channels[bushrustle], false); + OPENAL_3D_SetAttributes(channels[bushrustle], gLoc, vel); + OPENAL_SetVolume(channels[bushrustle], 40*findLength(&velocity)); + OPENAL_SetPaused(channels[bushrustle], false); if(id==0){ envsound[numenvsounds]=coords; @@ -6176,9 +6177,9 @@ void Person::DoStuff(){ vel[1]=0; vel[2]=0; PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); - FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel); - FSOUND_SetVolume(channels[firestartsound], 256); - FSOUND_SetPaused(channels[firestartsound], false); + OPENAL_3D_SetAttributes(channels[firestartsound], gLoc, vel); + OPENAL_SetVolume(channels[firestartsound], 256); + OPENAL_SetPaused(channels[firestartsound], false); objects.onfire[i]=1; } }*/ @@ -6195,9 +6196,9 @@ void Person::DoStuff(){ vel[1]=velocity.y; vel[2]=velocity.z; PlaySoundEx( bushrustle, samp[bushrustle], NULL, true); - FSOUND_3D_SetAttributes(channels[bushrustle], gLoc, vel); - FSOUND_SetVolume(channels[bushrustle], 40*findLength(&velocity)); - FSOUND_SetPaused(channels[bushrustle], false); + OPENAL_3D_SetAttributes(channels[bushrustle], gLoc, vel); + OPENAL_SetVolume(channels[bushrustle], 40*findLength(&velocity)); + OPENAL_SetPaused(channels[bushrustle], false); if(id==0){ envsound[numenvsounds]=coords; @@ -6280,9 +6281,9 @@ void Person::DoStuff(){ if(whichsound!=-1){ PlaySoundEx( whichsound, samp[whichsound], NULL, true); - FSOUND_3D_SetAttributes(channels[whichsound], gLoc, vel); - FSOUND_SetVolume(channels[whichsound], 512); - FSOUND_SetPaused(channels[whichsound], false); + OPENAL_3D_SetAttributes(channels[whichsound], gLoc, vel); + OPENAL_SetVolume(channels[whichsound], 512); + OPENAL_SetPaused(channels[whichsound], false); } } @@ -6703,8 +6704,8 @@ void Person::DoStuff(){ onterrain=1; if(id==0){ - FSOUND_SetPaused(channels[whooshsound], true); - FSOUND_SetVolume(channels[whooshsound], 0); + OPENAL_SetPaused(channels[whooshsound], true); + OPENAL_SetVolume(channels[whooshsound], 0); } if(targetanimation==jumpdownanim||isFlip()){ @@ -6719,9 +6720,9 @@ void Person::DoStuff(){ vel[1]=velocity.y; vel[2]=velocity.z; PlaySoundEx( landsound, samp[landsound], NULL, true); - FSOUND_3D_SetAttributes(channels[landsound], gLoc, vel); - FSOUND_SetVolume(channels[landsound], 128); - FSOUND_SetPaused(channels[landsound], false); + OPENAL_3D_SetAttributes(channels[landsound], gLoc, vel); + OPENAL_SetVolume(channels[landsound], 128); + OPENAL_SetPaused(channels[landsound], false); if(id==0){ envsound[numenvsounds]=coords; @@ -6787,15 +6788,15 @@ void Person::DoStuff(){ vel[2]=velocity.z; if(!onterrain||environment==grassyenvironment){ PlaySoundEx( skidsound, samp[skidsound], NULL, true); - FSOUND_3D_SetAttributes(channels[skidsound], gLoc, vel); - FSOUND_SetVolume(channels[skidsound], 128*velspeed/10); - FSOUND_SetPaused(channels[skidsound], false); + OPENAL_3D_SetAttributes(channels[skidsound], gLoc, vel); + OPENAL_SetVolume(channels[skidsound], 128*velspeed/10); + OPENAL_SetPaused(channels[skidsound], false); } else { PlaySoundEx( snowskidsound, samp[snowskidsound], NULL, true); - FSOUND_3D_SetAttributes(channels[snowskidsound], gLoc, vel); - FSOUND_SetVolume(channels[snowskidsound], 128*velspeed/10); - FSOUND_SetPaused(channels[snowskidsound], false); + OPENAL_3D_SetAttributes(channels[snowskidsound], gLoc, vel); + OPENAL_SetVolume(channels[snowskidsound], 128*velspeed/10); + OPENAL_SetPaused(channels[snowskidsound], false); } } @@ -7653,8 +7654,8 @@ int Person::SphereCheck(XYZ *p1,float radius, XYZ *p, XYZ *move, float *rotate, onterrain=1; if(id==0){ - FSOUND_SetPaused(channels[whooshsound], true); - FSOUND_SetVolume(channels[whooshsound], 0); + OPENAL_SetPaused(channels[whooshsound], true); + OPENAL_SetVolume(channels[whooshsound], 0); } if((targetanimation==jumpdownanim||isFlip())&&!wasLanding()&&!wasLandhard()){ @@ -7669,9 +7670,9 @@ int Person::SphereCheck(XYZ *p1,float radius, XYZ *p, XYZ *move, float *rotate, vel[1]=velocity.y; vel[2]=velocity.z; PlaySoundEx( landsound, samp[landsound], NULL, true); - FSOUND_3D_SetAttributes(channels[landsound], gLoc, vel); - FSOUND_SetVolume(channels[landsound], 128); - FSOUND_SetPaused(channels[landsound], false); + OPENAL_3D_SetAttributes(channels[landsound], gLoc, vel); + OPENAL_SetVolume(channels[landsound], 128); + OPENAL_SetPaused(channels[landsound], false); if(id==0){ envsound[numenvsounds]=coords; diff --git a/Source/Skeleton.cpp b/Source/Skeleton.cpp index 057ea9d..cd4e791 100644 --- a/Source/Skeleton.cpp +++ b/Source/Skeleton.cpp @@ -22,12 +22,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /**> HEADER FILES <**/ #include "Game.h" #include "Skeleton.h" +#include "openal_wrapper.h" extern float multiplier; extern float gravity; extern Skeleton testskeleton; extern Terrain terrain; -extern FSOUND_SAMPLE *samp[100]; +extern OPENAL_SAMPLE *samp[100]; extern int channels[100]; extern Objects objects; extern Sprites sprites; @@ -49,7 +50,7 @@ extern int whichjointendarray[26]; extern Game * pgame; extern bool visibleloading; -extern "C" void PlaySoundEx(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused); +extern "C" void PlaySoundEx(int channel, OPENAL_SAMPLE *sptr, OPENAL_DSPUNIT *dsp, signed char startpaused); void dealloc2(void* param){ free(param); @@ -295,9 +296,9 @@ float Skeleton::DoConstraints(XYZ *coords,float *scale) vel[1]=joints[jointlabels[head]].velocity.y; vel[2]=joints[jointlabels[head]].velocity.z; PlaySoundEx( landsound1, samp[landsound1], NULL, true); - FSOUND_3D_SetAttributes(channels[landsound1], gLoc, vel); - FSOUND_SetVolume(channels[landsound1], 128); - FSOUND_SetPaused(channels[landsound1], false); + OPENAL_3D_SetAttributes(channels[landsound1], gLoc, vel); + OPENAL_SetVolume(channels[landsound1], 128); + OPENAL_SetPaused(channels[landsound1], false); breaking=1; } @@ -314,9 +315,9 @@ float Skeleton::DoConstraints(XYZ *coords,float *scale) vel[1]=joints[jointlabels[head]].velocity.y; vel[2]=joints[jointlabels[head]].velocity.z; PlaySoundEx( landsound2, samp[landsound2], NULL, true); - FSOUND_3D_SetAttributes(channels[landsound2], gLoc, vel); - FSOUND_SetVolume(channels[landsound2], 128); - FSOUND_SetPaused(channels[landsound2], false); + OPENAL_3D_SetAttributes(channels[landsound2], gLoc, vel); + OPENAL_SetVolume(channels[landsound2], 128); + OPENAL_SetPaused(channels[landsound2], false); } terrainnormal=DoRotation(objects.model[k].facenormals[whichhit],0,objects.rotation[k],0)*-1; @@ -341,9 +342,9 @@ float Skeleton::DoConstraints(XYZ *coords,float *scale) vel[1]=joints[jointlabels[head]].velocity.y; vel[2]=joints[jointlabels[head]].velocity.z; PlaySoundEx( breaksound2, samp[breaksound2], NULL, true); - FSOUND_3D_SetAttributes(channels[breaksound2], gLoc, vel); - FSOUND_SetVolume(channels[breaksound2], 300); - FSOUND_SetPaused(channels[breaksound2], false); + OPENAL_3D_SetAttributes(channels[breaksound2], gLoc, vel); + OPENAL_SetVolume(channels[breaksound2], 300); + OPENAL_SetPaused(channels[breaksound2], false); envsound[numenvsounds]=*coords; envsoundvol[numenvsounds]=64; @@ -426,9 +427,9 @@ float Skeleton::DoConstraints(XYZ *coords,float *scale) vel[2]=joints[i].velocity.z; if(tutoriallevel!=1||id==0){ PlaySoundEx( landsound1, samp[landsound1], NULL, true); - FSOUND_3D_SetAttributes(channels[landsound1], gLoc, vel); - FSOUND_SetVolume(channels[landsound1], 128); - FSOUND_SetPaused(channels[landsound1], false); + OPENAL_3D_SetAttributes(channels[landsound1], gLoc, vel); + OPENAL_SetVolume(channels[landsound1], 128); + OPENAL_SetPaused(channels[landsound1], false); } breaking=1; } @@ -446,9 +447,9 @@ float Skeleton::DoConstraints(XYZ *coords,float *scale) vel[2]=joints[i].velocity.z; if(tutoriallevel!=1||id==0){ PlaySoundEx( landsound2, samp[landsound2], NULL, true); - FSOUND_3D_SetAttributes(channels[landsound2], gLoc, vel); - FSOUND_SetVolume(channels[landsound2], 128); - FSOUND_SetPaused(channels[landsound2], false); + OPENAL_3D_SetAttributes(channels[landsound2], gLoc, vel); + OPENAL_SetVolume(channels[landsound2], 128); + OPENAL_SetPaused(channels[landsound2], false); } } @@ -479,9 +480,9 @@ float Skeleton::DoConstraints(XYZ *coords,float *scale) vel[1]=joints[i].velocity.y; vel[2]=joints[i].velocity.z; PlaySoundEx( breaksound2, samp[breaksound2], NULL, true); - FSOUND_3D_SetAttributes(channels[breaksound2], gLoc, vel); - FSOUND_SetVolume(channels[breaksound2], 300); - FSOUND_SetPaused(channels[breaksound2], false); + OPENAL_3D_SetAttributes(channels[breaksound2], gLoc, vel); + OPENAL_SetVolume(channels[breaksound2], 300); + OPENAL_SetPaused(channels[breaksound2], false); envsound[numenvsounds]=*coords; envsoundvol[numenvsounds]=64; @@ -548,9 +549,9 @@ float Skeleton::DoConstraints(XYZ *coords,float *scale) vel[2]=joints[i].velocity.z; if(tutoriallevel!=1||id==0){ PlaySoundEx( landsound1, samp[landsound1], NULL, true); - FSOUND_3D_SetAttributes(channels[landsound1], gLoc, vel); - FSOUND_SetVolume(channels[landsound1], 128); - FSOUND_SetPaused(channels[landsound1], false); + OPENAL_3D_SetAttributes(channels[landsound1], gLoc, vel); + OPENAL_SetVolume(channels[landsound1], 128); + OPENAL_SetPaused(channels[landsound1], false); } breaking=1; } @@ -568,9 +569,9 @@ float Skeleton::DoConstraints(XYZ *coords,float *scale) vel[2]=joints[i].velocity.z; if(tutoriallevel!=1||id==0){ PlaySoundEx( landsound2, samp[landsound2], NULL, true); - FSOUND_3D_SetAttributes(channels[landsound2], gLoc, vel); - FSOUND_SetVolume(channels[landsound2], 128); - FSOUND_SetPaused(channels[landsound2], false); + OPENAL_3D_SetAttributes(channels[landsound2], gLoc, vel); + OPENAL_SetVolume(channels[landsound2], 128); + OPENAL_SetPaused(channels[landsound2], false); } } @@ -597,9 +598,9 @@ float Skeleton::DoConstraints(XYZ *coords,float *scale) vel[1]=joints[i].velocity.y; vel[2]=joints[i].velocity.z; PlaySoundEx( breaksound2, samp[breaksound2], NULL, true); - FSOUND_3D_SetAttributes(channels[breaksound2], gLoc, vel); - FSOUND_SetVolume(channels[breaksound2], 300); - FSOUND_SetPaused(channels[breaksound2], false); + OPENAL_3D_SetAttributes(channels[breaksound2], gLoc, vel); + OPENAL_SetVolume(channels[breaksound2], 300); + OPENAL_SetPaused(channels[breaksound2], false); envsound[numenvsounds]=*coords; envsoundvol[numenvsounds]=64; diff --git a/Source/Weapons.cpp b/Source/Weapons.cpp index c4ee9f5..2caa4c6 100644 --- a/Source/Weapons.cpp +++ b/Source/Weapons.cpp @@ -21,10 +21,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /**> HEADER FILES <**/ #include "Weapons.h" +#include "openal_wrapper.h" extern float multiplier; extern Animation animation[animation_count]; -extern FSOUND_SAMPLE *samp[100]; +extern OPENAL_SAMPLE *samp[100]; extern int channels[100]; extern Terrain terrain; extern float gravity; @@ -58,7 +59,7 @@ extern float bonustotal; extern float bonustime; extern int tutoriallevel; extern int numthrowkill; -extern "C" void PlaySoundEx(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused); +extern "C" void PlaySoundEx(int channel, OPENAL_SAMPLE *sptr, OPENAL_DSPUNIT *dsp, signed char startpaused); void Weapons::DoStuff(){ static int i,whichpatchx,whichpatchz,j,k,whichhit,m; @@ -98,9 +99,9 @@ void Weapons::DoStuff(){ vel[1]=0; vel[2]=0; PlaySoundEx( staffbreaksound, samp[staffbreaksound], NULL, true); - FSOUND_3D_SetAttributes(channels[staffbreaksound], gLoc, vel); - FSOUND_SetVolume(channels[staffbreaksound], 256); - FSOUND_SetPaused(channels[staffbreaksound], false); + OPENAL_3D_SetAttributes(channels[staffbreaksound], gLoc, vel); + OPENAL_SetVolume(channels[staffbreaksound], 256); + OPENAL_SetPaused(channels[staffbreaksound], false); XYZ tempvel; XYZ speed; //speed=(tippoint[i]-oldtippoint[i])/multiplier/6; @@ -189,9 +190,9 @@ void Weapons::DoStuff(){ vel[1]=0; vel[2]=0; PlaySoundEx( knifesheathesound, samp[knifesheathesound], NULL, true); - FSOUND_3D_SetAttributes(channels[knifesheathesound], gLoc, vel); - FSOUND_SetVolume(channels[knifesheathesound], 128); - FSOUND_SetPaused(channels[knifesheathesound], false); + OPENAL_3D_SetAttributes(channels[knifesheathesound], gLoc, vel); + OPENAL_SetVolume(channels[knifesheathesound], 128); + OPENAL_SetPaused(channels[knifesheathesound], false); bloody[i]=0; @@ -224,9 +225,9 @@ void Weapons::DoStuff(){ vel[1]=player[j].velocity.y; vel[2]=player[j].velocity.z; PlaySoundEx( knifedrawsound, samp[knifedrawsound], NULL, true); - FSOUND_3D_SetAttributes(channels[knifedrawsound], gLoc, vel); - FSOUND_SetVolume(channels[knifedrawsound], 128); - FSOUND_SetPaused(channels[knifedrawsound], false); + OPENAL_3D_SetAttributes(channels[knifedrawsound], gLoc, vel); + OPENAL_SetVolume(channels[knifedrawsound], 128); + OPENAL_SetPaused(channels[knifedrawsound], false); player[j].weaponactive=0; player[j].targetanimation=removeknifeanim; @@ -282,9 +283,9 @@ void Weapons::DoStuff(){ vel[1]=0; vel[2]=0; PlaySoundEx( fleshstabsound, samp[fleshstabsound], NULL, true); - FSOUND_3D_SetAttributes(channels[fleshstabsound], gLoc, vel); - FSOUND_SetVolume(channels[fleshstabsound], 128); - FSOUND_SetPaused(channels[fleshstabsound], false); + OPENAL_3D_SetAttributes(channels[fleshstabsound], gLoc, vel); + OPENAL_SetVolume(channels[fleshstabsound], 128); + OPENAL_SetPaused(channels[fleshstabsound], false); if(animation[player[0].targetanimation].height==highheight){ bonus=ninja; @@ -351,9 +352,9 @@ void Weapons::DoStuff(){ vel[1]=0; vel[2]=0; PlaySoundEx( knifesheathesound, samp[knifesheathesound], NULL, true); - FSOUND_3D_SetAttributes(channels[knifesheathesound], gLoc, vel); - FSOUND_SetVolume(channels[knifesheathesound], 128); - FSOUND_SetPaused(channels[knifesheathesound], false); + OPENAL_3D_SetAttributes(channels[knifesheathesound], gLoc, vel); + OPENAL_SetVolume(channels[knifesheathesound], 128); + OPENAL_SetPaused(channels[knifesheathesound], false); XYZ terrainlight; terrainlight=terrain.getLighting(position[i].x,position[i].z); @@ -502,9 +503,9 @@ void Weapons::DoStuff(){ vel[1]=0; vel[2]=0; PlaySoundEx( whichsound, samp[whichsound], NULL, true); - FSOUND_3D_SetAttributes(channels[whichsound], gLoc, vel); - FSOUND_SetVolume(channels[whichsound], 128*findLengthfast(&bounceness)); - FSOUND_SetPaused(channels[whichsound], false); + OPENAL_3D_SetAttributes(channels[whichsound], gLoc, vel); + OPENAL_SetVolume(channels[whichsound], 128*findLengthfast(&bounceness)); + OPENAL_SetPaused(channels[whichsound], false); } } start=oldtippoint[i]; @@ -539,9 +540,9 @@ void Weapons::DoStuff(){ vel[1]=0; vel[2]=0; PlaySoundEx( whichsound, samp[whichsound], NULL, true); - FSOUND_3D_SetAttributes(channels[whichsound], gLoc, vel); - FSOUND_SetVolume(channels[whichsound], 128*findLengthfast(&bounceness)); - FSOUND_SetPaused(channels[whichsound], false); + OPENAL_3D_SetAttributes(channels[whichsound], gLoc, vel); + OPENAL_SetVolume(channels[whichsound], 128*findLengthfast(&bounceness)); + OPENAL_SetPaused(channels[whichsound], false); } } @@ -581,9 +582,9 @@ void Weapons::DoStuff(){ vel[1]=0; vel[2]=0; PlaySoundEx( whichsound, samp[whichsound], NULL, true); - FSOUND_3D_SetAttributes(channels[whichsound], gLoc, vel); - FSOUND_SetVolume(channels[whichsound], 128*findLengthfast(&bounceness)); - FSOUND_SetPaused(channels[whichsound], false); + OPENAL_3D_SetAttributes(channels[whichsound], gLoc, vel); + OPENAL_SetVolume(channels[whichsound], 128*findLengthfast(&bounceness)); + OPENAL_SetPaused(channels[whichsound], false); } position[i]+=(mid-oldmid2)*(20/(1+(float)m*10)); } @@ -622,9 +623,9 @@ void Weapons::DoStuff(){ vel[1]=0; vel[2]=0; PlaySoundEx( whichsound, samp[whichsound], NULL, true); - FSOUND_3D_SetAttributes(channels[whichsound], gLoc, vel); - FSOUND_SetVolume(channels[whichsound], 128*findLengthfast(&bounceness)); - FSOUND_SetPaused(channels[whichsound], false); + OPENAL_3D_SetAttributes(channels[whichsound], gLoc, vel); + OPENAL_SetVolume(channels[whichsound], 128*findLengthfast(&bounceness)); + OPENAL_SetPaused(channels[whichsound], false); } tippoint[i]+=(mid-oldmid2)*(20/(1+(float)m*10)); } @@ -708,10 +709,10 @@ void Weapons::DoStuff(){ vel[1]=0; vel[2]=0; PlaySoundEx( whichsound, samp[whichsound], NULL, true); - FSOUND_3D_SetAttributes(channels[whichsound], gLoc, vel); - if(terrain.getOpacity(position[i].x,position[i].z)>.2)FSOUND_SetVolume(channels[whichsound], 128*findLengthfast(&bounceness)); - else FSOUND_SetVolume(channels[whichsound], 32*findLengthfast(&bounceness)); - FSOUND_SetPaused(channels[whichsound], false); + OPENAL_3D_SetAttributes(channels[whichsound], gLoc, vel); + if(terrain.getOpacity(position[i].x,position[i].z)>.2)OPENAL_SetVolume(channels[whichsound], 128*findLengthfast(&bounceness)); + else OPENAL_SetVolume(channels[whichsound], 32*findLengthfast(&bounceness)); + OPENAL_SetPaused(channels[whichsound], false); if(terrain.getOpacity(position[i].x,position[i].z)<.2){ XYZ terrainlight; @@ -762,10 +763,10 @@ void Weapons::DoStuff(){ vel[1]=0; vel[2]=0; PlaySoundEx( whichsound, samp[whichsound], NULL, true); - FSOUND_3D_SetAttributes(channels[whichsound], gLoc, vel); - if(terrain.getOpacity(tippoint[i].x,tippoint[i].z)>.2)FSOUND_SetVolume(channels[whichsound], 128*findLengthfast(&bounceness)); - else FSOUND_SetVolume(channels[whichsound], 32*findLengthfast(&bounceness)); - FSOUND_SetPaused(channels[whichsound], false); + OPENAL_3D_SetAttributes(channels[whichsound], gLoc, vel); + if(terrain.getOpacity(tippoint[i].x,tippoint[i].z)>.2)OPENAL_SetVolume(channels[whichsound], 128*findLengthfast(&bounceness)); + else OPENAL_SetVolume(channels[whichsound], 32*findLengthfast(&bounceness)); + OPENAL_SetPaused(channels[whichsound], false); if(terrain.getOpacity(tippoint[i].x,tippoint[i].z)<.2){ XYZ terrainlight; @@ -820,10 +821,10 @@ void Weapons::DoStuff(){ vel[1]=0; vel[2]=0; PlaySoundEx( whichsound, samp[whichsound], NULL, true); - FSOUND_3D_SetAttributes(channels[whichsound], gLoc, vel); - if(terrain.getOpacity(position[i].x,position[i].z)>.2)FSOUND_SetVolume(channels[whichsound], 128*findLengthfast(&bounceness)); - else FSOUND_SetVolume(channels[whichsound], 32*findLengthfast(&bounceness)); - FSOUND_SetPaused(channels[whichsound], false); + OPENAL_3D_SetAttributes(channels[whichsound], gLoc, vel); + if(terrain.getOpacity(position[i].x,position[i].z)>.2)OPENAL_SetVolume(channels[whichsound], 128*findLengthfast(&bounceness)); + else OPENAL_SetVolume(channels[whichsound], 32*findLengthfast(&bounceness)); + OPENAL_SetPaused(channels[whichsound], false); } position[i]+=(mid-oldmid)*20; } @@ -864,10 +865,10 @@ void Weapons::DoStuff(){ vel[1]=0; vel[2]=0; PlaySoundEx( whichsound, samp[whichsound], NULL, true); - FSOUND_3D_SetAttributes(channels[whichsound], gLoc, vel); - if(terrain.getOpacity(position[i].x,position[i].z)>.2)FSOUND_SetVolume(channels[whichsound], 128*findLengthfast(&bounceness)); - else FSOUND_SetVolume(channels[whichsound], 32*findLengthfast(&bounceness)); - FSOUND_SetPaused(channels[whichsound], false); + OPENAL_3D_SetAttributes(channels[whichsound], gLoc, vel); + if(terrain.getOpacity(position[i].x,position[i].z)>.2)OPENAL_SetVolume(channels[whichsound], 128*findLengthfast(&bounceness)); + else OPENAL_SetVolume(channels[whichsound], 32*findLengthfast(&bounceness)); + OPENAL_SetPaused(channels[whichsound], false); } tippoint[i]+=(mid-oldmid)*20; } @@ -906,10 +907,10 @@ void Weapons::DoStuff(){ vel[1]=0; vel[2]=0; PlaySoundEx( whichsound, samp[whichsound], NULL, true); - FSOUND_3D_SetAttributes(channels[whichsound], gLoc, vel); - if(terrain.getOpacity(position[i].x,position[i].z)>.2)FSOUND_SetVolume(channels[whichsound], 128*findLengthfast(&bounceness)); - else FSOUND_SetVolume(channels[whichsound], 32*findLengthfast(&bounceness)); - FSOUND_SetPaused(channels[whichsound], false); + OPENAL_3D_SetAttributes(channels[whichsound], gLoc, vel); + if(terrain.getOpacity(position[i].x,position[i].z)>.2)OPENAL_SetVolume(channels[whichsound], 128*findLengthfast(&bounceness)); + else OPENAL_SetVolume(channels[whichsound], 32*findLengthfast(&bounceness)); + OPENAL_SetPaused(channels[whichsound], false); } } @@ -945,10 +946,10 @@ void Weapons::DoStuff(){ vel[1]=0; vel[2]=0; PlaySoundEx( whichsound, samp[whichsound], NULL, true); - FSOUND_3D_SetAttributes(channels[whichsound], gLoc, vel); - if(terrain.getOpacity(tippoint[i].x,tippoint[i].z)>.2)FSOUND_SetVolume(channels[whichsound], 128*findLengthfast(&bounceness)); - else FSOUND_SetVolume(channels[whichsound], 32*findLengthfast(&bounceness)); - FSOUND_SetPaused(channels[whichsound], false); + OPENAL_3D_SetAttributes(channels[whichsound], gLoc, vel); + if(terrain.getOpacity(tippoint[i].x,tippoint[i].z)>.2)OPENAL_SetVolume(channels[whichsound], 128*findLengthfast(&bounceness)); + else OPENAL_SetVolume(channels[whichsound], 32*findLengthfast(&bounceness)); + OPENAL_SetPaused(channels[whichsound], false); } }*/ diff --git a/Source/fmod.h b/Source/fmod.h index 0fa8065..e69de29 100644 --- a/Source/fmod.h +++ b/Source/fmod.h @@ -1,71 +0,0 @@ -/* -Copyright (C) 2003, 2010 - Wolfire Games - -This file is part of Lugaru. - -Lugaru is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -// wrapper for FMOD to account for filename conversions in windows - -#ifndef _FMODWRAPPER_H_ -#define _FMODWRAPPER_H_ - -#if USE_OPENAL -#define FSOUND_3D_Listener_SetAttributes OPENAL_3D_Listener_SetAttributes -#define FSOUND_3D_SetAttributes OPENAL_3D_SetAttributes -#define FSOUND_3D_SetDopplerFactor OPENAL_3D_SetDopplerFactor -#define FSOUND_Close OPENAL_Close -#define FSOUND_GetCurrentSample OPENAL_GetCurrentSample -#define FSOUND_GetLoopMode OPENAL_GetLoopMode -#define FSOUND_GetPaused OPENAL_GetPaused -#define FSOUND_Init OPENAL_Init -#define FSOUND_IsPlaying OPENAL_IsPlaying -#define FSOUND_PlaySoundEx OPENAL_PlaySoundEx -#define FSOUND_Sample_Free OPENAL_Sample_Free -#define FSOUND_Sample_Load OPENAL_Sample_Load -#define FSOUND_Sample_SetMinMaxDistance OPENAL_Sample_SetMinMaxDistance -#define FSOUND_Sample_SetMode OPENAL_Sample_SetMode -#define FSOUND_SetFrequency OPENAL_SetFrequency -#define FSOUND_SetPaused OPENAL_SetPaused -#define FSOUND_SetSFXMasterVolume OPENAL_SetSFXMasterVolume -#define FSOUND_SetVolume OPENAL_SetVolume -#define FSOUND_StopSound OPENAL_StopSound -#define FSOUND_Stream_Close OPENAL_Stream_Close -#define FSOUND_Stream_GetSample OPENAL_Stream_GetSample -#define FSOUND_Stream_Open OPENAL_Stream_Open -#define FSOUND_Stream_PlayEx OPENAL_Stream_PlayEx -#define FSOUND_Stream_SetMode OPENAL_Stream_SetMode -#define FSOUND_Stream_Stop OPENAL_Stream_Stop -#define FSOUND_Update OPENAL_Update -#define FSOUND_SetOutput OPENAL_SetOutput -#endif - -#include "fmod_header.h" -#include "MacCompatibility.h" - -#if USE_OPENAL -# undef FSOUND_Sample_Load -# undef FSOUND_Stream_Open -# define FSOUND_Sample_Load(a, b, c, d, e) OPENAL_Sample_Load( a, ConvertFileName( b), c, d, e) -# define FSOUND_Stream_Open(a, b, c, d) OPENAL_Stream_Open(ConvertFileName(a), b, c, d) -#elif !PLATFORM_MACOSX -# define FSOUND_Sample_Load(a, b, c, d, e) FSOUND_Sample_Load( a, ConvertFileName( b), c, d, e) -# define FSOUND_Stream_Open(a, b, c, d) FSOUND_Stream_Open(ConvertFileName(a), b, c, d) -#endif - -#endif - diff --git a/Source/fmod_errors.h b/Source/fmod_errors.h deleted file mode 100644 index e51a060..0000000 --- a/Source/fmod_errors.h +++ /dev/null @@ -1,54 +0,0 @@ -/* -Copyright (C) 2003, 2010 - Wolfire Games - -This file is part of Lugaru. - -Lugaru is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef _FMOD_ERRORS_H -#define _FMOD_ERRORS_H - -static char *FMOD_ErrorString(int errcode) -{ - switch (errcode) - { - case FMOD_ERR_NONE: return "No errors"; - case FMOD_ERR_BUSY: return "Cannot call this command after FSOUND_Init. Call FSOUND_Close first."; - case FMOD_ERR_UNINITIALIZED: return "This command failed because FSOUND_Init was not called"; - case FMOD_ERR_PLAY: return "Playing the sound failed."; - case FMOD_ERR_INIT: return "Error initializing output device."; - case FMOD_ERR_ALLOCATED: return "The output device is already in use and cannot be reused."; - case FMOD_ERR_OUTPUT_FORMAT: return "Soundcard does not support the features needed for this soundsystem (16bit stereo output)"; - case FMOD_ERR_COOPERATIVELEVEL: return "Error setting cooperative level for hardware."; - case FMOD_ERR_CREATEBUFFER: return "Error creating hardware sound buffer."; - case FMOD_ERR_FILE_NOTFOUND: return "File not found"; - case FMOD_ERR_FILE_FORMAT: return "Unknown file format"; - case FMOD_ERR_FILE_BAD: return "Error loading file"; - case FMOD_ERR_MEMORY: return "Not enough memory "; - case FMOD_ERR_VERSION: return "The version number of this file format is not supported"; - case FMOD_ERR_INVALID_PARAM: return "An invalid parameter was passed to this function"; - case FMOD_ERR_NO_EAX: return "Tried to use an EAX command on a non EAX enabled channel or output."; - case FMOD_ERR_CHANNEL_ALLOC: return "Failed to allocate a new channel"; - case FMOD_ERR_RECORD: return "Recording not supported on this device"; - case FMOD_ERR_MEDIAPLAYER: return "Required Mediaplayer codec is not installed"; - - default : return "Unknown error"; - }; -} - -#endif - diff --git a/Source/fmod_header.h b/Source/fmod_header.h index e9c12d7..e69de29 100644 --- a/Source/fmod_header.h +++ b/Source/fmod_header.h @@ -1,1241 +0,0 @@ -/* -Copyright (C) 2003, 2010 - Wolfire Games - -This file is part of Lugaru. - -Lugaru is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -/* ========================================================================================== */ -/* FMOD Main header file. Copyright (c), Firelight Technologies Pty, Ltd. 1999-2004. */ -/* ========================================================================================== */ - -#ifndef _FMOD_H_ -#define _FMOD_H_ - -/* ========================================================================================== */ -/* DEFINITIONS */ -/* ========================================================================================== */ - -#if (!defined(WIN32) && !defined(_WIN32) && !defined(__WIN32__) && !defined(_WIN64) && !defined(_WIN32_WCE) && !defined(_XBOX)) || (defined(__GNUC__) && defined(WIN32)) - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __stdcall - #define __stdcall - #endif -#endif - -#if defined(_WIN32_WCE) - #define F_API _cdecl - #define F_CALLBACKAPI _cdecl -#else - #define F_API __stdcall - #define F_CALLBACKAPI __stdcall -#endif - -#ifdef DLL_EXPORTS - #define DLL_API __declspec(dllexport) -#else - #if defined(__LCC__) || defined(__MINGW32__) || defined(__CYGWIN32__) - #define DLL_API F_API - #else - #define DLL_API - #endif /* __LCC__ || __MINGW32__ || __CYGWIN32__ */ -#endif /* DLL_EXPORTS */ - -#define FMOD_VERSION 3.74f - -/* - FMOD defined types -*/ -typedef struct FSOUND_SAMPLE FSOUND_SAMPLE; -typedef struct FSOUND_STREAM FSOUND_STREAM; -typedef struct FSOUND_DSPUNIT FSOUND_DSPUNIT; -typedef struct FSOUND_SYNCPOINT FSOUND_SYNCPOINT; -typedef struct FMUSIC_MODULE FMUSIC_MODULE; - -/* - Callback types -*/ -typedef void * (F_CALLBACKAPI *FSOUND_OPENCALLBACK) (const char *name); -typedef void (F_CALLBACKAPI *FSOUND_CLOSECALLBACK) (void *handle); -typedef int (F_CALLBACKAPI *FSOUND_READCALLBACK) (void *buffer, int size, void *handle); -typedef int (F_CALLBACKAPI *FSOUND_SEEKCALLBACK) (void *handle, int pos, signed char mode); -typedef int (F_CALLBACKAPI *FSOUND_TELLCALLBACK) (void *handle); - -typedef void * (F_CALLBACKAPI *FSOUND_ALLOCCALLBACK) (unsigned int size); -typedef void * (F_CALLBACKAPI *FSOUND_REALLOCCALLBACK) (void *ptr, unsigned int size); -typedef void (F_CALLBACKAPI *FSOUND_FREECALLBACK) (void *ptr); - -typedef void * (F_CALLBACKAPI *FSOUND_DSPCALLBACK) (void *originalbuffer, void *newbuffer, int length, void *userdata); -typedef signed char (F_CALLBACKAPI *FSOUND_STREAMCALLBACK) (FSOUND_STREAM *stream, void *buff, int len, void *userdata); -typedef signed char (F_CALLBACKAPI *FSOUND_METADATACALLBACK)(char *name, char *value, void *userdata); -typedef void (F_CALLBACKAPI *FMUSIC_CALLBACK) (FMUSIC_MODULE *mod, unsigned char param); - - -/* -[ENUM] -[ - [DESCRIPTION] - On failure of commands in FMOD, use FSOUND_GetError to attain what happened. - - [SEE_ALSO] - FSOUND_GetError -] -*/ -enum FMOD_ERRORS -{ - FMOD_ERR_NONE, /* No errors */ - FMOD_ERR_BUSY, /* Cannot call this command after FSOUND_Init. Call FSOUND_Close first. */ - FMOD_ERR_UNINITIALIZED, /* This command failed because FSOUND_Init or FSOUND_SetOutput was not called */ - FMOD_ERR_INIT, /* Error initializing output device. */ - FMOD_ERR_ALLOCATED, /* Error initializing output device, but more specifically, the output device is already in use and cannot be reused. */ - FMOD_ERR_PLAY, /* Playing the sound failed. */ - FMOD_ERR_OUTPUT_FORMAT, /* Soundcard does not support the features needed for this soundsystem (16bit stereo output) */ - FMOD_ERR_COOPERATIVELEVEL, /* Error setting cooperative level for hardware. */ - FMOD_ERR_CREATEBUFFER, /* Error creating hardware sound buffer. */ - FMOD_ERR_FILE_NOTFOUND, /* File not found */ - FMOD_ERR_FILE_FORMAT, /* Unknown file format */ - FMOD_ERR_FILE_BAD, /* Error loading file */ - FMOD_ERR_MEMORY, /* Not enough memory or resources */ - FMOD_ERR_VERSION, /* The version number of this file format is not supported */ - FMOD_ERR_INVALID_PARAM, /* An invalid parameter was passed to this function */ - FMOD_ERR_NO_EAX, /* Tried to use an EAX command on a non EAX enabled channel or output. */ - FMOD_ERR_CHANNEL_ALLOC, /* Failed to allocate a new channel */ - FMOD_ERR_RECORD, /* Recording is not supported on this machine */ - FMOD_ERR_MEDIAPLAYER, /* Windows Media Player not installed so cannot play wma or use internet streaming. */ - FMOD_ERR_CDDEVICE /* An error occured trying to open the specified CD device */ -}; - - -/* -[ENUM] -[ - [DESCRIPTION] - These output types are used with FSOUND_SetOutput, to choose which output driver to use. - - FSOUND_OUTPUT_DSOUND will not support hardware 3d acceleration if the sound card driver - does not support DirectX 6 Voice Manager Extensions. - - FSOUND_OUTPUT_WINMM is recommended for NT and CE. - - [SEE_ALSO] - FSOUND_SetOutput - FSOUND_GetOutput -] -*/ -enum FSOUND_OUTPUTTYPES -{ - FSOUND_OUTPUT_NOSOUND, /* NoSound driver, all calls to this succeed but do nothing. */ - FSOUND_OUTPUT_WINMM, /* Windows Multimedia driver. */ - FSOUND_OUTPUT_DSOUND, /* DirectSound driver. You need this to get EAX2 or EAX3 support, or FX api support. */ - FSOUND_OUTPUT_A3D, /* A3D driver. */ - - FSOUND_OUTPUT_OSS, /* Linux/Unix OSS (Open Sound System) driver, i.e. the kernel sound drivers. */ - FSOUND_OUTPUT_ESD, /* Linux/Unix ESD (Enlightment Sound Daemon) driver. */ - FSOUND_OUTPUT_ALSA, /* Linux Alsa driver. */ - - FSOUND_OUTPUT_ASIO, /* Low latency ASIO driver */ - FSOUND_OUTPUT_XBOX, /* Xbox driver */ - FSOUND_OUTPUT_PS2, /* PlayStation 2 driver */ - FSOUND_OUTPUT_MAC, /* Mac SoundManager driver */ - FSOUND_OUTPUT_GC, /* Gamecube driver */ - - FSOUND_OUTPUT_NOSOUND_NONREALTIME /* This is the same as nosound, but the sound generation is driven by FSOUND_Update */ -}; - - -/* -[ENUM] -[ - [DESCRIPTION] - These mixer types are used with FSOUND_SetMixer, to choose which mixer to use, or to act - upon for other reasons using FSOUND_GetMixer. - It is not nescessary to set the mixer. FMOD will autodetect the best mixer for you. - - [SEE_ALSO] - FSOUND_SetMixer - FSOUND_GetMixer -] -*/ -enum FSOUND_MIXERTYPES -{ - FSOUND_MIXER_AUTODETECT, /* CE/PS2/GC Only - Non interpolating/low quality mixer. */ - FSOUND_MIXER_BLENDMODE, /* Removed / obsolete. */ - FSOUND_MIXER_MMXP5, /* Removed / obsolete. */ - FSOUND_MIXER_MMXP6, /* Removed / obsolete. */ - - FSOUND_MIXER_QUALITY_AUTODETECT,/* All platforms - Autodetect the fastest quality mixer based on your cpu. */ - FSOUND_MIXER_QUALITY_FPU, /* Win32/Linux only - Interpolating/volume ramping FPU mixer. */ - FSOUND_MIXER_QUALITY_MMXP5, /* Win32/Linux only - Interpolating/volume ramping P5 MMX mixer. */ - FSOUND_MIXER_QUALITY_MMXP6, /* Win32/Linux only - Interpolating/volume ramping ppro+ MMX mixer. */ - - FSOUND_MIXER_MONO, /* CE/PS2/GC only - MONO non interpolating/low quality mixer. For speed*/ - FSOUND_MIXER_QUALITY_MONO, /* CE/PS2/GC only - MONO Interpolating mixer. For speed */ - - FSOUND_MIXER_MAX -}; - - -/* -[ENUM] -[ - [DESCRIPTION] - These definitions describe the type of song being played. - - [SEE_ALSO] - FMUSIC_GetType -] -*/ -enum FMUSIC_TYPES -{ - FMUSIC_TYPE_NONE, - FMUSIC_TYPE_MOD, /* Protracker / Fasttracker */ - FMUSIC_TYPE_S3M, /* ScreamTracker 3 */ - FMUSIC_TYPE_XM, /* FastTracker 2 */ - FMUSIC_TYPE_IT, /* Impulse Tracker. */ - FMUSIC_TYPE_MIDI, /* MIDI file */ - FMUSIC_TYPE_FSB /* FMOD Sample Bank file */ -}; - - -/* -[DEFINE_START] -[ - [NAME] - FSOUND_DSP_PRIORITIES - - [DESCRIPTION] - These default priorities are used by FMOD internal system DSP units. They describe the - position of the DSP chain, and the order of how audio processing is executed. - You can actually through the use of FSOUND_DSP_GetxxxUnit (where xxx is the name of the DSP - unit), disable or even change the priority of a DSP unit. - - [SEE_ALSO] - FSOUND_DSP_Create - FSOUND_DSP_SetPriority - FSOUND_DSP_GetSpectrum -] -*/ -#define FSOUND_DSP_DEFAULTPRIORITY_CLEARUNIT 0 /* DSP CLEAR unit - done first */ -#define FSOUND_DSP_DEFAULTPRIORITY_SFXUNIT 100 /* DSP SFX unit - done second */ -#define FSOUND_DSP_DEFAULTPRIORITY_MUSICUNIT 200 /* DSP MUSIC unit - done third */ -#define FSOUND_DSP_DEFAULTPRIORITY_USER 300 /* User priority, use this as reference for your own DSP units */ -#define FSOUND_DSP_DEFAULTPRIORITY_FFTUNIT 900 /* This reads data for FSOUND_DSP_GetSpectrum, so it comes after user units */ -#define FSOUND_DSP_DEFAULTPRIORITY_CLIPANDCOPYUNIT 1000 /* DSP CLIP AND COPY unit - last */ -/* [DEFINE_END] */ - - -/* -[DEFINE_START] -[ - [NAME] - FSOUND_CAPS - - [DESCRIPTION] - Driver description bitfields. Use FSOUND_Driver_GetCaps to determine if a driver enumerated - has the settings you are after. The enumerated driver depends on the output mode, see - FSOUND_OUTPUTTYPES - - [SEE_ALSO] - FSOUND_GetDriverCaps - FSOUND_OUTPUTTYPES -] -*/ -#define FSOUND_CAPS_HARDWARE 0x1 /* This driver supports hardware accelerated 3d sound. */ -#define FSOUND_CAPS_EAX2 0x2 /* This driver supports EAX 2 reverb */ -#define FSOUND_CAPS_EAX3 0x10 /* This driver supports EAX 3 reverb */ -/* [DEFINE_END] */ - - -/* -[DEFINE_START] -[ - [NAME] - FSOUND_MODES - - [DESCRIPTION] - Sample description bitfields, OR them together for loading and describing samples. - NOTE. If the file format being loaded already has a defined format, such as WAV or MP3, then - trying to override the pre-defined format with a new set of format flags will not work. For - example, an 8 bit WAV file will not load as 16bit if you specify FSOUND_16BITS. It will just - ignore the flag and go ahead loading it as 8bits. For these type of formats the only flags - you can specify that will really alter the behaviour of how it is loaded, are the following. - --------- - Looping behaviour - FSOUND_LOOP_OFF, FSOUND_LOOP_NORMAL, FSOUND_LOOP_BIDI - Load destination - FSOUND_HW3D, FSOUND_HW2D, FSOUND_2D - Loading behaviour - FSOUND_NONBLOCKING, FSOUND_LOADMEMORY, FSOUND_LOADRAW, FSOUND_MPEGACCURATE, FSOUND_MPEGHALFRATE, FSOUND_FORCEMONO - Playback behaviour - FSOUND_STREAMABLE, FSOUND_ENABLEFX - PlayStation 2 only - FSOUND_USECORE0, FSOUND_USECORE1, FSOUND_LOADMEMORYIOP - --------- - See flag descriptions for what these do. -] -*/ -#define FSOUND_LOOP_OFF 0x00000001 /* For non looping samples. */ -#define FSOUND_LOOP_NORMAL 0x00000002 /* For forward looping samples. */ -#define FSOUND_LOOP_BIDI 0x00000004 /* For bidirectional looping samples. (no effect if in hardware). */ -#define FSOUND_8BITS 0x00000008 /* For 8 bit samples. */ -#define FSOUND_16BITS 0x00000010 /* For 16 bit samples. */ -#define FSOUND_MONO 0x00000020 /* For mono samples. */ -#define FSOUND_STEREO 0x00000040 /* For stereo samples. */ -#define FSOUND_UNSIGNED 0x00000080 /* For user created source data containing unsigned samples. */ -#define FSOUND_SIGNED 0x00000100 /* For user created source data containing signed data. */ -#define FSOUND_DELTA 0x00000200 /* For user created source data stored as delta values. */ -#define FSOUND_IT214 0x00000400 /* For user created source data stored using IT214 compression. */ -#define FSOUND_IT215 0x00000800 /* For user created source data stored using IT215 compression. */ -#define FSOUND_HW3D 0x00001000 /* Attempts to make samples use 3d hardware acceleration. (if the card supports it) */ -#define FSOUND_2D 0x00002000 /* Tells software (not hardware) based sample not to be included in 3d processing. */ -#define FSOUND_STREAMABLE 0x00004000 /* For a streamimg sound where you feed the data to it. */ -#define FSOUND_LOADMEMORY 0x00008000 /* "name" will be interpreted as a pointer to data for streaming and samples. */ -#define FSOUND_LOADRAW 0x00010000 /* Will ignore file format and treat as raw pcm. */ -#define FSOUND_MPEGACCURATE 0x00020000 /* For FSOUND_Stream_Open - for accurate FSOUND_Stream_GetLengthMs/FSOUND_Stream_SetTime. WARNING, see FSOUND_Stream_Open for inital opening time performance issues. */ -#define FSOUND_FORCEMONO 0x00040000 /* For forcing stereo streams and samples to be mono - needed if using FSOUND_HW3D and stereo data - incurs a small speed hit for streams */ -#define FSOUND_HW2D 0x00080000 /* 2D hardware sounds. allows hardware specific effects */ -#define FSOUND_ENABLEFX 0x00100000 /* Allows DX8 FX to be played back on a sound. Requires DirectX 8 - Note these sounds cannot be played more than once, be 8 bit, be less than a certain size, or have a changing frequency */ -#define FSOUND_MPEGHALFRATE 0x00200000 /* For FMODCE only - decodes mpeg streams using a lower quality decode, but faster execution */ -#define FSOUND_IMAADPCM 0x00400000 /* Contents are stored compressed as IMA ADPCM */ -#define FSOUND_VAG 0x00800000 /* For PS2 only - Contents are compressed as Sony VAG format */ -#define FSOUND_NONBLOCKING 0x01000000 /* For FSOUND_Stream_Open/FMUSIC_LoadSong - Causes stream or music to open in the background and not block the foreground app. See FSOUND_Stream_GetOpenState or FMUSIC_GetOpenState to determine when it IS ready. */ -#define FSOUND_GCADPCM 0x02000000 /* For Gamecube only - Contents are compressed as Gamecube DSP-ADPCM format */ -#define FSOUND_MULTICHANNEL 0x04000000 /* For PS2 and Gamecube only - Contents are interleaved into a multi-channel (more than stereo) format */ -#define FSOUND_USECORE0 0x08000000 /* For PS2 only - Sample/Stream is forced to use hardware voices 00-23 */ -#define FSOUND_USECORE1 0x10000000 /* For PS2 only - Sample/Stream is forced to use hardware voices 24-47 */ -#define FSOUND_LOADMEMORYIOP 0x20000000 /* For PS2 only - "name" will be interpreted as a pointer to data for streaming and samples. The address provided will be an IOP address */ -#define FSOUND_IGNORETAGS 0x40000000 /* Skips id3v2 etc tag checks when opening a stream, to reduce seek/read overhead when opening files (helps with CD performance) */ -#define FSOUND_STREAM_NET 0x80000000 /* Specifies an internet stream */ - -#define FSOUND_NORMAL (FSOUND_16BITS | FSOUND_SIGNED | FSOUND_MONO) -/* [DEFINE_END] */ - - - -/* -[DEFINE_START] -[ - [NAME] - FSOUND_CDPLAYMODES - - [DESCRIPTION] - Playback method for a CD Audio track, with FSOUND_CD_SetPlayMode - - [SEE_ALSO] - FSOUND_CD_SetPlayMode - FSOUND_CD_Play -] -*/ -#define FSOUND_CD_PLAYCONTINUOUS 0 /* Starts from the current track and plays to end of CD. */ -#define FSOUND_CD_PLAYONCE 1 /* Plays the specified track then stops. */ -#define FSOUND_CD_PLAYLOOPED 2 /* Plays the specified track looped, forever until stopped manually. */ -#define FSOUND_CD_PLAYRANDOM 3 /* Plays tracks in random order */ -/* [DEFINE_END] */ - - -/* -[DEFINE_START] -[ - [NAME] - FSOUND_MISC_VALUES - - [DESCRIPTION] - Miscellaneous values for FMOD functions. - - [SEE_ALSO] - FSOUND_PlaySound - FSOUND_PlaySoundEx - FSOUND_Sample_Alloc - FSOUND_Sample_Load - FSOUND_SetPan -] -*/ -#define FSOUND_FREE -1 /* value to play on any free channel, or to allocate a sample in a free sample slot. */ -#define FSOUND_UNMANAGED -2 /* value to allocate a sample that is NOT managed by FSOUND or placed in a sample slot. */ -#define FSOUND_ALL -3 /* for a channel index , this flag will affect ALL channels available! Not supported by every function. */ -#define FSOUND_STEREOPAN -1 /* value for FSOUND_SetPan so that stereo sounds are not played at half volume. See FSOUND_SetPan for more on this. */ -#define FSOUND_SYSTEMCHANNEL -1000 /* special 'channel' ID for all channel based functions that want to alter the global FSOUND software mixing output channel */ -#define FSOUND_SYSTEMSAMPLE -1000 /* special 'sample' ID for all sample based functions that want to alter the global FSOUND software mixing output sample */ - -/* [DEFINE_END] */ - - -/* -[STRUCTURE] -[ - [DESCRIPTION] - Structure defining a reverb environment. - For more indepth descriptions of the reverb properties under win32, please see the EAX2 and EAX3 - documentation at http://developer.creative.com/ under the 'downloads' section. - If they do not have the EAX3 documentation, then most information can be attained from - the EAX2 documentation, as EAX3 only adds some more parameters and functionality on top of EAX2. - Note the default reverb properties are the same as the FSOUND_PRESET_GENERIC preset. - Note that integer values that typically range from -10,000 to 1000 are represented in decibels, and are of a logarithmic scale, not linear, wheras float values are typically linear. - PORTABILITY: Each member has the platform it supports in braces ie (win32/xbox). - Some reverb parameters are only supported in win32 and some only on xbox. If all parameters are set then the reverb should product a similar effect on either platform. - - The numerical values listed below are the maximum, minimum and default values for each variable respectively. - - [SEE_ALSO] - FSOUND_Reverb_SetProperties - FSOUND_Reverb_GetProperties - FSOUND_REVERB_PRESETS - FSOUND_REVERB_FLAGS -] -*/ -typedef struct _FSOUND_REVERB_PROPERTIES /* MIN MAX DEFAULT DESCRIPTION */ -{ - unsigned int Environment; /* 0 , 25 , 0 , sets all listener properties (WIN32/PS2 only) */ - float EnvSize; /* 1.0 , 100.0 , 7.5 , environment size in meters (WIN32 only) */ - float EnvDiffusion; /* 0.0 , 1.0 , 1.0 , environment diffusion (WIN32/XBOX) */ - int Room; /* -10000, 0 , -1000 , room effect level (at mid frequencies) (WIN32/XBOX/PS2) */ - int RoomHF; /* -10000, 0 , -100 , relative room effect level at high frequencies (WIN32/XBOX) */ - int RoomLF; /* -10000, 0 , 0 , relative room effect level at low frequencies (WIN32 only) */ - float DecayTime; /* 0.1 , 20.0 , 1.49 , reverberation decay time at mid frequencies (WIN32/XBOX) */ - float DecayHFRatio; /* 0.1 , 2.0 , 0.83 , high-frequency to mid-frequency decay time ratio (WIN32/XBOX) */ - float DecayLFRatio; /* 0.1 , 2.0 , 1.0 , low-frequency to mid-frequency decay time ratio (WIN32 only) */ - int Reflections; /* -10000, 1000 , -2602 , early reflections level relative to room effect (WIN32/XBOX) */ - float ReflectionsDelay; /* 0.0 , 0.3 , 0.007 , initial reflection delay time (WIN32/XBOX) */ - float ReflectionsPan[3]; /* , , [0,0,0], early reflections panning vector (WIN32 only) */ - int Reverb; /* -10000, 2000 , 200 , late reverberation level relative to room effect (WIN32/XBOX) */ - float ReverbDelay; /* 0.0 , 0.1 , 0.011 , late reverberation delay time relative to initial reflection (WIN32/XBOX) */ - float ReverbPan[3]; /* , , [0,0,0], late reverberation panning vector (WIN32 only) */ - float EchoTime; /* .075 , 0.25 , 0.25 , echo time (WIN32/PS2 only. PS2 = Delay time for ECHO/DELAY modes only) */ - float EchoDepth; /* 0.0 , 1.0 , 0.0 , echo depth (WIN32/PS2 only. PS2 = Feedback level for ECHO mode only) */ - float ModulationTime; /* 0.04 , 4.0 , 0.25 , modulation time (WIN32 only) */ - float ModulationDepth; /* 0.0 , 1.0 , 0.0 , modulation depth (WIN32 only) */ - float AirAbsorptionHF; /* -100 , 0.0 , -5.0 , change in level per meter at high frequencies (WIN32 only) */ - float HFReference; /* 1000.0, 20000 , 5000.0 , reference high frequency (hz) (WIN32/XBOX) */ - float LFReference; /* 20.0 , 1000.0, 250.0 , reference low frequency (hz) (WIN32 only) */ - float RoomRolloffFactor; /* 0.0 , 10.0 , 0.0 , like FSOUND_3D_SetRolloffFactor but for room effect (WIN32/XBOX) */ - float Diffusion; /* 0.0 , 100.0 , 100.0 , Value that controls the echo density in the late reverberation decay. (XBOX only) */ - float Density; /* 0.0 , 100.0 , 100.0 , Value that controls the modal density in the late reverberation decay (XBOX only) */ - unsigned int Flags; /* FSOUND_REVERB_FLAGS - modifies the behavior of above properties (WIN32/PS2 only) */ -} FSOUND_REVERB_PROPERTIES; - - -/* -[DEFINE_START] -[ - [NAME] - FSOUND_REVERB_FLAGS - - [DESCRIPTION] - Values for the Flags member of the FSOUND_REVERB_PROPERTIES structure. - - [SEE_ALSO] - FSOUND_REVERB_PROPERTIES -] -*/ -#define FSOUND_REVERB_FLAGS_DECAYTIMESCALE 0x00000001 /* 'EnvSize' affects reverberation decay time */ -#define FSOUND_REVERB_FLAGS_REFLECTIONSSCALE 0x00000002 /* 'EnvSize' affects reflection level */ -#define FSOUND_REVERB_FLAGS_REFLECTIONSDELAYSCALE 0x00000004 /* 'EnvSize' affects initial reflection delay time */ -#define FSOUND_REVERB_FLAGS_REVERBSCALE 0x00000008 /* 'EnvSize' affects reflections level */ -#define FSOUND_REVERB_FLAGS_REVERBDELAYSCALE 0x00000010 /* 'EnvSize' affects late reverberation delay time */ -#define FSOUND_REVERB_FLAGS_DECAYHFLIMIT 0x00000020 /* AirAbsorptionHF affects DecayHFRatio */ -#define FSOUND_REVERB_FLAGS_ECHOTIMESCALE 0x00000040 /* 'EnvSize' affects echo time */ -#define FSOUND_REVERB_FLAGS_MODULATIONTIMESCALE 0x00000080 /* 'EnvSize' affects modulation time */ -#define FSOUND_REVERB_FLAGS_CORE0 0x00000100 /* PS2 Only - Reverb is applied to CORE0 (hw voices 0-23) */ -#define FSOUND_REVERB_FLAGS_CORE1 0x00000200 /* PS2 Only - Reverb is applied to CORE1 (hw voices 24-47) */ -#define FSOUND_REVERB_FLAGS_DEFAULT (FSOUND_REVERB_FLAGS_DECAYTIMESCALE | \ - FSOUND_REVERB_FLAGS_REFLECTIONSSCALE | \ - FSOUND_REVERB_FLAGS_REFLECTIONSDELAYSCALE | \ - FSOUND_REVERB_FLAGS_REVERBSCALE | \ - FSOUND_REVERB_FLAGS_REVERBDELAYSCALE | \ - FSOUND_REVERB_FLAGS_DECAYHFLIMIT | \ - FSOUND_REVERB_FLAGS_CORE0 | \ - FSOUND_REVERB_FLAGS_CORE1 ) -/* [DEFINE_END] */ - - - - -/* -[DEFINE_START] -[ - [NAME] - FSOUND_REVERB_PRESETS - - [DESCRIPTION] - A set of predefined environment PARAMETERS, created by Creative Labs - These are used to initialize an FSOUND_REVERB_PROPERTIES structure statically. - ie - FSOUND_REVERB_PROPERTIES prop = FSOUND_PRESET_GENERIC; - - [SEE_ALSO] - FSOUND_Reverb_SetProperties -] -*/ -/* Env Size Diffus Room RoomHF RmLF DecTm DecHF DecLF Refl RefDel RefPan Revb RevDel ReverbPan EchoTm EchDp ModTm ModDp AirAbs HFRef LFRef RRlOff Diffus Densty FLAGS */ -#define FSOUND_PRESET_OFF {0, 7.5f, 1.00f, -10000, -10000, 0, 1.00f, 1.00f, 1.0f, -2602, 0.007f, { 0.0f,0.0f,0.0f }, 200, 0.011f, { 0.0f,0.0f,0.0f }, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 0.0f, 0.0f, 0x33f } -#define FSOUND_PRESET_GENERIC {0, 7.5f, 1.00f, -1000, -100, 0, 1.49f, 0.83f, 1.0f, -2602, 0.007f, { 0.0f,0.0f,0.0f }, 200, 0.011f, { 0.0f,0.0f,0.0f }, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f } -#define FSOUND_PRESET_PADDEDCELL {1, 1.4f, 1.00f, -1000, -6000, 0, 0.17f, 0.10f, 1.0f, -1204, 0.001f, { 0.0f,0.0f,0.0f }, 207, 0.002f, { 0.0f,0.0f,0.0f }, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f } -#define FSOUND_PRESET_ROOM {2, 1.9f, 1.00f, -1000, -454, 0, 0.40f, 0.83f, 1.0f, -1646, 0.002f, { 0.0f,0.0f,0.0f }, 53, 0.003f, { 0.0f,0.0f,0.0f }, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f } -#define FSOUND_PRESET_BATHROOM {3, 1.4f, 1.00f, -1000, -1200, 0, 1.49f, 0.54f, 1.0f, -370, 0.007f, { 0.0f,0.0f,0.0f }, 1030, 0.011f, { 0.0f,0.0f,0.0f }, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 60.0f, 0x3f } -#define FSOUND_PRESET_LIVINGROOM {4, 2.5f, 1.00f, -1000, -6000, 0, 0.50f, 0.10f, 1.0f, -1376, 0.003f, { 0.0f,0.0f,0.0f }, -1104, 0.004f, { 0.0f,0.0f,0.0f }, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f } -#define FSOUND_PRESET_STONEROOM {5, 11.6f, 1.00f, -1000, -300, 0, 2.31f, 0.64f, 1.0f, -711, 0.012f, { 0.0f,0.0f,0.0f }, 83, 0.017f, { 0.0f,0.0f,0.0f }, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f } -#define FSOUND_PRESET_AUDITORIUM {6, 21.6f, 1.00f, -1000, -476, 0, 4.32f, 0.59f, 1.0f, -789, 0.020f, { 0.0f,0.0f,0.0f }, -289, 0.030f, { 0.0f,0.0f,0.0f }, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f } -#define FSOUND_PRESET_CONCERTHALL {7, 19.6f, 1.00f, -1000, -500, 0, 3.92f, 0.70f, 1.0f, -1230, 0.020f, { 0.0f,0.0f,0.0f }, -2, 0.029f, { 0.0f,0.0f,0.0f }, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f } -#define FSOUND_PRESET_CAVE {8, 14.6f, 1.00f, -1000, 0, 0, 2.91f, 1.30f, 1.0f, -602, 0.015f, { 0.0f,0.0f,0.0f }, -302, 0.022f, { 0.0f,0.0f,0.0f }, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x1f } -#define FSOUND_PRESET_ARENA {9, 36.2f, 1.00f, -1000, -698, 0, 7.24f, 0.33f, 1.0f, -1166, 0.020f, { 0.0f,0.0f,0.0f }, 16, 0.030f, { 0.0f,0.0f,0.0f }, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f } -#define FSOUND_PRESET_HANGAR {10, 50.3f, 1.00f, -1000, -1000, 0, 10.05f, 0.23f, 1.0f, -602, 0.020f, { 0.0f,0.0f,0.0f }, 198, 0.030f, { 0.0f,0.0f,0.0f }, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f } -#define FSOUND_PRESET_CARPETTEDHALLWAY {11, 1.9f, 1.00f, -1000, -4000, 0, 0.30f, 0.10f, 1.0f, -1831, 0.002f, { 0.0f,0.0f,0.0f }, -1630, 0.030f, { 0.0f,0.0f,0.0f }, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f } -#define FSOUND_PRESET_HALLWAY {12, 1.8f, 1.00f, -1000, -300, 0, 1.49f, 0.59f, 1.0f, -1219, 0.007f, { 0.0f,0.0f,0.0f }, 441, 0.011f, { 0.0f,0.0f,0.0f }, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f } -#define FSOUND_PRESET_STONECORRIDOR {13, 13.5f, 1.00f, -1000, -237, 0, 2.70f, 0.79f, 1.0f, -1214, 0.013f, { 0.0f,0.0f,0.0f }, 395, 0.020f, { 0.0f,0.0f,0.0f }, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f } -#define FSOUND_PRESET_ALLEY {14, 7.5f, 0.30f, -1000, -270, 0, 1.49f, 0.86f, 1.0f, -1204, 0.007f, { 0.0f,0.0f,0.0f }, -4, 0.011f, { 0.0f,0.0f,0.0f }, 0.125f, 0.95f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f } -#define FSOUND_PRESET_FOREST {15, 38.0f, 0.30f, -1000, -3300, 0, 1.49f, 0.54f, 1.0f, -2560, 0.162f, { 0.0f,0.0f,0.0f }, -229, 0.088f, { 0.0f,0.0f,0.0f }, 0.125f, 1.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 79.0f, 100.0f, 0x3f } -#define FSOUND_PRESET_CITY {16, 7.5f, 0.50f, -1000, -800, 0, 1.49f, 0.67f, 1.0f, -2273, 0.007f, { 0.0f,0.0f,0.0f }, -1691, 0.011f, { 0.0f,0.0f,0.0f }, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 50.0f, 100.0f, 0x3f } -#define FSOUND_PRESET_MOUNTAINS {17, 100.0f, 0.27f, -1000, -2500, 0, 1.49f, 0.21f, 1.0f, -2780, 0.300f, { 0.0f,0.0f,0.0f }, -1434, 0.100f, { 0.0f,0.0f,0.0f }, 0.250f, 1.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 27.0f, 100.0f, 0x1f } -#define FSOUND_PRESET_QUARRY {18, 17.5f, 1.00f, -1000, -1000, 0, 1.49f, 0.83f, 1.0f, -10000, 0.061f, { 0.0f,0.0f,0.0f }, 500, 0.025f, { 0.0f,0.0f,0.0f }, 0.125f, 0.70f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f } -#define FSOUND_PRESET_PLAIN {19, 42.5f, 0.21f, -1000, -2000, 0, 1.49f, 0.50f, 1.0f, -2466, 0.179f, { 0.0f,0.0f,0.0f }, -1926, 0.100f, { 0.0f,0.0f,0.0f }, 0.250f, 1.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 21.0f, 100.0f, 0x3f } -#define FSOUND_PRESET_PARKINGLOT {20, 8.3f, 1.00f, -1000, 0, 0, 1.65f, 1.50f, 1.0f, -1363, 0.008f, { 0.0f,0.0f,0.0f }, -1153, 0.012f, { 0.0f,0.0f,0.0f }, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x1f } -#define FSOUND_PRESET_SEWERPIPE {21, 1.7f, 0.80f, -1000, -1000, 0, 2.81f, 0.14f, 1.0f, 429, 0.014f, { 0.0f,0.0f,0.0f }, 1023, 0.021f, { 0.0f,0.0f,0.0f }, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 80.0f, 60.0f, 0x3f } -#define FSOUND_PRESET_UNDERWATER {22, 1.8f, 1.00f, -1000, -4000, 0, 1.49f, 0.10f, 1.0f, -449, 0.007f, { 0.0f,0.0f,0.0f }, 1700, 0.011f, { 0.0f,0.0f,0.0f }, 0.250f, 0.00f, 1.18f, 0.348f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f } - -/* Non I3DL2 presets */ - -#define FSOUND_PRESET_DRUGGED {23, 1.9f, 0.50f, -1000, 0, 0, 8.39f, 1.39f, 1.0f, -115, 0.002f, { 0.0f,0.0f,0.0f }, 985, 0.030f, { 0.0f,0.0f,0.0f }, 0.250f, 0.00f, 0.25f, 1.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x1f } -#define FSOUND_PRESET_DIZZY {24, 1.8f, 0.60f, -1000, -400, 0, 17.23f, 0.56f, 1.0f, -1713, 0.020f, { 0.0f,0.0f,0.0f }, -613, 0.030f, { 0.0f,0.0f,0.0f }, 0.250f, 1.00f, 0.81f, 0.310f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x1f } -#define FSOUND_PRESET_PSYCHOTIC {25, 1.0f, 0.50f, -1000, -151, 0, 7.56f, 0.91f, 1.0f, -626, 0.020f, { 0.0f,0.0f,0.0f }, 774, 0.030f, { 0.0f,0.0f,0.0f }, 0.250f, 0.00f, 4.00f, 1.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x1f } - -/* PlayStation 2 Only presets */ - -#define FSOUND_PRESET_PS2_ROOM {1, 0, 0, 0, 0, 0, 0.0f, 0.0f, 0.0f, 0, 0.000f, { 0.0f,0.0f,0.0f }, 0, 0.000f, { 0.0f,0.0f,0.0f }, 0.000f, 0.00f, 0.00f, 0.000f, 0.0f, 0000.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0x31f } -#define FSOUND_PRESET_PS2_STUDIO_A {2, 0, 0, 0, 0, 0, 0.0f, 0.0f, 0.0f, 0, 0.000f, { 0.0f,0.0f,0.0f }, 0, 0.000f, { 0.0f,0.0f,0.0f }, 0.000f, 0.00f, 0.00f, 0.000f, 0.0f, 0000.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0x31f } -#define FSOUND_PRESET_PS2_STUDIO_B {3, 0, 0, 0, 0, 0, 0.0f, 0.0f, 0.0f, 0, 0.000f, { 0.0f,0.0f,0.0f }, 0, 0.000f, { 0.0f,0.0f,0.0f }, 0.000f, 0.00f, 0.00f, 0.000f, 0.0f, 0000.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0x31f } -#define FSOUND_PRESET_PS2_STUDIO_C {4, 0, 0, 0, 0, 0, 0.0f, 0.0f, 0.0f, 0, 0.000f, { 0.0f,0.0f,0.0f }, 0, 0.000f, { 0.0f,0.0f,0.0f }, 0.000f, 0.00f, 0.00f, 0.000f, 0.0f, 0000.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0x31f } -#define FSOUND_PRESET_PS2_HALL {5, 0, 0, 0, 0, 0, 0.0f, 0.0f, 0.0f, 0, 0.000f, { 0.0f,0.0f,0.0f }, 0, 0.000f, { 0.0f,0.0f,0.0f }, 0.000f, 0.00f, 0.00f, 0.000f, 0.0f, 0000.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0x31f } -#define FSOUND_PRESET_PS2_SPACE {6, 0, 0, 0, 0, 0, 0.0f, 0.0f, 0.0f, 0, 0.000f, { 0.0f,0.0f,0.0f }, 0, 0.000f, { 0.0f,0.0f,0.0f }, 0.000f, 0.00f, 0.00f, 0.000f, 0.0f, 0000.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0x31f } -#define FSOUND_PRESET_PS2_ECHO {7, 0, 0, 0, 0, 0, 0.0f, 0.0f, 0.0f, 0, 0.000f, { 0.0f,0.0f,0.0f }, 0, 0.000f, { 0.0f,0.0f,0.0f }, 0.000f, 0.00f, 0.00f, 0.000f, 0.0f, 0000.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0x31f } -#define FSOUND_PRESET_PS2_DELAY {8, 0, 0, 0, 0, 0, 0.0f, 0.0f, 0.0f, 0, 0.000f, { 0.0f,0.0f,0.0f }, 0, 0.000f, { 0.0f,0.0f,0.0f }, 0.000f, 0.00f, 0.00f, 0.000f, 0.0f, 0000.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0x31f } -#define FSOUND_PRESET_PS2_PIPE {9, 0, 0, 0, 0, 0, 0.0f, 0.0f, 0.0f, 0, 0.000f, { 0.0f,0.0f,0.0f }, 0, 0.000f, { 0.0f,0.0f,0.0f }, 0.000f, 0.00f, 0.00f, 0.000f, 0.0f, 0000.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0x31f } - -/* [DEFINE_END] */ - - -/* -[STRUCTURE] -[ - [DESCRIPTION] - Structure defining the properties for a reverb source, related to a FSOUND channel. - For more indepth descriptions of the reverb properties under win32, please see the EAX3 - documentation at http://developer.creative.com/ under the 'downloads' section. - If they do not have the EAX3 documentation, then most information can be attained from - the EAX2 documentation, as EAX3 only adds some more parameters and functionality on top of - EAX2. - - Note the default reverb properties are the same as the FSOUND_PRESET_GENERIC preset. - Note that integer values that typically range from -10,000 to 1000 are represented in - decibels, and are of a logarithmic scale, not linear, wheras float values are typically linear. - PORTABILITY: Each member has the platform it supports in braces ie (win32/xbox). - Some reverb parameters are only supported in win32 and some only on xbox. If all parameters are set then - the reverb should product a similar effect on either platform. - Linux and FMODCE do not support the reverb api. - - The numerical values listed below are the maximum, minimum and default values for each variable respectively. - - [SEE_ALSO] - FSOUND_Reverb_SetChannelProperties - FSOUND_Reverb_GetChannelProperties - FSOUND_REVERB_CHANNELFLAGS -] -*/ -typedef struct _FSOUND_REVERB_CHANNELPROPERTIES /* MIN MAX DEFAULT */ -{ - int Direct; /* -10000, 1000, 0, direct path level (at low and mid frequencies) (WIN32/XBOX) */ - int DirectHF; /* -10000, 0, 0, relative direct path level at high frequencies (WIN32/XBOX) */ - int Room; /* -10000, 1000, 0, room effect level (at low and mid frequencies) (WIN32/XBOX/PS2) */ - int RoomHF; /* -10000, 0, 0, relative room effect level at high frequencies (WIN32/XBOX) */ - int Obstruction; /* -10000, 0, 0, main obstruction control (attenuation at high frequencies) (WIN32/XBOX) */ - float ObstructionLFRatio; /* 0.0, 1.0, 0.0, obstruction low-frequency level re. main control (WIN32/XBOX) */ - int Occlusion; /* -10000, 0, 0, main occlusion control (attenuation at high frequencies) (WIN32/XBOX) */ - float OcclusionLFRatio; /* 0.0, 1.0, 0.25, occlusion low-frequency level re. main control (WIN32/XBOX) */ - float OcclusionRoomRatio; /* 0.0, 10.0, 1.5, relative occlusion control for room effect (WIN32) */ - float OcclusionDirectRatio; /* 0.0, 10.0, 1.0, relative occlusion control for direct path (WIN32) */ - int Exclusion; /* -10000, 0, 0, main exlusion control (attenuation at high frequencies) (WIN32) */ - float ExclusionLFRatio; /* 0.0, 1.0, 1.0, exclusion low-frequency level re. main control (WIN32) */ - int OutsideVolumeHF; /* -10000, 0, 0, outside sound cone level at high frequencies (WIN32) */ - float DopplerFactor; /* 0.0, 10.0, 0.0, like DS3D flDopplerFactor but per source (WIN32) */ - float RolloffFactor; /* 0.0, 10.0, 0.0, like DS3D flRolloffFactor but per source (WIN32) */ - float RoomRolloffFactor; /* 0.0, 10.0, 0.0, like DS3D flRolloffFactor but for room effect (WIN32/XBOX) */ - float AirAbsorptionFactor; /* 0.0, 10.0, 1.0, multiplies AirAbsorptionHF member of FSOUND_REVERB_PROPERTIES (WIN32) */ - int Flags; /* FSOUND_REVERB_CHANNELFLAGS - modifies the behavior of properties (WIN32) */ -} FSOUND_REVERB_CHANNELPROPERTIES; - - -/* -[DEFINE_START] -[ - [NAME] - FSOUND_REVERB_CHANNELFLAGS - - [DESCRIPTION] - Values for the Flags member of the FSOUND_REVERB_CHANNELPROPERTIES structure. - - [SEE_ALSO] - FSOUND_REVERB_CHANNELPROPERTIES -] -*/ -#define FSOUND_REVERB_CHANNELFLAGS_DIRECTHFAUTO 0x00000001 /* Automatic setting of 'Direct' due to distance from listener */ -#define FSOUND_REVERB_CHANNELFLAGS_ROOMAUTO 0x00000002 /* Automatic setting of 'Room' due to distance from listener */ -#define FSOUND_REVERB_CHANNELFLAGS_ROOMHFAUTO 0x00000004 /* Automatic setting of 'RoomHF' due to distance from listener */ -#define FSOUND_REVERB_CHANNELFLAGS_DEFAULT (FSOUND_REVERB_CHANNELFLAGS_DIRECTHFAUTO | \ - FSOUND_REVERB_CHANNELFLAGS_ROOMAUTO| \ - FSOUND_REVERB_CHANNELFLAGS_ROOMHFAUTO) -/* [DEFINE_END] */ - - -/* -[ENUM] -[ - [DESCRIPTION] - These values are used with FSOUND_FX_Enable to enable DirectX 8 FX for a channel. - - [SEE_ALSO] - FSOUND_FX_Enable - FSOUND_FX_Disable - FSOUND_FX_SetChorus - FSOUND_FX_SetCompressor - FSOUND_FX_SetDistortion - FSOUND_FX_SetEcho - FSOUND_FX_SetFlanger - FSOUND_FX_SetGargle - FSOUND_FX_SetI3DL2Reverb - FSOUND_FX_SetParamEQ - FSOUND_FX_SetWavesReverb -] -*/ -enum FSOUND_FX_MODES -{ - FSOUND_FX_CHORUS, - FSOUND_FX_COMPRESSOR, - FSOUND_FX_DISTORTION, - FSOUND_FX_ECHO, - FSOUND_FX_FLANGER, - FSOUND_FX_GARGLE, - FSOUND_FX_I3DL2REVERB, - FSOUND_FX_PARAMEQ, - FSOUND_FX_WAVES_REVERB, - - FSOUND_FX_MAX -}; - -/* -[ENUM] -[ - [DESCRIPTION] - These are speaker types defined for use with the FSOUND_SetSpeakerMode command. - Note - Only reliably works with FSOUND_OUTPUT_DSOUND or FSOUND_OUTPUT_XBOX output modes. Other output modes will only - interpret FSOUND_SPEAKERMODE_MONO and set everything else to be stereo. - - Using either DolbyDigital or DTS will use whatever 5.1 digital mode is available if destination hardware is unsure. - - [SEE_ALSO] - FSOUND_SetSpeakerMode - -] -*/ -enum FSOUND_SPEAKERMODES -{ - FSOUND_SPEAKERMODE_DOLBYDIGITAL, /* Dolby Digital Output (XBOX or PC only). */ - FSOUND_SPEAKERMODE_HEADPHONES, /* The speakers are headphones. */ - FSOUND_SPEAKERMODE_MONO, /* The speakers are monaural. */ - FSOUND_SPEAKERMODE_QUAD, /* The speakers are quadraphonic. */ - FSOUND_SPEAKERMODE_STEREO, /* The speakers are stereo (default value). */ - FSOUND_SPEAKERMODE_SURROUND, /* The speakers are surround sound. */ - FSOUND_SPEAKERMODE_DTS, /* DTS output (XBOX only). */ - FSOUND_SPEAKERMODE_PROLOGIC2, /* Dolby Prologic 2. Playstation 2 and Gamecube only. PlayStation 2 doesnt support interior panning, but supports 48 voices simultaneously. */ - FSOUND_SPEAKERMODE_PROLOGIC2_INTERIOR /* Dolby Prologic 2. Playstation 2 and Gamecube only. PlayStation 2 does support interior panning, but only supports 24 voices simultaneously. */ -}; - - -/* -[DEFINE_START] -[ - [NAME] - FSOUND_INIT_FLAGS - - [DESCRIPTION] - Initialization flags. Use them with FSOUND_Init in the flags parameter to change various behaviour. - - FSOUND_INIT_ENABLESYSTEMCHANNELFX Is an init mode which enables the FSOUND mixer buffer to be affected by DirectX 8 effects. - Note that due to limitations of DirectSound, FSOUND_Init may fail if this is enabled because the buffersize is too small. - This can be fixed with FSOUND_SetBufferSize. Increase the BufferSize until it works. - When it is enabled you can use the FSOUND_FX api, and use FSOUND_SYSTEMCHANNEL as the channel id when setting parameters. - - [SEE_ALSO] - FSOUND_Init -] -*/ -#define FSOUND_INIT_USEDEFAULTMIDISYNTH 0x0001 /* Win32 only - Causes MIDI playback to force software decoding. */ -#define FSOUND_INIT_GLOBALFOCUS 0x0002 /* Win32 only - For DirectSound output - sound is not muted when window is out of focus. */ -#define FSOUND_INIT_ENABLESYSTEMCHANNELFX 0x0004 /* Win32 only - For DirectSound output - Allows FSOUND_FX api to be used on global software mixer output! (use FSOUND_SYSTEMCHANNEL as channel id) */ -#define FSOUND_INIT_ACCURATEVULEVELS 0x0008 /* This latency adjusts FSOUND_GetCurrentLevels, but incurs a small cpu and memory hit */ -#define FSOUND_INIT_PS2_DISABLECORE0REVERB 0x0010 /* PS2 only - Disable reverb on CORE 0 (SPU2 voices 00-23) to regain SRAM */ -#define FSOUND_INIT_PS2_DISABLECORE1REVERB 0x0020 /* PS2 only - Disable reverb on CORE 1 (SPU2 voices 24-47) to regain SRAM */ -#define FSOUND_INIT_PS2_SWAPDMACORES 0x0040 /* PS2 only - By default FMOD uses DMA CH0 for mixing, CH1 for uploads, this flag swaps them around */ -#define FSOUND_INIT_DONTLATENCYADJUST 0x0080 /* Callbacks are not latency adjusted, and are called at mix time. Also information functions are immediate */ -#define FSOUND_INIT_GC_INITLIBS 0x0100 /* GC only - Initializes GC audio libraries */ -#define FSOUND_INIT_STREAM_FROM_MAIN_THREAD 0x0200 /* Turns off fmod streamer thread, and makes streaming update from FSOUND_Update called by the user */ -#define FSOUND_INIT_PS2_USEVOLUMERAMPING 0x0400 /* PS2 only - Turns on volume ramping system to remove hardware clicks. */ -#define FSOUND_INIT_DSOUND_DEFERRED 0x0800 /* Win32 only - For DirectSound output. 3D commands are batched together and executed at FSOUND_Update. */ -#define FSOUND_INIT_DSOUND_HRTF_LIGHT 0x1000 /* Win32 only - For DirectSound output. FSOUND_HW3D buffers use a slightly higher quality algorithm when 3d hardware acceleration is not present. */ -#define FSOUND_INIT_DSOUND_HRTF_FULL 0x2000 /* Win32 only - For DirectSound output. FSOUND_HW3D buffers use full quality 3d playback when 3d hardware acceleration is not present. */ -/* [DEFINE_END] */ - - -/* -[ENUM] -[ - [DESCRIPTION] - Status values for internet streams. Use FSOUND_Stream_Net_GetStatus to get the current status of an internet stream. - - [SEE_ALSO] - FSOUND_Stream_Net_GetStatus -] -*/ -enum FSOUND_STREAM_NET_STATUS -{ - FSOUND_STREAM_NET_NOTCONNECTED = 0, /* Stream hasn't connected yet */ - FSOUND_STREAM_NET_CONNECTING, /* Stream is connecting to remote host */ - FSOUND_STREAM_NET_BUFFERING, /* Stream is buffering data */ - FSOUND_STREAM_NET_READY, /* Stream is ready to play */ - FSOUND_STREAM_NET_ERROR /* Stream has suffered a fatal error */ -}; - - -/* -[ENUM] -[ - [DESCRIPTION] - Describes the type of a particular tag field. - - [SEE_ALSO] - FSOUND_Stream_GetNumTagFields - FSOUND_Stream_GetTagField - FSOUND_Stream_FindTagField -] -*/ -enum FSOUND_TAGFIELD_TYPE -{ - FSOUND_TAGFIELD_VORBISCOMMENT = 0, /* A vorbis comment */ - FSOUND_TAGFIELD_ID3V1, /* Part of an ID3v1 tag */ - FSOUND_TAGFIELD_ID3V2, /* An ID3v2 frame */ - FSOUND_TAGFIELD_SHOUTCAST, /* A SHOUTcast header line */ - FSOUND_TAGFIELD_ICECAST, /* An Icecast header line */ - FSOUND_TAGFIELD_ASF /* An Advanced Streaming Format header line */ -}; - - -/* -[DEFINE_START] -[ - [NAME] - FSOUND_STATUS_FLAGS - - [DESCRIPTION] - These values describe the protocol and format of an internet stream. Use FSOUND_Stream_Net_GetStatus to retrieve this information for an open internet stream. - - [SEE_ALSO] - FSOUND_Stream_Net_GetStatus -] -*/ -#define FSOUND_PROTOCOL_SHOUTCAST 0x00000001 -#define FSOUND_PROTOCOL_ICECAST 0x00000002 -#define FSOUND_PROTOCOL_HTTP 0x00000004 -#define FSOUND_FORMAT_MPEG 0x00010000 -#define FSOUND_FORMAT_OGGVORBIS 0x00020000 -/* [DEFINE_END] */ - - -/* -[STRUCTURE] -[ - [DESCRIPTION] - Structure defining a CD table of contents. This structure is returned as a tag from FSOUND_Stream_FindTagField when the tag name "CD_TOC" is specified. - Note: All tracks on the CD - including data tracks- will be represented in this structure so it's use for anything other than generating disc id information is not recommended. - See the cdda example program for info on retrieving and using this structure. - - [SEE_ALSO] - FSOUND_Stream_Open - FSOUND_Stream_FindTagField -] -*/ -typedef struct _FSOUND_TOC_TAG -{ - char name[4]; /* The string "TOC", just in case this structure is accidentally treated as a string */ - int numtracks; /* The number of tracks on the CD */ - int min[100]; /* The start offset of each track in minutes */ - int sec[100]; /* The start offset of each track in seconds */ - int frame[100]; /* The start offset of each track in frames */ - -} FSOUND_TOC_TAG; - - -/* ========================================================================================== */ -/* FUNCTION PROTOTYPES */ -/* ========================================================================================== */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* ================================== */ -/* Initialization / Global functions. */ -/* ================================== */ - -/* - PRE - FSOUND_Init functions. These can't be called after FSOUND_Init is - called (they will fail). They set up FMOD system functionality. -*/ - -DLL_API signed char F_API FSOUND_SetOutput(int outputtype); -DLL_API signed char F_API FSOUND_SetDriver(int driver); -DLL_API signed char F_API FSOUND_SetMixer(int mixer); -DLL_API signed char F_API FSOUND_SetBufferSize(int len_ms); -DLL_API signed char F_API FSOUND_SetHWND(void *hwnd); -DLL_API signed char F_API FSOUND_SetMinHardwareChannels(int min); -DLL_API signed char F_API FSOUND_SetMaxHardwareChannels(int max); -DLL_API signed char F_API FSOUND_SetMemorySystem(void *pool, - int poollen, - FSOUND_ALLOCCALLBACK useralloc, - FSOUND_REALLOCCALLBACK userrealloc, - FSOUND_FREECALLBACK userfree); -/* - Main initialization / closedown functions. - Note : Use FSOUND_INIT_USEDEFAULTMIDISYNTH with FSOUND_Init for software override - with MIDI playback. - : Use FSOUND_INIT_GLOBALFOCUS with FSOUND_Init to make sound audible no matter - which window is in focus. (FSOUND_OUTPUT_DSOUND only) -*/ - -DLL_API signed char F_API FSOUND_Init(int mixrate, int maxsoftwarechannels, unsigned int flags); -DLL_API void F_API FSOUND_Close(); - -/* - Runtime system level functions -*/ - -DLL_API void F_API FSOUND_Update(); /* This is called to update 3d sound / non-realtime output */ - -DLL_API void F_API FSOUND_SetSpeakerMode(unsigned int speakermode); -DLL_API void F_API FSOUND_SetSFXMasterVolume(int volume); -DLL_API void F_API FSOUND_SetPanSeperation(float pansep); -DLL_API void F_API FSOUND_File_SetCallbacks(FSOUND_OPENCALLBACK useropen, - FSOUND_CLOSECALLBACK userclose, - FSOUND_READCALLBACK userread, - FSOUND_SEEKCALLBACK userseek, - FSOUND_TELLCALLBACK usertell); - -/* - System information functions. -*/ - -DLL_API int F_API FSOUND_GetError(); -DLL_API float F_API FSOUND_GetVersion(); -DLL_API int F_API FSOUND_GetOutput(); -DLL_API void * F_API FSOUND_GetOutputHandle(); -DLL_API int F_API FSOUND_GetDriver(); -DLL_API int F_API FSOUND_GetMixer(); -DLL_API int F_API FSOUND_GetNumDrivers(); -DLL_API const char * F_API FSOUND_GetDriverName(int id); -DLL_API signed char F_API FSOUND_GetDriverCaps(int id, unsigned int *caps); -DLL_API int F_API FSOUND_GetOutputRate(); -DLL_API int F_API FSOUND_GetMaxChannels(); -DLL_API int F_API FSOUND_GetMaxSamples(); -DLL_API int F_API FSOUND_GetSFXMasterVolume(); -DLL_API signed char F_API FSOUND_GetNumHWChannels(int *num2d, int *num3d, int *total); -DLL_API int F_API FSOUND_GetChannelsPlaying(); -DLL_API float F_API FSOUND_GetCPUUsage(); -DLL_API void F_API FSOUND_GetMemoryStats(unsigned int *currentalloced, unsigned int *maxalloced); - -/* =================================== */ -/* Sample management / load functions. */ -/* =================================== */ - -/* - Sample creation and management functions - Note : Use FSOUND_LOADMEMORY flag with FSOUND_Sample_Load to load from memory. - Use FSOUND_LOADRAW flag with FSOUND_Sample_Load to treat as as raw pcm data. -*/ - -DLL_API FSOUND_SAMPLE * F_API FSOUND_Sample_Load(int index, const char *name_or_data, unsigned int mode, int offset, int length); -DLL_API FSOUND_SAMPLE * F_API FSOUND_Sample_Alloc(int index, int length, unsigned int mode, int deffreq, int defvol, int defpan, int defpri); -DLL_API void F_API FSOUND_Sample_Free(FSOUND_SAMPLE *sptr); -DLL_API signed char F_API FSOUND_Sample_Upload(FSOUND_SAMPLE *sptr, void *srcdata, unsigned int mode); -DLL_API signed char F_API FSOUND_Sample_Lock(FSOUND_SAMPLE *sptr, int offset, int length, void **ptr1, void **ptr2, unsigned int *len1, unsigned int *len2); -DLL_API signed char F_API FSOUND_Sample_Unlock(FSOUND_SAMPLE *sptr, void *ptr1, void *ptr2, unsigned int len1, unsigned int len2); - -/* - Sample control functions -*/ - -DLL_API signed char F_API FSOUND_Sample_SetMode(FSOUND_SAMPLE *sptr, unsigned int mode); -DLL_API signed char F_API FSOUND_Sample_SetLoopPoints(FSOUND_SAMPLE *sptr, int loopstart, int loopend); -DLL_API signed char F_API FSOUND_Sample_SetDefaults(FSOUND_SAMPLE *sptr, int deffreq, int defvol, int defpan, int defpri); -DLL_API signed char F_API FSOUND_Sample_SetDefaultsEx(FSOUND_SAMPLE *sptr, int deffreq, int defvol, int defpan, int defpri, int varfreq, int varvol, int varpan); -DLL_API signed char F_API FSOUND_Sample_SetMinMaxDistance(FSOUND_SAMPLE *sptr, float min, float max); -DLL_API signed char F_API FSOUND_Sample_SetMaxPlaybacks(FSOUND_SAMPLE *sptr, int max); - -/* - Sample information functions -*/ - -DLL_API FSOUND_SAMPLE * F_API FSOUND_Sample_Get(int sampno); -DLL_API const char * F_API FSOUND_Sample_GetName(FSOUND_SAMPLE *sptr); -DLL_API unsigned int F_API FSOUND_Sample_GetLength(FSOUND_SAMPLE *sptr); -DLL_API signed char F_API FSOUND_Sample_GetLoopPoints(FSOUND_SAMPLE *sptr, int *loopstart, int *loopend); -DLL_API signed char F_API FSOUND_Sample_GetDefaults(FSOUND_SAMPLE *sptr, int *deffreq, int *defvol, int *defpan, int *defpri); -DLL_API signed char F_API FSOUND_Sample_GetDefaultsEx(FSOUND_SAMPLE *sptr, int *deffreq, int *defvol, int *defpan, int *defpri, int *varfreq, int *varvol, int *varpan); -DLL_API unsigned int F_API FSOUND_Sample_GetMode(FSOUND_SAMPLE *sptr); -DLL_API signed char F_API FSOUND_Sample_GetMinMaxDistance(FSOUND_SAMPLE *sptr, float *min, float *max); - -/* ============================ */ -/* Channel control functions. */ -/* ============================ */ - -/* - Playing and stopping sounds. - Note : Use FSOUND_FREE as the 'channel' variable, to let FMOD pick a free channel for you. - Use FSOUND_ALL as the 'channel' variable to control ALL channels with one function call! -*/ - -DLL_API int F_API FSOUND_PlaySound(int channel, FSOUND_SAMPLE *sptr); -DLL_API int F_API FSOUND_PlaySoundEx(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused); -DLL_API signed char F_API FSOUND_StopSound(int channel); - -/* - Functions to control playback of a channel. - Note : FSOUND_ALL can be used on most of these functions as a channel value. -*/ - -DLL_API signed char F_API FSOUND_SetFrequency(int channel, int freq); -DLL_API signed char F_API FSOUND_SetVolume(int channel, int vol); -DLL_API signed char F_API FSOUND_SetVolumeAbsolute(int channel, int vol); -DLL_API signed char F_API FSOUND_SetPan(int channel, int pan); -DLL_API signed char F_API FSOUND_SetSurround(int channel, signed char surround); -DLL_API signed char F_API FSOUND_SetMute(int channel, signed char mute); -DLL_API signed char F_API FSOUND_SetPriority(int channel, int priority); -DLL_API signed char F_API FSOUND_SetReserved(int channel, signed char reserved); -DLL_API signed char F_API FSOUND_SetPaused(int channel, signed char paused); -DLL_API signed char F_API FSOUND_SetLoopMode(int channel, unsigned int loopmode); -DLL_API signed char F_API FSOUND_SetCurrentPosition(int channel, unsigned int offset); -DLL_API signed char F_API FSOUND_3D_SetAttributes(int channel, const float *pos, const float *vel); -DLL_API signed char F_API FSOUND_3D_SetMinMaxDistance(int channel, float min, float max); - -/* - Channel information functions. -*/ - -DLL_API signed char F_API FSOUND_IsPlaying(int channel); -DLL_API int F_API FSOUND_GetFrequency(int channel); -DLL_API int F_API FSOUND_GetVolume(int channel); -DLL_API int F_API FSOUND_GetAmplitude(int channel); -DLL_API int F_API FSOUND_GetPan(int channel); -DLL_API signed char F_API FSOUND_GetSurround(int channel); -DLL_API signed char F_API FSOUND_GetMute(int channel); -DLL_API int F_API FSOUND_GetPriority(int channel); -DLL_API signed char F_API FSOUND_GetReserved(int channel); -DLL_API signed char F_API FSOUND_GetPaused(int channel); -DLL_API unsigned int F_API FSOUND_GetLoopMode(int channel); -DLL_API unsigned int F_API FSOUND_GetCurrentPosition(int channel); -DLL_API FSOUND_SAMPLE * F_API FSOUND_GetCurrentSample(int channel); -DLL_API signed char F_API FSOUND_GetCurrentLevels(int channel, float *l, float *r); -DLL_API int F_API FSOUND_GetNumSubChannels(int channel); -DLL_API int F_API FSOUND_GetSubChannel(int channel, int subchannel); -DLL_API signed char F_API FSOUND_3D_GetAttributes(int channel, float *pos, float *vel); -DLL_API signed char F_API FSOUND_3D_GetMinMaxDistance(int channel, float *min, float *max); - -/* ========================== */ -/* Global 3D sound functions. */ -/* ========================== */ - -/* - See also 3d sample and channel based functions above. - Call FSOUND_Update once a frame to process 3d information. -*/ - -DLL_API void F_API FSOUND_3D_Listener_SetAttributes(const float *pos, const float *vel, float fx, float fy, float fz, float tx, float ty, float tz); -DLL_API void F_API FSOUND_3D_Listener_GetAttributes(float *pos, float *vel, float *fx, float *fy, float *fz, float *tx, float *ty, float *tz); -DLL_API void F_API FSOUND_3D_Listener_SetCurrent(int current, int numlisteners); /* use this if you use multiple listeners / splitscreen */ -DLL_API void F_API FSOUND_3D_SetDopplerFactor(float scale); -DLL_API void F_API FSOUND_3D_SetDistanceFactor(float scale); -DLL_API void F_API FSOUND_3D_SetRolloffFactor(float scale); - -/* =================== */ -/* FX functions. */ -/* =================== */ - -/* - Functions to control DX8 only effects processing. - - - FX enabled samples can only be played once at a time, not multiple times at once. - - Sounds have to be created with FSOUND_HW2D or FSOUND_HW3D for this to work. - - FSOUND_INIT_ENABLESYSTEMCHANNELFX can be used to apply hardware effect processing to the - global mixed output of FMOD's software channels. - - FSOUND_FX_Enable returns an FX handle that you can use to alter fx parameters. - - FSOUND_FX_Enable can be called multiple times in a row, even on the same FX type, - it will return a unique handle for each FX. - - FSOUND_FX_Enable cannot be called if the sound is playing or locked. - - FSOUND_FX_Disable must be called to reset/clear the FX from a channel. -*/ - -DLL_API int F_API FSOUND_FX_Enable(int channel, unsigned int fxtype); /* See FSOUND_FX_MODES */ -DLL_API signed char F_API FSOUND_FX_Disable(int channel); /* Disables all effects */ - -DLL_API signed char F_API FSOUND_FX_SetChorus(int fxid, float WetDryMix, float Depth, float Feedback, float Frequency, int Waveform, float Delay, int Phase); -DLL_API signed char F_API FSOUND_FX_SetCompressor(int fxid, float Gain, float Attack, float Release, float Threshold, float Ratio, float Predelay); -DLL_API signed char F_API FSOUND_FX_SetDistortion(int fxid, float Gain, float Edge, float PostEQCenterFrequency, float PostEQBandwidth, float PreLowpassCutoff); -DLL_API signed char F_API FSOUND_FX_SetEcho(int fxid, float WetDryMix, float Feedback, float LeftDelay, float RightDelay, int PanDelay); -DLL_API signed char F_API FSOUND_FX_SetFlanger(int fxid, float WetDryMix, float Depth, float Feedback, float Frequency, int Waveform, float Delay, int Phase); -DLL_API signed char F_API FSOUND_FX_SetGargle(int fxid, int RateHz, int WaveShape); -DLL_API signed char F_API FSOUND_FX_SetI3DL2Reverb(int fxid, int Room, int RoomHF, float RoomRolloffFactor, float DecayTime, float DecayHFRatio, int Reflections, float ReflectionsDelay, int Reverb, float ReverbDelay, float Diffusion, float Density, float HFReference); -DLL_API signed char F_API FSOUND_FX_SetParamEQ(int fxid, float Center, float Bandwidth, float Gain); -DLL_API signed char F_API FSOUND_FX_SetWavesReverb(int fxid, float InGain, float ReverbMix, float ReverbTime, float HighFreqRTRatio); - -/* ========================= */ -/* File Streaming functions. */ -/* ========================= */ - -/* - Note : Use FSOUND_LOADMEMORY flag with FSOUND_Stream_Open to stream from memory. - Use FSOUND_LOADRAW flag with FSOUND_Stream_Open to treat stream as raw pcm data. - Use FSOUND_MPEGACCURATE flag with FSOUND_Stream_Open to open mpegs in 'accurate mode' for settime/gettime/getlengthms. - Use FSOUND_FREE as the 'channel' variable, to let FMOD pick a free channel for you. -*/ - -DLL_API signed char F_API FSOUND_Stream_SetBufferSize(int ms); /* call this before opening streams, not after */ - -DLL_API FSOUND_STREAM * F_API FSOUND_Stream_Open(const char *name_or_data, unsigned int mode, int offset, int length); -DLL_API FSOUND_STREAM * F_API FSOUND_Stream_Create(FSOUND_STREAMCALLBACK callback, int length, unsigned int mode, int samplerate, void *userdata); -DLL_API signed char F_API FSOUND_Stream_Close(FSOUND_STREAM *stream); - -DLL_API int F_API FSOUND_Stream_Play(int channel, FSOUND_STREAM *stream); -DLL_API int F_API FSOUND_Stream_PlayEx(int channel, FSOUND_STREAM *stream, FSOUND_DSPUNIT *dsp, signed char startpaused); -DLL_API signed char F_API FSOUND_Stream_Stop(FSOUND_STREAM *stream); - -DLL_API signed char F_API FSOUND_Stream_SetPosition(FSOUND_STREAM *stream, unsigned int position); -DLL_API unsigned int F_API FSOUND_Stream_GetPosition(FSOUND_STREAM *stream); -DLL_API signed char F_API FSOUND_Stream_SetTime(FSOUND_STREAM *stream, int ms); -DLL_API int F_API FSOUND_Stream_GetTime(FSOUND_STREAM *stream); -DLL_API int F_API FSOUND_Stream_GetLength(FSOUND_STREAM *stream); -DLL_API int F_API FSOUND_Stream_GetLengthMs(FSOUND_STREAM *stream); - -DLL_API signed char F_API FSOUND_Stream_SetMode(FSOUND_STREAM *stream, unsigned int mode); -DLL_API unsigned int F_API FSOUND_Stream_GetMode(FSOUND_STREAM *stream); -DLL_API signed char F_API FSOUND_Stream_SetLoopPoints(FSOUND_STREAM *stream, unsigned int loopstartpcm, unsigned int loopendpcm); -DLL_API signed char F_API FSOUND_Stream_SetLoopCount(FSOUND_STREAM *stream, int count); -DLL_API int F_API FSOUND_Stream_GetOpenState(FSOUND_STREAM *stream); /* use with FSOUND_NONBLOCKING opened streams */ -DLL_API FSOUND_SAMPLE * F_API FSOUND_Stream_GetSample(FSOUND_STREAM *stream); -DLL_API FSOUND_DSPUNIT * F_API FSOUND_Stream_CreateDSP(FSOUND_STREAM *stream, FSOUND_DSPCALLBACK callback, int priority, void *userdata); - -DLL_API signed char F_API FSOUND_Stream_SetEndCallback(FSOUND_STREAM *stream, FSOUND_STREAMCALLBACK callback, void *userdata); -DLL_API signed char F_API FSOUND_Stream_SetSyncCallback(FSOUND_STREAM *stream, FSOUND_STREAMCALLBACK callback, void *userdata); - -DLL_API FSOUND_SYNCPOINT * F_API FSOUND_Stream_AddSyncPoint(FSOUND_STREAM *stream, unsigned int pcmoffset, const char *name); -DLL_API signed char F_API FSOUND_Stream_DeleteSyncPoint(FSOUND_SYNCPOINT *point); -DLL_API int F_API FSOUND_Stream_GetNumSyncPoints(FSOUND_STREAM *stream); -DLL_API FSOUND_SYNCPOINT * F_API FSOUND_Stream_GetSyncPoint(FSOUND_STREAM *stream, int index); -DLL_API char * F_API FSOUND_Stream_GetSyncPointInfo(FSOUND_SYNCPOINT *point, unsigned int *pcmoffset); - -DLL_API signed char F_API FSOUND_Stream_SetSubStream(FSOUND_STREAM *stream, int index); /* For FMOD .FSB bank files. */ -DLL_API int F_API FSOUND_Stream_GetNumSubStreams(FSOUND_STREAM *stream); /* For FMOD .FSB bank files. */ -DLL_API signed char F_API FSOUND_Stream_SetSubStreamSentence(FSOUND_STREAM *stream, const int *sentencelist, int numitems); - -DLL_API signed char F_API FSOUND_Stream_GetNumTagFields(FSOUND_STREAM *stream, int *num); -DLL_API signed char F_API FSOUND_Stream_GetTagField(FSOUND_STREAM *stream, int num, int *type, char **name, void **value, int *length); -DLL_API signed char F_API FSOUND_Stream_FindTagField(FSOUND_STREAM *stream, int type, const char *name, void **value, int *length); - -/* - Internet streaming functions -*/ - -DLL_API signed char F_API FSOUND_Stream_Net_SetProxy(const char *proxy); -DLL_API char * F_API FSOUND_Stream_Net_GetLastServerStatus(); -DLL_API signed char F_API FSOUND_Stream_Net_SetBufferProperties(int buffersize, int prebuffer_percent, int rebuffer_percent); -DLL_API signed char F_API FSOUND_Stream_Net_GetBufferProperties(int *buffersize, int *prebuffer_percent, int *rebuffer_percent); -DLL_API signed char F_API FSOUND_Stream_Net_SetMetadataCallback(FSOUND_STREAM *stream, FSOUND_METADATACALLBACK callback, void *userdata); -DLL_API signed char F_API FSOUND_Stream_Net_GetStatus(FSOUND_STREAM *stream, int *status, int *bufferpercentused, int *bitrate, unsigned int *flags); - -/* =================== */ -/* CD audio functions. */ -/* =================== */ - -/* - Note : 0 = default cdrom. Otherwise specify the drive letter, for example. 'D'. -*/ - -DLL_API signed char F_API FSOUND_CD_Play(char drive, int track); -DLL_API void F_API FSOUND_CD_SetPlayMode(char drive, signed char mode); -DLL_API signed char F_API FSOUND_CD_Stop(char drive); -DLL_API signed char F_API FSOUND_CD_SetPaused(char drive, signed char paused); -DLL_API signed char F_API FSOUND_CD_SetVolume(char drive, int volume); -DLL_API signed char F_API FSOUND_CD_SetTrackTime(char drive, unsigned int ms); -DLL_API signed char F_API FSOUND_CD_OpenTray(char drive, signed char open); - -DLL_API signed char F_API FSOUND_CD_GetPaused(char drive); -DLL_API int F_API FSOUND_CD_GetTrack(char drive); -DLL_API int F_API FSOUND_CD_GetNumTracks(char drive); -DLL_API int F_API FSOUND_CD_GetVolume(char drive); -DLL_API int F_API FSOUND_CD_GetTrackLength(char drive, int track); -DLL_API int F_API FSOUND_CD_GetTrackTime(char drive); - -/* ============== */ -/* DSP functions. */ -/* ============== */ - -/* - DSP Unit control and information functions. - These functions allow you access to the mixed stream that FMOD uses to play back sound on. -*/ - -DLL_API FSOUND_DSPUNIT *F_API FSOUND_DSP_Create(FSOUND_DSPCALLBACK callback, int priority, void *userdata); -DLL_API void F_API FSOUND_DSP_Free(FSOUND_DSPUNIT *unit); -DLL_API void F_API FSOUND_DSP_SetPriority(FSOUND_DSPUNIT *unit, int priority); -DLL_API int F_API FSOUND_DSP_GetPriority(FSOUND_DSPUNIT *unit); -DLL_API void F_API FSOUND_DSP_SetActive(FSOUND_DSPUNIT *unit, signed char active); -DLL_API signed char F_API FSOUND_DSP_GetActive(FSOUND_DSPUNIT *unit); - -/* - Functions to get hold of FSOUND 'system DSP unit' handles. -*/ - -DLL_API FSOUND_DSPUNIT *F_API FSOUND_DSP_GetClearUnit(); -DLL_API FSOUND_DSPUNIT *F_API FSOUND_DSP_GetSFXUnit(); -DLL_API FSOUND_DSPUNIT *F_API FSOUND_DSP_GetMusicUnit(); -DLL_API FSOUND_DSPUNIT *F_API FSOUND_DSP_GetFFTUnit(); -DLL_API FSOUND_DSPUNIT *F_API FSOUND_DSP_GetClipAndCopyUnit(); - -/* - Miscellaneous DSP functions - Note for the spectrum analysis function to work, you have to enable the FFT DSP unit with - the following code FSOUND_DSP_SetActive(FSOUND_DSP_GetFFTUnit(), TRUE); - It is off by default to save cpu usage. -*/ - -DLL_API signed char F_API FSOUND_DSP_MixBuffers(void *destbuffer, void *srcbuffer, int len, int freq, int vol, int pan, unsigned int mode); -DLL_API void F_API FSOUND_DSP_ClearMixBuffer(); -DLL_API int F_API FSOUND_DSP_GetBufferLength(); /* Length of each DSP update */ -DLL_API int F_API FSOUND_DSP_GetBufferLengthTotal(); /* Total buffer length due to FSOUND_SetBufferSize */ -DLL_API float * F_API FSOUND_DSP_GetSpectrum(); /* Array of 512 floats - call FSOUND_DSP_SetActive(FSOUND_DSP_GetFFTUnit(), TRUE)) for this to work. */ - -/* =================================================================================== */ -/* Reverb functions. (eax2/eax3 reverb) (ONLY SUPPORTED ON WIN32 W/ FSOUND_HW3D FLAG) */ -/* =================================================================================== */ - -/* - See top of file for definitions and information on the reverb parameters. -*/ - -DLL_API signed char F_API FSOUND_Reverb_SetProperties(const FSOUND_REVERB_PROPERTIES *prop); -DLL_API signed char F_API FSOUND_Reverb_GetProperties(FSOUND_REVERB_PROPERTIES *prop); -DLL_API signed char F_API FSOUND_Reverb_SetChannelProperties(int channel, const FSOUND_REVERB_CHANNELPROPERTIES *prop); -DLL_API signed char F_API FSOUND_Reverb_GetChannelProperties(int channel, FSOUND_REVERB_CHANNELPROPERTIES *prop); - -/* ===================================================== */ -/* Recording functions (ONLY SUPPORTED IN WIN32, WINCE) */ -/* ===================================================== */ - -/* - Recording initialization functions -*/ - -DLL_API signed char F_API FSOUND_Record_SetDriver(int outputtype); -DLL_API int F_API FSOUND_Record_GetNumDrivers(); -DLL_API const char * F_API FSOUND_Record_GetDriverName(int id); -DLL_API int F_API FSOUND_Record_GetDriver(); - -/* - Recording functionality. Only one recording session will work at a time. -*/ - -DLL_API signed char F_API FSOUND_Record_StartSample(FSOUND_SAMPLE *sptr, signed char loop); -DLL_API signed char F_API FSOUND_Record_Stop(); -DLL_API int F_API FSOUND_Record_GetPosition(); - -/* ========================================================================================== */ -/* FMUSIC API (MOD,S3M,XM,IT,MIDI PLAYBACK) */ -/* ========================================================================================== */ - -/* - Song management / playback functions. -*/ - -DLL_API FMUSIC_MODULE * F_API FMUSIC_LoadSong(const char *name); -DLL_API FMUSIC_MODULE * F_API FMUSIC_LoadSongEx(const char *name_or_data, int offset, int length, unsigned int mode, const int *samplelist, int samplelistnum); -DLL_API int F_API FMUSIC_GetOpenState(FMUSIC_MODULE *mod); -DLL_API signed char F_API FMUSIC_FreeSong(FMUSIC_MODULE *mod); -DLL_API signed char F_API FMUSIC_PlaySong(FMUSIC_MODULE *mod); -DLL_API signed char F_API FMUSIC_StopSong(FMUSIC_MODULE *mod); -DLL_API void F_API FMUSIC_StopAllSongs(); - -DLL_API signed char F_API FMUSIC_SetZxxCallback(FMUSIC_MODULE *mod, FMUSIC_CALLBACK callback); -DLL_API signed char F_API FMUSIC_SetRowCallback(FMUSIC_MODULE *mod, FMUSIC_CALLBACK callback, int rowstep); -DLL_API signed char F_API FMUSIC_SetOrderCallback(FMUSIC_MODULE *mod, FMUSIC_CALLBACK callback, int orderstep); -DLL_API signed char F_API FMUSIC_SetInstCallback(FMUSIC_MODULE *mod, FMUSIC_CALLBACK callback, int instrument); - -DLL_API signed char F_API FMUSIC_SetSample(FMUSIC_MODULE *mod, int sampno, FSOUND_SAMPLE *sptr); -DLL_API signed char F_API FMUSIC_SetUserData(FMUSIC_MODULE *mod, void *userdata); -DLL_API signed char F_API FMUSIC_OptimizeChannels(FMUSIC_MODULE *mod, int maxchannels, int minvolume); - -/* - Runtime song functions. -*/ - -DLL_API signed char F_API FMUSIC_SetReverb(signed char reverb); /* MIDI only */ -DLL_API signed char F_API FMUSIC_SetLooping(FMUSIC_MODULE *mod, signed char looping); -DLL_API signed char F_API FMUSIC_SetOrder(FMUSIC_MODULE *mod, int order); -DLL_API signed char F_API FMUSIC_SetPaused(FMUSIC_MODULE *mod, signed char pause); -DLL_API signed char F_API FMUSIC_SetMasterVolume(FMUSIC_MODULE *mod, int volume); -DLL_API signed char F_API FMUSIC_SetMasterSpeed(FMUSIC_MODULE *mode, float speed); -DLL_API signed char F_API FMUSIC_SetPanSeperation(FMUSIC_MODULE *mod, float pansep); - -/* - Static song information functions. -*/ - -DLL_API const char * F_API FMUSIC_GetName(FMUSIC_MODULE *mod); -DLL_API int F_API FMUSIC_GetType(FMUSIC_MODULE *mod); -DLL_API int F_API FMUSIC_GetNumOrders(FMUSIC_MODULE *mod); -DLL_API int F_API FMUSIC_GetNumPatterns(FMUSIC_MODULE *mod); -DLL_API int F_API FMUSIC_GetNumInstruments(FMUSIC_MODULE *mod); -DLL_API int F_API FMUSIC_GetNumSamples(FMUSIC_MODULE *mod); -DLL_API int F_API FMUSIC_GetNumChannels(FMUSIC_MODULE *mod); -DLL_API FSOUND_SAMPLE * F_API FMUSIC_GetSample(FMUSIC_MODULE *mod, int sampno); -DLL_API int F_API FMUSIC_GetPatternLength(FMUSIC_MODULE *mod, int orderno); - -/* - Runtime song information. -*/ - -DLL_API signed char F_API FMUSIC_IsFinished(FMUSIC_MODULE *mod); -DLL_API signed char F_API FMUSIC_IsPlaying(FMUSIC_MODULE *mod); -DLL_API int F_API FMUSIC_GetMasterVolume(FMUSIC_MODULE *mod); -DLL_API int F_API FMUSIC_GetGlobalVolume(FMUSIC_MODULE *mod); -DLL_API int F_API FMUSIC_GetOrder(FMUSIC_MODULE *mod); -DLL_API int F_API FMUSIC_GetPattern(FMUSIC_MODULE *mod); -DLL_API int F_API FMUSIC_GetSpeed(FMUSIC_MODULE *mod); -DLL_API int F_API FMUSIC_GetBPM(FMUSIC_MODULE *mod); -DLL_API int F_API FMUSIC_GetRow(FMUSIC_MODULE *mod); -DLL_API signed char F_API FMUSIC_GetPaused(FMUSIC_MODULE *mod); -DLL_API int F_API FMUSIC_GetTime(FMUSIC_MODULE *mod); -DLL_API int F_API FMUSIC_GetRealChannel(FMUSIC_MODULE *mod, int modchannel); -DLL_API void * F_API FMUSIC_GetUserData(FMUSIC_MODULE *mod); - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/Source/fmoddyn.h b/Source/fmoddyn.h deleted file mode 100644 index 2f0ba7f..0000000 --- a/Source/fmoddyn.h +++ /dev/null @@ -1,565 +0,0 @@ -/* -Copyright (C) 2003, 2010 - Wolfire Games - -This file is part of Lugaru. - -Lugaru is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -/* =========================================================================================== */ -/* FMOD Dynamic DLL loading header. Copyright (c), Firelight Technologies Pty, Ltd. 1999-2004. */ -/* =========================================================================================== */ - -#ifndef _FMODDYN_H_ -#define _FMODDYN_H_ - -#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(_WIN64) - #include -#else - #include - #include -#endif -#include - -#include "fmod.h" - -typedef struct -{ - void *module; - - signed char (F_API *FSOUND_SetOutput)(int outputtype); - signed char (F_API *FSOUND_SetDriver)(int driver); - signed char (F_API *FSOUND_SetMixer)(int mixer); - signed char (F_API *FSOUND_SetBufferSize)(int len_ms); - signed char (F_API *FSOUND_SetHWND)(void *hwnd); - signed char (F_API *FSOUND_SetMinHardwareChannels)(int min); - signed char (F_API *FSOUND_SetMaxHardwareChannels)(int max); - signed char (F_API *FSOUND_SetMemorySystem)(void *pool, int poollen, FSOUND_ALLOCCALLBACK useralloc, FSOUND_REALLOCCALLBACK userrealloc, FSOUND_FREECALLBACK userfree); - signed char (F_API *FSOUND_Init)(int mixrate, int maxsoftwarechannels, unsigned int flags); - void (F_API *FSOUND_Close)(); - void (F_API *FSOUND_Update)(); /* you must call this once a frame */ - void (F_API *FSOUND_SetSpeakerMode)(unsigned int speakermode); - void (F_API *FSOUND_SetSFXMasterVolume)(int volume); - void (F_API *FSOUND_SetPanSeperation)(float pansep); - void (F_API *FSOUND_File_SetCallbacks)(FSOUND_OPENCALLBACK useropen, FSOUND_CLOSECALLBACK userclose, FSOUND_READCALLBACK userread, FSOUND_SEEKCALLBACK userseek, FSOUND_TELLCALLBACK usertell); - int (F_API *FSOUND_GetError)(); - float (F_API *FSOUND_GetVersion)(); - int (F_API *FSOUND_GetOutput)(); - void * (F_API *FSOUND_GetOutputHandle)(); - int (F_API *FSOUND_GetDriver)(); - int (F_API *FSOUND_GetMixer)(); - int (F_API *FSOUND_GetNumDrivers)(); - signed char * (F_API *FSOUND_GetDriverName)(int id); - signed char (F_API *FSOUND_GetDriverCaps)(int id, unsigned int *caps); - int (F_API *FSOUND_GetOutputRate)(); - int (F_API *FSOUND_GetMaxChannels)(); - int (F_API *FSOUND_GetMaxSamples)(); - int (F_API *FSOUND_GetSFXMasterVolume)(); - signed char (F_API *FSOUND_GetNumHWChannels)(int *num2d, int *num3d, int *total); - int (F_API *FSOUND_GetChannelsPlaying)(); - float (F_API *FSOUND_GetCPUUsage)(); - void (F_API *FSOUND_GetMemoryStats)(unsigned int *currentalloced, unsigned int *maxalloced); - FSOUND_SAMPLE * (F_API *FSOUND_Sample_Load)(int index, const char *name_or_data, unsigned int mode, int offset, int length); - FSOUND_SAMPLE * (F_API *FSOUND_Sample_Alloc)(int index, int length, unsigned int mode, int deffreq, int defvol, int defpan, int defpri); - void (F_API *FSOUND_Sample_Free)(FSOUND_SAMPLE *sptr); - signed char (F_API *FSOUND_Sample_Upload)(FSOUND_SAMPLE *sptr, void *srcdata, unsigned int mode); - signed char (F_API *FSOUND_Sample_Lock)(FSOUND_SAMPLE *sptr, int offset, int length, void **ptr1, void **ptr2, unsigned int *len1, unsigned int *len2); - signed char (F_API *FSOUND_Sample_Unlock)(FSOUND_SAMPLE *sptr, void *ptr1, void *ptr2, unsigned int len1, unsigned int len2); - signed char (F_API *FSOUND_Sample_SetMode)(FSOUND_SAMPLE *sptr, unsigned int mode); - signed char (F_API *FSOUND_Sample_SetLoopPoints)(FSOUND_SAMPLE *sptr, int loopstart, int loopend); - signed char (F_API *FSOUND_Sample_SetDefaults)(FSOUND_SAMPLE *sptr, int deffreq, int defvol, int defpan, int defpri); - signed char (F_API *FSOUND_Sample_SetDefaultsEx)(FSOUND_SAMPLE *sptr, int deffreq, int defvol, int defpan, int defpri, int varfreq, int varvol, int varpan); - signed char (F_API *FSOUND_Sample_SetMinMaxDistance)(FSOUND_SAMPLE *sptr, float min, float max); - signed char (F_API *FSOUND_Sample_SetMaxPlaybacks)(FSOUND_SAMPLE *sptr, int max); - FSOUND_SAMPLE * (F_API *FSOUND_Sample_Get)(int sampno); - char * (F_API *FSOUND_Sample_GetName)(FSOUND_SAMPLE *sptr); - unsigned int (F_API *FSOUND_Sample_GetLength)(FSOUND_SAMPLE *sptr); - signed char (F_API *FSOUND_Sample_GetLoopPoints)(FSOUND_SAMPLE *sptr, int *loopstart, int *loopend); - signed char (F_API *FSOUND_Sample_GetDefaults)(FSOUND_SAMPLE *sptr, int *deffreq, int *defvol, int *defpan, int *defpri); - signed char (F_API *FSOUND_Sample_GetDefaultsEx)(FSOUND_SAMPLE *sptr, int *deffreq, int *defvol, int *defpan, int *defpri, int *varfreq, int *varvol, int *varpan); - unsigned int (F_API *FSOUND_Sample_GetMode)(FSOUND_SAMPLE *sptr); - signed char (F_API *FSOUND_Sample_GetMinMaxDistance)(FSOUND_SAMPLE *sptr, float *min, float *max); - int (F_API *FSOUND_PlaySound)(int channel, FSOUND_SAMPLE *sptr); - int (F_API *FSOUND_PlaySoundEx)(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused); - signed char (F_API *FSOUND_StopSound)(int channel); - signed char (F_API *FSOUND_SetFrequency)(int channel, int freq); - signed char (F_API *FSOUND_SetVolume)(int channel, int vol); - signed char (F_API *FSOUND_SetVolumeAbsolute)(int channel, int vol); - signed char (F_API *FSOUND_SetPan)(int channel, int pan); - signed char (F_API *FSOUND_SetSurround)(int channel, signed char surround); - signed char (F_API *FSOUND_SetMute)(int channel, signed char mute); - signed char (F_API *FSOUND_SetPriority)(int channel, int priority); - signed char (F_API *FSOUND_SetReserved)(int channel, signed char reserved); - signed char (F_API *FSOUND_SetPaused)(int channel, signed char paused); - signed char (F_API *FSOUND_SetLoopMode)(int channel, unsigned int loopmode); - signed char (F_API *FSOUND_SetCurrentPosition)(int channel, unsigned int offset); - signed char (F_API *FSOUND_3D_SetAttributes)(int channel, float *pos, float *vel); - signed char (F_API *FSOUND_3D_SetMinMaxDistance)(int channel, float min, float max); - signed char (F_API *FSOUND_IsPlaying)(int channel); - int (F_API *FSOUND_GetFrequency)(int channel); - int (F_API *FSOUND_GetVolume)(int channel); - int (F_API *FSOUND_GetAmplitude)(int channel); - int (F_API *FSOUND_GetPan)(int channel); - signed char (F_API *FSOUND_GetSurround)(int channel); - signed char (F_API *FSOUND_GetMute)(int channel); - int (F_API *FSOUND_GetPriority)(int channel); - signed char (F_API *FSOUND_GetReserved)(int channel); - signed char (F_API *FSOUND_GetPaused)(int channel); - unsigned int (F_API *FSOUND_GetLoopMode)(int channel); - unsigned int (F_API *FSOUND_GetCurrentPosition)(int channel); - FSOUND_SAMPLE * (F_API *FSOUND_GetCurrentSample)(int channel); - signed char (F_API *FSOUND_GetCurrentLevels)(int channel, float *l, float *r); - int (F_API *FSOUND_GetNumSubChannels)(int channel); - int (F_API *FSOUND_GetSubChannel)(int channel, int subchannel); - signed char (F_API *FSOUND_3D_GetAttributes)(int channel, float *pos, float *vel); - signed char (F_API *FSOUND_3D_GetMinMaxDistance)(int channel, float *min, float *max); - void (F_API *FSOUND_3D_SetDopplerFactor)(float scale); - void (F_API *FSOUND_3D_SetDistanceFactor)(float scale); - void (F_API *FSOUND_3D_SetRolloffFactor)(float scale); - void (F_API *FSOUND_3D_Listener_SetCurrent)(int current, int numlisteners); /* use this if you use multiple listeners / splitscreen */ - void (F_API *FSOUND_3D_Listener_SetAttributes)(float *pos, float *vel, float fx, float fy, float fz, float tx, float ty, float tz); - void (F_API *FSOUND_3D_Listener_GetAttributes)(float *pos, float *vel, float *fx, float *fy, float *fz, float *tx, float *ty, float *tz); - int (F_API *FSOUND_FX_Enable)(int channel, unsigned int fx); /* See FSOUND_FX_MODES */ - signed char (F_API *FSOUND_FX_Disable)(int channel); - signed char (F_API *FSOUND_FX_SetChorus)(int fxid, float WetDryMix, float Depth, float Feedback, float Frequency, int Waveform, float Delay, int Phase); - signed char (F_API *FSOUND_FX_SetCompressor)(int fxid, float Gain, float Attack, float Release, float Threshold, float Ratio, float Predelay); - signed char (F_API *FSOUND_FX_SetDistortion)(int fxid, float Gain, float Edge, float PostEQCenterFrequency, float PostEQBandwidth, float PreLowpassCutoff); - signed char (F_API *FSOUND_FX_SetEcho)(int fxid, float WetDryMix, float Feedback, float LeftDelay, float RightDelay, int PanDelay); - signed char (F_API *FSOUND_FX_SetFlanger)(int fxid, float WetDryMix, float Depth, float Feedback, float Frequency, int Waveform, float Delay, int Phase); - signed char (F_API *FSOUND_FX_SetGargle)(int fxid, int RateHz, int WaveShape); - signed char (F_API *FSOUND_FX_SetI3DL2Reverb)(int fxid, int Room, int RoomHF, float RoomRolloffFactor, float DecayTime, float DecayHFRatio, int Reflections, float ReflectionsDelay, int Reverb, float ReverbDelay, float Diffusion, float Density, float HFReference); - signed char (F_API *FSOUND_FX_SetParamEQ)(int fxid, float Center, float Bandwidth, float Gain); - signed char (F_API *FSOUND_FX_SetWavesReverb)(int fxid, float InGain, float ReverbMix, float ReverbTime, float HighFreqRTRatio); - signed char (F_API *FSOUND_Stream_SetBufferSize)(int ms); /* call this before opening streams, not after */ - FSOUND_STREAM * (F_API *FSOUND_Stream_Open)(const char *name_or_data, unsigned int mode, int offset, int length); - FSOUND_STREAM * (F_API *FSOUND_Stream_Create)(FSOUND_STREAMCALLBACK callback, int length, unsigned int mode, int samplerate, void *userdata); - signed char (F_API *FSOUND_Stream_Close)(FSOUND_STREAM *stream); - int (F_API *FSOUND_Stream_Play)(int channel, FSOUND_STREAM *stream); - int (F_API *FSOUND_Stream_PlayEx)(int channel, FSOUND_STREAM *stream, FSOUND_DSPUNIT *dsp, signed char startpaused); - signed char (F_API *FSOUND_Stream_Stop)(FSOUND_STREAM *stream); - signed char (F_API *FSOUND_Stream_SetPosition)(FSOUND_STREAM *stream, unsigned int position); - unsigned int (F_API *FSOUND_Stream_GetPosition)(FSOUND_STREAM *stream); - signed char (F_API *FSOUND_Stream_SetTime)(FSOUND_STREAM *stream, int ms); - int (F_API *FSOUND_Stream_GetTime)(FSOUND_STREAM *stream); - int (F_API *FSOUND_Stream_GetLength)(FSOUND_STREAM *stream); - int (F_API *FSOUND_Stream_GetLengthMs)(FSOUND_STREAM *stream); - signed char (F_API *FSOUND_Stream_SetMode)(FSOUND_STREAM *stream, unsigned int mode); - unsigned int (F_API *FSOUND_Stream_GetMode)(FSOUND_STREAM *stream); - signed char (F_API *FSOUND_Stream_SetLoopPoints)(FSOUND_STREAM *stream, unsigned int loopstartpcm, unsigned int loopendpcm); - signed char (F_API *FSOUND_Stream_SetLoopCount)(FSOUND_STREAM *stream, int count); - int (F_API *FSOUND_Stream_GetOpenState)(FSOUND_STREAM *stream); - FSOUND_SAMPLE * (F_API *FSOUND_Stream_GetSample)(FSOUND_STREAM *stream); /* every stream contains a sample to playback on */ - FSOUND_DSPUNIT * (F_API *FSOUND_Stream_CreateDSP)(FSOUND_STREAM *stream, FSOUND_DSPCALLBACK callback, int priority, void *userdata); - signed char (F_API *FSOUND_Stream_SetEndCallback)(FSOUND_STREAM *stream, FSOUND_STREAMCALLBACK callback, void *userdata); - signed char (F_API *FSOUND_Stream_SetSyncCallback)(FSOUND_STREAM *stream, FSOUND_STREAMCALLBACK callback, void *userdata); - FSOUND_SYNCPOINT *(F_API *FSOUND_Stream_AddSyncPoint)(FSOUND_STREAM *stream, unsigned int pcmoffset, void *userdata); - signed char (F_API *FSOUND_Stream_DeleteSyncPoint)(FSOUND_SYNCPOINT *point); - int (F_API *FSOUND_Stream_GetNumSyncPoints)(FSOUND_STREAM *stream); - FSOUND_SYNCPOINT *(F_API *FSOUND_Stream_GetSyncPoint)(FSOUND_STREAM *stream, int index); - char * (F_API *FSOUND_Stream_GetSyncPointInfo)(FSOUND_SYNCPOINT *point, unsigned int *pcmoffset); - signed char (F_API *FSOUND_Stream_SetSubStream)(FSOUND_STREAM *stream, int index); - int (F_API *FSOUND_Stream_GetNumSubStreams)(FSOUND_STREAM *stream); - signed char (F_API *FSOUND_Stream_SetSubStreamSentence)(FSOUND_STREAM *stream, int *sentencelist, int numitems); - signed char (F_API *FSOUND_Stream_GetNumTagFields)(FSOUND_STREAM *stream, int *num); - signed char (F_API *FSOUND_Stream_GetTagField)(FSOUND_STREAM *stream, int num, int *type, char **name, void **value, int *length); - signed char (F_API *FSOUND_Stream_FindTagField)(FSOUND_STREAM *stream, int type, const char *name, void **value, int *length); - signed char (F_API *FSOUND_Stream_Net_SetProxy)(const char *proxy); - char * (F_API *FSOUND_Stream_Net_GetLastServerStatus)(); - signed char (F_API *FSOUND_Stream_Net_SetBufferProperties)(int buffersize, int prebuffer_percent, int rebuffer_percent); - signed char (F_API *FSOUND_Stream_Net_GetBufferProperties)(int *buffersize, int *prebuffer_percent, int *rebuffer_percent); - signed char (F_API *FSOUND_Stream_Net_SetMetadataCallback)(FSOUND_STREAM *stream, FSOUND_METADATACALLBACK callback, void *userdata); - signed char (F_API *FSOUND_Stream_Net_GetStatus)(FSOUND_STREAM *stream, int *status, int *bufferpercentused, int *bitrate, unsigned int *flags); - signed char (F_API *FSOUND_CD_Play)(char drive, int track); - void (F_API *FSOUND_CD_SetPlayMode)(char drive, signed char mode); - signed char (F_API *FSOUND_CD_Stop)(char drive); - signed char (F_API *FSOUND_CD_SetPaused)(char drive, signed char paused); - signed char (F_API *FSOUND_CD_SetVolume)(char drive, int volume); - signed char (F_API *FSOUND_CD_SetTrackTime)(char drive, unsigned int ms); - signed char (F_API *FSOUND_CD_OpenTray)(char drive, signed char open); - signed char (F_API *FSOUND_CD_GetPaused)(char drive); - int (F_API *FSOUND_CD_GetTrack)(char drive); - int (F_API *FSOUND_CD_GetNumTracks)(char drive); - int (F_API *FSOUND_CD_GetVolume)(char drive); - int (F_API *FSOUND_CD_GetTrackLength)(char drive, int track); - int (F_API *FSOUND_CD_GetTrackTime)(char drive); - FSOUND_DSPUNIT * (F_API *FSOUND_DSP_Create)(FSOUND_DSPCALLBACK callback, int priority, void *userdata); - void (F_API *FSOUND_DSP_Free)(FSOUND_DSPUNIT *unit); - void (F_API *FSOUND_DSP_SetPriority)(FSOUND_DSPUNIT *unit, int priority); - int (F_API *FSOUND_DSP_GetPriority)(FSOUND_DSPUNIT *unit); - void (F_API *FSOUND_DSP_SetActive)(FSOUND_DSPUNIT *unit, signed char active); - signed char (F_API *FSOUND_DSP_GetActive)(FSOUND_DSPUNIT *unit); - FSOUND_DSPUNIT * (F_API *FSOUND_DSP_GetClearUnit)(); - FSOUND_DSPUNIT * (F_API *FSOUND_DSP_GetSFXUnit)(); - FSOUND_DSPUNIT * (F_API *FSOUND_DSP_GetMusicUnit)(); - FSOUND_DSPUNIT * (F_API *FSOUND_DSP_GetFFTUnit)(); - FSOUND_DSPUNIT * (F_API *FSOUND_DSP_GetClipAndCopyUnit)(); - signed char (F_API *FSOUND_DSP_MixBuffers)(void *destbuffer, void *srcbuffer, int len, int freq, int vol, int pan, unsigned int mode); - void (F_API *FSOUND_DSP_ClearMixBuffer)(); - int (F_API *FSOUND_DSP_GetBufferLength)(); /* Length of each DSP update */ - int (F_API *FSOUND_DSP_GetBufferLengthTotal)(); /* Total buffer length due to FSOUND_SetBufferSize */ - float * (F_API *FSOUND_DSP_GetSpectrum)(); /* Array of 512 floats - call FSOUND_DSP_SetActive(FSOUND_DSP_GetFFTUnit(), TRUE)) for this to work. */ - signed char (F_API *FSOUND_Reverb_SetProperties)(FSOUND_REVERB_PROPERTIES *prop); - signed char (F_API *FSOUND_Reverb_GetProperties)(FSOUND_REVERB_PROPERTIES *prop); - signed char (F_API *FSOUND_Reverb_SetChannelProperties)(int channel, FSOUND_REVERB_CHANNELPROPERTIES *prop); - signed char (F_API *FSOUND_Reverb_GetChannelProperties)(int channel, FSOUND_REVERB_CHANNELPROPERTIES *prop); - signed char (F_API *FSOUND_Record_SetDriver)(int outputtype); - int (F_API *FSOUND_Record_GetNumDrivers)(); - signed char * (F_API *FSOUND_Record_GetDriverName)(int id); - int (F_API *FSOUND_Record_GetDriver)(); - signed char (F_API *FSOUND_Record_StartSample)(FSOUND_SAMPLE *sptr, signed char loop); - signed char (F_API *FSOUND_Record_Stop)(); - int (F_API *FSOUND_Record_GetPosition)(); - FMUSIC_MODULE * (F_API *FMUSIC_LoadSong)(const char *name); - FMUSIC_MODULE * (F_API *FMUSIC_LoadSongEx)(const char *name_or_data, int offset, int length, unsigned int mode, int *samplelist, int samplelistnum); - int (F_API *FMUSIC_GetOpenState)(FMUSIC_MODULE *mod); - signed char (F_API *FMUSIC_FreeSong)(FMUSIC_MODULE *mod); - signed char (F_API *FMUSIC_PlaySong)(FMUSIC_MODULE *mod); - signed char (F_API *FMUSIC_StopSong)(FMUSIC_MODULE *mod); - void (F_API *FMUSIC_StopAllSongs)(); - signed char (F_API *FMUSIC_SetZxxCallback)(FMUSIC_MODULE *mod, FMUSIC_CALLBACK callback); - signed char (F_API *FMUSIC_SetRowCallback)(FMUSIC_MODULE *mod, FMUSIC_CALLBACK callback, int rowstep); - signed char (F_API *FMUSIC_SetOrderCallback)(FMUSIC_MODULE *mod, FMUSIC_CALLBACK callback, int orderstep); - signed char (F_API *FMUSIC_SetInstCallback)(FMUSIC_MODULE *mod, FMUSIC_CALLBACK callback, int instrument); - signed char (F_API *FMUSIC_SetSample)(FMUSIC_MODULE *mod, int sampno, FSOUND_SAMPLE *sptr); - signed char (F_API *FMUSIC_SetUserData)(FMUSIC_MODULE *mod, void *userdata); - signed char (F_API *FMUSIC_OptimizeChannels)(FMUSIC_MODULE *mod, int maxchannels, int minvolume); - signed char (F_API *FMUSIC_SetReverb)(signed char reverb); /* MIDI only */ - signed char (F_API *FMUSIC_SetLooping)(FMUSIC_MODULE *mod, signed char looping); - signed char (F_API *FMUSIC_SetOrder)(FMUSIC_MODULE *mod, int order); - signed char (F_API *FMUSIC_SetPaused)(FMUSIC_MODULE *mod, signed char pause); - signed char (F_API *FMUSIC_SetMasterVolume)(FMUSIC_MODULE *mod, int volume); - signed char (F_API *FMUSIC_SetMasterSpeed)(FMUSIC_MODULE *mode, float speed); - signed char (F_API *FMUSIC_SetPanSeperation)(FMUSIC_MODULE *mod, float pansep); - char * (F_API *FMUSIC_GetName)(FMUSIC_MODULE *mod); - int (F_API *FMUSIC_GetType)(FMUSIC_MODULE *mod); - int (F_API *FMUSIC_GetNumOrders)(FMUSIC_MODULE *mod); - int (F_API *FMUSIC_GetNumPatterns)(FMUSIC_MODULE *mod); - int (F_API *FMUSIC_GetNumInstruments)(FMUSIC_MODULE *mod); - int (F_API *FMUSIC_GetNumSamples)(FMUSIC_MODULE *mod); - int (F_API *FMUSIC_GetNumChannels)(FMUSIC_MODULE *mod); - FSOUND_SAMPLE * (F_API *FMUSIC_GetSample)(FMUSIC_MODULE *mod, int sampno); - int (F_API *FMUSIC_GetPatternLength)(FMUSIC_MODULE *mod, int orderno); - signed char (F_API *FMUSIC_IsFinished)(FMUSIC_MODULE *mod); - signed char (F_API *FMUSIC_IsPlaying)(FMUSIC_MODULE *mod); - int (F_API *FMUSIC_GetMasterVolume)(FMUSIC_MODULE *mod); - int (F_API *FMUSIC_GetGlobalVolume)(FMUSIC_MODULE *mod); - int (F_API *FMUSIC_GetOrder)(FMUSIC_MODULE *mod); - int (F_API *FMUSIC_GetPattern)(FMUSIC_MODULE *mod); - int (F_API *FMUSIC_GetSpeed)(FMUSIC_MODULE *mod); - int (F_API *FMUSIC_GetBPM)(FMUSIC_MODULE *mod); - int (F_API *FMUSIC_GetRow)(FMUSIC_MODULE *mod); - signed char (F_API *FMUSIC_GetPaused)(FMUSIC_MODULE *mod); - int (F_API *FMUSIC_GetTime)(FMUSIC_MODULE *mod); - int (F_API *FMUSIC_GetRealChannel)(FMUSIC_MODULE *mod, int modchannel); - unsigned int (F_API *FMUSIC_GetUserData)(FMUSIC_MODULE *mod); -} FMOD_INSTANCE; - - -static FMOD_INSTANCE *FMOD_CreateInstance(char *dllName) -{ - FMOD_INSTANCE *instance; - - instance = (FMOD_INSTANCE *)calloc(sizeof(FMOD_INSTANCE), 1); - if (!instance) - { - return NULL; - } - -#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(_WIN64) - instance->module = LoadLibrary(dllName); -#else - instance->module = dlopen(dllName, RTLD_LAZY); -#endif - if (!instance->module) - { - free(instance); - return NULL; - } - -#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(_WIN64) - #define F_GETPROC(_x, _y) \ - { \ - *((unsigned int *)&instance->_x) = (unsigned int)GetProcAddress((HMODULE)instance->module, _y); \ - if (!instance->_x) \ - { \ - FreeLibrary((HMODULE)instance->module); \ - free(instance); \ - return NULL; \ - } \ - } -#else - #define F_GETPROC(_x, _y) \ - { \ - char tmp[] = _y; \ - *(strchr(tmp, '@')) = 0; \ - *((unsigned int *)&instance->_x) = (unsigned int)dlsym(instance->module, &tmp[1]); \ - if (!instance->_x) \ - { \ - dlclose(instance->module); \ - free(instance); \ - return NULL; \ - } \ - } -#endif - - F_GETPROC(FSOUND_SetOutput, "_FSOUND_SetOutput@4"); - F_GETPROC(FSOUND_SetDriver, "_FSOUND_SetDriver@4"); - F_GETPROC(FSOUND_SetMixer, "_FSOUND_SetMixer@4"); - F_GETPROC(FSOUND_SetBufferSize, "_FSOUND_SetBufferSize@4"); - F_GETPROC(FSOUND_SetHWND, "_FSOUND_SetHWND@4"); - F_GETPROC(FSOUND_SetMinHardwareChannels, "_FSOUND_SetMinHardwareChannels@4"); - F_GETPROC(FSOUND_SetMaxHardwareChannels, "_FSOUND_SetMaxHardwareChannels@4"); - F_GETPROC(FSOUND_SetMemorySystem, "_FSOUND_SetMemorySystem@20"); - F_GETPROC(FSOUND_Init, "_FSOUND_Init@12"); - F_GETPROC(FSOUND_Close, "_FSOUND_Close@0"); - F_GETPROC(FSOUND_Update, "_FSOUND_Update@0"); - F_GETPROC(FSOUND_SetSFXMasterVolume, "_FSOUND_SetSFXMasterVolume@4"); - F_GETPROC(FSOUND_SetPanSeperation, "_FSOUND_SetPanSeperation@4"); - F_GETPROC(FSOUND_SetSpeakerMode, "_FSOUND_SetSpeakerMode@4"); - F_GETPROC(FSOUND_GetError, "_FSOUND_GetError@0"); - F_GETPROC(FSOUND_GetVersion, "_FSOUND_GetVersion@0"); - F_GETPROC(FSOUND_GetOutput, "_FSOUND_GetOutput@0"); - F_GETPROC(FSOUND_GetOutputHandle, "_FSOUND_GetOutputHandle@0"); - F_GETPROC(FSOUND_GetDriver, "_FSOUND_GetDriver@0"); - F_GETPROC(FSOUND_GetMixer, "_FSOUND_GetMixer@0"); - F_GETPROC(FSOUND_GetNumDrivers, "_FSOUND_GetNumDrivers@0"); - F_GETPROC(FSOUND_GetDriverName, "_FSOUND_GetDriverName@4"); - F_GETPROC(FSOUND_GetDriverCaps, "_FSOUND_GetDriverCaps@8"); - F_GETPROC(FSOUND_GetOutputRate, "_FSOUND_GetOutputRate@0"); - F_GETPROC(FSOUND_GetMaxChannels, "_FSOUND_GetMaxChannels@0"); - F_GETPROC(FSOUND_GetMaxSamples, "_FSOUND_GetMaxSamples@0"); - F_GETPROC(FSOUND_GetSFXMasterVolume, "_FSOUND_GetSFXMasterVolume@0"); - F_GETPROC(FSOUND_GetNumHWChannels, "_FSOUND_GetNumHWChannels@12"); - F_GETPROC(FSOUND_GetChannelsPlaying, "_FSOUND_GetChannelsPlaying@0"); - F_GETPROC(FSOUND_GetCPUUsage, "_FSOUND_GetCPUUsage@0"); - F_GETPROC(FSOUND_GetMemoryStats, "_FSOUND_GetMemoryStats@8"); - F_GETPROC(FSOUND_Sample_Load, "_FSOUND_Sample_Load@20"); - F_GETPROC(FSOUND_Sample_Alloc, "_FSOUND_Sample_Alloc@28"); - F_GETPROC(FSOUND_Sample_Free, "_FSOUND_Sample_Free@4"); - F_GETPROC(FSOUND_Sample_Upload, "_FSOUND_Sample_Upload@12"); - F_GETPROC(FSOUND_Sample_Lock, "_FSOUND_Sample_Lock@28"); - F_GETPROC(FSOUND_Sample_Unlock, "_FSOUND_Sample_Unlock@20"); - F_GETPROC(FSOUND_Sample_SetMode, "_FSOUND_Sample_SetMode@8"); - F_GETPROC(FSOUND_Sample_SetLoopPoints, "_FSOUND_Sample_SetLoopPoints@12"); - F_GETPROC(FSOUND_Sample_SetDefaults, "_FSOUND_Sample_SetDefaults@20"); - F_GETPROC(FSOUND_Sample_SetDefaultsEx, "_FSOUND_Sample_SetDefaultsEx@32"); - F_GETPROC(FSOUND_Sample_SetMinMaxDistance, "_FSOUND_Sample_SetMinMaxDistance@12"); - F_GETPROC(FSOUND_Sample_SetMaxPlaybacks, "_FSOUND_Sample_SetMaxPlaybacks@8"); - F_GETPROC(FSOUND_Sample_Get, "_FSOUND_Sample_Get@4"); - F_GETPROC(FSOUND_Sample_GetName, "_FSOUND_Sample_GetName@4"); - F_GETPROC(FSOUND_Sample_GetLength, "_FSOUND_Sample_GetLength@4"); - F_GETPROC(FSOUND_Sample_GetLoopPoints, "_FSOUND_Sample_GetLoopPoints@12"); - F_GETPROC(FSOUND_Sample_GetDefaults, "_FSOUND_Sample_GetDefaults@20"); - F_GETPROC(FSOUND_Sample_GetDefaultsEx, "_FSOUND_Sample_GetDefaultsEx@32"); - F_GETPROC(FSOUND_Sample_GetMode, "_FSOUND_Sample_GetMode@4"); - F_GETPROC(FSOUND_Sample_GetMinMaxDistance, "_FSOUND_Sample_GetMinMaxDistance@12"); - F_GETPROC(FSOUND_PlaySound, "_FSOUND_PlaySound@8"); - F_GETPROC(FSOUND_PlaySoundEx, "_FSOUND_PlaySoundEx@16"); - F_GETPROC(FSOUND_StopSound, "_FSOUND_StopSound@4"); - F_GETPROC(FSOUND_SetFrequency, "_FSOUND_SetFrequency@8"); - F_GETPROC(FSOUND_SetVolume, "_FSOUND_SetVolume@8"); - F_GETPROC(FSOUND_SetVolumeAbsolute, "_FSOUND_SetVolumeAbsolute@8"); - F_GETPROC(FSOUND_SetPan, "_FSOUND_SetPan@8"); - F_GETPROC(FSOUND_SetSurround, "_FSOUND_SetSurround@8"); - F_GETPROC(FSOUND_SetMute, "_FSOUND_SetMute@8"); - F_GETPROC(FSOUND_SetPriority, "_FSOUND_SetPriority@8"); - F_GETPROC(FSOUND_SetReserved, "_FSOUND_SetReserved@8"); - F_GETPROC(FSOUND_SetPaused, "_FSOUND_SetPaused@8"); - F_GETPROC(FSOUND_SetLoopMode, "_FSOUND_SetLoopMode@8"); - F_GETPROC(FSOUND_SetCurrentPosition, "_FSOUND_SetCurrentPosition@8"); - F_GETPROC(FSOUND_3D_SetAttributes, "_FSOUND_3D_SetAttributes@12"); - F_GETPROC(FSOUND_3D_SetMinMaxDistance, "_FSOUND_3D_SetMinMaxDistance@12"); - F_GETPROC(FSOUND_IsPlaying, "_FSOUND_IsPlaying@4"); - F_GETPROC(FSOUND_GetFrequency, "_FSOUND_GetFrequency@4"); - F_GETPROC(FSOUND_GetVolume, "_FSOUND_GetVolume@4"); - F_GETPROC(FSOUND_GetAmplitude, "_FSOUND_GetAmplitude@4"); - F_GETPROC(FSOUND_GetPan, "_FSOUND_GetPan@4"); - F_GETPROC(FSOUND_GetSurround, "_FSOUND_GetSurround@4"); - F_GETPROC(FSOUND_GetMute, "_FSOUND_GetMute@4"); - F_GETPROC(FSOUND_GetPriority, "_FSOUND_GetPriority@4"); - F_GETPROC(FSOUND_GetReserved, "_FSOUND_GetReserved@4"); - F_GETPROC(FSOUND_GetPaused, "_FSOUND_GetPaused@4"); - F_GETPROC(FSOUND_GetLoopMode, "_FSOUND_GetLoopMode@4"); - F_GETPROC(FSOUND_GetCurrentPosition, "_FSOUND_GetCurrentPosition@4"); - F_GETPROC(FSOUND_GetCurrentSample, "_FSOUND_GetCurrentSample@4"); - F_GETPROC(FSOUND_GetCurrentLevels, "_FSOUND_GetCurrentLevels@12"); - F_GETPROC(FSOUND_GetNumSubChannels, "_FSOUND_GetNumSubChannels@4"); - F_GETPROC(FSOUND_GetSubChannel, "_FSOUND_GetSubChannel@8"); - F_GETPROC(FSOUND_3D_GetAttributes, "_FSOUND_3D_GetAttributes@12"); - F_GETPROC(FSOUND_3D_GetMinMaxDistance, "_FSOUND_3D_GetMinMaxDistance@12"); - F_GETPROC(FSOUND_3D_Listener_SetCurrent, "_FSOUND_3D_Listener_SetCurrent@8"); - F_GETPROC(FSOUND_3D_Listener_SetAttributes, "_FSOUND_3D_Listener_SetAttributes@32"); - F_GETPROC(FSOUND_3D_Listener_GetAttributes, "_FSOUND_3D_Listener_GetAttributes@32"); - F_GETPROC(FSOUND_3D_SetDopplerFactor, "_FSOUND_3D_SetDopplerFactor@4"); - F_GETPROC(FSOUND_3D_SetDistanceFactor, "_FSOUND_3D_SetDistanceFactor@4"); - F_GETPROC(FSOUND_3D_SetRolloffFactor, "_FSOUND_3D_SetRolloffFactor@4"); - F_GETPROC(FSOUND_FX_Enable, "_FSOUND_FX_Enable@8"); - F_GETPROC(FSOUND_FX_Disable, "_FSOUND_FX_Disable@4"); - F_GETPROC(FSOUND_FX_SetChorus, "_FSOUND_FX_SetChorus@32"); - F_GETPROC(FSOUND_FX_SetCompressor, "_FSOUND_FX_SetCompressor@28"); - F_GETPROC(FSOUND_FX_SetDistortion, "_FSOUND_FX_SetDistortion@24"); - F_GETPROC(FSOUND_FX_SetEcho, "_FSOUND_FX_SetEcho@24"); - F_GETPROC(FSOUND_FX_SetFlanger, "_FSOUND_FX_SetFlanger@32"); - F_GETPROC(FSOUND_FX_SetGargle, "_FSOUND_FX_SetGargle@12"); - F_GETPROC(FSOUND_FX_SetI3DL2Reverb, "_FSOUND_FX_SetI3DL2Reverb@52"); - F_GETPROC(FSOUND_FX_SetParamEQ, "_FSOUND_FX_SetParamEQ@16"); - F_GETPROC(FSOUND_FX_SetWavesReverb, "_FSOUND_FX_SetWavesReverb@20"); - F_GETPROC(FSOUND_Stream_Open, "_FSOUND_Stream_Open@16"); - F_GETPROC(FSOUND_Stream_Create, "_FSOUND_Stream_Create@20"); - F_GETPROC(FSOUND_Stream_Play, "_FSOUND_Stream_Play@8"); - F_GETPROC(FSOUND_Stream_PlayEx, "_FSOUND_Stream_PlayEx@16"); - F_GETPROC(FSOUND_Stream_Stop, "_FSOUND_Stream_Stop@4"); - F_GETPROC(FSOUND_Stream_Close, "_FSOUND_Stream_Close@4"); - F_GETPROC(FSOUND_Stream_SetEndCallback, "_FSOUND_Stream_SetEndCallback@12"); - F_GETPROC(FSOUND_Stream_SetSyncCallback, "_FSOUND_Stream_SetSyncCallback@12"); - F_GETPROC(FSOUND_Stream_GetSample, "_FSOUND_Stream_GetSample@4"); - F_GETPROC(FSOUND_Stream_CreateDSP, "_FSOUND_Stream_CreateDSP@16"); - F_GETPROC(FSOUND_Stream_SetBufferSize, "_FSOUND_Stream_SetBufferSize@4"); - F_GETPROC(FSOUND_Stream_SetPosition, "_FSOUND_Stream_SetPosition@8"); - F_GETPROC(FSOUND_Stream_GetPosition, "_FSOUND_Stream_GetPosition@4"); - F_GETPROC(FSOUND_Stream_SetTime, "_FSOUND_Stream_SetTime@8"); - F_GETPROC(FSOUND_Stream_GetTime, "_FSOUND_Stream_GetTime@4"); - F_GETPROC(FSOUND_Stream_GetLength, "_FSOUND_Stream_GetLength@4"); - F_GETPROC(FSOUND_Stream_GetLengthMs, "_FSOUND_Stream_GetLengthMs@4"); - F_GETPROC(FSOUND_Stream_SetMode, "_FSOUND_Stream_SetMode@8"); - F_GETPROC(FSOUND_Stream_GetMode, "_FSOUND_Stream_GetMode@4"); - F_GETPROC(FSOUND_Stream_SetSubStream, "_FSOUND_Stream_SetSubStream@8"); - F_GETPROC(FSOUND_Stream_GetNumSubStreams, "_FSOUND_Stream_GetNumSubStreams@4"); - F_GETPROC(FSOUND_Stream_SetSubStreamSentence, "_FSOUND_Stream_SetSubStreamSentence@12"); - F_GETPROC(FSOUND_Stream_SetLoopPoints, "_FSOUND_Stream_SetLoopPoints@12"); - F_GETPROC(FSOUND_Stream_SetLoopCount, "_FSOUND_Stream_SetLoopCount@8"); - F_GETPROC(FSOUND_Stream_AddSyncPoint, "_FSOUND_Stream_AddSyncPoint@12"); - F_GETPROC(FSOUND_Stream_DeleteSyncPoint, "_FSOUND_Stream_DeleteSyncPoint@4"); - F_GETPROC(FSOUND_Stream_GetNumSyncPoints, "_FSOUND_Stream_GetNumSyncPoints@4"); - F_GETPROC(FSOUND_Stream_GetSyncPoint, "_FSOUND_Stream_GetSyncPoint@8"); - F_GETPROC(FSOUND_Stream_GetSyncPointInfo, "_FSOUND_Stream_GetSyncPointInfo@8"); - F_GETPROC(FSOUND_Stream_GetOpenState, "_FSOUND_Stream_GetOpenState@4"); - F_GETPROC(FSOUND_Stream_GetNumTagFields, "_FSOUND_Stream_GetNumTagFields@8"); - F_GETPROC(FSOUND_Stream_GetTagField, "_FSOUND_Stream_GetTagField@24"); - F_GETPROC(FSOUND_Stream_FindTagField, "_FSOUND_Stream_FindTagField@20"); - F_GETPROC(FSOUND_Stream_Net_SetProxy, "_FSOUND_Stream_Net_SetProxy@4"); - F_GETPROC(FSOUND_Stream_Net_GetLastServerStatus, "_FSOUND_Stream_Net_GetLastServerStatus@0"); - F_GETPROC(FSOUND_Stream_Net_SetBufferProperties, "_FSOUND_Stream_Net_SetBufferProperties@12"); - F_GETPROC(FSOUND_Stream_Net_GetBufferProperties, "_FSOUND_Stream_Net_GetBufferProperties@12"); - F_GETPROC(FSOUND_Stream_Net_SetMetadataCallback, "_FSOUND_Stream_Net_SetMetadataCallback@12"); - F_GETPROC(FSOUND_Stream_Net_GetStatus, "_FSOUND_Stream_Net_GetStatus@20"); - F_GETPROC(FSOUND_CD_Play, "_FSOUND_CD_Play@8"); - F_GETPROC(FSOUND_CD_SetPlayMode, "_FSOUND_CD_SetPlayMode@8"); - F_GETPROC(FSOUND_CD_Stop, "_FSOUND_CD_Stop@4"); - F_GETPROC(FSOUND_CD_SetPaused, "_FSOUND_CD_SetPaused@8"); - F_GETPROC(FSOUND_CD_SetVolume, "_FSOUND_CD_SetVolume@8"); - F_GETPROC(FSOUND_CD_SetTrackTime, "_FSOUND_CD_SetTrackTime@8"); - F_GETPROC(FSOUND_CD_OpenTray, "_FSOUND_CD_OpenTray@8"); - F_GETPROC(FSOUND_CD_GetPaused, "_FSOUND_CD_GetPaused@4"); - F_GETPROC(FSOUND_CD_GetTrack, "_FSOUND_CD_GetTrack@4"); - F_GETPROC(FSOUND_CD_GetNumTracks, "_FSOUND_CD_GetNumTracks@4"); - F_GETPROC(FSOUND_CD_GetVolume, "_FSOUND_CD_GetVolume@4"); - F_GETPROC(FSOUND_CD_GetTrackLength, "_FSOUND_CD_GetTrackLength@8"); - F_GETPROC(FSOUND_CD_GetTrackTime, "_FSOUND_CD_GetTrackTime@4"); - F_GETPROC(FSOUND_DSP_Create, "_FSOUND_DSP_Create@12"); - F_GETPROC(FSOUND_DSP_Free, "_FSOUND_DSP_Free@4"); - F_GETPROC(FSOUND_DSP_SetPriority, "_FSOUND_DSP_SetPriority@8"); - F_GETPROC(FSOUND_DSP_GetPriority, "_FSOUND_DSP_GetPriority@4"); - F_GETPROC(FSOUND_DSP_SetActive, "_FSOUND_DSP_SetActive@8"); - F_GETPROC(FSOUND_DSP_GetActive, "_FSOUND_DSP_GetActive@4"); - F_GETPROC(FSOUND_DSP_GetClearUnit, "_FSOUND_DSP_GetClearUnit@0"); - F_GETPROC(FSOUND_DSP_GetSFXUnit, "_FSOUND_DSP_GetSFXUnit@0"); - F_GETPROC(FSOUND_DSP_GetMusicUnit, "_FSOUND_DSP_GetMusicUnit@0"); - F_GETPROC(FSOUND_DSP_GetClipAndCopyUnit, "_FSOUND_DSP_GetClipAndCopyUnit@0"); - F_GETPROC(FSOUND_DSP_GetFFTUnit, "_FSOUND_DSP_GetFFTUnit@0"); - F_GETPROC(FSOUND_DSP_MixBuffers, "_FSOUND_DSP_MixBuffers@28"); - F_GETPROC(FSOUND_DSP_ClearMixBuffer, "_FSOUND_DSP_ClearMixBuffer@0"); - F_GETPROC(FSOUND_DSP_GetBufferLength, "_FSOUND_DSP_GetBufferLength@0"); - F_GETPROC(FSOUND_DSP_GetBufferLengthTotal, "_FSOUND_DSP_GetBufferLengthTotal@0"); - F_GETPROC(FSOUND_DSP_GetSpectrum, "_FSOUND_DSP_GetSpectrum@0"); - F_GETPROC(FSOUND_Reverb_SetProperties, "_FSOUND_Reverb_SetProperties@4"); - F_GETPROC(FSOUND_Reverb_GetProperties, "_FSOUND_Reverb_GetProperties@4"); - F_GETPROC(FSOUND_Reverb_SetChannelProperties, "_FSOUND_Reverb_SetChannelProperties@8"); - F_GETPROC(FSOUND_Reverb_GetChannelProperties, "_FSOUND_Reverb_GetChannelProperties@8"); - F_GETPROC(FSOUND_Record_SetDriver, "_FSOUND_Record_SetDriver@4"); - F_GETPROC(FSOUND_Record_GetNumDrivers, "_FSOUND_Record_GetNumDrivers@0"); - F_GETPROC(FSOUND_Record_GetDriverName, "_FSOUND_Record_GetDriverName@4"); - F_GETPROC(FSOUND_Record_GetDriver, "_FSOUND_Record_GetDriver@0"); - F_GETPROC(FSOUND_Record_StartSample, "_FSOUND_Record_StartSample@8"); - F_GETPROC(FSOUND_Record_Stop, "_FSOUND_Record_Stop@0"); - F_GETPROC(FSOUND_Record_GetPosition, "_FSOUND_Record_GetPosition@0"); - F_GETPROC(FSOUND_File_SetCallbacks, "_FSOUND_File_SetCallbacks@20"); - F_GETPROC(FMUSIC_LoadSong, "_FMUSIC_LoadSong@4"); - F_GETPROC(FMUSIC_LoadSongEx, "_FMUSIC_LoadSongEx@24"); - F_GETPROC(FMUSIC_GetOpenState, "_FMUSIC_GetOpenState@4"); - F_GETPROC(FMUSIC_FreeSong, "_FMUSIC_FreeSong@4"); - F_GETPROC(FMUSIC_PlaySong, "_FMUSIC_PlaySong@4"); - F_GETPROC(FMUSIC_StopSong, "_FMUSIC_StopSong@4"); - F_GETPROC(FMUSIC_StopAllSongs, "_FMUSIC_StopAllSongs@0"); - F_GETPROC(FMUSIC_SetZxxCallback, "_FMUSIC_SetZxxCallback@8"); - F_GETPROC(FMUSIC_SetRowCallback, "_FMUSIC_SetRowCallback@12"); - F_GETPROC(FMUSIC_SetOrderCallback, "_FMUSIC_SetOrderCallback@12"); - F_GETPROC(FMUSIC_SetInstCallback, "_FMUSIC_SetInstCallback@12"); - F_GETPROC(FMUSIC_SetSample, "_FMUSIC_SetSample@12"); - F_GETPROC(FMUSIC_SetUserData, "_FMUSIC_SetUserData@8"); - F_GETPROC(FMUSIC_OptimizeChannels, "_FMUSIC_OptimizeChannels@12"); - F_GETPROC(FMUSIC_SetReverb, "_FMUSIC_SetReverb@4"); - F_GETPROC(FMUSIC_SetLooping, "_FMUSIC_SetLooping@8"); - F_GETPROC(FMUSIC_SetOrder, "_FMUSIC_SetOrder@8"); - F_GETPROC(FMUSIC_SetPaused, "_FMUSIC_SetPaused@8"); - F_GETPROC(FMUSIC_SetMasterVolume, "_FMUSIC_SetMasterVolume@8"); - F_GETPROC(FMUSIC_SetMasterSpeed, "_FMUSIC_SetMasterSpeed@8"); - F_GETPROC(FMUSIC_SetPanSeperation, "_FMUSIC_SetPanSeperation@8"); - F_GETPROC(FMUSIC_GetName, "_FMUSIC_GetName@4"); - F_GETPROC(FMUSIC_GetType, "_FMUSIC_GetType@4"); - F_GETPROC(FMUSIC_GetNumOrders, "_FMUSIC_GetNumOrders@4"); - F_GETPROC(FMUSIC_GetNumPatterns, "_FMUSIC_GetNumPatterns@4"); - F_GETPROC(FMUSIC_GetNumInstruments, "_FMUSIC_GetNumInstruments@4"); - F_GETPROC(FMUSIC_GetNumSamples, "_FMUSIC_GetNumSamples@4"); - F_GETPROC(FMUSIC_GetNumChannels, "_FMUSIC_GetNumChannels@4"); - F_GETPROC(FMUSIC_GetSample, "_FMUSIC_GetSample@8"); - F_GETPROC(FMUSIC_GetPatternLength, "_FMUSIC_GetPatternLength@8"); - F_GETPROC(FMUSIC_IsFinished, "_FMUSIC_IsFinished@4"); - F_GETPROC(FMUSIC_IsPlaying, "_FMUSIC_IsPlaying@4"); - F_GETPROC(FMUSIC_GetMasterVolume, "_FMUSIC_GetMasterVolume@4"); - F_GETPROC(FMUSIC_GetGlobalVolume, "_FMUSIC_GetGlobalVolume@4"); - F_GETPROC(FMUSIC_GetOrder, "_FMUSIC_GetOrder@4"); - F_GETPROC(FMUSIC_GetPattern, "_FMUSIC_GetPattern@4"); - F_GETPROC(FMUSIC_GetSpeed, "_FMUSIC_GetSpeed@4"); - F_GETPROC(FMUSIC_GetBPM, "_FMUSIC_GetBPM@4"); - F_GETPROC(FMUSIC_GetRow, "_FMUSIC_GetRow@4"); - F_GETPROC(FMUSIC_GetPaused, "_FMUSIC_GetPaused@4"); - F_GETPROC(FMUSIC_GetTime, "_FMUSIC_GetTime@4"); - F_GETPROC(FMUSIC_GetRealChannel, "_FMUSIC_GetRealChannel@8"); - F_GETPROC(FMUSIC_GetUserData, "_FMUSIC_GetUserData@4"); - - return instance; -} - -static void FMOD_FreeInstance(FMOD_INSTANCE *instance) -{ - if (instance) - { - if (instance->module) - { -#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(_WIN64) - FreeLibrary((HMODULE)instance->module); -#else - dlclose(instance->module); -#endif - } - free(instance); - } -} - -#endif - - diff --git a/Source/openal_wrapper.cpp b/Source/openal_wrapper.cpp index 9f8debc..883a5ab 100644 --- a/Source/openal_wrapper.cpp +++ b/Source/openal_wrapper.cpp @@ -19,27 +19,18 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - #if USE_OPENAL #include #include #include -#include "MacCompatibility.h" -#include "fmod.h" - -#include "AL/al.h" -#include "AL/alc.h" - -#include "ogg/ogg.h" -#include "vorbis/vorbisfile.h" +#include "openal_wrapper.h" // NOTE: // FMOD uses a Left Handed Coordinate system, OpenAL uses a Right Handed // one...so we just need to flip the sign on the Z axis when appropriate. - #define DYNAMIC_LOAD_OPENAL 0 #if DYNAMIC_LOAD_OPENAL @@ -107,38 +98,36 @@ static bool lookup_all_alsyms(const char *libname) #define unload_alsyms() #endif - typedef struct { ALuint sid; - FSOUND_SAMPLE *sample; + OPENAL_SAMPLE *sample; bool startpaused; float position[3]; } OPENAL_Channels; -typedef struct FSOUND_SAMPLE +typedef struct OPENAL_SAMPLE { char *name; ALuint bid; // buffer id. int mode; int is2d; float min_distance; -} FSOUND_SAMPLE; +} OPENAL_SAMPLE; -typedef struct FSOUND_STREAM +typedef struct OPENAL_STREAM { char *name; ALuint bid; // buffer id. int mode; int is2d; -} FSOUND_STREAM; +} OPENAL_STREAM; static size_t num_channels = 0; static OPENAL_Channels *channels = NULL; static bool initialized = false; static float listener_position[3]; - static inline bool source_too_close(const int channel) { const OPENAL_Channels *chan = &channels[channel]; @@ -159,7 +148,7 @@ static void set_channel_position(const int channel, const float x, chan->position[1] = y; chan->position[2] = z; - FSOUND_SAMPLE *sptr = chan->sample; + OPENAL_SAMPLE *sptr = chan->sample; if (sptr == NULL) return; @@ -179,7 +168,7 @@ static void set_channel_position(const int channel, const float x, } -void F_API OPENAL_3D_Listener_SetAttributes(const float *pos, const float *vel, float fx, float fy, float fz, float tx, float ty, float tz) +AL_API void OPENAL_3D_Listener_SetAttributes(const float *pos, const float *vel, float fx, float fy, float fz, float tx, float ty, float tz) { if (!initialized) return; if (pos != NULL) @@ -203,7 +192,7 @@ void F_API OPENAL_3D_Listener_SetAttributes(const float *pos, const float *vel, } } -signed char F_API OPENAL_3D_SetAttributes(int channel, const float *pos, const float *vel) +AL_API signed char OPENAL_3D_SetAttributes(int channel, const float *pos, const float *vel) { if (!initialized) return false; if ((channel < 0) || (channel >= num_channels)) return false; @@ -216,13 +205,13 @@ signed char F_API OPENAL_3D_SetAttributes(int channel, const float *pos, const f return true; } -void F_API OPENAL_3D_SetDopplerFactor(float scale) +AL_API void OPENAL_3D_SetDopplerFactor(float scale) { if (!initialized) return; // unimplemented...looks like init routines just call this with scale == 0.0f anyhow. } -signed char F_API OPENAL_Init(int mixrate, int maxsoftwarechannels, unsigned int flags) +AL_API signed char OPENAL_Init(int mixrate, int maxsoftwarechannels, unsigned int flags) { if (initialized) return false; if (maxsoftwarechannels == 0) return false; @@ -273,7 +262,7 @@ signed char F_API OPENAL_Init(int mixrate, int maxsoftwarechannels, unsigned int return true; } -void F_API OPENAL_Close() +AL_API void OPENAL_Close() { if (!initialized) return; @@ -301,14 +290,14 @@ void F_API OPENAL_Close() initialized = false; } -FSOUND_SAMPLE *F_API OPENAL_GetCurrentSample(int channel) +AL_API OPENAL_SAMPLE *OPENAL_GetCurrentSample(int channel) { if (!initialized) return NULL; if ((channel < 0) || (channel >= num_channels)) return NULL; return channels[channel].sample; } -signed char F_API OPENAL_GetPaused(int channel) +AL_API signed char OPENAL_GetPaused(int channel) { if (!initialized) return false; if ((channel < 0) || (channel >= num_channels)) return false; @@ -320,18 +309,18 @@ signed char F_API OPENAL_GetPaused(int channel) return((state == AL_PAUSED) ? true : false); } -unsigned int F_API OPENAL_GetLoopMode(int channel) +AL_API unsigned int OPENAL_GetLoopMode(int channel) { if (!initialized) return 0; if ((channel < 0) || (channel >= num_channels)) return 0; ALint loop = 0; alGetSourceiv(channels[channel].sid, AL_LOOPING, &loop); if (loop) - return(FSOUND_LOOP_NORMAL); - return FSOUND_LOOP_OFF; + return(OPENAL_LOOP_NORMAL); + return OPENAL_LOOP_OFF; } -signed char F_API OPENAL_IsPlaying(int channel) +AL_API signed char OPENAL_IsPlaying(int channel) { if (!initialized) return false; if ((channel < 0) || (channel >= num_channels)) return false; @@ -340,12 +329,12 @@ signed char F_API OPENAL_IsPlaying(int channel) return((state == AL_PLAYING) ? true : false); } -int F_API OPENAL_PlaySoundEx(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused) +AL_API int OPENAL_PlaySoundEx(int channel, OPENAL_SAMPLE *sptr, OPENAL_DSPUNIT *dsp, signed char startpaused) { if (!initialized) return -1; if (sptr == NULL) return -1; if (dsp != NULL) return -1; - if (channel == FSOUND_FREE) + if (channel == OPENAL_FREE) { for (int i = 0; i < num_channels; i++) { @@ -363,7 +352,7 @@ int F_API OPENAL_PlaySoundEx(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *d alSourceStop(channels[channel].sid); channels[channel].sample = sptr; alSourcei(channels[channel].sid, AL_BUFFER, sptr->bid); - alSourcei(channels[channel].sid, AL_LOOPING, (sptr->mode == FSOUND_LOOP_OFF) ? AL_FALSE : AL_TRUE); + alSourcei(channels[channel].sid, AL_LOOPING, (sptr->mode == OPENAL_LOOP_OFF) ? AL_FALSE : AL_TRUE); set_channel_position(channel, 0.0f, 0.0f, 0.0f); channels[channel].startpaused = ((startpaused) ? true : false); @@ -467,15 +456,15 @@ static void *decode_to_pcm(const char *_fname, ALenum &format, ALsizei &size, AL } -FSOUND_SAMPLE * F_API OPENAL_Sample_Load(int index, const char *name_or_data, unsigned int mode, int offset, int length) +AL_API OPENAL_SAMPLE *OPENAL_Sample_Load(int index, const char *name_or_data, unsigned int mode, int offset, int length) { if (!initialized) return NULL; - if (index != FSOUND_FREE) return NULL; // this is all the game does... + if (index != OPENAL_FREE) return NULL; // this is all the game does... if (offset != 0) return NULL; // this is all the game does... if (length != 0) return NULL; // this is all the game does... - if ((mode != FSOUND_HW3D) && (mode != FSOUND_2D)) return NULL; // this is all the game does... + if ((mode != OPENAL_HW3D) && (mode != OPENAL_2D)) return NULL; // this is all the game does... - FSOUND_SAMPLE *retval = NULL; + OPENAL_SAMPLE *retval = NULL; ALuint bufferName = 0; ALenum format = AL_NONE; ALsizei size = 0; @@ -490,10 +479,10 @@ FSOUND_SAMPLE * F_API OPENAL_Sample_Load(int index, const char *name_or_data, un if (alGetError() == AL_NO_ERROR) { alBufferData(bid, format, data, size, frequency); - retval = new FSOUND_SAMPLE; + retval = new OPENAL_SAMPLE; retval->bid = bid; - retval->mode = FSOUND_LOOP_OFF; - retval->is2d = (mode == FSOUND_2D); + retval->mode = OPENAL_LOOP_OFF; + retval->is2d = (mode == OPENAL_2D); retval->name = new char[strlen(name_or_data) + 1]; if (retval->name) strcpy(retval->name, name_or_data); @@ -503,7 +492,7 @@ FSOUND_SAMPLE * F_API OPENAL_Sample_Load(int index, const char *name_or_data, un return(retval); } -void F_API OPENAL_Sample_Free(FSOUND_SAMPLE *sptr) +AL_API void OPENAL_Sample_Free(OPENAL_SAMPLE *sptr) { if (!initialized) return; if (sptr) @@ -523,16 +512,16 @@ void F_API OPENAL_Sample_Free(FSOUND_SAMPLE *sptr) } } -signed char F_API OPENAL_Sample_SetMode(FSOUND_SAMPLE *sptr, unsigned int mode) +AL_API signed char OPENAL_Sample_SetMode(OPENAL_SAMPLE *sptr, unsigned int mode) { if (!initialized) return false; - if ((mode != FSOUND_LOOP_NORMAL) && (mode != FSOUND_LOOP_OFF)) return false; + if ((mode != OPENAL_LOOP_NORMAL) && (mode != OPENAL_LOOP_OFF)) return false; if (!sptr) return false; sptr->mode = mode; return true; } -signed char F_API OPENAL_Sample_SetMinMaxDistance(FSOUND_SAMPLE *sptr, float mindist, float maxdist) +AL_API signed char OPENAL_Sample_SetMinMaxDistance(OPENAL_SAMPLE *sptr, float mindist, float maxdist) { if (!initialized) return false; if (sptr == NULL) return false; @@ -553,10 +542,10 @@ signed char F_API OPENAL_Sample_SetMinMaxDistance(FSOUND_SAMPLE *sptr, float min return 0; } -signed char F_API OPENAL_SetFrequency(int channel, int freq) +AL_API signed char OPENAL_SetFrequency(int channel, int freq) { if (!initialized) return false; - if (channel == FSOUND_ALL) + if (channel == OPENAL_ALL) { for (int i = 0; i < num_channels; i++) OPENAL_SetFrequency(i, freq); @@ -571,11 +560,11 @@ signed char F_API OPENAL_SetFrequency(int channel, int freq) return true; } -signed char F_API OPENAL_SetVolume(int channel, int vol) +AL_API signed char OPENAL_SetVolume(int channel, int vol) { if (!initialized) return false; - if (channel == FSOUND_ALL) + if (channel == OPENAL_ALL) { for (int i = 0; i < num_channels; i++) OPENAL_SetVolume(i, vol); @@ -591,11 +580,11 @@ signed char F_API OPENAL_SetVolume(int channel, int vol) return true; } -signed char F_API OPENAL_SetPaused(int channel, signed char paused) +AL_API signed char OPENAL_SetPaused(int channel, signed char paused) { if (!initialized) return false; - if (channel == FSOUND_ALL) + if (channel == OPENAL_ALL) { for (int i = 0; i < num_channels; i++) OPENAL_SetPaused(i, paused); @@ -620,18 +609,18 @@ signed char F_API OPENAL_SetPaused(int channel, signed char paused) return true; } -void F_API OPENAL_SetSFXMasterVolume(int volume) +AL_API void OPENAL_SetSFXMasterVolume(int volume) { if (!initialized) return; ALfloat gain = ((ALfloat) volume) / 255.0f; alListenerf(AL_GAIN, gain); } -signed char F_API OPENAL_StopSound(int channel) +AL_API signed char OPENAL_StopSound(int channel) { if (!initialized) return false; - if (channel == FSOUND_ALL) + if (channel == OPENAL_ALL) { for (int i = 0; i < num_channels; i++) OPENAL_StopSound(i); @@ -644,33 +633,33 @@ signed char F_API OPENAL_StopSound(int channel) return true; } -FSOUND_STREAM * F_API OPENAL_Stream_Open(const char *name_or_data, unsigned int mode, int offset, int length) +AL_API OPENAL_STREAM *OPENAL_Stream_Open(const char *name_or_data, unsigned int mode, int offset, int length) { - return (FSOUND_STREAM *) OPENAL_Sample_Load(FSOUND_FREE, name_or_data, mode, offset, length); + return (OPENAL_STREAM *) OPENAL_Sample_Load(OPENAL_FREE, name_or_data, mode, offset, length); } -signed char F_API OPENAL_Stream_Close(FSOUND_STREAM *stream) +AL_API signed char OPENAL_Stream_Close(OPENAL_STREAM *stream) { - OPENAL_Sample_Free((FSOUND_SAMPLE *) stream); + OPENAL_Sample_Free((OPENAL_SAMPLE *) stream); } -FSOUND_SAMPLE * F_API OPENAL_Stream_GetSample(FSOUND_STREAM *stream) +AL_API OPENAL_SAMPLE *OPENAL_Stream_GetSample(OPENAL_STREAM *stream) { if (!initialized) return NULL; - return (FSOUND_SAMPLE *) stream; + return (OPENAL_SAMPLE *) stream; } -int F_API OPENAL_Stream_PlayEx(int channel, FSOUND_STREAM *stream, FSOUND_DSPUNIT *dsp, signed char startpaused) +AL_API int OPENAL_Stream_PlayEx(int channel, OPENAL_STREAM *stream, OPENAL_DSPUNIT *dsp, signed char startpaused) { - return OPENAL_PlaySoundEx(channel, (FSOUND_SAMPLE *) stream, dsp, startpaused); + return OPENAL_PlaySoundEx(channel, (OPENAL_SAMPLE *) stream, dsp, startpaused); } -signed char F_API OPENAL_Stream_Stop(FSOUND_STREAM *stream) +AL_API signed char OPENAL_Stream_Stop(OPENAL_STREAM *stream) { if (!initialized) return false; for (int i = 0; i < num_channels; i++) { - if (channels[i].sample == (FSOUND_SAMPLE *) stream) + if (channels[i].sample == (OPENAL_SAMPLE *) stream) { alSourceStop(channels[i].sid); channels[i].startpaused = false; @@ -679,18 +668,18 @@ signed char F_API OPENAL_Stream_Stop(FSOUND_STREAM *stream) return true; } -signed char F_API OPENAL_Stream_SetMode(FSOUND_STREAM *stream, unsigned int mode) +AL_API signed char OPENAL_Stream_SetMode(OPENAL_STREAM *stream, unsigned int mode) { - return OPENAL_Sample_SetMode((FSOUND_SAMPLE *) stream, mode); + return OPENAL_Sample_SetMode((OPENAL_SAMPLE *) stream, mode); } -void F_API OPENAL_Update() +AL_API void OPENAL_Update() { if (!initialized) return; alcProcessContext(alcGetCurrentContext()); } -signed char F_API OPENAL_SetOutput(int outputtype) +AL_API signed char OPENAL_SetOutput(int outputtype) { return true; } diff --git a/Source/openal_wrapper.h b/Source/openal_wrapper.h new file mode 100644 index 0000000..08ab1be --- /dev/null +++ b/Source/openal_wrapper.h @@ -0,0 +1,104 @@ +#ifndef OPENAL_WRAPPER_H +#define OPENAL_WRAPPER_H + +#include "AL/al.h" +#include "AL/alc.h" + +#include "ogg/ogg.h" +#include "vorbis/vorbisfile.h" + +#include "MacCompatibility.h" + +#if 0 /* this should only be enable if OPENAL doesn't provide AL_API on all platforms */ +#if (!defined(WIN32) && !defined(_WIN32) && !defined(__WIN32__) && !defined(_WIN64) && !defined(_WIN32_WCE) && !defined(_XBOX)) || (defined(__GNUC__) && defined(WIN32)) +#ifndef __cdecl +#define __cdecl +#endif +#ifndef __stdcall +#define __stdcall +#endif +#endif + +#if defined(_WIN32_WCE) +#define AL_API _cdecl +#define F_CALLBACKAPI _cdecl +#else +#define AL_API __stdcall +#define F_CALLBACKAPI __stdcall +#endif + +#ifdef DLL_EXPORTS +#define DLL_API __declspec(dllexport) +#else +#if defined(__LCC__) || defined(__MINGW32__) || defined(__CYGWIN32__) +#define DLL_API AL_API +#else +#define DLL_API +#endif /* __LCC__ || __MINGW32__ || __CYGWIN32__ */ +#endif /* DLL_EXPORTS */ +#endif /* if 0 */ + + +typedef struct OPENAL_SAMPLE OPENAL_SAMPLE; +typedef struct OPENAL_STREAM OPENAL_STREAM; +typedef struct OPENAL_DSPUNIT OPENAL_DSPUNIT; + +enum OPENAL_OUTPUTTYPES +{ + OPENAL_OUTPUT_NOSOUND, /* NoSound driver, all calls to this succeed but do nothing. */ + OPENAL_OUTPUT_OSS, /* Linux/Unix OSS (Open Sound System) driver, i.e. the kernel sound drivers. */ + OPENAL_OUTPUT_ALSA, /* Linux Alsa driver. */ +}; + +#define OPENAL_LOOP_OFF 0x00000001 /* For non looping samples. */ +#define OPENAL_LOOP_NORMAL 0x00000002 /* For forward looping samples. */ +#define OPENAL_HW3D 0x00001000 /* Attempts to make samples use 3d hardware acceleration. (if the card supports it) */ +#define OPENAL_2D 0x00002000 /* Tells software (not hardware) based sample not to be included in 3d processing. */ +#define OPENAL_FREE -1 /* value to play on any free channel, or to allocate a sample in a free sample slot. */ +#define OPENAL_ALL -3 /* for a channel index , this flag will affect ALL channels available! Not supported by every function. */ + +#ifdef __cplusplus +extern "C" { +#endif + +AL_API void OPENAL_3D_Listener_SetAttributes(const float *pos, const float *vel, float fx, float fy, float fz, float tx, float ty, float tz); +AL_API signed char OPENAL_3D_SetAttributes(int channel, const float *pos, const float *vel); +AL_API void OPENAL_3D_SetDopplerFactor(float scale); +AL_API signed char OPENAL_Init(int mixrate, int maxsoftwarechannels, unsigned int flags); +AL_API void OPENAL_Close(); +AL_API OPENAL_SAMPLE *OPENAL_GetCurrentSample(int channel); +AL_API signed char OPENAL_GetPaused(int channel); +AL_API unsigned int OPENAL_GetLoopMode(int channel); +AL_API signed char OPENAL_IsPlaying(int channel); +AL_API int OPENAL_PlaySoundEx(int channel, OPENAL_SAMPLE *sptr, OPENAL_DSPUNIT *dsp, signed char startpaused); +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); +AL_API void OPENAL_SetSFXMasterVolume(int volume); +AL_API signed char OPENAL_StopSound(int channel); +AL_API OPENAL_STREAM *OPENAL_Stream_Open(const char *name_or_data, unsigned int mode, int offset, int length); +AL_API signed char OPENAL_Stream_Close(OPENAL_STREAM *stream); +AL_API OPENAL_SAMPLE *OPENAL_Stream_GetSample(OPENAL_STREAM *stream); +AL_API int OPENAL_Stream_PlayEx(int channel, OPENAL_STREAM *stream, OPENAL_DSPUNIT *dsp, signed char startpaused); +AL_API signed char OPENAL_Stream_Stop(OPENAL_STREAM *stream); +AL_API signed char OPENAL_Stream_SetMode(OPENAL_STREAM *stream, unsigned int mode); +AL_API void OPENAL_Update(); +AL_API signed char OPENAL_SetOutput(int outputtype); + +#ifdef __cplusplus +} +#endif + +#if USE_OPENAL +# define OPENAL_Sample_LoadEx(a, b, c, d, e) OPENAL_Sample_Load( a, ConvertFileName( b), c, d, e) +# define OPENAL_Stream_OpenEx(a, b, c, d) OPENAL_Stream_Open(ConvertFileName(a), b, c, d) +#elif !PLATFORM_MACOSX +# define OPENAL_Sample_LoadEx(a, b, c, d, e) FSOUND_Sample_Load( a, ConvertFileName( b), c, d, e) +# define OPENAL_Stream_OpenEx(a, b, c, d) FSOUND_Stream_Open(ConvertFileName(a), b, c, d) +#endif + +#endif