b8 P880D@P.text0F .rdata0F0Fp0f.dataHHPh@.sdataJJj.sbssKK.bssKKBretty simple program. * * See other demos for a much easyier to understand example of * * the tod animation. * *********************************************************************/ // INCLUDE FILES //--------------- #include #include #include "pad.h" /* pad control */ #include "tod.h" /* definition for TOD functions */ #include "IDLists.h" /* TMD ID list (not used) */ #include "graphics.h" /* Various graphic and animation*/ #include "addrs.h" /* Model and TOD addresses */ // DEFINES //------------ #define ALIVE (0) #define DYING (1) #define DEAD (2) #define BORED (0) #define BREATHE (1) #define COMEON (2) #define FOOT (3) #define PUNCH (4) #define PUNCH1 (5) #define PUNCH2 (6) #define RUN (7) #define SIT (8) #define WALK (9) // PROTOTYPES //-------- long UpdateWorld(); void RenderWorld(); void ProcessInput(); // GLOBALS //---------- u_long pad; // For controller GsRVIEW2 view; // For viewing LinkObjectStruct theModel; // The animated model u_long world_time=0; u_long button_held[4] = {FALSE,FALSE,FALSE,FALSE}; // button states // FUNCTIONS //---------- ////////////////////////////////////////////////////////////////////////////////// // Update the animation keeping track of frame speeds // and controlling the animation according to the // animationState varible. long UpdateWorld() { int i; static int flip=0; int hold=FALSE; // control playback. if(theModel.currentTod == SIT) { if(NextFrame(&theModel,FALSE)) { return(DEAD); } return(DYING); } // Play one of the idle animations alternatly when // the character has done nothing for a short while. if(world_time > 400) { if(flip == 0) { ResetAnim(&theModel,BORED); flip=1; } else { ResetAnim(&theModel,COMEON); flip=0; } world_time=0; } // check to see if a button is held down for(i=0;i<4;i++) { if(button_held[i]==TRUE) hold= TRUE; } // Advance animation. If animation reaches end reset // to the default breathing animation. if(hold ==TRUE) { if(button_held[2]==TRUE) { if(NextFrame(&theModel,FALSE)) { //switch(theModel.currentTod) //{ // case PUNCH: // ResetAnim(&theModel,PUNCH1); break; // case PUNCH1: // ResetAnim(&theModel,PUNCH2); break; // case PUNCH2: // ResetAnim(&theModel,PUNCH); break; //} if((world_time==25) && (theModel.currentTod == PUNCH)) ResetAnim(&theModel,PUNCH1); else if((world_time==45) && (theModel.currentTod == PUNCH1)) ResetAnim(&theModel,PUNCH2); } } else { NextFrame(&theModel,TRUE); world_time=0; } } else { if(NextFrame(&theModel,FALSE)) { ResetAnim(&theModel,BREATHE); } } // increment world counter. world_time++; return ALIVE; } ////////////////////////////////////////////////////////////////////////////////////////////////////// // Handle Object drawing function calls void RenderWorld() { int i; RenderPrepare(); //create a delay. (Pause should be for ????frames???) for(i=0;i<500;i++){VSync(1);}; DrawObjectLink(theModel.objs); RenderFinish(); } ///////////////////////////////////////////////////////////////////////////////////////////////////////// // Process Joypad controller input. Controls camera positioning. void ProcessInput() { static int camera=0; static int pressed=0; pad = PadRead(); if(pressed==0) { if((pad & PADRleft) > 0) { ResetAnim(&theMo'!@,ď <`4d@ȯȏ! *'#C,Ïd$ <`4d@ȯȏ! *'#C,Ïd$ <`4d@ȯȏ! *'#C C$ï,Ïb$! @0ŏ Ïb0)@,ÏdD,ď$dD,ď$dDC$ïÏb0@,Ïb$! @0ŏ 0ď,ŏn Ïb0@,ÏdD,ď$dD,ď$d D C$ï,Ïb$0ďb !(@@Cb0ďŏ !0@! @(ŏ= !0$+CC `C4bv(CH`Ïb$!@ïC$ïďE 4¯(Ïb4ÏdHD@@$ Cďŏ, ďŏ Ïb0e@Ïb0<@!@Ï! `ď:zc%C1<#2IZ9Wڥ2-64OSk%ޟݦ @@?`f4؎ҎЉRQX[Ӊa.-xV4ͫ~ffffVW_^ffff&G*fFf&G,f&G.fFf&G f&G.ϐ/޿ʿobXJ&jhjjjjjjj.5X.5Z.5\.5^!Ð@@@ @ @4@p+ŝi@զIx@GA~QCǑF uuvHM]=];Z R`%umain.w.sh-E-H@8 t  INSTRUCTIONS --------------- Left = Back cycle through cameras. Right = Forward cycle through cameras. Triangle = Run Square = Walk Circle = Hurting Foot Cross = Punch Hold the walk or run button for continuous animation. Press the punch button once for a single punch animation. Hold the punch button through the first animation for a double punch. Again hold the punch through the first and second punch for a super third punch! Press select to quit (plays end animation). td"""$ "    pDĹDDDDķĺDDDb