Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9003 in orxonox.OLD for trunk/src/world_entities/bsp_entity.cc


Ignore:
Timestamp:
Jul 2, 2006, 1:36:13 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the single_player_map branche back
merged with command:
svn merge -r8896:HEAD https://svn.orxonox.net/orxonox/branches/single_player_map .
no conflicts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/bsp_entity.cc

    r8490 r9003  
    11/*
    22   orxonox - the future of 3D-vertical-scrollers
    3 
     3 
    44   Copyright (C) 2004 orx
    5 
     5 
    66   This program is free software; you can redistribute it and/or modify
    77   it under the terms of the GNU General Public License as published by
    88   the Free Software Foundation; either version 2, or (at your option)
    99   any later version.
    10 
     10 
    1111   ### File Specific:
    1212   main-programmer: Claudio Botta
     
    1515
    1616#include "bsp_entity.h"
     17#include "util/loading/resource_manager.h"
    1718#include "util/loading/resource_manager.h"
    1819
     
    3839BspEntity::~BspEntity ()
    3940{
    40   if( this->bspManager)
     41  if( this->bspManager != NULL)
    4142    delete this->bspManager;
    4243}
     44
    4345
    4446
     
    4951void BspEntity::init()
    5052{
    51   this->setClassID(CL_BSP_ENTITY, "BspEntity");
    5253
    53   this->bspManager = new BspManager(this);
    54   this->toList(OM_ENVIRON);
    55 
     54  this->bspManager = NULL;
    5655  /**
    5756   * @todo: Write CL_BSP_ENTITY INTO THE src/defs/class_id.h (your own definition)
     
    6463  PRINTF(0)("+++++++++++ LOADING NAME %s\n", name.c_str());
    6564
    66   this->bspManager->load(name.c_str(), 0.1f);
     65  // Check wether file exists....
     66  if ( File(ResourceManager::getFullName(name)).exists()  ) {
     67
     68    this->setClassID(CL_BSP_ENTITY, "BspEntity");
     69    this->bspManager = new BspManager(this);
     70
     71    if(this->bspManager->load(name.c_str(), 0.1f) == -1 ) {
     72      this->bspManager = NULL;
     73
     74    } else {
     75      this->toList(OM_ENVIRON); // Success!!!
     76    }
     77  } else {
     78    this->bspManager = NULL;
     79    this->toList(OM_DEAD);
     80  }
    6781}
    6882
     
    7690{
    7791  // all the clases this Entity is directly derived from must be called in this way, to load all settings.
    78  // WorldEntity::loadParam(root);
     92  // WorldEntity::loadParam(root);
    7993
    8094  LoadParam(root, "Name", this, BspEntity, setName)
    81       .describe("Sets the of the BSP file.");
     95  .describe("Sets the of the BSP file.");
    8296
    83 /*  LoadParam(root, "Scale", this, BSpEntity, setScale)
    84       .describe("Sets the scale factore of the bsp level.");
    85 */
     97  /*  LoadParam(root, "Scale", this, BSpEntity, setScale)
     98        .describe("Sets the scale factore of the bsp level.");
     99  */
    86100
    87101  /**
     
    115129 */
    116130void BspEntity::collidesWith (WorldEntity* entity, const Vector& location)
    117 {
    118 
    119 }
     131{}
Note: See TracChangeset for help on using the changeset viewer.