]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Audio/Sounds.cpp
Added braces to all statements with clang-tidy and ran clang-format again
[lugaru.git] / Source / Audio / Sounds.cpp
index 063e0c81b0d9d862d1fc8bbe7b3d1995b193af4f..4d8510a7c2ad56aaf7abaa53c58c6141216478c5 100644 (file)
@@ -22,7 +22,7 @@ along with Lugaru.  If not, see <http://www.gnu.org/licenses/>.
 #include "Audio/openal_wrapper.hpp"
 #include "Utils/Folders.hpp"
 
-struct OPENAL_SAMPLE *samp[sounds_count];
+struct OPENAL_SAMPLEsamp[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 charsound_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 XYZpos, 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 XYZpos, 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);
 }