Changeset 6339 in orxonox.OLD for branches/avi_play/src/subprojects/importer/multitex.cc
- Timestamp:
- Dec 30, 2005, 1:51:41 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/avi_play/src/subprojects/importer/multitex.cc
r6333 r6339 20 20 #include "light.h" 21 21 22 #include "texture_sequence.h"23 22 #include "material.h" 24 25 23 #include "primitive_model.h" 26 24 #include <stdlib.h> … … 29 27 30 28 Model* obj; 31 TextureSequence* seq;32 29 Material* testMat; 33 MediaContainer* m ovie;30 MediaContainer* media_container; 34 31 35 32 int counter = 0; … … 40 37 void Framework::moduleInit(int argc, char** argv) 41 38 { 42 if( argc <= 2)39 if( argc <= 1) 43 40 { 44 41 printf("Wrong arguments try following notations:\n"); 45 printf("./multitex [media_file] [start_time]\n");42 printf("./multitex [media_file]\n"); 46 43 exit(0); 47 44 } 48 45 49 movie = new MediaContainer(argv[1]); 50 //movie = new MediaContainer(); 51 //movie->loadMedia(argv[1]); 52 fps = movie->getFPS(); 53 54 int start_frame = atoi(argv[2]); 55 56 // print information about the media file 57 movie->printMediaInformation(); 46 media_container = new MediaContainer(argv[1]); 58 47 59 48 testMat = new Material; 60 61 seq = new TextureSequence();62 63 // get each fram individually64 //while(seq->addFrame(movie->getNextFrame()) != NULL);65 // get a list of frames66 movie->gotoFrame(start_frame);67 seq->addFrameList(movie->getFrameList());68 69 49 testMat->setDiffuseMap("maps/radialTransparency.png"); 70 71 50 obj = new PrimitiveModel(PRIM_PLANE, 10.0); 72 51 … … 75 54 (new Light())->setAbsCoor(5.0, 10.0, 40.0); 76 55 (new Light())->setAbsCoor(-10, -20, -100); 56 57 fps = media_container->getFPS(); 77 58 } 78 59 … … 96 77 case SDLK_9: 97 78 fps++; 98 PRINTF( 1)("fps: %f\n", fps);79 PRINTF(0)("fps: %0.2f\n", fps); 99 80 break; 100 81 // decrease fps … … 102 83 if(fps > 0) 103 84 fps--; 104 PRINTF( 1)("fps: %f\n", fps);85 PRINTF(0)("fps: %0.2f\n", fps); 105 86 break; 106 87 } … … 116 97 counter = fps * timer; 117 98 118 if (counter > seq->getFrameCount())99 if (counter >= media_container->getFrameCount()) 119 100 { 120 101 timer = 0; 121 102 counter = 0; 122 103 } 123 124 seq->gotoFrame(counter);125 104 } 126 105 } … … 129 108 { 130 109 testMat->select(); 131 glBindTexture(GL_TEXTURE_2D, seq->getTexture());110 glBindTexture(GL_TEXTURE_2D, media_container->getFrameTexture(counter)); 132 111 obj->draw(); 133 112 … … 135 114 } 136 115 137 138 116 void Framework::moduleHelp(void) const 139 117 {
Note: See TracChangeset
for help on using the changeset viewer.