Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6827 in orxonox.OLD for trunk


Ignore:
Timestamp:
Jan 29, 2006, 2:10:48 PM (19 years ago)
Author:
bensch
Message:

trunk: Music should be loadable

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/sound/ogg_player.cc

    r5283 r6827  
    3434{
    3535  this->setClassID(CL_SOUND_OGG_PLAYER, "OggPlayer");
     36
     37  this->source = 0;
     38
    3639  if (fileName != NULL)
    3740  {
     
    7073    alGenBuffers(2, buffers);
    7174    check();
    72     alGenSources(1, &source);
     75    SoundEngine::getInstance()->popALSource(this->source);
    7376    check();
    7477
     
    8891    alSourceStop(source);
    8992    empty();
    90     alDeleteSources(1, &source);
     93    SoundEngine::getInstance()->pushALSource(source);
    9194    check();
    9295    alDeleteBuffers(1, buffers);
  • trunk/src/story_entities/game_world.cc

    r6780 r6827  
    366366  PNode::getNullParent()->updateNode (this->dtS);
    367367  SoundEngine::getInstance()->update();
    368   //music->update();
     368
     369  if (this->dataTank->music != NULL)
     370    this->dataTank->music->update();
    369371}
    370372
     
    435437
    436438  engine->draw();
    437 
    438   /* final draw command */
    439439}
    440440
  • trunk/src/story_entities/game_world_data.cc

    r6815 r6827  
    280280  LoadParamXML(root, "GraphicsEngine", GraphicsEngine::getInstance(), GraphicsEngine, loadParams);
    281281
     282  LoadParam(root, "Music", this, GameWorldData, setSoundTrack);
     283
    282284//  LoadParamXML(root, "ParticleEngine", ParticleEngine::getInstance(), ParticleEngine, loadParams);
    283285  //LoadParamXML(root, "PhysicsEngine", PhysicsEngine::getInstance(), PhysicsEngine, loadParams);
     
    311313void GameWorldData::setSoundTrack(const char* name)
    312314{
     315  if (this->music != NULL)
     316    delete this->music;
     317
    313318  PRINTF(3)("Setting Sound Track to %s\n", name);
    314319  this->music = (OggPlayer*)ResourceManager::getInstance()->load(name, OGG, RP_LEVEL);
  • trunk/src/story_entities/game_world_data.h

    r6634 r6827  
    5252    virtual ErrorMessage unloadScene();
    5353
    54 
    5554  public:
    5655    GLMenuImageScreen*  glmis;                       //!< The Level-Loader Display
Note: See TracChangeset for help on using the changeset viewer.