X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FAudio%2FSounds.cpp;h=4d8510a7c2ad56aaf7abaa53c58c6141216478c5;hb=b9a46d8e2b7e7e22c706e7dd3734f31015db4408;hp=063e0c81b0d9d862d1fc8bbe7b3d1995b193af4f;hpb=ed3662c0852c4312a612b4fc35bd03aba8d13db7;p=lugaru.git diff --git a/Source/Audio/Sounds.cpp b/Source/Audio/Sounds.cpp index 063e0c8..4d8510a 100644 --- a/Source/Audio/Sounds.cpp +++ b/Source/Audio/Sounds.cpp @@ -22,7 +22,7 @@ along with Lugaru. If not, see . #include "Audio/openal_wrapper.hpp" #include "Utils/Folders.hpp" -struct OPENAL_SAMPLE *samp[sounds_count]; +struct OPENAL_SAMPLE* samp[sounds_count]; extern XYZ envsound[30]; extern float envsoundvol[30]; @@ -33,7 +33,7 @@ int footstepsound, footstepsound2, footstepsound3, footstepsound4; int channels[100]; -static const char *sound_data[sounds_count] = { +static const char* sound_data[sounds_count] = { #define DECLARE_SOUND(id, filename) filename, #include "Sounds.def" #undef DECLARE_SOUND @@ -44,14 +44,14 @@ static const char *sound_data[sounds_count] = { static int snd_mode(int snd) { switch (snd) { - case alarmsound: - case consolefailsound: - case consolesuccesssound: - case firestartsound: - case fireendsound: - return OPENAL_2D; - default: - return OPENAL_HW3D; + case alarmsound: + case consolefailsound: + case consolesuccesssound: + case firestartsound: + case fireendsound: + return OPENAL_2D; + default: + return OPENAL_HW3D; } } @@ -70,8 +70,9 @@ void loadAllSounds() footstepsound4 = footstepst2; // Huh? // OPENAL_Sample_SetMode(samp[whooshsound], OPENAL_LOOP_NORMAL); - for (int i = stream_firesound; i <= stream_menutheme; i++) + for (int i = stream_firesound; i <= stream_menutheme; i++) { OPENAL_Stream_SetMode(samp[i], OPENAL_LOOP_NORMAL); + } } void addEnvSound(XYZ coords, float vol, float life) @@ -82,42 +83,42 @@ void addEnvSound(XYZ coords, float vol, float life) numenvsounds++; } -void emit_sound_at(int soundid, const XYZ &pos, float vol) +void emit_sound_at(int soundid, const XYZ& pos, float vol) { - PlaySoundEx (soundid, samp[soundid], NULL, true); - OPENAL_3D_SetAttributes_ (channels[soundid], pos, NULL); - OPENAL_SetVolume (channels[soundid], vol); - OPENAL_SetPaused (channels[soundid], false); + PlaySoundEx(soundid, samp[soundid], NULL, true); + OPENAL_3D_SetAttributes_(channels[soundid], pos); + OPENAL_SetVolume(channels[soundid], vol); + OPENAL_SetPaused(channels[soundid], false); } void emit_sound_np(int soundid, float vol) { - PlaySoundEx (soundid, samp[soundid], NULL, true); - OPENAL_SetVolume (channels[soundid], vol); - OPENAL_SetPaused (channels[soundid], false); + PlaySoundEx(soundid, samp[soundid], NULL, true); + OPENAL_SetVolume(channels[soundid], vol); + OPENAL_SetPaused(channels[soundid], false); } -void emit_stream_at(int soundid, const XYZ &pos, float vol) +void emit_stream_at(int soundid, const XYZ& pos, float vol) { - PlayStreamEx (soundid, samp[soundid], NULL, true); - OPENAL_3D_SetAttributes_ (channels[soundid], pos, NULL); - OPENAL_SetVolume (channels[soundid], vol); - OPENAL_SetPaused (channels[soundid], false); + PlayStreamEx(soundid, samp[soundid], NULL, true); + OPENAL_3D_SetAttributes_(channels[soundid], pos); + OPENAL_SetVolume(channels[soundid], vol); + OPENAL_SetPaused(channels[soundid], false); } void emit_stream_np(int soundid, float vol) { - PlayStreamEx (soundid, samp[soundid], NULL, true); - OPENAL_SetVolume (channels[soundid], vol); - OPENAL_SetPaused (channels[soundid], false); + PlayStreamEx(soundid, samp[soundid], NULL, true); + OPENAL_SetVolume(channels[soundid], vol); + OPENAL_SetPaused(channels[soundid], false); } void resume_stream(int soundid) { - OPENAL_SetPaused (channels[soundid], false); + OPENAL_SetPaused(channels[soundid], false); } void pause_sound(int soundid) { - OPENAL_SetPaused (channels[soundid], true); + OPENAL_SetPaused(channels[soundid], true); }