extern float gravity;
extern Skeleton testskeleton;
extern Terrain terrain;
-extern OPENAL_SAMPLE *samp[100];
extern int channels[100];
extern Objects objects;
extern int environment;
extern float envsoundvol[30];
extern int numenvsounds;
extern float envsoundlife[30];
-extern int bonus;
-extern float bonustime;
extern int tutoriallevel;
extern int whichjointstartarray[26];
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;
}
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.);
}
}
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;
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;
}
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.);
}
}
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;