Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9180 in orxonox.OLD for branches


Ignore:
Timestamp:
Jul 5, 2006, 12:49:40 AM (18 years ago)
Author:
bensch
Message:

less errors/segfaults

Location:
branches/presentation/src
Files:
3 edited
2 copied

Legend:

Unmodified
Added
Removed
  • branches/presentation/src/defs/class_id.h

    r9173 r9180  
    229229  CL_BOMB                       =    0x000003e4,
    230230  CL_GROUND_TURRET              =    0x000003e5,
    231   CL_GUIDED_MISSILE             =    0x000003e6,
    232   CL_HYPERBLAST                 =    0x000003e7,
     231  CL_SPACE_TURRET               =    0x000003e6,
     232  CL_GUIDED_MISSILE             =    0x000003e7,
     233  CL_HYPERBLAST                 =    0x000003e8,
    233234
    234235  // NPC's
  • branches/presentation/src/story_entities/game_world_data.cc

    r9179 r9180  
    392392    std::string oggFile = ResourceManager::getFullName(name);
    393393    this->music = new OrxSound::OggPlayer(oggFile);
    394     this->music->debug();
    395394    if (this->localPlayer != NULL)
    396395      this->localPlayer->hud().notifyUser(std::string("Playing SoundTrack: ") + this->music->artist() + " - " + this->music->title());
  • branches/presentation/src/world_entities/WorldEntities.am

    r9173 r9180  
    44                world_entities/npcs/npc_test.cc \
    55                world_entities/npcs/ground_turret.cc \
     6                world_entities/npcs/space_turret.cc \
    67                world_entities/npcs/generic_npc.cc \
    78                world_entities/npcs/door.cc \
     
    7475                npcs/npc_test1.h \
    7576                npcs/ground_turret.h \
     77                npcs/space_turret.h \
    7678                npcs/door.cc \
    7779                npcs/repair_station.h \
  • branches/presentation/src/world_entities/npcs/space_turret.cc

    r9178 r9180  
    1414*/
    1515
    16 #include "ground_turret.h"
     16#include "space_turret.h"
    1717#include "model.h"
    1818#include "world_entities/weapons/turret.h"
     
    2929#include "effects/explosion.h"
    3030
    31 CREATE_FACTORY(GroundTurret, CL_GROUND_TURRET);
    32 
    33 using namespace std;
    34 
     31CREATE_FACTORY(SpaceTurret, CL_SPACE_TURRET);
    3532
    3633/**
    37  * constructs and loads a GroundTurret from a XML-element
     34 * constructs and loads a SpaceTurret from a XML-element
    3835 * @param root the XML-element to load from
    3936 */
    40 GroundTurret::GroundTurret(const TiXmlElement* root)
     37SpaceTurret::SpaceTurret(const TiXmlElement* root)
    4138  : NPC(root)
    4239{
     
    5047 * standard deconstructor
    5148 */
    52 GroundTurret::~GroundTurret ()
     49SpaceTurret::~SpaceTurret ()
    5350{
    5451
     
    5754
    5855/**
    59  * initializes the GroundTurret
     56 * initializes the SpaceTurret
    6057 * @todo change this to what you wish
    6158 */
    62 void GroundTurret::init()
     59void SpaceTurret::init()
    6360{
    64   this->setClassID(CL_GROUND_TURRET, "GroundTurret");
     61  this->setClassID(CL_SPACE_TURRET, "SpaceTurret");
    6562  this->loadModel("models/ground_turret_#.obj", 5);
     63  this->loadModel("models/comet.obj", .5, 3);
    6664  this->left = NULL;
    6765  this->right = NULL;
     
    8078
    8179/**
    82  * loads a GroundTurret from a XML-element
     80 * loads a SpaceTurret from a XML-element
    8381 * @param root the XML-element to load from
    8482 * @todo make the class Loadable
    8583 */
    86 void GroundTurret::loadParams(const TiXmlElement* root)
     84void SpaceTurret::loadParams(const TiXmlElement* root)
    8785{
    8886  // all the clases this Entity is directly derived from must be called in this way, to load all settings.
     
    121119
    122120/**
    123  * advances the GroundTurret about time seconds
     121 * advances the SpaceTurret about time seconds
    124122 * @param time the Time to step
    125123 */
    126 void GroundTurret::tick(float dt)
     124void SpaceTurret::tick(float dt)
    127125{
    128126  if(this->getHealth() > 0.0f && State::getPlayer() &&
     
    146144 * draws this worldEntity
    147145 */
    148 void GroundTurret::draw () const
     146void SpaceTurret::draw () const
    149147{
    150   WorldEntity::draw();
     148  glPushMatrix();
     149  glTranslatef (this->getAbsCoor ().x,
     150                this->getAbsCoor ().y,
     151                this->getAbsCoor ().z);
     152
     153  Vector tmpRot = this->getAbsDir().getSpacialAxis();
     154  glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
     155
     156  this->getModel()->draw();
     157  if (this->getModel() != NULL)
     158    this->getModel(3)->draw();
     159  glPopMatrix();
    151160
    152161  if (this->left != NULL)
     
    162171 *
    163172 */
    164 void GroundTurret::postSpawn ()
     173void SpaceTurret::postSpawn ()
    165174{
    166175
     
    171180 *
    172181 */
    173 void GroundTurret::leftWorld ()
     182void SpaceTurret::leftWorld ()
    174183{
    175184
    176185}
    177186
    178 void GroundTurret::destroy(WorldEntity* killer)
     187void SpaceTurret::destroy(WorldEntity* killer)
    179188{
    180189  this->setAbsDirSoft(Quaternion(-90, Vector(0,0,1)), 90);
  • branches/presentation/src/world_entities/npcs/space_turret.h

    r9178 r9180  
    11/*!
    2  * @file ground_turret.h
     2 * @file space_turret.h
    33 * @brief description
    44*/
    55
    6 #ifndef _GROUND_TURRET_H
    7 #define _GROUND_TURRET_H
     6#ifndef _SPACE_TURRET_H
     7#define _SPACE_TURRET_H
    88
    99#include "npcs/npc.h"
     
    1212
    1313//! A Class to ...
    14 class GroundTurret : public NPC
     14class SpaceTurret : public NPC
    1515{
    1616
    17  public:
    18   GroundTurret(const TiXmlElement* root = NULL);
    19   virtual ~GroundTurret();
     17public:
     18  SpaceTurret(const TiXmlElement* root = NULL);
     19  virtual ~SpaceTurret();
    2020
    21   void init();
    2221  virtual void loadParams(const TiXmlElement* root);
    2322
     
    3029  virtual void tick(float time);
    3130
    32  private:
    33    PNode  weaponHolder[2];
    34    Weapon *left, *right;
     31private:
     32  void init();
     33
     34
     35private:
     36  PNode  weaponHolder[2];
     37  Weapon *left, *right;
    3538};
    3639
    37 #endif /* _GROUND_TURRET_H */
     40#endif /* _SPACE_TURRET_H */
Note: See TracChangeset for help on using the changeset viewer.