]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Skeleton.cpp
Cleaned up handling of envsounds array through a function
[lugaru.git] / Source / Skeleton.cpp
index c7c9eb00912c0e15c78bcf6aaeb798b49c7b764b..af343d6b3261b3a405f876f877e665a7a6813c85 100644 (file)
@@ -26,17 +26,12 @@ along with Lugaru.  If not, see <http://www.gnu.org/licenses/>.
 
 extern float multiplier;
 extern float gravity;
-extern Skeleton testskeleton;
 extern Terrain terrain;
 extern Objects objects;
 extern int environment;
 extern float camerashake;
 extern bool freeze;
 extern int detail;
-extern XYZ envsound[30];
-extern float envsoundvol[30];
-extern int numenvsounds;
-extern float envsoundlife[30];
 extern int tutoriallevel;
 
 extern int whichjointstartarray[26];
@@ -351,10 +346,7 @@ float Skeleton::DoConstraints(XYZ *coords, float *scale)
 
                             emit_sound_at(breaksound2, joints[i].position * (*scale) + *coords);
 
-                            envsound[numenvsounds] = *coords;
-                            envsoundvol[numenvsounds] = 64;
-                            envsoundlife[numenvsounds] = .4;
-                            numenvsounds++;
+                            addEnvSound(*coords, 64);
                         }
 
                     if (findLengthfast(&bounceness) > 2500) {
@@ -439,10 +431,7 @@ float Skeleton::DoConstraints(XYZ *coords, float *scale)
 
                                             emit_sound_at(breaksound2, joints[i].position * (*scale) + *coords);
 
-                                            envsound[numenvsounds] = *coords;
-                                            envsoundvol[numenvsounds] = 64;
-                                            envsoundlife[numenvsounds] = .4;
-                                            numenvsounds++;
+                                            addEnvSound(*coords, 64);
                                         }
                                     if (objects.type[k] == treetrunktype) {
                                         objects.rotx[k] += joints[i].velocity.x * multiplier * .4;