X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FSkeleton.cpp;h=057ea9d046af22afd0fb41361571acd1f16eddb9;hb=21a5795e0a42a3a0a91148f7c0f9f6cfe78b1235;hp=8b7c18a33f5182ff04beca5c9be9b77d95e198c0;hpb=36cc3af3e5074215817ddee16defde754e2ad67f;p=lugaru.git diff --git a/Source/Skeleton.cpp b/Source/Skeleton.cpp index 8b7c18a..057ea9d 100644 --- a/Source/Skeleton.cpp +++ b/Source/Skeleton.cpp @@ -1,4 +1,26 @@ +/* +Copyright (C) 2003, 2010 - Wolfire Games + +This file is part of Lugaru. + +Lugaru is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + /**> HEADER FILES <**/ +#include "Game.h" #include "Skeleton.h" extern float multiplier; @@ -25,10 +47,9 @@ extern int tutoriallevel; extern int whichjointstartarray[26]; extern int whichjointendarray[26]; -#include "Game.h" extern Game * pgame; extern bool visibleloading; -extern "C" void PlaySoundEx(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused); +extern "C" void PlaySoundEx(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused); void dealloc2(void* param){ free(param); @@ -182,7 +203,7 @@ float Skeleton::DoConstraints(XYZ *coords,float *scale) objects.SphereCheckPossible(&terrainlight, 1); /* for(i=0; i2500){ Normalise(&bounceness); bounceness=bounceness*50; - } + } joints[i].velocity+=bounceness*elasticity; @@ -526,10 +547,10 @@ float Skeleton::DoConstraints(XYZ *coords,float *scale) vel[1]=joints[i].velocity.y; vel[2]=joints[i].velocity.z; if(tutoriallevel!=1||id==0){ - PlaySoundEx( landsound1, samp[landsound1], NULL, TRUE); + PlaySoundEx( landsound1, samp[landsound1], NULL, true); FSOUND_3D_SetAttributes(channels[landsound1], gLoc, vel); FSOUND_SetVolume(channels[landsound1], 128); - FSOUND_SetPaused(channels[landsound1], FALSE); + FSOUND_SetPaused(channels[landsound1], false); } breaking=1; } @@ -546,10 +567,10 @@ float Skeleton::DoConstraints(XYZ *coords,float *scale) vel[1]=joints[i].velocity.y; vel[2]=joints[i].velocity.z; if(tutoriallevel!=1||id==0){ - PlaySoundEx( landsound2, samp[landsound2], NULL, TRUE); + PlaySoundEx( landsound2, samp[landsound2], NULL, true); FSOUND_3D_SetAttributes(channels[landsound2], gLoc, vel); FSOUND_SetVolume(channels[landsound2], 128); - FSOUND_SetPaused(channels[landsound2], FALSE); + FSOUND_SetPaused(channels[landsound2], false); } } @@ -575,10 +596,10 @@ float Skeleton::DoConstraints(XYZ *coords,float *scale) vel[0]=joints[i].velocity.x; vel[1]=joints[i].velocity.y; vel[2]=joints[i].velocity.z; - PlaySoundEx( breaksound2, samp[breaksound2], NULL, TRUE); + PlaySoundEx( breaksound2, samp[breaksound2], NULL, true); FSOUND_3D_SetAttributes(channels[breaksound2], gLoc, vel); FSOUND_SetVolume(channels[breaksound2], 300); - FSOUND_SetPaused(channels[breaksound2], FALSE); + FSOUND_SetPaused(channels[breaksound2], false); envsound[numenvsounds]=*coords; envsoundvol[numenvsounds]=64; @@ -662,9 +683,9 @@ float Skeleton::DoConstraints(XYZ *coords,float *scale) for(i=0; iposition.x,muscles[i].parent1->position.y,muscles[i].parent1->position.z); glVertex3f(muscles[i].parent2->position.x,muscles[i].parent2->position.y,muscles[i].parent2->position.z); } - } + } glEnd(); if(muscleview!=2){ @@ -885,7 +906,7 @@ void Skeleton::SetJoint(float x, float y, float z, int which, int whichjoint) joints[whichjoint].parent=&joints[which]; joints[whichjoint].hasparent=1; joints[whichjoint].length=findDistance(&joints[whichjoint].position,&joints[whichjoint].parent->position); - } + } } } @@ -1062,7 +1083,9 @@ void Animation::Load(char *filename, int aheight, int aattack) funpackf(tfile, "Bf", &twist[j][i]); } for(j=0;j