Changeset 6324 in orxonox.OLD for branches/avi_play/src/lib/graphics/importer/movie_player.cc
- Timestamp:
- Dec 27, 2005, 10:25:48 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/avi_play/src/lib/graphics/importer/movie_player.cc
r6323 r6324 57 57 { 58 58 status = STOP; 59 timer = 0; 59 60 60 61 material = new Material; … … 82 83 void MoviePlayer::start(unsigned int start_frame) 83 84 { 84 texture = media_container->getFrame(start_frame); 85 status = PLAY; 86 timer = 0; 87 fps = media_container->getFPS(); 85 88 86 status = PLAY; 89 media_container->gotoFrame(start_frame); 90 91 PRINTF(0)("start\n"); 87 92 } 88 93 … … 90 95 { 91 96 if(status == STOP) 92 texture = media_container->getFrame(0); 93 status = PLAY; 97 this->start(0); 98 else 99 status = PLAY; 100 101 PRINTF(0)("resume\n"); 94 102 } 95 103 … … 98 106 if(status != STOP) 99 107 status = PAUSE; 108 109 PRINTF(0)("pause\n"); 100 110 } 101 111 … … 104 114 status = STOP; 105 115 texture = NULL; 116 117 PRINTF(0)("stop\n"); 106 118 } 107 119 108 void MoviePlayer::tick(float time)120 void MoviePlayer::tick(float dt) 109 121 { 110 122 if(status == PLAY) 111 123 { 112 texture = media_container->getNextFrame(); 124 current_frame = media_container->getFrameNumber(); 125 timer += dt; 126 actuel_frame = timer * fps; 127 128 if(actuel_frame != current_frame) 129 { 130 if(actuel_frame - current_frame == 1) 131 texture = media_container->getNextFrame(); 132 else 133 texture = media_container->skipFrame(actuel_frame - current_frame - 1); 134 } 113 135 //PRINTF(0)("frame_number: %i\n", media_container->getFrameNumber()); 114 if(texture == NULL) 115 status = STOP; 136 137 if(texture == NULL && current_frame != 0) 138 this->stop(); 116 139 } 117 140 }
Note: See TracChangeset
for help on using the changeset viewer.