- Timestamp:
- Jan 19, 2006, 12:35:05 AM (19 years ago)
- Location:
- branches/avi_play/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/avi_play/src/lib/graphics/importer/movie_player.cc
r6600 r6611 62 62 av_free(frame); 63 63 64 avcodec_default_free_buffers(codec_context);65 66 64 // Close the codec 67 65 avcodec_close(codec_context); … … 80 78 frame_number = 0; 81 79 loading = false; 82 83 /*material = new Material;84 material->setDiffuseMap("maps/radialTransparency.png");85 86 model = new PrimitiveModel(PRIM_PLANE, 10.0);87 88 LightManager* lightMan = LightManager::getInstance();89 lightMan->setAmbientColor(.1,.1,.1);90 (new Light())->setAbsCoor(5.0, 10.0, 40.0);91 (new Light())->setAbsCoor(-10, -20, -100);92 */93 80 } 94 81 … … 344 331 status = PLAY; 345 332 timer = 0; 346 347 this->gotoFrame(start_frame);348 349 PRINTF(0)("start\n");350 333 } 351 334 } … … 354 337 { 355 338 if(status == PAUSE) 356 {357 339 status = PLAY; 358 PRINTF(0)("resume\n");359 }360 340 } 361 341 … … 363 343 { 364 344 if(status == PLAY) 365 {366 345 status = PAUSE; 367 PRINTF(0)("pause\n");368 }369 346 } 370 347 … … 372 349 { 373 350 status = STOP; 374 375 PRINTF(0)("stop\n");376 351 } 377 352 … … 389 364 this->skipFrame(actual_frame - frame_number - 1); 390 365 } 391 //PRINTF(0)("frame_number: %i\n", frame_number); 392 } 393 } 394 395 /*const void MoviePlayer::draw() 396 { 397 material->select(); 398 glBindTexture(GL_TEXTURE_2D, texture); 399 model->draw(); 400 401 LightManager::getInstance()->draw(); 402 }*/ 366 } 367 } 403 368 404 369 GLuint MoviePlayer::getTexture() -
branches/avi_play/src/lib/graphics/importer/movie_player.h
r6600 r6611 17 17 18 18 #include "glincl.h" 19 20 //#include "light.h"21 19 #include "texture.h" 22 //#include "material.h"23 //#include "primitive_model.h"24 20 25 21 // include base_object.h since all classes are derived from this one … … 29 25 typedef enum MP_STATUS { 30 26 PLAY, 31 32 27 PAUSE, 28 STOP 33 29 }; 34 30 … … 37 33 38 34 private: 39 40 //Model* model;41 //Material* material;42 35 43 36 AVFormatContext* format_context; … … 71 64 bool loadMovie(const char* filename); 72 65 73 74 75 76 66 void start(float start_time); 67 void resume(); 68 void pause(); 69 void stop(); 77 70 78 void tick(float dt); 79 //const void draw(); 80 GLuint getTexture(); 71 void tick(float dt); 72 GLuint getTexture(); 81 73 82 83 84 74 void setFPS(float fps); 75 float getFPS(); 76 const MP_STATUS getStatus(); 85 77 void printInformation(); 86 78 … … 94 86 }; 95 87 96 97 98 88 #endif // _MOVIE_PLAYER -
branches/avi_play/src/story_entities/movie_loader.cc
r6604 r6611 20 20 #include "graphics_engine.h" 21 21 #include "load_param.h" 22 #include "resource_manager.h"23 22 #include "state.h" 24 23 … … 36 35 } 37 36 38 MovieLoader::~MovieLoader() 37 MovieLoader::~MovieLoader() 39 38 { 40 PRINTF(4)("Deleted MoviePlayer\n");39 delete this->movie_player; 41 40 } 42 41 … … 53 52 { 54 53 movie_player->loadMovie(filename); 55 56 PRINTF(0)("\nloaded Movie %s\n\n", filename);57 54 } 58 55 59 56 60 ErrorMessage MovieLoader::init() 61 { 62 63 } 57 ErrorMessage MovieLoader::init() {} 64 58 65 59 66 ErrorMessage MovieLoader::loadData() 67 { 68 69 } 60 ErrorMessage MovieLoader::loadData() {} 70 61 71 62 72 ErrorMessage MovieLoader::unloadData() 73 { 74 75 } 63 ErrorMessage MovieLoader::unloadData() {} 76 64 77 65 bool MovieLoader::start() 78 66 { 79 PRINTF(0)("\nMovieLoader INFO:\n"); 80 movie_player->printInformation(); 81 PRINTF(0)("\n"); 82 67 this->movie_player->start(0); 68 83 69 this->isRunning = true; 84 85 70 this->run(); 86 71 } … … 98 83 // first timestamp for t = 0 99 84 this->lastFrame = SDL_GetTicks (); 100 this->movie_player->start(0);101 85 102 86 while( this->isRunning) 103 87 { 104 105 88 this->tick(); 106 89 this->draw(); 107 108 90 } 109 91 }
Note: See TracChangeset
for help on using the changeset viewer.