Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6567 in orxonox.OLD for branches


Ignore:
Timestamp:
Jan 18, 2006, 3:18:49 PM (19 years ago)
Author:
stefalie
Message:

branches/avi_play: …

Location:
branches/avi_play/src/story_entities
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/avi_play/src/story_entities/movie_loader.cc

    r6562 r6567  
    8484void MovieLoader::run()
    8585{
     86  // first timestamp for t = 0
     87  this->lastFrame = SDL_GetTicks ();
     88
    8689  while( this->isRunning)
    8790  {
     
    8992    this->tick();
    9093
    91     this->draw();
     94    movie_player>draw();
    9295  }
    9396}
     
    100103void MovieLoader::tick()
    101104{
     105  // get timestamp
     106  Uint32 currentFrame = SDL_GetTicks();
    102107
     108  // calculate time difference in milliseconds (Uint32)
     109  this->dt = currentFrame - this->lastFrame;
     110  // calculate time difference in seconds (float)
     111  this->dtS = (float)this->dt / 1000.0f;
     112
     113  movie_player->tick(dts);
     114
     115  this->lastFrame = currentFrame;
    103116}
  • branches/avi_play/src/story_entities/movie_loader.h

    r6557 r6567  
    3434    void draw() const;
    3535    void tick();
     36
     37    Uint32              lastFrame;                    // last time of frame
     38    Uint32              dt;                           // time needed to calculate this frame (in milliSeconds)
     39    float               dtS;
    3640};
    3741
Note: See TracChangeset for help on using the changeset viewer.