Changeset 6168 in orxonox.OLD for branches/avi_play/src/subprojects
- Timestamp:
- Dec 20, 2005, 12:16:31 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/avi_play/src/subprojects/importer/multitex.cc
r6163 r6168 37 37 MediaContainer* movie; 38 38 39 float counter = 0; 39 int counter = 0; 40 float timer = 0; 41 float fps; 40 42 41 43 42 44 void Framework::moduleInit(int argc, char** argv) 43 45 { 44 45 46 47 48 49 46 if( argc <= 1) 47 { 48 printf("Wrong arguments try following notations:\n"); 49 printf("./multitex [mediaFile]\n"); 50 exit(0); 51 } 50 52 51 53 movie = new MediaContainer(argv[1]); 54 fps = movie->getFPS(); 52 55 53 56 // print information about the media file … … 97 100 obj = new PrimitiveModel(PRIM_PLANE, 10.0); 98 101 break; 102 // increase fps 103 case SDLK_9: 104 fps++; 105 PRINTF(1)("fps: %f\n", fps); 106 break; 107 // decrease fps 108 case SDLK_8: 109 if(fps > 0) 110 fps--; 111 PRINTF(1)("fps: %f\n", fps); 112 break; 99 113 } 100 114 } … … 103 117 void Framework::moduleTick(float dt) 104 118 { 105 counter += 0.2;119 timer += dt; 106 120 107 seq->gotoFrame((unsigned int)counter); 121 if(counter != fps * timer) 122 { 123 counter = fps * timer; 124 125 if (counter > seq->getFrameCount()) 126 { 127 timer = 0; 128 counter = 0; 129 } 108 130 109 if ((unsigned int)counter > seq->getFrameCount()) 110 counter = 0; 111 131 seq->gotoFrame(counter); 132 } 112 133 } 113 134
Note: See TracChangeset
for help on using the changeset viewer.