Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6532 in orxonox.OLD


Ignore:
Timestamp:
Jan 18, 2006, 1:20:02 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged branches/movie_play to the trunk. no conflicts, but a minor virtual function BUG

Location:
trunk
Files:
11 edited
7 copied

Legend:

Unmodified
Added
Removed
  • trunk/config.h.in

    r6271 r6532  
    1010#undef HAVE_AL_AL_H
    1111
     12/* Define to 1 if you have the <avcodec.h> header file. */
     13#undef HAVE_AVCODEC_H
     14
     15/* Define to 1 if you have the <avformat.h> header file. */
     16#undef HAVE_AVFORMAT_H
     17
    1218/* Define to 1 if you have the `bzero' function. */
    1319#undef HAVE_BZERO
     
    1521/* if we have CURL */
    1622#undef HAVE_CURL
     23
     24/* Define to 1 if you have the <ffmpeg/avcodec.h> header file. */
     25#undef HAVE_FFMPEG_AVCODEC_H
     26
     27/* Define to 1 if you have the <ffmpeg/avformat.h> header file. */
     28#undef HAVE_FFMPEG_AVFORMAT_H
    1729
    1830/* Define to 1 if you have the <GL/glew.h> header file. */
  • trunk/configure.ac

    r6274 r6532  
     1
    12##########################################################################
    23#   orxonox - the future of 3D-vertical-scrollers                        #
     
    522523AX_CHECK_REQUIRED_HEADER_LIB([vorbis/codec.h], [vorbis], [main],,, [http://www.xiph.org/ogg/vorbis/index.html])
    523524AX_CHECK_REQUIRED_HEADER_LIB([vorbis/vorbisfile.h], [vorbisfile], [main],,, [http://www.xiph.org/ogg/vorbis/index.html])
     525
     526#--------#
     527# FFmpeg #
     528#--------#
     529# checking for FFmpeg-headers
     530  AC_CHECK_HEADERS([avformat.h] ,,
     531      [AC_CHECK_HEADERS([ffmpeg/avformat.h] ,,AC_MSG_ERROR([cannot find FFmpeg header.])]))
     532# checking for ffmpeg-lib
     533  AC_CHECK_LIB([avformat], [main], [FOUND_avformat=yes; LIBS="$LIBS -lavformat"])
     534     if test x$FOUND_avformat != xyes ; then
     535        echo "------------------"
     536        echo "avformat library not found."
     537        echo "please install the FFmpeg library, which can be found at http://ffmpeg.sourceforge.net"
     538        echo "------------------"
     539        exit -1
     540     fi
     541  AC_CHECK_HEADERS([avcodec.h] ,,
     542      [AC_CHECK_HEADERS([ffmpeg/avcodec.h] ,,AC_MSG_ERROR([cannot find FFmpeg header.])]))
     543  AC_CHECK_LIB([avcodec], [main], [FOUND_avcodec=yes; LIBS="$LIBS -lavcodec"])
     544     if test x$FOUND_avcodec != xyes ; then
     545        echo "------------------"
     546        echo "avcodec library not found."
     547        echo "please install the FFmpeg library, which can be found at http://ffmpeg.sourceforge.net"
     548        echo "------------------"
     549        exit -1
     550     fi
     551  AC_CHECK_LIB([avutil], [main], [FOUND_avutil=yes; LIBS="$LIBS -lavutil"])
     552
     553  AC_CHECK_LIB([theora], [main], [FOUND_theora=yes; LIBS="$LIBS -ltheora"])
     554
     555  AC_CHECK_LIB([dts], [main], [FOUND_dts=yes; LIBS="$LIBS -ldts"])
     556
     557  AC_CHECK_LIB([gsm], [main], [FOUND_gsm=yes; LIBS="$LIBS -lgsm"])
     558
     559  AC_CHECK_LIB([dc1394_control], [main], [FOUND_dc1394_control=yes; LIBS="$LIBS -ldc1394_control"])
     560
     561  AC_CHECK_LIB([vorbisenc], [main], [FOUND_vorbisenc=yes; LIBS="$LIBS -lvorbisenc"])
    524562
    525563#---------#
  • trunk/src/defs/class_id.h

    r6455 r6532  
    192192  CL_NPC_TEST1                  =    0x00000301,
    193193  CL_NPC_TEST2                  =    0x00000302,
     194  CL_MOVIE_ENTITY               =    0x00000303,
    194195
    195196
     
    226227  CL_TEXTURE_SEQUENCE           =    0x00004805,
    227228  CL_OBJ_MODEL                  =    0x00000807,
     229
     230  CL_MOVIE_PLAYER               =    0x00000805,
     231  CL_MEDIA_CONTAINER            =    0x00000806,
    228232  CL_PROMITIVE_MODEL            =    0x00000808,
    229233  CL_MD2Model                   =    0x00000809,
  • trunk/src/lib/graphics/importer/Makefile.am

    r6455 r6532  
    1414                           texture.cc \
    1515                           texture_sequence.cc \
    16                            height_map.cc
     16                           height_map.cc \
     17                           media_container.cc \
     18                           movie_player.cc
    1719
    1820libtc_a_SOURCES  = tc.cc
     
    3234                 height_map.h \
    3335                 anorms.h \
    34                  anormtab.h
     36                 anormtab.h \
     37                 media_container.h \
     38                 movie_player.h
  • trunk/src/lib/graphics/importer/texture.cc

    r6523 r6532  
    199199                               0xFF000000
    200200#else
    201                                    0xFF000000,
     201                               0xFF000000,
    202202                               0x00FF0000,
    203203                               0x0000FF00,
  • trunk/src/lib/graphics/importer/texture_sequence.cc

    r5885 r6532  
    4747TextureSequence::~TextureSequence()
    4848{
     49  this->clearLists();
     50}
     51
     52void TextureSequence::clearLists()
     53{
    4954  // delete all images
    5055  while(!this->images.empty())
     
    5459  }
    5560
    56   this->setTexture(0);
    5761  // delete all textures.
    5862  while(!this->textures.empty())
     
    6367  }
    6468}
    65 
    6669
    6770/**
     
    149152  }
    150153  this->setAlpha(hasAlpha);
     154
    151155  return true;
    152156}
    153157
     158/**
     159 * @brief adds a new Frame at the end of the Sequence.
     160 * @param texture the texture to add at the end of the Sequence.
     161 */
     162bool TextureSequence::addFrame(GLuint texture)
     163{
     164  if (texture == 0)
     165    return false;
     166  this->textures.push_back(texture);
    154167
     168  return true;
     169}
    155170
    156171/**
     
    158173 * @param frameNumber the n-th frame
    159174 */
    160 void TextureSequence::gotoFrame(unsigned int frameNumber)
     175/*void TextureSequence::gotoFrame(unsigned int frameNumber)
    161176{
    162177  if (this->textures.size() > frameNumber)
    163178    this->setTexture(this->textures[frameNumber]);
    164179}
     180*/
  • trunk/src/lib/graphics/importer/texture_sequence.h

    r5865 r6532  
    2929    bool addFrame(const char* image);
    3030    bool addFrame(SDL_Surface* surface);
     31    bool addFrame(GLuint texture);
     32
     33    void clearLists();
    3134
    3235    virtual bool rebuild();
     
    3538    inline unsigned int getFrameCount() const { return this->textures.size(); };
    3639
    37     void gotoFrame(unsigned int frameNumber);
     40    //void gotoFrame(unsigned int frameNumber);
    3841    /** @returns The textureID of the Frame @param frameNumber the n-th frame this texture-series.  */
    3942    inline GLuint getFrameTexture(unsigned int frameNumber) const { return (this->textures.size()>frameNumber)?this->textures[frameNumber]:0; };
  • trunk/src/subprojects/importer/Makefile.am

    r6310 r6532  
    77
    88bin_PROGRAMS = importer \
    9                multitex
     9               multitex \
     10                                                         movie_player_test
    1011
    1112importer_LDADD = $(MAINSRCDIR)/lib/event/libORXevent.a \
     
    6364                  $(MAINSRCDIR)/lib/util/executor/executor.cc \
    6465                  $(MAINSRCDIR)/util/loading/factory.cc
     66
     67movie_player_test_LDADD = $(MAINSRCDIR)/lib/event/libORXevent.a \
     68                                                        $(MAINSRCDIR)/lib/parser/tinyxml/libtinyxml.a \
     69                                                        $(MAINSRCDIR)/lib/graphics/libORXgraphics.a \
     70                                                        $(MAINSRCDIR)/lib/shell/libORXshell.a \
     71                                                        $(MAINSRCDIR)/lib/sound/libORXsound.a \
     72                                                        $(MAINSRCDIR)/lib/graphics/importer/libORXimporter.a
     73
     74movie_player_test_SOURCES= ../framework.cc \
     75                                                 movie_player_test.cc \
     76                                                 $(MAINSRCDIR)/util/state.cc \
     77                                                 $(MAINSRCDIR)/world_entities/camera.cc \
     78                                                 $(MAINSRCDIR)/lib/lang/base_object.cc \
     79                                                                                                         $(MAINSRCDIR)/lib/lang/class_list.cc \
     80                                                                                                         $(MAINSRCDIR)/lib/math/vector.cc \
     81                                                                                                         $(MAINSRCDIR)/util/loading/resource_manager.cc \
     82                                                                                                         $(MAINSRCDIR)/lib/parser/ini_parser/ini_parser.cc \
     83                                                                                                         $(MAINSRCDIR)/lib/coord/p_node.cc \
     84                                                                                                         $(MAINSRCDIR)/lib/coord/null_parent.cc \
     85                                                                                                         $(MAINSRCDIR)/util/loading/load_param.cc \
     86                                                                                                         $(MAINSRCDIR)/util/loading/load_param_description.cc \
     87                                                                                                         $(MAINSRCDIR)/lib/util/helper_functions.cc \
     88                                                                                                         $(MAINSRCDIR)/lib/util/substring.cc \
     89                                                                                                         $(MAINSRCDIR)/lib/util/color.cc \
     90                                                                                                         $(MAINSRCDIR)/lib/util/multi_type.cc \
     91                                                                                                         $(MAINSRCDIR)/lib/util/executor/executor.cc \
     92                                                                                                         $(MAINSRCDIR)/util/loading/factory.cc
  • trunk/src/subprojects/importer/multitex.cc

    r5866 r6532  
    1010
    1111   ### File Specific:
    12    main-programmer: Benjamin Grauer
     12   main-programmer: David Hasenfratz
    1313   co-programmer: ...
    1414
     
    2020#include "light.h"
    2121
    22 #include "texture_sequence.h"
    2322#include "material.h"
    24 
    25 #include "objModel.h"
    26 
    2723#include "primitive_model.h"
    2824#include <stdlib.h>
    2925
    30 #include "resource_manager.h"
     26#include "media_container.h"
    3127
    3228Model* obj;
    33 TextureSequence* seq;
    34 Texture* test;
    3529Material* testMat;
     30MediaContainer* media_container;
    3631
    37 float counter = 0;
     32int counter = 0;
     33float timer = 0;
     34float fps;
    3835
    3936
    4037void Framework::moduleInit(int argc, char** argv)
    4138{
    42   ResourceManager::getInstance()->addImageDir("./");
     39  if( argc <= 1)
     40  {
     41    printf("Wrong arguments try following notations:\n");
     42    printf("./multitex [media_file]\n");
     43    exit(0);
     44  }
     45
     46  media_container = new MediaContainer(argv[1]);
    4347
    4448  testMat = new Material;
    45 
    46   seq = new TextureSequence();
    47   for (int i = 1; i < argc; i++)
    48   {
    49     seq->addFrame(argv[i]);
    50     printf("%s\n", argv[i]);
    51   }
    52   test = new Texture(argv[1]);
    53   testMat->setDiffuseMap(argv[1]);
    54 
    55   ResourceManager::getInstance()->addImageDir("");
    56 
    57 
    58   obj = new PrimitiveModel(PRIM_SPHERE, 10.0);
    59 
    60   ResourceManager::getInstance()->debug();
     49  testMat->setDiffuseMap("maps/radialTransparency.png");
     50  obj = new PrimitiveModel(PRIM_PLANE, 10.0);
    6151
    6252  LightManager* lightMan = LightManager::getInstance();
     
    6454  (new Light())->setAbsCoor(5.0, 10.0, 40.0);
    6555  (new Light())->setAbsCoor(-10, -20, -100);
     56
     57  fps = media_container->getFPS();
    6658}
    6759
     
    7365      switch (event->key.keysym.sym)
    7466        {
    75         case SDLK_i:
     67        case SDLK_1:
     68          obj = new PrimitiveModel(PRIM_CUBE, 10.0);
     69          break;
     70        case SDLK_2:
     71          obj = new PrimitiveModel(PRIM_SPHERE, 10.0);
     72          break;
     73        case SDLK_3:
     74          obj = new PrimitiveModel(PRIM_PLANE, 10.0);
     75          break;
     76        // increase fps
     77        case SDLK_9:
     78          fps++;
     79          PRINTF(0)("fps: %0.2f\n", fps);
     80          break;
     81        // decrease fps
     82        case SDLK_8:
     83          if(fps > 0)
     84            fps--;
     85          PRINTF(0)("fps: %0.2f\n", fps);
    7686          break;
    7787        }
     
    8191void Framework::moduleTick(float dt)
    8292{
    83   counter+=dt;
     93  timer += dt;
    8494
    85   seq->gotoFrame((unsigned int)counter);
    86   if ((unsigned int)counter > seq->getFrameCount())
    87     counter = 0;
     95  if(counter != fps * timer)
     96  {
     97    counter = fps * timer;
     98
     99    if (counter >= media_container->getFrameCount())
     100    {
     101      timer = 0;
     102      counter = 0;
     103    }
     104  }
    88105}
    89106
     
    91108{
    92109  testMat->select();
    93   glBindTexture(GL_TEXTURE_2D, seq->getTexture());
     110  glBindTexture(GL_TEXTURE_2D, media_container->getFrameTexture(counter));
    94111  obj->draw();
    95112
     
    97114}
    98115
    99 
    100116void Framework::moduleHelp(void) const
    101117{
  • trunk/src/world_entities/Makefile.am

    r6455 r6532  
    2020                  world_entities/terrain.cc \
    2121                  world_entities/satellite.cc \
     22                  world_entities/movie_entity.cc \
    2223                  world_entities/character_attributes.cc \
    2324                  world_entities/test_entity.cc \
     
    6869                 world_entities/terrain.h \
    6970                 world_entities/satellite.h \
     71                 world_entities/movie_entity.h \
    7072                 world_entities/character_attributes.h \
    7173                 world_entities/test_entity.h \
  • trunk/src/world_entities/movie_entity.cc

    r6526 r6532  
    6565void MovieEntity::loadParams(const TiXmlElement* root)
    6666{
    67   static_cast<WorldEntity*>(this)->loadParams(root);
     67  WorldEntity::loadParams(root);
    6868
    6969  LoadParam(root, "name", this, MovieEntity, loadMovie);
     
    107107  if(counter != fps * timer)
    108108  {
    109     counter = fps * timer;
     109    counter = (int)(fps * timer);
    110110
    111111    if (counter >= media_container->getFrameCount())
  • trunk/src/world_entities/movie_entity.h

    r6526 r6532  
    3535    virtual void tick (float time);
    3636
    37     void loadParams(const TiXmlElement* root);
     37    virtual void loadParams(const TiXmlElement* root);
    3838
    3939    void loadMovie(const char* filename);
  • trunk/src/world_entities/space_ships/space_ship.cc

    r6518 r6532  
    123123  PRINTF(4)("SPACESHIP INIT\n");
    124124
    125   EventHandler::getInstance()->grabEvents(true);
     125  //EventHandler::getInstance()->grabEvents(true);
    126126
    127127  bUp = bDown = bLeft = bRight = bAscend = bDescend = bRollL = bRollR = false;
Note: See TracChangeset for help on using the changeset viewer.