Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4657 in orxonox.OLD for orxonox/trunk


Ignore:
Timestamp:
Jun 18, 2005, 7:16:51 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: minor QuickAnim: deleteEntry should work

Location:
orxonox/trunk/src/lib/particles
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/particles/quick_animation.cc

    r4656 r4657  
    162162}
    163163
    164 /*
    165   \param position The position where to find the Node to kill
    166 
    167   bool QuickAnimation::removeEntry(float position)
    168   {
    169   this->current = this->first;
    170   QuickKeyFrame* last =
    171 
    172   while (this->current)
    173   {
    174   if (this->current->position == position)
    175   {
    176 
    177 
    178   }
    179   this->current = this->current->next;
    180   }
    181   this->current = this->first;
    182   }
    183 */
     164
     165/**
     166 * removes a KeyFrame from the List.
     167 * @param position
     168 * @return
     169 */
     170void QuickAnimation::removeEntry(float position)
     171{
     172  this->current = this->first;
     173
     174  if (this->count <= 0)
     175  {
     176    this->current->value = 0.0;
     177    this->current->position = 0.0;
     178    count = 0;
     179    return;
     180  }
     181  else
     182  {
     183    do
     184    {
     185      if (this->current->position == position)
     186      {
     187        if (this->current == this->first)
     188          this->first = this->first->next;
     189        this->current->next->prev = this->current->prev;
     190        this->current->prev->next = this->current->next;
     191        delete this->current;
     192        break;
     193      }
     194      this->current = this->current->next;
     195    } while (this->current != this->first);
     196
     197    count --;
     198    this->current = this->first;
     199  }
     200}
     201
    184202
    185203/**
  • orxonox/trunk/src/lib/particles/quick_animation.h

    r4654 r4657  
    4242  void changeEntry(float position, float value, float region = .04);
    4343
    44   /** \todo implemente thos functions
    45       bool removeEntry(float position);
     44  void removeEntry(float position);
     45  /** \todo implemente those functions
    4646      bool moveEntry(float position);
    4747  */
Note: See TracChangeset for help on using the changeset viewer.