X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FSkeleton.cpp;h=aba644e2f86c14a1c6637782a8868c51a45a1a5b;hb=fcdac6a36d47d719a12f3db7a7f0a0ae59e47ef7;hp=9683f5572cd983f5a20fb319a89dbcfd3a6ed9cf;hpb=617a36f729718c59c2f886fd4a1d145388e7c8bc;p=lugaru.git diff --git a/Source/Skeleton.cpp b/Source/Skeleton.cpp index 9683f55..aba644e 100644 --- a/Source/Skeleton.cpp +++ b/Source/Skeleton.cpp @@ -40,8 +40,6 @@ extern XYZ envsound[30]; extern float envsoundvol[30]; extern int numenvsounds; extern float envsoundlife[30]; -extern int bonus; -extern float bonustime; extern int tutoriallevel; extern int whichjointstartarray[26]; @@ -416,19 +414,8 @@ float Skeleton::DoConstraints(XYZ *coords,float *scale) if(joints[i].label==groin&&!joints[i].locked&&joints[i].delay<=0){ joints[i].locked=1; joints[i].delay=1; - static float gLoc[3]; - static float vel[3]; - gLoc[0]=joints[i].position.x*(*scale)+coords->x; - gLoc[1]=joints[i].position.y*(*scale)+coords->y; - gLoc[2]=joints[i].position.z*(*scale)+coords->z; - vel[0]=joints[i].velocity.x; - vel[1]=joints[i].velocity.y; - vel[2]=joints[i].velocity.z; if(tutoriallevel!=1||id==0){ - PlaySoundEx( landsound1, samp[landsound1], NULL, true); - OPENAL_3D_SetAttributes(channels[landsound1], gLoc, vel); - OPENAL_SetVolume(channels[landsound1], 128); - OPENAL_SetPaused(channels[landsound1], false); + emit_sound_at(landsound1, joints[i].position*(*scale)+*coords, 128.); } breaking=1; } @@ -436,19 +423,8 @@ float Skeleton::DoConstraints(XYZ *coords,float *scale) if(joints[i].label==head&&!joints[i].locked&&joints[i].delay<=0){ joints[i].locked=1; joints[i].delay=1; - static float gLoc[3]; - static float vel[3]; - gLoc[0]=joints[i].position.x*(*scale)+coords->x; - gLoc[1]=joints[i].position.y*(*scale)+coords->y; - gLoc[2]=joints[i].position.z*(*scale)+coords->z; - vel[0]=joints[i].velocity.x; - vel[1]=joints[i].velocity.y; - vel[2]=joints[i].velocity.z; if(tutoriallevel!=1||id==0){ - PlaySoundEx( landsound2, samp[landsound2], NULL, true); - OPENAL_3D_SetAttributes(channels[landsound2], gLoc, vel); - OPENAL_SetVolume(channels[landsound2], 128); - OPENAL_SetPaused(channels[landsound2], false); + emit_sound_at(landsound2, joints[i].position*(*scale)+*coords, 128.); } } @@ -470,18 +446,7 @@ float Skeleton::DoConstraints(XYZ *coords,float *scale) breaking=0; camerashake+=.6; - static float gLoc[3]; - static float vel[3]; - gLoc[0]=joints[i].position.x*(*scale)+coords->x; - gLoc[1]=joints[i].position.y*(*scale)+coords->y; - gLoc[2]=joints[i].position.z*(*scale)+coords->z; - vel[0]=joints[i].velocity.x; - vel[1]=joints[i].velocity.y; - vel[2]=joints[i].velocity.z; - PlaySoundEx( breaksound2, samp[breaksound2], NULL, true); - OPENAL_3D_SetAttributes(channels[breaksound2], gLoc, vel); - OPENAL_SetVolume(channels[breaksound2], 300); - OPENAL_SetPaused(channels[breaksound2], false); + emit_sound_at(breaksound2, joints[i].position*(*scale)+*coords); envsound[numenvsounds]=*coords; envsoundvol[numenvsounds]=64; @@ -538,19 +503,8 @@ float Skeleton::DoConstraints(XYZ *coords,float *scale) if(joints[i].label==groin&&!joints[i].locked&&joints[i].delay<=0){ joints[i].locked=1; joints[i].delay=1; - static float gLoc[3]; - static float vel[3]; - gLoc[0]=joints[i].position.x*(*scale)+coords->x; - gLoc[1]=joints[i].position.y*(*scale)+coords->y; - gLoc[2]=joints[i].position.z*(*scale)+coords->z; - vel[0]=joints[i].velocity.x; - vel[1]=joints[i].velocity.y; - vel[2]=joints[i].velocity.z; if(tutoriallevel!=1||id==0){ - PlaySoundEx( landsound1, samp[landsound1], NULL, true); - OPENAL_3D_SetAttributes(channels[landsound1], gLoc, vel); - OPENAL_SetVolume(channels[landsound1], 128); - OPENAL_SetPaused(channels[landsound1], false); + emit_sound_at(landsound1, joints[i].position*(*scale)+*coords, 128.); } breaking=1; } @@ -558,19 +512,8 @@ float Skeleton::DoConstraints(XYZ *coords,float *scale) if(joints[i].label==head&&!joints[i].locked&&joints[i].delay<=0){ joints[i].locked=1; joints[i].delay=1; - static float gLoc[3]; - static float vel[3]; - gLoc[0]=joints[i].position.x*(*scale)+coords->x; - gLoc[1]=joints[i].position.y*(*scale)+coords->y; - gLoc[2]=joints[i].position.z*(*scale)+coords->z; - vel[0]=joints[i].velocity.x; - vel[1]=joints[i].velocity.y; - vel[2]=joints[i].velocity.z; if(tutoriallevel!=1||id==0){ - PlaySoundEx( landsound2, samp[landsound2], NULL, true); - OPENAL_3D_SetAttributes(channels[landsound2], gLoc, vel); - OPENAL_SetVolume(channels[landsound2], 128); - OPENAL_SetPaused(channels[landsound2], false); + emit_sound_at(landsound2, joints[i].position*(*scale)+*coords, 128.); } } @@ -588,18 +531,7 @@ float Skeleton::DoConstraints(XYZ *coords,float *scale) breaking=0; camerashake+=.6; - static float gLoc[3]; - static float vel[3]; - gLoc[0]=joints[i].position.x*(*scale)+coords->x; - gLoc[1]=joints[i].position.y*(*scale)+coords->y; - gLoc[2]=joints[i].position.z*(*scale)+coords->z; - vel[0]=joints[i].velocity.x; - vel[1]=joints[i].velocity.y; - vel[2]=joints[i].velocity.z; - PlaySoundEx( breaksound2, samp[breaksound2], NULL, true); - OPENAL_3D_SetAttributes(channels[breaksound2], gLoc, vel); - OPENAL_SetVolume(channels[breaksound2], 300); - OPENAL_SetPaused(channels[breaksound2], false); + emit_sound_at(breaksound2, joints[i].position*(*scale)+*coords); envsound[numenvsounds]=*coords; envsoundvol[numenvsounds]=64;