Changeset 6339 in orxonox.OLD for branches/avi_play/src/subprojects
- Timestamp:
- Dec 30, 2005, 1:51:41 AM (19 years ago)
- Location:
- branches/avi_play/src/subprojects/importer
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/avi_play/src/subprojects/importer/importer.cc
r6286 r6339 25 25 #include "resource_manager.h" 26 26 27 MediaContainer* movie;28 27 29 28 void Framework::moduleInit(int argc, char** argv) 30 29 { 31 30 32 movie = new MediaContainer(argv[1]);33 34 // print information about the media file35 movie->printMediaInformation();36 37 SDL_Delay(1000);38 31 39 32 } … … 46 39 void Framework::moduleTick(float dt) 47 40 { 48 while(movie->getNextFrame() != NULL); 49 movie->saveCurrentFrame(); 41 50 42 } 51 43 -
branches/avi_play/src/subprojects/importer/movie_player_test.cc
r6325 r6339 21 21 #include "movie_player.h" 22 22 23 MoviePlayer* movie_player;23 //MoviePlayer* movie_player; 24 24 25 25 void Framework::moduleInit(int argc, char** argv) 26 26 { 27 movie_player = new MoviePlayer(argv[1]);27 //movie_player = new MoviePlayer(argv[1]); 28 28 29 movie_player->printInformation();29 //movie_player->printInformation(); 30 30 } 31 31 32 32 void Framework::moduleEventHandler(SDL_Event* event) 33 33 { 34 switch (event->type)34 /*switch (event->type) 35 35 { 36 36 case SDL_KEYDOWN: … … 58 58 break; 59 59 } 60 } 60 }*/ 61 61 } 62 62 63 63 void Framework::moduleTick(float dt) 64 64 { 65 movie_player->tick(dt);65 //movie_player->tick(dt); 66 66 } 67 67 68 68 void Framework::moduleDraw(void) const 69 69 { 70 movie_player->draw();70 //movie_player->draw(); 71 71 } 72 72 -
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.