Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7217 in orxonox.OLD


Ignore:
Timestamp:
Mar 12, 2006, 2:16:24 PM (18 years ago)
Author:
bensch
Message:

orxonox/std:: removed two seg-fault bugs… but strangely some models are not loaded

Location:
branches/std/src/world_entities
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/std/src/world_entities/creatures/md2_creature.cc

    r7193 r7217  
    255255  this->shiftCoor (move);
    256256
    257   if( this->bJump)
     257  if( this->bJump && likely(this->getModel(0) != NULL))
    258258  {
    259259    ((MD2Model*)this->getModel(0))->setAnim(JUMP);
    260260  }
    261   else if( this->bFire)
     261  else if( this->bFire && likely(this->getModel(0) != NULL))
    262262  {
    263263    if( ((MD2Model*)this->getModel(0))->getAnim() != ATTACK) ((MD2Model*)this->getModel(0))->setAnim(ATTACK);
    264264  }
    265   else if( fabs(move.len()) > 0.0f)
     265  else if( fabs(move.len()) > 0.0f && likely(this->getModel(0) != NULL))
    266266  {
    267267    if( ((MD2Model*)this->getModel(0))->getAnim() != RUN) ((MD2Model*)this->getModel(0))->setAnim(RUN);
    268268  }
    269   else
     269  else if (likely(this->getModel(0) != NULL))
    270270  {
    271271    if( ((MD2Model*)this->getModel(0))->getAnim() != STAND) ((MD2Model*)this->getModel(0))->setAnim(STAND);
  • branches/std/src/world_entities/terrain.cc

    r7216 r7217  
    177177void Terrain::loadVegetation(const std::string& vegetationFile)
    178178{
    179   PRINTF(0)("loadVegetation: %s\n", vegetationFile.c_str());
     179  PRINTF(4)("loadVegetation: %s\n", vegetationFile.c_str());
    180180  if (this->vegetation)
    181181    ResourceManager::getInstance()->unload(this->vegetation, RP_LEVEL);
  • branches/std/src/world_entities/weapons/aiming_turret.cc

    r7193 r7217  
    168168  glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
    169169
    170   this->getModel()->draw();
     170  if (this->getModel())
     171    this->getModel()->draw();
    171172  glPopMatrix();
    172173}
  • branches/std/src/world_entities/world_entity.cc

    r7216 r7217  
    118118 * @param fileName the name of the model to load
    119119 * @param scaling the Scaling of the model
    120  *
    121  * @todo fix this, so it only has one loadModel-Function.
    122 */
     120 */
    123121void WorldEntity::loadModel(const std::string& fileName, float scaling, unsigned int modelNumber)
    124122{
     
    152150      if (loadedModel != NULL)
    153151        this->setModel(dynamic_cast<Model*>(loadedModel), modelNumber);
     152      else
     153        PRINTF(1)("OBJ-File %s not found.\n", fileName.c_str());
    154154
    155155      if( modelNumber == 0)
Note: See TracChangeset for help on using the changeset viewer.