|
From: Seb <whi...@us...> - 2004-11-14 13:34:53
|
Update of /cvsroot/epfl/tggame In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27317 Modified Files: playercontroller.cc weapon.cc weapon.h Log Message: Un effet de style plus une nouvelle fonction pour changer l'animation de l'arme en cours :-) Index: playercontroller.cc =================================================================== RCS file: /cvsroot/epfl/tggame/playercontroller.cc,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** playercontroller.cc 14 Nov 2004 13:07:17 -0000 1.16 --- playercontroller.cc 14 Nov 2004 13:34:44 -0000 1.17 *************** *** 88,95 **** --- 88,97 ---- { bFire = true; + pWeapon->Animation("fire4"); } else if (e.type == evMouseButtonUp) { bFire = false; + pWeapon->Animation("idle"); } Index: weapon.cc =================================================================== RCS file: /cvsroot/epfl/tggame/weapon.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** weapon.cc 14 Nov 2004 13:07:17 -0000 1.2 --- weapon.cc 14 Nov 2004 13:34:44 -0000 1.3 *************** *** 46,50 **** --- 46,54 ---- SoundManager::pSoundManager->PlaySound("gun"); + } + void Weapon::Animation(string name) + { + pModel->SetAnimation(name); } Index: weapon.h =================================================================== RCS file: /cvsroot/epfl/tggame/weapon.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** weapon.h 13 Nov 2004 23:38:08 -0000 1.1 --- weapon.h 14 Nov 2004 13:34:44 -0000 1.2 *************** *** 17,20 **** --- 17,23 ---- void Fire (const Vector3& vPosition, const Vector3& vTarget, Pawn* p); void Think (float eTime); + + void Animation(std::string name); + protected: MD5Instance* pModel; |