- Timestamp:
- Jan 18, 2006, 3:18:49 PM (19 years ago)
- 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 84 84 void MovieLoader::run() 85 85 { 86 // first timestamp for t = 0 87 this->lastFrame = SDL_GetTicks (); 88 86 89 while( this->isRunning) 87 90 { … … 89 92 this->tick(); 90 93 91 this->draw();94 movie_player>draw(); 92 95 } 93 96 } … … 100 103 void MovieLoader::tick() 101 104 { 105 // get timestamp 106 Uint32 currentFrame = SDL_GetTicks(); 102 107 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; 103 116 } -
branches/avi_play/src/story_entities/movie_loader.h
r6557 r6567 34 34 void draw() const; 35 35 void tick(); 36 37 Uint32 lastFrame; // last time of frame 38 Uint32 dt; // time needed to calculate this frame (in milliSeconds) 39 float dtS; 36 40 }; 37 41
Note: See TracChangeset
for help on using the changeset viewer.