Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7071 in orxonox.OLD for trunk/src/lib/graphics


Ignore:
Timestamp:
Feb 7, 2006, 2:58:08 PM (18 years ago)
Author:
patrick
Message:

patches: network load level and md2 death

Location:
trunk/src/lib/graphics/importer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/importer/md2Model.cc

    r7068 r7071  
    157157  the animation types can be looked up in the animationType table
    158158*/
    159 void MD2Model::setAnim(int type)
     159void MD2Model::setAnim(int type, int animPlayback)
    160160{
    161161  if( (type < 0) || (type > MAX_ANIMATIONS) )
     
    174174  this->animationState.type = type;
    175175  this->animationState.numPlays = 0;
     176  this->animationState.animPlaybackMode = animPlayback;
    176177
    177178  this->animationState.interpolationState = 0.0f;
     
    315316    }
    316317
    317   if( this->animationState.currentFrame > (this->data->numFrames - 1) )
     318  if( this->animationState.currentFrame > (this->data->numFrames - 1) && this->animationState.animPlaybackMode == MD2_ANIM_LOOP)
    318319    this->animationState.currentFrame = 0;
    319320  if( this->animationState.nextFrame > (this->data->numFrames - 1) )
  • trunk/src/lib/graphics/importer/md2Model.h

    r7059 r7071  
    136136  int              nextFrame;            //!< the next frame in the list
    137137  int              numPlays;             //!< the number of times, this has been played in series
     138
     139  int              animPlaybackMode;     //!< the playback mode
    138140} sAnimState;
    139141
     
    168170
    169171
     172typedef enum animPlayback
     173{
     174  MD2_ANIM_LOOP = 0,
     175  MD2_ANIM_ONCE,
     176
     177  MD2_ANIM_NUM
     178};
     179
     180
    170181
    171182/* forward definitions */
     
    219230
    220231
    221   void setAnim(int type);
     232  void setAnim(int type, int animPlayback = MD2_ANIM_LOOP);
    222233  /**  returns the current animation @returns animation type */
    223234  inline int MD2Model::getAnim() { return this->animationState.type; }
Note: See TracChangeset for help on using the changeset viewer.