Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 28, 2006, 11:47:35 PM (18 years ago)
Author:
patrick
Message:

door and weapon stuff

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/single_player_map/src/world_entities/door.cc

    r8886 r8890  
    5353Door::Door(const TiXmlElement* root)
    5454{
    55   this->init();
     55
     56  this->setClassID(CL_DOOR, "Door");
     57  this->scale = 1.0f;
    5658
    5759  if( root != NULL)
    5860    this->loadParams(root);
     61
     62  this->toList(OM_COMMON);
     63  this->bLocked = false;
     64
     65  this->loadMD2Texture("maps/doors.jpg");
     66  this->loadModel("models/creatures/doors.md2", this->scale);
     67  this->setAnimation(DOOR_CLOSE, MD2_ANIM_ONCE);
    5968}
    6069
     
    6473
    6574
    66 
    67 void Door::init()
    68 {
    69   this->setClassID(CL_DOOR, "Door");
    70   this->toList(OM_COMMON);
    71 
    72   this->bLocked = false;
    73 
    74 
    75   this->loadMD2Texture("maps/doors.jpg");
    76   this->loadModel("models/creatures/doors.md2", 1.0);
    77   this->setAnimation(DOOR_CLOSE, MD2_ANIM_ONCE);
    78 }
    7975
    8076/**
     
    8682  WorldEntity::loadParams(root);
    8783
    88   LoadParam(root, "", this, Door, setActionRadius)
     84  LoadParam(root, "action-radius", this, Door, setActionRadius)
    8985      .describe("sets the action radius of the door")
    9086      .defaultValues(3.0);
     87  LoadParam(root, "scale", this, Door, setScale)
     88      .describe("sets the scale of the door")
     89      .defaultValues(1.0);
    9190}
    9291
     
    115114    ((InteractiveModel*)this->getModel(0))->tick(time);
    116115
    117   this->checkOpen();
     116  if( this->checkOpen() && !this->bOpen)
     117    this->open();
     118  else if( bOpen)
     119    this->close();
     120
    118121}
    119122
     
    128131
    129132  this->setAnimation(DOOR_OPEN, MD2_ANIM_ONCE);
    130 
     133  this->bOpen = true;
    131134}
    132135
     
    137140void Door::close()
    138141{
    139 
     142  this->setAnimation(DOOR_CLOSE, MD2_ANIM_ONCE);
     143  this->bOpen = false;
    140144}
    141145
Note: See TracChangeset for help on using the changeset viewer.