Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6339 in orxonox.OLD for branches/avi_play/src/subprojects


Ignore:
Timestamp:
Dec 30, 2005, 1:51:41 AM (19 years ago)
Author:
hdavid
Message:

branches\avi_play: some copy, pasta & delete

Location:
branches/avi_play/src/subprojects/importer
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/avi_play/src/subprojects/importer/importer.cc

    r6286 r6339  
    2525#include "resource_manager.h"
    2626
    27 MediaContainer* movie;
    2827
    2928void Framework::moduleInit(int argc, char** argv)
    3029{
    3130
    32   movie = new MediaContainer(argv[1]);
    33 
    34   // print information about the media file
    35   movie->printMediaInformation();
    36 
    37   SDL_Delay(1000);
    3831
    3932}
     
    4639void Framework::moduleTick(float dt)
    4740{
    48   while(movie->getNextFrame() != NULL);
    49     movie->saveCurrentFrame(); 
     41
    5042}
    5143
  • branches/avi_play/src/subprojects/importer/movie_player_test.cc

    r6325 r6339  
    2121#include "movie_player.h"
    2222
    23 MoviePlayer* movie_player;
     23//MoviePlayer* movie_player;
    2424
    2525void Framework::moduleInit(int argc, char** argv)
    2626{
    27   movie_player = new MoviePlayer(argv[1]);
     27  //movie_player = new MoviePlayer(argv[1]);
    2828
    29   movie_player->printInformation();
     29  //movie_player->printInformation();
    3030}
    3131
    3232void Framework::moduleEventHandler(SDL_Event* event)
    3333{
    34   switch (event->type)
     34  /*switch (event->type)
    3535  {
    3636    case SDL_KEYDOWN:
     
    5858          break;
    5959      }
    60   }
     60  }*/
    6161}
    6262
    6363void Framework::moduleTick(float dt)
    6464{
    65   movie_player->tick(dt);
     65  //movie_player->tick(dt);
    6666}
    6767
    6868void Framework::moduleDraw(void) const
    6969{
    70   movie_player->draw();
     70  //movie_player->draw();
    7171}
    7272
  • branches/avi_play/src/subprojects/importer/multitex.cc

    r6333 r6339  
    2020#include "light.h"
    2121
    22 #include "texture_sequence.h"
    2322#include "material.h"
    24 
    2523#include "primitive_model.h"
    2624#include <stdlib.h>
     
    2927
    3028Model* obj;
    31 TextureSequence* seq;
    3229Material* testMat;
    33 MediaContainer* movie;
     30MediaContainer* media_container;
    3431
    3532int counter = 0;
     
    4037void Framework::moduleInit(int argc, char** argv)
    4138{
    42   if( argc <= 2)
     39  if( argc <= 1)
    4340  {
    4441    printf("Wrong arguments try following notations:\n");
    45     printf("./multitex [media_file] [start_time]\n");
     42    printf("./multitex [media_file]\n");
    4643    exit(0);
    4744  }
    4845
    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]);
    5847
    5948  testMat = new Material;
    60 
    61   seq = new TextureSequence();
    62 
    63   // get each fram individually
    64   //while(seq->addFrame(movie->getNextFrame()) != NULL);
    65   // get a list of frames
    66   movie->gotoFrame(start_frame);
    67   seq->addFrameList(movie->getFrameList());
    68 
    6949  testMat->setDiffuseMap("maps/radialTransparency.png");
    70 
    7150  obj = new PrimitiveModel(PRIM_PLANE, 10.0);
    7251
     
    7554  (new Light())->setAbsCoor(5.0, 10.0, 40.0);
    7655  (new Light())->setAbsCoor(-10, -20, -100);
     56
     57  fps = media_container->getFPS();
    7758}
    7859
     
    9677        case SDLK_9:
    9778          fps++;
    98           PRINTF(1)("fps: %f\n", fps);
     79          PRINTF(0)("fps: %0.2f\n", fps);
    9980          break;
    10081        // decrease fps
     
    10283          if(fps > 0)
    10384            fps--;
    104           PRINTF(1)("fps: %f\n", fps);
     85          PRINTF(0)("fps: %0.2f\n", fps);
    10586          break;
    10687        }
     
    11697    counter = fps * timer;
    11798
    118     if (counter > seq->getFrameCount())
     99    if (counter >= media_container->getFrameCount())
    119100    {
    120101      timer = 0;
    121102      counter = 0;
    122103    }
    123 
    124     seq->gotoFrame(counter);
    125104  }
    126105}
     
    129108{
    130109  testMat->select();
    131   glBindTexture(GL_TEXTURE_2D, seq->getTexture());
     110  glBindTexture(GL_TEXTURE_2D, media_container->getFrameTexture(counter));
    132111  obj->draw();
    133112
     
    135114}
    136115
    137 
    138116void Framework::moduleHelp(void) const
    139117{
Note: See TracChangeset for help on using the changeset viewer.