Changeset 6598 in orxonox.OLD for branches/avi_play
- Timestamp:
- Jan 18, 2006, 5:11:26 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
r6585 r6598 17 17 18 18 #include "movie_player.h" 19 #include "factory.h" 20 #include "graphics_engine.h" 19 21 #include "load_param.h" 20 22 #include "resource_manager.h" … … 23 25 using namespace std; 24 26 27 CREATE_FACTORY(MovieLoader, CL_MOVIE_LOADER); 25 28 26 29 MovieLoader::MovieLoader(const TiXmlElement* root) … … 50 53 movie_player->loadMovie(filename); 51 54 52 PRINTF(0)(" loaded Movie %s", filename);55 PRINTF(0)("\nloaded Movie %s\n\n", filename); 53 56 } 54 57 … … 73 76 bool MovieLoader::start() 74 77 { 78 PRINTF(0)("\nMovieLoader INFO:\n"); 79 movie_player->printInformation(); 80 PRINTF(0)("\n"); 81 75 82 this->isRunning = true; 76 83 77 //this->run();84 this->run(); 78 85 } 79 86 … … 90 97 // first timestamp for t = 0 91 98 this->lastFrame = SDL_GetTicks (); 99 this->movie_player->start(0); 92 100 93 101 while( this->isRunning) … … 95 103 96 104 this->tick(); 105 this->draw(); 97 106 98 //movie_player->draw();99 107 } 100 108 } 109 110 void MovieLoader::draw() const 111 { 112 glClear( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); 113 114 115 GraphicsEngine::enter2DMode(); 116 117 //glEnable(GL_TEXTURE_2D); 118 //glBindTexture(GL_TEXTURE_2D, movie_player->getTexture()); 119 120 glColor3f(1.0, 1.0, 1.0); 121 122 glBegin(GL_QUADS); 123 glTexCoord2f(1.0f, 1.0f); glVertex2f( 0, 0); 124 glTexCoord2f(0.0f, 1.0f); glVertex2f( 1, 0); 125 glTexCoord2f(0.0f, 0.0f); glVertex2f( 1, 1); 126 glTexCoord2f(1.0f, 0.0f); glVertex2f( 0, 1); 127 glEnd(); 128 129 GraphicsEngine::leave2DMode(); 130 131 SDL_GL_SwapBuffers(); 132 } 133 101 134 102 135 void MovieLoader::tick() … … 112 145 movie_player->tick(dts); 113 146 147 if (movie_player->getStatus() == STOP) 148 this->isRunning = false; 149 114 150 this->lastFrame = currentFrame; 115 151 } -
branches/avi_play/src/story_entities/movie_loader.h
r6576 r6598 42 42 void loadMovie(const char* filename); 43 43 void tick(); 44 void draw() const; 44 45 45 46 };
Note: See TracChangeset
for help on using the changeset viewer.