]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Person.cpp
Remove some extra declarations of "channels"
[lugaru.git] / Source / Person.cpp
index 2c704158607f3182cc86ed021172ba997bd3555d..66d268ff75f592e4a3f4de9c509c09e4b120fc26 100644 (file)
@@ -28,7 +28,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "Game.h"
 
 extern float multiplier;
-extern int channels[100];
 extern Terrain terrain;
 extern float gravity;
 extern int environment;
@@ -123,7 +122,8 @@ void Person::CheckKick()
       velocity=facing*-10;
       velocity.y=5;
       skeleton.free=0;
-      if(id==0)OPENAL_SetPaused(channels[whooshsound], false);
+      if(id==0)
+       resume_stream(whooshsound);
 
       award_bonus(id, cannon);
     }
@@ -1501,7 +1501,7 @@ void      Person::DoAnimations(){
                        if(targetanimation==rollanim&&targetframe==3&&onfire){
                                onfire=0;
                                emit_sound_at(fireendsound, coords);
-                               OPENAL_SetPaused(channels[stream_firesound], true);
+                               pause_sound(stream_firesound);
                                deathbleeding=0;
                        }
 
@@ -3340,7 +3340,8 @@ void      Person::DoAnimations(){
                                                                                targetframe=3;
                                                                                velocity=facing*-8;
                                                                                velocity.y=4;
-                                                                               if(id==0)OPENAL_SetPaused(channels[whooshsound], false);
+                                                                               if(id==0)
+                                                                                 resume_stream(whooshsound);
                                                                        }
                                                                        if(targetanimation==walljumprightanim){
                                                                                targetanimation=rightflipanim;
@@ -3358,7 +3359,8 @@ void      Person::DoAnimations(){
                                                                                velocity=facing*8;
                                                                                velocity.y=4;
                                                                        }
-                                                                       if(id==0)OPENAL_SetPaused(channels[whooshsound], false);
+                                                                       if(id==0)
+                                                                         resume_stream(whooshsound);
                                                                }
                                                                if(targetanimation==walljumpleftanim){
                                                                        if(attackkeydown){
@@ -3398,7 +3400,8 @@ void      Person::DoAnimations(){
                                                                                velocity=DoRotation(facing,0,-30,0)*-8;
                                                                                velocity.y=4;
                                                                        }
-                                                                       if(id==0)OPENAL_SetPaused(channels[whooshsound], false);
+                                                                       if(id==0)
+                                                                         resume_stream(whooshsound);
                                                                }
                                                                if(targetanimation==sneakattackanim){
                                                                        float ycoords=oldcoords.y;
@@ -3551,7 +3554,7 @@ void      Person::DoAnimations(){
                                                                                escapednum++;
                                                                                targetanimation=rollanim;
                                                                                coords+=facing;
-                                                                               if(id==0)OPENAL_SetPaused(channels[whooshsound], true);
+                                                                               if(id==0)pause_sound(whooshsound);
                                                                        }
                                                                        lastfeint=0;
                                                                }
@@ -3574,7 +3577,7 @@ void      Person::DoAnimations(){
                                                                                escapednum++;
                                                                                targetanimation=rollanim;
                                                                                coords+=facing*2;
-                                                                               if(id==0)OPENAL_SetPaused(channels[whooshsound], true);
+                                                                               if(id==0)pause_sound(whooshsound);
                                                                        }
                                                                        lastfeint=0;
                                                                }
@@ -4403,14 +4406,10 @@ void    Person::DoStuff(){
                skeleton.free=1;
 
                emit_sound_at(breaksound, coords);
-               /*if(id==0||findDistancefast(&coords,&viewer)<50){
-               slomo=1;
-               slomodelay=.2;
-               }*/
        }
 
        if(skeleton.free==1){
-               if(id==0)OPENAL_SetPaused(channels[whooshsound], true);
+               if(id==0)pause_sound(whooshsound);
 
                if(!dead){
                        //If knocked over, open hands and close mouth
@@ -4473,7 +4472,7 @@ void      Person::DoStuff(){
                        skeleton.longdead+=(2000-findLength(&average))*multiplier+multiplier;
                        if(skeleton.longdead>2000){
                                if(skeleton.longdead>6000){
-                                       if(id==0)OPENAL_SetPaused(channels[whooshsound], true);
+                                       if(id==0)pause_sound(whooshsound);
                                        skeleton.free=3;
                                        DrawSkeleton();
                                        skeleton.free=2;
@@ -4582,7 +4581,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)OPENAL_SetPaused(channels[whooshsound], true);
+                               if(id==0)pause_sound(whooshsound);
                                skeleton.free=0;
                                velocity=0;
                                XYZ middle;
@@ -5294,7 +5293,7 @@ void      Person::DoStuff(){
                                                onterrain=1;
 
                                                if(id==0){
-                                                       OPENAL_SetPaused(channels[whooshsound], true);
+                                                       pause_sound(whooshsound);
                                                        OPENAL_SetVolume(channels[whooshsound], 0);
                                                }
 
@@ -5650,35 +5649,11 @@ int Person::DrawSkeleton(){
 
                                                skeleton.muscles[i].lastrotate3=skeleton.muscles[i].rotate3;
                                                glRotatef(-skeleton.muscles[i].lastrotate3,0,1,0);
-                                               /*
-                                               if(!isnormal(proportionbody.x)||!isnormal(proportionbody.y)||!isnormal(proportionbody.z)){
-                                               proportionbody=1;
-                                               proportionweird=1;
-                                               }
-                                               if(!isnormal(proportionarms.x)||!isnormal(proportionarms.y)||!isnormal(proportionarms.z)){
-                                               proportionarms=1;
-                                               proportionweird=1;
-                                               }
-                                               if(!isnormal(proportionhead.x)||!isnormal(proportionhead.y)||!isnormal(proportionhead.z)){
-                                               proportionhead=1;
-                                               proportionweird=1;
-                                               }
-                                               if(!isnormal(proportionlegs.x)||!isnormal(proportionlegs.y)||!isnormal(proportionlegs.z)){
-                                               proportionlegs=1;
-                                               proportionweird=1;
-                                               }*/
 
                                                if(playerdetail||skeleton.free==3)
                                                {
                                                        for(j=0;j<skeleton.muscles[i].numvertices;j++)
                                                        {
-                                                               /*if(!isnormal(skeleton.model[start].vertex[skeleton.muscles[i].vertices[j]].x))vertexweird[0]=1;
-                                                               if(!isnormal(skeleton.model[start].vertex[skeleton.muscles[i].vertices[j]].y))vertexweird[1]=1;
-                                                               if(!isnormal(skeleton.model[start].vertex[skeleton.muscles[i].vertices[j]].z))vertexweird[2]=1;
-                                                               if(!isnormal(skeleton.model[endthing].vertex[skeleton.muscles[i].vertices[j]].x))vertexweird[3]=1;
-                                                               if(!isnormal(skeleton.model[endthing].vertex[skeleton.muscles[i].vertices[j]].y))vertexweird[4]=1;
-                                                               if(!isnormal(skeleton.model[endthing].vertex[skeleton.muscles[i].vertices[j]].z))vertexweird[5]=1;
-                                                               if(skeleton.muscles[i].vertices[j]<skeleton.model[start].vertexNum&&skeleton.muscles[i].vertices[j]>=0){*/
                                                                glMatrixMode(GL_MODELVIEW);                                                     // Select The Modelview Matrix
                                                                glPushMatrix();
                                                                        if(skeleton.muscles[i].parent1->label==abdomen||skeleton.muscles[i].parent2->label==abdomen)
@@ -5973,13 +5948,6 @@ int Person::DrawSkeleton(){
                                                CrossProduct(&vec1,&vec2,&tempnormthing);
                                                Normalise(&tempnormthing);
                                                if(targetanimation!=staffhitanim&&currentanimation!=staffhitanim&&targetanimation!=staffgroundsmashanim&&currentanimation!=staffgroundsmashanim&&targetanimation!=staffspinhitanim&&currentanimation!=staffspinhitanim)weaponpoint+=tempnormthing*.1-skeleton.specialforward[1]*.3+(skeleton.joints[skeleton.jointlabels[rightwrist]].position-skeleton.joints[skeleton.jointlabels[rightelbow]].position);
-                                               /*if(targetanimation==staffhitanim||currentanimation==staffhitanim){
-                                               XYZ weaptargnorm;
-                                               weaptargnorm=DoRotation(weapons.tippoint[i]-weapons.position[i],0,-rotation,0);
-                                               //weaptargnorm=animation[currentanimation].weapontarget[currentframe]*(1-target)+animation[targetanimation].weapontarget[targetframe]*(target);
-                                               Normalise(&weaptargnorm);
-                                               weaponpoint-=weaptargnorm*2;
-                                               }*/
                                        }
                                }
                                if(weaponactive!=k&&weaponstuck!=k){
@@ -6214,7 +6182,7 @@ int Person::SphereCheck(XYZ *p1,float radius, XYZ *p, XYZ *move, float *rotate,
                                                                onterrain=1;
 
                                                                if(id==0){
-                                                                       OPENAL_SetPaused(channels[whooshsound], true);
+                                                                       pause_sound(whooshsound);
                                                                        OPENAL_SetVolume(channels[whooshsound], 0);
                                                                }