Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6598 in orxonox.OLD


Ignore:
Timestamp:
Jan 18, 2006, 5:11:26 PM (18 years ago)
Author:
hdavid
Message:

avi-play: movie stops afer it is done

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  
    1717
    1818#include "movie_player.h"
     19#include "factory.h"
     20#include "graphics_engine.h"
    1921#include "load_param.h"
    2022#include "resource_manager.h"
     
    2325using namespace std;
    2426
     27CREATE_FACTORY(MovieLoader, CL_MOVIE_LOADER);
    2528
    2629MovieLoader::MovieLoader(const TiXmlElement* root)
     
    5053  movie_player->loadMovie(filename);
    5154
    52   PRINTF(0)("loaded Movie %s", filename);
     55  PRINTF(0)("\nloaded Movie %s\n\n", filename);
    5356}
    5457
     
    7376bool MovieLoader::start()
    7477{
     78  PRINTF(0)("\nMovieLoader INFO:\n");
     79  movie_player->printInformation();
     80  PRINTF(0)("\n");
     81
    7582  this->isRunning = true;
    7683
    77   //this->run();
     84  this->run();
    7885}
    7986
     
    9097  // first timestamp for t = 0
    9198  this->lastFrame = SDL_GetTicks ();
     99  this->movie_player->start(0);
    92100
    93101  while( this->isRunning)
     
    95103
    96104    this->tick();
     105    this->draw();
    97106
    98     //movie_player->draw();
    99107  }
    100108}
     109
     110void 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
    101134
    102135void MovieLoader::tick()
     
    112145  movie_player->tick(dts);
    113146
     147  if (movie_player->getStatus() == STOP)
     148    this->isRunning = false;
     149
    114150  this->lastFrame = currentFrame;
    115151}
  • branches/avi_play/src/story_entities/movie_loader.h

    r6576 r6598  
    4242    void loadMovie(const char* filename);
    4343    void tick();
     44    void draw() const;
    4445
    4546};
Note: See TracChangeset for help on using the changeset viewer.