Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7221 in orxonox.OLD for trunk/src/world_entities


Ignore:
Timestamp:
Mar 15, 2006, 3:10:45 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the std-branche back, it runs on windows and Linux

svn merge https://svn.orxonox.net/orxonox/branches/std . -r7202:HEAD

Location:
trunk/src/world_entities
Files:
41 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/creatures/md2_creature.cc

    r7193 r7221  
    5252 * @param fileName the name of the File to load the MD2Creature from (absolute path)
    5353 */
    54 MD2Creature::MD2Creature(const char* fileName)
     54MD2Creature::MD2Creature(const std::string& fileName)
    5555{
    5656  this->init();
     
    5959  if(!doc.LoadFile())
    6060  {
    61     PRINTF(2)("Loading file %s failed for md2 creature.\n", fileName);
     61    PRINTF(2)("Loading file %s failed for md2 creature.\n", fileName.c_str());
    6262    return;
    6363  }
     
    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);
  • trunk/src/world_entities/creatures/md2_creature.h

    r7092 r7221  
    1919  public:
    2020
    21     MD2Creature(const char* fileName);
     21    MD2Creature(const std::string& fileName);
    2222    MD2Creature(const TiXmlElement* root = NULL);
    2323    virtual ~MD2Creature();
  • trunk/src/world_entities/elements/image_entity.cc

    r7193 r7221  
    106106 * @param textureFile The texture-file to load onto the crosshair
    107107 */
    108 void ImageEntity::setTexture(const char* textureFile)
     108void ImageEntity::setTexture(const std::string& textureFile)
    109109{
    110110  this->material->setDiffuseMap(textureFile);
  • trunk/src/world_entities/elements/image_entity.h

    r7016 r7221  
    3030
    3131  void setSize(float sizeX, float sizeY);
    32   void setTexture(const char* textureFile);
     32  void setTexture(const std::string& textureFile);
    3333  /** @param rotationSpeed the speed at what the crosshair should rotate */
    3434  void setRotationSpeed(float rotationSpeed) { this->rotationSpeed = rotationSpeed; };
  • trunk/src/world_entities/elements/text_element.cc

    r7193 r7221  
    7070}
    7171
    72 void TextElement::setText(const char* text)
     72void TextElement::setText(const std::string& text)
    7373{
    7474  Text::setText(text);
    7575}
    7676
    77 void TextElement::setFont(const char* font)
     77void TextElement::setFont(const std::string& font)
    7878{
    7979  Text::setFont(font, (unsigned int)this->getSizeY2D());
  • trunk/src/world_entities/elements/text_element.h

    r7019 r7221  
    2929  virtual void loadParams(const TiXmlElement* root);
    3030
    31   void setText(const char* text);
    32   void setFont(const char* font);
     31  void setText(const std::string& text);
     32  void setFont(const std::string& font);
    3333
    3434 private:
  • trunk/src/world_entities/movie_entity.cc

    r7193 r7221  
    7474}
    7575
    76 void MovieEntity::loadMovie(const char* filename)
     76void MovieEntity::loadMovie(const std::string& filename)
    7777{
    7878  if(media_container->loadMedia(filename))
  • trunk/src/world_entities/movie_entity.h

    r7010 r7221  
    3737    virtual void loadParams(const TiXmlElement* root);
    3838
    39     void loadMovie(const char* filename);
     39    void loadMovie(const std::string& filename);
    4040    void setAxis(float axis);
    4141    void setRotation(float rotation);
  • trunk/src/world_entities/planet.cc

    r7193 r7221  
    4545  this->toList(OM_GROUP_01);
    4646
    47   this->material = new Material();
    4847  //this->material->setIllum(20);
    4948  //this->material->setAmbient(0.1, 0.1, 0.1);
     
    7170{
    7271  PRINTF(5)("Deleting Planet\n");
    73   if( this->material)
    74     delete this->material;
    7572}
    7673
     
    9289 * @param textureName the top texture.
    9390*/
    94 void Planet::setTexture(const char* textureName)
     91void Planet::setTexture(const std::string& textureName)
    9592{
    96   this->material->setDiffuseMap(textureName);
     93  this->material.setDiffuseMap(textureName);
    9794}
    9895
     
    124121  glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
    125122
    126   this->material->select();
     123  this->material.select();
    127124
    128125//   /WorldEntity::draw();
  • trunk/src/world_entities/planet.h

    r6959 r7221  
    99/* INCLUDES */
    1010#include "world_entity.h"
    11 
     11#include "material.h"
    1212/* FORWARD DECLARATION */
    13 class Material;
    1413class Texture;
    1514
     
    2625  void setSize(float size);
    2726  /** assumes jpg as input-format */
    28   void setTexture(const char* textureName);
     27  void setTexture(const std::string& textureName);
    2928
    3029
     
    3433
    3534 private:
    36   Material*       material;        //!< Materials for the Planet. sorted by number (0-5) top, bottom, left, right, front, back
     35  Material        material;        //!< Materials for the Planet. sorted by number (0-5) top, bottom, left, right, front, back
    3736  Texture*        texture;         //!< Textures for the CubeMap.
    3837
  • trunk/src/world_entities/power_ups/param_power_up.cc

    r7193 r7221  
    8181}
    8282
    83 void ParamPowerUp::setType(const char* type)
     83void ParamPowerUp::setType(const std::string& type)
    8484{
    8585  for(int i = 0; i < POWERUP_PARAM_size; ++i) {
    86     if(strcmp(type, paramTypes[i]) == 0) {
     86    if(type == paramTypes[i]) {
    8787      this->type = (EnumParamPowerUpType)i;
    8888      break;
  • trunk/src/world_entities/power_ups/param_power_up.h

    r7065 r7221  
    2828  void setMaxValue(float value);
    2929  void setMinValue(float value);
    30   void setType(const char* type);
     30  void setType(const std::string& type);
    3131  EnumParamPowerUpType getType();
    3232  float getValue();
     
    4343
    4444private:
    45   static const char* paramTypes[];
    46   EnumParamPowerUpType type;
    47   float value;
    48   float max_value;
    49   float min_value;
     45  EnumParamPowerUpType    type;
     46  float                   value;
     47  float                   max_value;
     48  float                   min_value;
     49
     50  static const char*      paramTypes[];
     51
    5052};
    5153
  • trunk/src/world_entities/power_ups/power_up.cc

    r7193 r7221  
    3333  this->respawnStart = 10;
    3434  this->model = NULL;
    35 /*  if(!PowerUp::sphereModel) {*/
     35  /*  if(!PowerUp::sphereModel) {*/
    3636
    3737  Model* sphereModel = new PrimitiveModel(PRIM_SPHERE, 7, 5);
     
    7575
    7676
    77 void PowerUp::loadPickupSound(const char* pickupSound)
     77void PowerUp::loadPickupSound(const std::string& pickupSound)
    7878{
    7979  if (this->pickupBuffer != NULL)
    8080    ResourceManager::getInstance()->unload(this->pickupBuffer);
    8181
    82   else if (pickupSound != NULL)
    83 {
    84   this->pickupBuffer = (SoundBuffer*)ResourceManager::getInstance()->load(pickupSound, WAV);
    85   if (this->pickupBuffer != NULL)
    86   {
    87     PRINTF(4)("Loaded sound %s to Pickup: %s.\n", pickupSound, this->getName());
    88   }
    89   else
    90   {
    91     PRINTF(2)("Failed to load sound %s to pickup %s.\n.", pickupSound, this->getName());
    92   }
    93 }
     82  else if (!pickupSound.empty())
     83  {
     84    this->pickupBuffer = (SoundBuffer*)ResourceManager::getInstance()->load(pickupSound, WAV);
     85    if (this->pickupBuffer != NULL)
     86    {
     87      PRINTF(4)("Loaded sound %s to Pickup: %s.\n", pickupSound.c_str(), this->getName());
     88    }
     89    else
     90    {
     91      PRINTF(2)("Failed to load sound %s to pickup %s.\n.", pickupSound.c_str(), this->getName());
     92    }
     93  }
    9494  else
    9595    this->pickupBuffer = NULL;
    9696}
    9797
    98 void PowerUp::loadRespawnSound(const char* respawnSound)
     98void PowerUp::loadRespawnSound(const std::string& respawnSound)
    9999{
    100100  if (this->respawnBuffer != NULL)
    101101    ResourceManager::getInstance()->unload(this->respawnBuffer);
    102102
    103   else if (respawnSound != NULL)
     103  else if (!respawnSound.empty())
    104104  {
    105105    this->respawnBuffer = (SoundBuffer*)ResourceManager::getInstance()->load(respawnSound, WAV);
    106106    if (this->respawnBuffer != NULL)
    107107    {
    108       PRINTF(4)("Loaded sound %s to Pickup: %s.\n", respawnSound, this->getName());
     108      PRINTF(4)("Loaded sound %s to Pickup: %s.\n", respawnSound.c_str(), this->getName());
    109109    }
    110110    else
    111111    {
    112       PRINTF(2)("Failed to load sound %s to respawn %s.\n.", respawnSound, this->getName());
     112      PRINTF(2)("Failed to load sound %s to respawn %s.\n.", respawnSound.c_str(), this->getName());
    113113    }
    114114  }
     
    128128        this->soundSource.play(this->pickupBuffer);
    129129
    130       switch(respawnType) {
    131         case RESPAWN_NONE:
    132           this->toList(OM_DEAD);
    133           break;
    134         case RESPAWN_TIME:
    135           this->toList(OM_DEAD_TICK);
    136           this->respawnTime = this->respawnStart;
    137           break;
     130      switch(respawnType)
     131      {
     132      case RESPAWN_NONE:
     133        this->toList(OM_DEAD);
     134        break;
     135      case RESPAWN_TIME:
     136        this->toList(OM_DEAD_TICK);
     137        this->respawnTime = this->respawnStart;
     138        break;
    138139      }
    139140    }
     
    141142}
    142143
    143 void PowerUp::tick(float dt) {
    144   if(this->getOMListNumber() != OM_COMMON) {
     144void PowerUp::tick(float dt)
     145{
     146  if(this->getOMListNumber() != OM_COMMON)
     147  {
    145148    this->respawnTime -= dt;
    146149    if(this->respawnTime <= 0)
     
    157160void PowerUp::draw() const
    158161{
    159   if(this->model != NULL) {
     162  if(this->model != NULL)
     163  {
    160164    glMatrixMode(GL_MODELVIEW);
    161165    glPushMatrix();
     
    172176}
    173177
    174 const char* PowerUp::respawnTypes[] = {
    175   "none",
    176   "time"
    177 };
    178 
    179 void PowerUp::setRespawnType(const char* type)
    180 {
    181   for(int i = 0; i < RESPAWN_size; ++i) {
    182     if(!strcmp(type, respawnTypes[i])) {
     178const char* PowerUp::respawnTypes[] =
     179  {
     180    "none",
     181    "time"
     182  };
     183
     184
     185void PowerUp::setRespawnType(const std::string& type)
     186{
     187  for(int i = 0; i < RESPAWN_size; ++i)
     188  {
     189    if(type == respawnTypes[i])
     190    {
    183191      this->respawnType = (PowerUpRespawn)i;
    184192      break;
  • trunk/src/world_entities/power_ups/power_up.h

    r7102 r7221  
    2626  void collidesWith (WorldEntity* entity, const Vector& location);
    2727
    28   void loadPickupSound(const char* pickupSound);
    29   void loadRespawnSound(const char* pickupSound);
     28  void loadPickupSound(const std::string& pickupSound);
     29  void loadRespawnSound(const std::string& respawnSound);
    3030
    3131  virtual void draw () const;
    3232  virtual void tick(float dt);
    33   void setRespawnType(const char* type);
     33  void setRespawnType(const std::string& type);
    3434  void setRespawnTime(const float respawn);
    3535
     
    4545
    4646private:
    47   SoundSource    soundSource;
    48   SoundBuffer*   pickupBuffer;
    49   SoundBuffer*   respawnBuffer;
    50   Material* sphereMaterial;
    51   PowerUpRespawn respawnType;
    52   float respawnTime;
    53   float respawnStart;
    54   static const char* respawnTypes[];
     47  SoundSource         soundSource;
     48  SoundBuffer*        pickupBuffer;
     49  SoundBuffer*        respawnBuffer;
     50  Material*           sphereMaterial;
     51  PowerUpRespawn      respawnType;
     52  float               respawnTime;
     53  float               respawnStart;
     54  static const char*  respawnTypes[];
    5555
    56   WorldEntity* collider;
     56  WorldEntity*        collider;
    5757};
    5858
  • trunk/src/world_entities/power_ups/weapon_power_up.cc

    r7193 r7221  
    9292}
    9393
    94 void WeaponPowerUp::setWeaponClass(const char* name)
     94void WeaponPowerUp::setWeaponClass(const std::string& name)
    9595{
    9696  this->weapon = dynamic_cast<Weapon*>(Factory::fabricate(name));
    9797  if (this->weapon == NULL)
    9898  {
    99     PRINTF(1)("Unable to load Weapon. %s\n", name);
     99    PRINTF(1)("Unable to load Weapon. %s\n", name.c_str());
    100100    this->weapon = dynamic_cast<Weapon*>(Factory::fabricate("Turret"));
    101101  }
  • trunk/src/world_entities/power_ups/weapon_power_up.h

    r7065 r7221  
    2222
    2323  Weapon* getWeapon();
    24   void setWeaponClass(const char* name);
     24  void setWeaponClass(const std::string& name);
    2525
    2626  virtual int writeBytes(const byte* data, int length, int sender);
  • trunk/src/world_entities/projectiles/projectile.cc

    r7193 r7221  
    6161
    6262
    63 void Projectile::loadExplosionSound(const char* explosionSound)
     63void Projectile::loadExplosionSound(const std::string& explosionSound)
    6464{
    6565  if (this->explosionBuffer != NULL)
    6666    ResourceManager::getInstance()->unload(this->explosionBuffer);
    6767
    68   else if (explosionSound != NULL)
     68  else if (!explosionSound.empty())
    6969  {
    7070    this->explosionBuffer = (SoundBuffer*)ResourceManager::getInstance()->load(explosionSound, WAV);
    7171    if (this->explosionBuffer != NULL)
    7272    {
    73       PRINTF(4)("Loaded sound %s to Pickup: %s.\n", explosionSound, this->getName());
     73      PRINTF(4)("Loaded sound %s to Pickup: %s.\n", explosionSound.c_str(), this->getName());
    7474    }
    7575    else
    7676    {
    77       PRINTF(2)("Failed to load sound %s to explosion %s.\n.", explosionSound, this->getName());
     77      PRINTF(2)("Failed to load sound %s to explosion %s.\n.", explosionSound.c_str(), this->getName());
    7878    }
    7979  }
     
    8383
    8484
    85 void Projectile::loadEngineSound(const char* engineSound)
     85void Projectile::loadEngineSound(const std::string& engineSound)
    8686{
    8787  if (this->engineBuffer != NULL)
    8888    ResourceManager::getInstance()->unload(this->engineBuffer);
    8989
    90   else if (engineSound != NULL)
     90  else if (!engineSound.empty())
    9191  {
    9292    this->engineBuffer = (SoundBuffer*)ResourceManager::getInstance()->load(engineSound, WAV);
    9393    if (this->engineBuffer != NULL)
    9494    {
    95       PRINTF(4)("Loaded sound %s to Pickup: %s.\n", engineSound, this->getName());
     95      PRINTF(4)("Loaded sound %s to Pickup: %s.\n", engineSound.c_str(), this->getName());
    9696    }
    9797    else
    9898    {
    99       PRINTF(2)("Failed to load sound %s to engine %s.\n.", engineSound, this->getName());
     99      PRINTF(2)("Failed to load sound %s to engine %s.\n.", engineSound.c_str(), this->getName());
    100100    }
    101101  }
  • trunk/src/world_entities/projectiles/projectile.h

    r7193 r7221  
    2626    void setLifeSpan(float lifeSpan);
    2727
    28     void loadExplosionSound(const char* explosionSound);
    29     void loadEngineSound(const char* engineSound);
     28    void loadExplosionSound(const std::string& explosionSound);
     29    void loadEngineSound(const std::string& engineSound);
    3030    void setMinEnergy(float energyMin);
    3131    /** @returns the minimal charched energy */
  • trunk/src/world_entities/recorder.cc

    r7193 r7221  
    5454
    5555  LoadParam(root, "duration", this, Recorder, setStreamDuration);
     56
    5657  LoadParam(root, "fps", this, Recorder, setFPS);
     58
    5759  LoadParam(root, "name", this, Recorder, initVideo);
    5860}
     
    7173
    7274
    73 void Recorder::initVideo(const char* filename)
     75void Recorder::initVideo(const std::string& filename)
    7476{
    7577  frame_count = 0;
     
    7880
    7981  // auto detect the output format from the name, default is mpeg
    80   output_format = guess_format(NULL, filename, NULL);
     82  output_format = guess_format(NULL, filename.c_str(), NULL);
    8183  if (!output_format)
    8284  {
     
    9395
    9496  format_context->oformat = output_format;
    95   snprintf(format_context->filename, sizeof(format_context->filename), "%s", filename);
     97  snprintf(format_context->filename, sizeof(format_context->filename), "%s", filename.c_str());
    9698
    9799  // add video stream using the default format codec and initialize the codec
     
    104106
    105107  // print some information
    106   dump_format(format_context, 0, filename, 1);
     108  dump_format(format_context, 0, filename.c_str(), 1);
    107109
    108110  // now that all the parameters are set, we can open the
     
    110112  if(video_stream)
    111113    this->openVideo();
    112  
     114
    113115  // open the output file, if needed
    114116  if(!(output_format->flags & AVFMT_NOFILE))
    115117  {
    116     if(url_fopen(&format_context->pb, filename, URL_WRONLY) < 0)
    117       PRINTF(1)("Could not open %s\n", filename);
     118    if(url_fopen(&format_context->pb, filename.c_str(), URL_WRONLY) < 0)
     119      PRINTF(1)("Could not open %s\n", filename.c_str());
    118120  }
    119121
    120122  // write the stream header, if any
    121   av_write_header(format_context); 
     123  av_write_header(format_context);
    122124}
    123125
     
    129131  av_free(buffer);
    130132
    131   // write the trailer, if any 
     133  // write the trailer, if any
    132134  av_write_trailer(format_context);
    133  
     135
    134136  // free the streams
    135137  for(int i = 0; i < format_context->nb_streams; i++)
     
    175177
    176178void Recorder::allocPicture()
    177 { 
     179{
    178180  picture = avcodec_alloc_frame();
    179181  if(!picture)
     
    189191      return;
    190192  }
    191   avpicture_fill((AVPicture *)picture, picture_buf, 
     193  avpicture_fill((AVPicture *)picture, picture_buf,
    192194                  codec_context->pix_fmt, width, height);
    193195
     
    211213  if (!video_stream)
    212214    PRINTF(1)("Could not alloc stream\n");
    213  
     215
    214216  codec_context = video_stream->codec;
    215217  codec_context->codec_id = output_format->video_codec;
     
    219221  codec_context->bit_rate = 400000;
    220222  // resolution must be a multiple of two
    221   codec_context->width = State::getResX(); 
     223  codec_context->width = State::getResX();
    222224  codec_context->height = State::getResY();
    223225
     
    229231  // timebase should be 1/framerate and timestamp increments should be
    230232  // identically 1
    231   codec_context->time_base.den = (int)stream_frame_rate; 
     233  codec_context->time_base.den = (int)stream_frame_rate;
    232234  codec_context->time_base.num = 1;
    233235  codec_context->gop_size = 12;  // emit one intra frame every twelve frames at most
     
    235237
    236238  if (codec_context->codec_id == CODEC_ID_MPEG1VIDEO)
    237       // needed to avoid using macroblocks in which some coeffs overflow 
    238       // this doesnt happen with normal video, it just happens here as the 
     239      // needed to avoid using macroblocks in which some coeffs overflow
     240      // this doesnt happen with normal video, it just happens here as the
    239241      // motion of the chroma plane doesnt match the luma plane
    240242      codec_context->mb_decision=2;
     
    275277{
    276278  int out_size, err;
    277  
     279
    278280  codec_context = video_stream->codec;
    279  
     281
    280282  if(frame_count >= stream_nb_frames)
    281283  {
     
    287289    this->fillYuvImage();
    288290
    289  
     291
    290292  if(format_context->oformat->flags & AVFMT_RAWPICTURE)
    291293  {
     
    293295    // futur for that
    294296    av_init_packet(&packet);
    295    
     297
    296298    packet.flags |= PKT_FLAG_KEY;
    297299    packet.stream_index= video_stream->index;
    298300    packet.data= (uint8_t *)picture;
    299301    packet.size= sizeof(AVPicture);
    300    
     302
    301303    err = av_write_frame(format_context, &packet);
    302304  }
     
    309311    {
    310312      av_init_packet(&packet);
    311      
     313
    312314      packet.pts= av_rescale_q(codec_context->coded_frame->pts, codec_context->time_base, video_stream->time_base);
    313315      if(codec_context->coded_frame->key_frame)
     
    316318      packet.data= buffer;
    317319      packet.size= out_size;
    318      
     320
    319321      // write the compressed frame in the media file
    320322      err = av_write_frame(format_context, &packet);
  • trunk/src/world_entities/recorder.h

    r6981 r7221  
    2020class Recorder : public WorldEntity
    2121{
    22   private:
    23     AVFrame* picture;
    24     uint8_t* buffer;
    25     int frame_count;
    26     int buffer_size;
    27 
    28     AVOutputFormat* output_format;
    29     AVFormatContext* format_context;
    30     AVCodecContext* codec_context;
    31     AVCodec *codec;
    32     AVStream* video_stream;
    33     AVPacket packet;
    34     double video_pts;
    35 
    36     uint8_t *picture_buf;
    37     int size;
    38 
    39     int height;
    40     int width;
    41     float time;
    42 
    43     float stream_duration;
    44     float stream_frame_rate;
    45     int stream_nb_frames;
    46 
    47 AVFrame* RGB_frame;
    4822  public:
    4923    Recorder (const TiXmlElement* root = NULL);
     
    5630
    5731  private:
    58     void initVideo(const char* filename);
     32    void initVideo(const std::string& filename);
    5933    void addVideoStream();
    6034    void openVideo();
     
    6640    void setStreamDuration(float duration);
    6741    void setFPS(float fps);
     42
     43
     44  private:
     45    AVFrame*            picture;
     46    uint8_t*            buffer;
     47    int                 frame_count;
     48    int                 buffer_size;
     49
     50    AVOutputFormat*     output_format;
     51    AVFormatContext*    format_context;
     52    AVCodecContext*     codec_context;
     53    AVCodec*            codec;
     54    AVStream*           video_stream;
     55    AVPacket            packet;
     56    double              video_pts;
     57
     58    uint8_t*            picture_buf;
     59    int                 size;
     60
     61    int                 height;
     62    int                 width;
     63    float               time;
     64
     65    float               stream_duration;
     66    float               stream_frame_rate;
     67    int                 stream_nb_frames;
     68
     69    AVFrame*            RGB_frame;
    6870};
    6971
  • trunk/src/world_entities/skybox.cc

    r7193 r7221  
    3838 * @param fileName the file to take as input for the SkyBox
    3939*/
    40 SkyBox::SkyBox(const char* fileName)
     40SkyBox::SkyBox(const std::string& fileName)
    4141{
    4242  this->preInit();
    43   if (fileName)
     43  if (!fileName.empty())
    4444    this->setTextureAndType(fileName, ".jpg");
    4545  this->postInit();
     
    8989  this->setParentMode(PNODE_MOVEMENT);
    9090
    91   this->textureName = NULL;
     91  this->textureName = "";
    9292}
    9393
     
    106106  for (int i = 0; i < 6; i++)
    107107  {
    108     if( this->material[i])
     108    if (this->material[i])
    109109      delete this->material[i];
    110     if( this->cubeTexture[i])
     110    if (this->cubeTexture[i])
    111111      ResourceManager::getInstance()->unload(this->cubeTexture[i]);
    112112  }
    113113}
     114
     115void SkyBox::setTexture(const std::string& name)
     116{
     117  this->textureName = name;
     118  this->setTextureAndType (name, "jpg");
     119};
     120
    114121
    115122/**
     
    122129               "skybox_right.jpg", "skybox_front.jpg", "skybox_back.jpg");
    123130*/
    124 void SkyBox::setTextureAndType(const char* name, const char* extension)
    125 {
    126   char* top    = new char[strlen(name)+strlen(extension)+ 10];
    127   char* bottom = new char[strlen(name)+strlen(extension)+ 10];
    128   char* left   = new char[strlen(name)+strlen(extension)+ 10];
    129   char* right  = new char[strlen(name)+strlen(extension)+ 10];
    130   char* front  = new char[strlen(name)+strlen(extension)+ 10];
    131   char* back   = new char[strlen(name)+strlen(extension)+ 10];
    132 
    133   sprintf(top, "%s_top.%s", name, extension);
    134   sprintf(bottom, "%s_bottom.%s", name, extension);
    135   sprintf(left, "%s_left.%s", name, extension);
    136   sprintf(right, "%s_right.%s", name, extension);
    137   sprintf(front, "%s_front.%s", name, extension);
    138   sprintf(back, "%s_back.%s", name, extension);
     131void SkyBox::setTextureAndType(const std::string& name, const std::string& extension)
     132{
     133  std::string top = name + "_top." + extension;
     134  std::string bottom = name + "_bottom." + extension;
     135  std::string left = name + "_left." + extension;
     136  std::string right = name + "_right." + extension;
     137  std::string front = name + "_front." + extension;
     138  std::string back = name + "_back." + extension;
    139139
    140140  this->setTextures(top, bottom, left, right, front, back);
    141 
    142   // deleted alocated memory of this function
    143   delete []top;
    144   delete []bottom;
    145   delete []left;
    146   delete []right;
    147   delete []front;
    148   delete []back;
    149141}
    150142
     
    158150 * @param back the back texture.
    159151*/
    160 void SkyBox::setTextures(const char* top, const char* bottom, const char* left,
    161                           const char* right, const char* front, const char* back)
     152void SkyBox::setTextures(const std::string& top, const std::string& bottom, const std::string& left,
     153                          const std::string& right, const std::string& front, const std::string& back)
    162154{
    163155  this->material[0]->setDiffuseMap(top);
     
    171163}
    172164
    173 void SkyBox::loadCubeMapTextures(const char* top, const char* bottom, const char* left,
    174                                   const char* right, const char* front, const char* back)
     165void SkyBox::loadCubeMapTextures(const std::string& top, const std::string& bottom, const std::string& left,
     166                                  const std::string& right, const std::string& front, const std::string& back)
    175167{
    176168  this->cubeTexture[0] = (Texture*)ResourceManager::getInstance()->load(top, RP_LEVEL, IMAGE, GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT);
     
    304296
    305297  SYNCHELP_READ_FLOAT( size, NWT_SB_SIZE );
    306   if ( textureName )
     298  if ( !this->textureName.empty() )
    307299  {
    308     delete[] textureName;
    309     textureName = NULL;
     300    textureName = "";
    310301  }
    311   SYNCHELP_READ_STRINGM( textureName, NWT_SB_TEXTURENAME );
     302  char* texName;
     303  SYNCHELP_READ_STRINGM( texName, NWT_SB_TEXTURENAME );
    312304
    313305  this->setSize( size );
    314   this->setTextureAndType( textureName, "jpg" );
     306  this->setTextureAndType( texName, "jpg" );
    315307  this->rebuild();
    316308
     
    338330
    339331    SYNCHELP_WRITE_FLOAT(this->size, NWT_SB_SIZE);
    340     SYNCHELP_WRITE_STRING(this->textureName, NWT_SB_TEXTURENAME);
     332    SYNCHELP_WRITE_STRING(this->textureName.c_str(), NWT_SB_TEXTURENAME);
    341333
    342334    return SYNCHELP_WRITE_N;
  • trunk/src/world_entities/skybox.h

    r6771 r7221  
    2828{
    2929 public:
    30   SkyBox(const char* fileName = NULL);
     30  SkyBox(const std::string& fileName = "");
    3131  SkyBox(const TiXmlElement* root);
    3232
     
    4444  void setSize(float size);
    4545  /** assumes jpg as input-format */
    46   void setTexture(const char* name) { if (textureName) delete[] textureName; textureName = new char[strlen(name)+1]; strcpy(textureName, name); this->setTextureAndType (name, "jpg"); };
     46  void setTexture(const std::string& name);
    4747
    48   void setTextureAndType(const char* name, const char* extension);
    49   void setTextures(const char* top, const char* bottom, const char* left,
    50                    const char* right, const char* front, const char* back);
     48  void setTextureAndType(const std::string& name, const std::string& extension);
     49  void setTextures(const std::string& top, const std::string& bottom, const std::string& left,
     50                   const std::string& right, const std::string& front, const std::string& back);
    5151
    52   void loadCubeMapTextures(const char* top, const char* bottom, const char* left,
    53                            const char* right, const char* front, const char* back);
     52  void loadCubeMapTextures(const std::string& top, const std::string& bottom, const std::string& left,
     53                           const std::string& right, const std::string& front, const std::string& back);
    5454
    5555  GLuint getTexture(SKY_SIDE side) const { return (this->material[side]) ? this->material[side]->getDiffuseTexture(): 0; };
     
    7171  float           size;            //!< Size of the SkyBox. This should match the frustum maximum range.
    7272  float           textureSize;     //!< this is the length of a texture (assumes a square texture)
    73   char*           textureName;     //!< Name of the Texture
     73  std::string     textureName;     //!< Name of the Texture
    7474
    7575};
  • trunk/src/world_entities/space_ships/helicopter.cc

    r7193 r7221  
    5555 * @param fileName the name of the File to load the helicopter from (absolute path)
    5656 */
    57 Helicopter::Helicopter(const char* fileName)
     57Helicopter::Helicopter(const std::string& fileName)
    5858{
    5959  this->init();
     
    6262  if(!doc.LoadFile())
    6363  {
    64     PRINTF(2)("Loading file %s failed for Helicopter.\n", fileName);
     64    PRINTF(2)("Loading file %s failed for Helicopter.\n", fileName.c_str());
    6565    return;
    6666  }
     
    110110  this->loadModel("models/ships/helicopter_#.obj", 1.0);
    111111
    112   EventHandler::getInstance()->grabEvents(true);
     112  //EventHandler::getInstance()->grabEvents(true);
    113113
    114114  bUp = bDown = bLeft = bRight = bAscend = bDescend = bRollL = bRollR = false;
  • trunk/src/world_entities/space_ships/helicopter.h

    r7092 r7221  
    1717
    1818    Helicopter();
    19     Helicopter(const char* fileName);
     19    Helicopter(const std::string& fileName);
    2020    Helicopter(const TiXmlElement* root);
    2121    virtual ~Helicopter();
  • trunk/src/world_entities/space_ships/hover.cc

    r7193 r7221  
    4747 * @param fileName the name of the File to load the hover from (absolute path)
    4848 */
    49 Hover::Hover(const char* fileName)
     49Hover::Hover(const std::string& fileName)
    5050{
    5151  this->init();
     
    5454  if(!doc.LoadFile())
    5555  {
    56     PRINTF(2)("Loading file %s failed for Hover.\n", fileName);
     56    PRINTF(2)("Loading file %s failed for Hover.\n", fileName.c_str());
    5757    return;
    5858  }
  • trunk/src/world_entities/space_ships/hover.h

    r7092 r7221  
    1414  public:
    1515
    16     Hover(const char* fileName);
     16    Hover(const std::string& fileName);
    1717    Hover(const TiXmlElement* root = NULL);
    1818    virtual ~Hover();
  • trunk/src/world_entities/space_ships/space_ship.cc

    r7193 r7221  
    6969 * @param fileName the name of the File to load the spaceship from (absolute path)
    7070 */
    71 SpaceShip::SpaceShip(const char* fileName)
     71SpaceShip::SpaceShip(const std::string& fileName)
    7272{
    7373  this->init();
     
    7676  if(!doc.LoadFile())
    7777  {
    78     PRINTF(2)("Loading file %s failed for spaceship.\n", fileName);
     78    PRINTF(2)("Loading file %s failed for spaceship.\n", fileName.c_str());
    7979    return;
    8080  }
  • trunk/src/world_entities/space_ships/space_ship.h

    r7116 r7221  
    2121
    2222  public:
    23     SpaceShip(const char* fileName);
     23    SpaceShip(const std::string& fileName);
    2424    SpaceShip(const TiXmlElement* root = NULL);
    2525    virtual ~SpaceShip();
  • trunk/src/world_entities/space_ships/turbine_hover.cc

    r7193 r7221  
    4949 * @param fileName the name of the File to load the turbine_hover from (absolute path)
    5050 */
    51 TurbineHover::TurbineHover(const char* fileName)
     51TurbineHover::TurbineHover(const std::string& fileName)
    5252{
    5353  this->init();
     
    5656  if(!doc.LoadFile())
    5757  {
    58     PRINTF(2)("Loading file %s failed for TurbineHover.\n", fileName);
     58    PRINTF(2)("Loading file %s failed for TurbineHover.\n", fileName.c_str());
    5959    return;
    6060  }
  • trunk/src/world_entities/space_ships/turbine_hover.h

    r7092 r7221  
    1818  public:
    1919
    20     TurbineHover(const char* fileName);
     20    TurbineHover(const std::string& fileName);
    2121    TurbineHover(const TiXmlElement* root = NULL);
    2222    virtual ~TurbineHover();
  • trunk/src/world_entities/terrain.cc

    r7193 r7221  
    4848    this->loadParams(root);
    4949
    50 //  if (this->model != NULL)
    51     //this->ssp = new SpatialSeparation((Model*)this->model, 10.0f);
     50  //  if (this->model != NULL)
     51  //this->ssp = new SpatialSeparation((Model*)this->model, 10.0f);
    5252}
    5353
     
    5959   this either loads out of an OBJ-file, or loads a heightmap if no .obj-extension is found.
    6060*/
    61 Terrain::Terrain(const char* fileName)
     61Terrain::Terrain(const std::string& fileName)
    6262{
    6363  this->init();
    6464
    65   if (!strstr(fileName, ".obj") || !strstr(fileName, ".OBJ") )
    66     {
    67       this->loadModel(fileName);
    68     }
     65  if (fileName.rfind(".obj" ) != -1 || fileName.rfind(".OBJ") != -1 )
     66  {
     67    this->loadModel(fileName);
     68  }
    6969  else
    70     {
    71       // load the hightMap here.
    72     }
     70  {
     71    // load the hightMap here.
     72  }
    7373}
    7474
     
    9898
    9999  if(this->heightMap)
    100         delete heightMap;
     100    delete heightMap;
    101101}
    102102
     
    122122
    123123  LoadParam(root, "scale", this, Terrain, setScale)
    124       .describe("The scale in x,y,z direction");
     124  .describe("The scale in x,y,z direction");
    125125
    126126  LoadParam(root, "texture", this, Terrain, loadTexture)
    127       .describe("The name of the Texture for this heightMap");
     127  .describe("The name of the Texture for this heightMap");
    128128
    129129  LoadParam(root, "vegetation", this, Terrain, loadVegetation)
    130       .describe("the fileName of the vegetation, that should be loaded onto this terrain. (must be relative to the data-dir)") ;
     130  .describe("the fileName of the vegetation, that should be loaded onto this terrain. (must be relative to the data-dir)") ;
    131131
    132132  LoadParam(root, "height-map", this, Terrain, loadHeightMap)
    133       .describe("The HeightMap, splitted into two strings seperated by ','. 1: HeighMap, 2: ColorMap");
     133  .describe("The HeightMap, splitted into two strings seperated by ','. 1: HeighMap, 2: ColorMap");
    134134
    135135}
     
    140140}
    141141
    142 void Terrain::loadHeightMap(const char* heightMapFile, const char* colorMap)
     142void Terrain::loadHeightMap(const std::string& heightMapFile, const std::string& colorMap)
    143143{
    144144  if (this->heightMap != NULL)
     
    146146  this->heightMap = NULL;
    147147
    148   char* hmName = ResourceManager::getFullName(heightMapFile);
    149   char* hmColorName = ResourceManager::getFullName(colorMap);
     148  std::string hmName = ResourceManager::getFullName(heightMapFile);
     149  std::string hmColorName = ResourceManager::getFullName(colorMap);
    150150
    151151
    152152  this->heightMap = new HeightMap(hmName, hmColorName);
    153 //   heightMap->scale(Vector(43.0f,4.7f,43.0f));
     153  //   heightMap->scale(Vector(43.0f,4.7f,43.0f));
    154154  heightMap->scale(this->terrainScale);
    155155  heightMap->setAbsCoor(this->getAbsCoor());
    156156  heightMap->load();
    157   delete[] hmName;
    158   delete[] hmColorName;
    159 
    160 }
    161 
    162 
    163 void Terrain::loadTexture(const char* textureName)
    164 {
    165    PRINTF(0)("Load texture: %s\n", textureName);
    166 
    167    heightMapMaterial->setDiffuse(1.0,1.0,1.0);
    168    heightMapMaterial->setAmbient(1.0,1.0,1.0 );
    169    heightMapMaterial->setSpecular(1.0,1.0,1.0);
    170    heightMapMaterial->setShininess(.5);
    171    heightMapMaterial->setTransparency(1.0);
    172 
    173    heightMapMaterial->setDiffuseMap(textureName);
    174    heightMapMaterial->setAmbientMap(textureName);
    175    heightMapMaterial->setSpecularMap(textureName);
    176 }
    177 
    178 
    179 
    180 void Terrain::loadVegetation(const char* vegetationFile)
    181 {
    182   PRINTF(0)("loadVegetation: %s\n", vegetationFile);
     157}
     158
     159
     160void Terrain::loadTexture(const std::string& textureName)
     161{
     162  PRINTF(4)("Load texture: %s\n", textureName.c_str());
     163
     164  heightMapMaterial->setDiffuse(1.0,1.0,1.0);
     165  heightMapMaterial->setAmbient(1.0,1.0,1.0 );
     166  heightMapMaterial->setSpecular(1.0,1.0,1.0);
     167  heightMapMaterial->setShininess(.5);
     168  heightMapMaterial->setTransparency(1.0);
     169
     170  heightMapMaterial->setDiffuseMap(textureName);
     171  //   heightMapMaterial->setAmbientMap(textureName);
     172  //   heightMapMaterial->setSpecularMap(textureName);
     173}
     174
     175
     176
     177void Terrain::loadVegetation(const std::string& vegetationFile)
     178{
     179  PRINTF(4)("loadVegetation: %s\n", vegetationFile.c_str());
    183180  if (this->vegetation)
    184181    ResourceManager::getInstance()->unload(this->vegetation, RP_LEVEL);
    185   if (vegetationFile != NULL)
    186   {
    187     PRINTF(4)("fetching %s\n", vegetationFile);
     182  if (!vegetationFile.empty())
     183  {
     184    PRINTF(4)("fetching %s\n", vegetationFile.c_str());
    188185    this->vegetation = dynamic_cast<Model*>(ResourceManager::getInstance()->load(vegetationFile, OBJ, RP_CAMPAIGN));
    189186  }
     
    205202                this->getAbsCoor ().z);
    206203  /* rotate */
    207  // Vector tmpRot = this->getAbsDir().getSpacialAxis();
     204  // Vector tmpRot = this->getAbsDir().getSpacialAxis();
    208205  //glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
    209206
     
    227224
    228225
    229 /*
    230   glMatrixMode(GL_MODELVIEW);
    231   glPushMatrix();
    232   glLoadIdentity();
    233   Vector camera =   State::getCameraNode()->getAbsCoor(); // Go on here ..........!!!
    234 
    235   float height =    heightMap->getHeight(camera.x, camera.z);
    236 
    237   glEnable (GL_COLOR_MATERIAL) ;
    238   glBegin(GL_QUADS);            // Draw The Cube Using quads
    239   glColor3f(0.0f,1.0f,0.0f);  // Color Blue
    240   glVertex3f(camera.x + 63.0f,Terrain->getHeight(camera.x+63.0f, camera.z-10.0f)+13.0f,camera.z-10.0f);      // Top Right Of The Quad (Top)
    241   glVertex3f(camera.x-63.0f, getHeight(camera.x+63.0f, camera.z-10.0f)+13.0f,camera.z-10.0f);      // Top Left Of The Quad (Top)
    242   glVertex3f(camera.x-63.0f, getHeight(camera.x+63.0f, camera.z+10.0f)+13.0f, camera.z+10.0f);      // Bottom Left Of The Quad (Top)
    243   glVertex3f(camera.x+ 63.0f, getHeight(camera.x+63.0f, camera.z+10.0f)+13.0f, camera.z+10.0f);      // Bottom Right Of The Quad (Top)
    244   glEnd();                      // End Drawing The Plan
    245 
    246   glPopMatrix();*/
    247 
    248 
    249 /* THIS IS ONLY FOR DEBUGGING INFORMATION */
     226  /*
     227    glMatrixMode(GL_MODELVIEW);
     228    glPushMatrix();
     229    glLoadIdentity();
     230    Vector camera =   State::getCameraNode()->getAbsCoor(); // Go on here ..........!!!
     231
     232    float height =    heightMap->getHeight(camera.x, camera.z);
     233
     234    glEnable (GL_COLOR_MATERIAL) ;
     235    glBegin(GL_QUADS);            // Draw The Cube Using quads
     236    glColor3f(0.0f,1.0f,0.0f);  // Color Blue
     237    glVertex3f(camera.x + 63.0f,Terrain->getHeight(camera.x+63.0f, camera.z-10.0f)+13.0f,camera.z-10.0f);      // Top Right Of The Quad (Top)
     238    glVertex3f(camera.x-63.0f, getHeight(camera.x+63.0f, camera.z-10.0f)+13.0f,camera.z-10.0f);      // Top Left Of The Quad (Top)
     239    glVertex3f(camera.x-63.0f, getHeight(camera.x+63.0f, camera.z+10.0f)+13.0f, camera.z+10.0f);      // Bottom Left Of The Quad (Top)
     240    glVertex3f(camera.x+ 63.0f, getHeight(camera.x+63.0f, camera.z+10.0f)+13.0f, camera.z+10.0f);      // Bottom Right Of The Quad (Top)
     241    glEnd();                      // End Drawing The Plan
     242
     243    glPopMatrix();*/
     244
     245
     246  /* THIS IS ONLY FOR DEBUGGING INFORMATION */
    250247  if (this->ssp != NULL)
    251248    this->ssp->drawQuadtree();
     
    257254  // if the terrain is the Terrain of Dave
    258255  if (debugTerrain == TERRAIN_DAVE)
    259     {
    260       objectList = glGenLists(1);
    261       glNewList (objectList, GL_COMPILE);
    262 
    263       glColor3f(1.0,0,0);
    264 
    265       int sizeX = 100;
    266       int sizeZ = 80;
    267       float length = 1000;
    268       float width = 200;
    269       float widthX = float (length /sizeX);
    270       float widthZ = float (width /sizeZ);
    271 
    272       float height [sizeX][sizeZ];
    273       Vector normal_vectors[sizeX][sizeZ];
    274 
    275 
    276       for ( int i = 0; i<sizeX-1; i+=1)
    277         for (int j = 0; j<sizeZ-1;j+=1)
    278           //height[i][j] = rand()/20046 + (j-25)*(j-25)/30;
     256  {
     257    objectList = glGenLists(1);
     258    glNewList (objectList, GL_COMPILE);
     259
     260    glColor3f(1.0,0,0);
     261
     262    int sizeX = 100;
     263    int sizeZ = 80;
     264    float length = 1000;
     265    float width = 200;
     266    float widthX = float (length /sizeX);
     267    float widthZ = float (width /sizeZ);
     268
     269    float height [sizeX][sizeZ];
     270    Vector normal_vectors[sizeX][sizeZ];
     271
     272
     273    for ( int i = 0; i<sizeX-1; i+=1)
     274      for (int j = 0; j<sizeZ-1;j+=1)
     275        //height[i][j] = rand()/20046 + (j-25)*(j-25)/30;
    279276#ifdef __WIN32__
    280           height[i][j]=(sin((float)j/3)*rand()*i/182400)*.5;
     277        height[i][j]=(sin((float)j/3)*rand()*i/182400)*.5;
    281278#else
    282       height[i][j]=(sin((float)j/3)*rand()*(long)i/6282450500.0)*.5;
     279        height[i][j]=(sin((float)j/3)*rand()*(long)i/6282450500.0)*.5;
    283280#endif
    284281
    285       //Die Huegel ein wenig glaetten
    286       for (int h=1; h<2;h++)
    287         for (int i=1;i<sizeX-2 ;i+=1 )
    288           for(int j=1;j<sizeZ-2;j+=1)
    289             height[i][j]=(height[i+1][j]+height[i][j+1]+height[i-1][j]+height[i][j-1])/4;
    290 
    291       //Berechnung von normalen Vektoren
    292       for(int i=1;i<sizeX-2;i+=1)
    293         for(int j=1;j<sizeZ-2 ;j+=1)
    294           {
    295             Vector v1 = Vector (widthX*(1),      height[i][j],      widthZ*(j) );
    296             Vector v2 = Vector (widthX*(i-1),    height[i-1][j],    widthZ*(j));
    297             Vector v3 = Vector (widthX*(i),      height[i][j+1],    widthZ*(j+1));
    298             Vector v4 = Vector (widthX*(i+1),    height[i+1][j],    widthZ*(j));
    299             Vector v5 = Vector (widthX*(i),      height[i][j-1],    widthZ*(j-1));
    300 
    301             Vector c1 = v2 - v1;
    302             Vector c2 = v3 - v1;
    303             Vector c3=  v4 - v1;
    304             Vector c4 = v5 - v1;
    305             Vector zero = Vector (0,0,0);
    306             normal_vectors[i][j]=c1.cross(v3-v5)+c2.cross(v4-v2)+c3.cross(v5-v3)+c4.cross(v2-v4);
    307             normal_vectors[i][j].normalize();
    308           }
    309 
    310       glBegin(GL_QUADS);
    311       int snowheight=3;
    312       for ( int i = 0; i<sizeX; i+=1)
    313         for (int j = 0; j<sizeZ;j+=1)
    314           {
    315             Vector v1 = Vector (widthX*(i),      height[i][j]-20,       widthZ*(j)  -width/2);
    316             Vector v2 = Vector (widthX*(i+1),    height[i+1][j]-20,     widthZ*(j)  -width/2);
    317             Vector v3 = Vector (widthX*(i+1),    height[i+1][j+1]-20,   widthZ*(j+1)-width/2);
    318             Vector v4 = Vector (widthX*(i),      height[i][j+1]-20,     widthZ*(j+1)-width/2);
    319             float a[3];
    320             if(height[i][j]<snowheight){
    321               a[0]=0;
    322               a[1]=1.0-height[i][j]/10-.3;
    323               a[2]=0;
    324               glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
    325             }
    326             else{
    327               a[0]=1.0;
    328               a[1]=1.0;
    329               a[2]=1.0;
    330               glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
    331 
    332             }
    333             glNormal3f(normal_vectors[i][j].x, normal_vectors[i][j].y, normal_vectors[i][j].z);
    334             glVertex3f(v1.x, v1.y, v1.z);
    335             if(height[i+1][j]<snowheight){
    336               a[0]=0;
    337               a[1] =1.0-height[i+1][j]/10-.3;
    338               a[2]=0;
    339               glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
    340             }
    341             else{
    342               a[0]=1.0;
    343               a[1]=1.0;
    344               a[2]=1.0;
    345               glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
    346 
    347             }
    348             glNormal3f(normal_vectors[i+1][j].x, normal_vectors[i+1][j].y, normal_vectors[i+1][j].z);
    349             glVertex3f(v2.x, v2.y, v2.z);
    350             if(height[i+1][j+1]<snowheight){
    351               a[0]=0;
    352               a[1] =1.0-height[i+1][j+1]/10-.3;
    353               a[2]=0;
    354               glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
    355             }
    356             else{
    357               a[0]=1.0;
    358               a[1]=1.0;
    359               a[2]=1.0;
    360               glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
    361 
    362 
    363             }
    364             glNormal3f(normal_vectors[i+1][j+1].x, normal_vectors[i+1][j+1].y, normal_vectors[i+1][j+1].z);
    365             glVertex3f(v3.x, v3.y, v3.z);
    366             if(height[i][j+1]<snowheight){
    367               a[0]=0;
    368               a[1] =1.0-height[i+1][j+1]/10-.3;
    369               a[2]=0;
    370               glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
    371             }
    372             else{
    373               a[0]=1.0;
    374               a[1]=1.0;
    375               a[2]=1.0;
    376               glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
    377             }
    378             glNormal3f(normal_vectors[i][j+1].x, normal_vectors[i][j+1].y, normal_vectors[i][j+1].z);
    379             glVertex3f(v4.x, v4.y, v4.z);
    380 
    381           }
    382       glEnd();
    383       glEndList();
    384     }
     282    //Die Huegel ein wenig glaetten
     283    for (int h=1; h<2;h++)
     284      for (int i=1;i<sizeX-2 ;i+=1 )
     285        for(int j=1;j<sizeZ-2;j+=1)
     286          height[i][j]=(height[i+1][j]+height[i][j+1]+height[i-1][j]+height[i][j-1])/4;
     287
     288    //Berechnung von normalen Vektoren
     289    for(int i=1;i<sizeX-2;i+=1)
     290      for(int j=1;j<sizeZ-2 ;j+=1)
     291      {
     292        Vector v1 = Vector (widthX*(1),      height[i][j],      widthZ*(j) );
     293        Vector v2 = Vector (widthX*(i-1),    height[i-1][j],    widthZ*(j));
     294        Vector v3 = Vector (widthX*(i),      height[i][j+1],    widthZ*(j+1));
     295        Vector v4 = Vector (widthX*(i+1),    height[i+1][j],    widthZ*(j));
     296        Vector v5 = Vector (widthX*(i),      height[i][j-1],    widthZ*(j-1));
     297
     298        Vector c1 = v2 - v1;
     299        Vector c2 = v3 - v1;
     300        Vector c3=  v4 - v1;
     301        Vector c4 = v5 - v1;
     302        Vector zero = Vector (0,0,0);
     303        normal_vectors[i][j]=c1.cross(v3-v5)+c2.cross(v4-v2)+c3.cross(v5-v3)+c4.cross(v2-v4);
     304        normal_vectors[i][j].normalize();
     305      }
     306
     307    glBegin(GL_QUADS);
     308    int snowheight=3;
     309    for ( int i = 0; i<sizeX; i+=1)
     310      for (int j = 0; j<sizeZ;j+=1)
     311      {
     312        Vector v1 = Vector (widthX*(i),      height[i][j]-20,       widthZ*(j)  -width/2);
     313        Vector v2 = Vector (widthX*(i+1),    height[i+1][j]-20,     widthZ*(j)  -width/2);
     314        Vector v3 = Vector (widthX*(i+1),    height[i+1][j+1]-20,   widthZ*(j+1)-width/2);
     315        Vector v4 = Vector (widthX*(i),      height[i][j+1]-20,     widthZ*(j+1)-width/2);
     316        float a[3];
     317        if(height[i][j]<snowheight)
     318        {
     319          a[0]=0;
     320          a[1]=1.0-height[i][j]/10-.3;
     321          a[2]=0;
     322          glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
     323        }
     324        else
     325        {
     326          a[0]=1.0;
     327          a[1]=1.0;
     328          a[2]=1.0;
     329          glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
     330
     331        }
     332        glNormal3f(normal_vectors[i][j].x, normal_vectors[i][j].y, normal_vectors[i][j].z);
     333        glVertex3f(v1.x, v1.y, v1.z);
     334        if(height[i+1][j]<snowheight)
     335        {
     336          a[0]=0;
     337          a[1] =1.0-height[i+1][j]/10-.3;
     338          a[2]=0;
     339          glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
     340        }
     341        else
     342        {
     343          a[0]=1.0;
     344          a[1]=1.0;
     345          a[2]=1.0;
     346          glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
     347
     348        }
     349        glNormal3f(normal_vectors[i+1][j].x, normal_vectors[i+1][j].y, normal_vectors[i+1][j].z);
     350        glVertex3f(v2.x, v2.y, v2.z);
     351        if(height[i+1][j+1]<snowheight)
     352        {
     353          a[0]=0;
     354          a[1] =1.0-height[i+1][j+1]/10-.3;
     355          a[2]=0;
     356          glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
     357        }
     358        else
     359        {
     360          a[0]=1.0;
     361          a[1]=1.0;
     362          a[2]=1.0;
     363          glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
     364
     365
     366        }
     367        glNormal3f(normal_vectors[i+1][j+1].x, normal_vectors[i+1][j+1].y, normal_vectors[i+1][j+1].z);
     368        glVertex3f(v3.x, v3.y, v3.z);
     369        if(height[i][j+1]<snowheight)
     370        {
     371          a[0]=0;
     372          a[1] =1.0-height[i+1][j+1]/10-.3;
     373          a[2]=0;
     374          glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
     375        }
     376        else
     377        {
     378          a[0]=1.0;
     379          a[1]=1.0;
     380          a[2]=1.0;
     381          glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
     382        }
     383        glNormal3f(normal_vectors[i][j+1].x, normal_vectors[i][j+1].y, normal_vectors[i][j+1].z);
     384        glVertex3f(v4.x, v4.y, v4.z);
     385
     386      }
     387    glEnd();
     388    glEndList();
     389  }
    385390
    386391  if (debugTerrain == TERRAIN_BENSCH)
    387     {
    388       /*
    389         this->model = (OBJModel*) new Model();
    390       this->model->setName("CUBE");
    391       this->model->addVertex (-0.5, -0.5, 0.5);
    392       this->model->addVertex (0.5, -0.5, 0.5);
    393       this->model->addVertex (-0.5, 0.5, 0.5);
    394       this->model->addVertex (0.5, 0.5, 0.5);
    395       this->model->addVertex (-0.5, 0.5, -0.5);
    396       this->model->addVertex (0.5, 0.5, -0.5);
    397       this->model->addVertex (-0.5, -0.5, -0.5);
    398       this->model->addVertex (0.5, -0.5, -0.5);
    399 
    400       this->model->addVertexTexture (0.0, 0.0);
    401       this->model->addVertexTexture (1.0, 0.0);
    402       this->model->addVertexTexture (0.0, 1.0);
    403       this->model->addVertexTexture (1.0, 1.0);
    404       this->model->addVertexTexture (0.0, 2.0);
    405       this->model->addVertexTexture (1.0, 2.0);
    406       this->model->addVertexTexture (0.0, 3.0);
    407       this->model->addVertexTexture (1.0, 3.0);
    408       this->model->addVertexTexture (0.0, 4.0);
    409       this->model->addVertexTexture (1.0, 4.0);
    410       this->model->addVertexTexture (2.0, 0.0);
    411       this->model->addVertexTexture (2.0, 1.0);
    412       this->model->addVertexTexture (-1.0, 0.0);
    413       this->model->addVertexTexture (-1.0, 1.0);
    414 
    415       this->model->finalize();
    416       */
    417     }
     392  {
     393    /*
     394      this->model = (OBJModel*) new Model();
     395    this->model->setName("CUBE");
     396    this->model->addVertex (-0.5, -0.5, 0.5);
     397    this->model->addVertex (0.5, -0.5, 0.5);
     398    this->model->addVertex (-0.5, 0.5, 0.5);
     399    this->model->addVertex (0.5, 0.5, 0.5);
     400    this->model->addVertex (-0.5, 0.5, -0.5);
     401    this->model->addVertex (0.5, 0.5, -0.5);
     402    this->model->addVertex (-0.5, -0.5, -0.5);
     403    this->model->addVertex (0.5, -0.5, -0.5);
     404
     405    this->model->addVertexTexture (0.0, 0.0);
     406    this->model->addVertexTexture (1.0, 0.0);
     407    this->model->addVertexTexture (0.0, 1.0);
     408    this->model->addVertexTexture (1.0, 1.0);
     409    this->model->addVertexTexture (0.0, 2.0);
     410    this->model->addVertexTexture (1.0, 2.0);
     411    this->model->addVertexTexture (0.0, 3.0);
     412    this->model->addVertexTexture (1.0, 3.0);
     413    this->model->addVertexTexture (0.0, 4.0);
     414    this->model->addVertexTexture (1.0, 4.0);
     415    this->model->addVertexTexture (2.0, 0.0);
     416    this->model->addVertexTexture (2.0, 1.0);
     417    this->model->addVertexTexture (-1.0, 0.0);
     418    this->model->addVertexTexture (-1.0, 1.0);
     419
     420    this->model->finalize();
     421    */
     422  }
    418423}
    419424
     
    453458
    454459void Terrain::writeDebug( ) const
    455 {
    456 }
     460  {}
    457461
    458462void Terrain::readDebug( ) const
    459 {
    460 }
     463  {}
    461464
    462465float Terrain::getHeight(float x, float y)
    463466{
    464         if(this->heightMap != NULL)
    465                 return (this->heightMap->getHeight(x, y));
    466         return 0;
    467 }
     467  if(this->heightMap != NULL)
     468    return (this->heightMap->getHeight(x, y));
     469  return 0;
     470}
  • trunk/src/world_entities/terrain.h

    r7046 r7221  
    2929 public:
    3030  Terrain(const TiXmlElement* root = NULL);
    31   Terrain(const char* fileName);
     31  Terrain(const std::string& fileName);
    3232  Terrain(DebugTerrain debugTerrain);
    3333  virtual ~Terrain();
     
    4141  virtual void loadParams(const TiXmlElement* root);
    4242
    43   void loadVegetation(const char* vegetationFile);
     43  void loadVegetation(const std::string& vegetationFile);
    4444
    45   void loadHeightMap(const char* heightMapFile, const char* colorMap = NULL);
    46   void loadTexture(const char* textureName);
     45  void loadHeightMap(const std::string& heightMapFile, const std::string& colorMap);
     46  void loadTexture(const std::string& textureName);
    4747  void setScale(float x, float y, float z);
    4848
  • trunk/src/world_entities/weapons/aim.cc

    r7193 r7221  
    147147 * @param textureFile The texture-file to load onto the crosshair
    148148 */
    149 void Aim::setTexture(const char* textureFile)
     149void Aim::setTexture(const std::string& textureFile)
    150150{
    151151  this->material->setDiffuseMap(textureFile);
  • trunk/src/world_entities/weapons/aim.h

    r6724 r7221  
    4646
    4747  void setSize(float size);
    48   void setTexture(const char* textureFile);
     48  void setTexture(const std::string& textureFile);
    4949  /** @param rotationSpeed the speed at what the crosshair should rotate */
    5050  inline void setRotationSpeed(float rotationSpeed) { this->rotationSpeed = rotationSpeed; };
  • trunk/src/world_entities/weapons/aiming_turret.cc

    r7193 r7221  
    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}
  • trunk/src/world_entities/weapons/crosshair.cc

    r7193 r7221  
    7979  EventListener::loadParams(root);
    8080
    81   LoadParam(root, "texture", this, Crosshair, setTexture)
     81  LoadParam(root, "texture", this->material, Material, setDiffuseMap)
    8282      .describe("the texture-file to load onto the Crosshair");
    8383
     
    103103 * @param textureFile The texture-file to load onto the crosshair
    104104 */
    105 void Crosshair::setTexture(const char* textureFile)
     105void Crosshair::setTexture(const std::string& textureFile)
    106106{
    107107  this->material->setDiffuseMap(textureFile);
  • trunk/src/world_entities/weapons/crosshair.h

    r6512 r7221  
    3131
    3232  void setSize(float size);
    33   void setTexture(const char* textureFile);
     33  void setTexture(const std::string& textureFile);
    3434  /** @param rotationSpeed the speed at what the crosshair should rotate */
    3535  void setRotationSpeed(float rotationSpeed) { this->rotationSpeed = rotationSpeed; };
  • trunk/src/world_entities/weapons/weapon.cc

    r7193 r7221  
    165165 * @param projectile the Name of the Projectile.
    166166 */
    167 void Weapon::setProjectileTypeC(const char* projectile)
    168 {
    169   if (projectile == NULL)
    170     return;
     167void Weapon::setProjectileTypeC(const std::string& projectile)
     168{
    171169  FastFactory* tmpFac = FastFactory::searchFastFactory(projectile);
    172170  if (tmpFac != NULL)
     
    176174  else
    177175  {
    178     PRINTF(1)("Projectile %s does not exist for weapon %s\n", projectile, this->getName());
     176    PRINTF(1)("Projectile %s does not exist for weapon %s\n", projectile.c_str(), this->getName());
    179177  }
    180178}
     
    232230 * @param soundFile the soundFile's relative position to the data-directory (will be looked for by the ResourceManager)
    233231 */
    234 void Weapon::setActionSound(WeaponAction action, const char* soundFile)
     232void Weapon::setActionSound(WeaponAction action, const std::string& soundFile)
    235233{
    236234  if (action >= WA_ACTION_COUNT)
     
    239237    ResourceManager::getInstance()->unload(this->soundBuffers[action]);
    240238
    241   else if (soundFile != NULL)
     239  else if (!soundFile.empty())
    242240  {
    243241    this->soundBuffers[action] = (SoundBuffer*)ResourceManager::getInstance()->load(soundFile, WAV);
    244242    if (this->soundBuffers[action] != NULL)
    245243    {
    246       PRINTF(4)("Loaded sound %s to action %s.\n", soundFile, actionToChar(action));
     244      PRINTF(4)("Loaded sound %s to action %s.\n", soundFile.c_str(), actionToChar(action));
    247245    }
    248246    else
    249247    {
    250       PRINTF(2)("Failed to load sound %s to %s.\n.", soundFile, actionToChar(action));
     248      PRINTF(2)("Failed to load sound %s to %s.\n.", soundFile.c_str(), actionToChar(action));
    251249    }
    252250  }
     
    613611 * @return The Action if known, WA_NONE otherwise.
    614612 */
    615 WeaponAction Weapon::charToAction(const char* action)
    616 {
    617   if (!strcmp(action, "none"))
     613WeaponAction Weapon::charToAction(const std::string& action)
     614{
     615  if (action == "none")
    618616    return WA_NONE;
    619   else if (!strcmp(action, "shoot"))
     617  else if (action == "shoot")
    620618    return WA_SHOOT;
    621   else if (!strcmp(action, "charge"))
     619  else if (action == "charge")
    622620    return WA_CHARGE;
    623   else if (!strcmp(action, "reload"))
     621  else if (action == "reload")
    624622    return WA_RELOAD;
    625   else if (!strcmp(action, "acitvate"))
     623  else if (action == "acitvate")
    626624    return WA_ACTIVATE;
    627   else if (!strcmp(action, "deactivate"))
     625  else if (action == "deactivate")
    628626    return WA_DEACTIVATE;
    629   else if (!strcmp(action, "special1"))
     627  else if (action == "special1")
    630628    return WA_SPECIAL1;
    631629  else
    632630  {
    633     PRINTF(2)("action %s could not be identified.\n", action);
     631    PRINTF(2)("action %s could not be identified.\n", action.c_str());
    634632    return WA_NONE;
    635633  }
     
    674672 * @return The State if known, WS_NONE otherwise.
    675673 */
    676 WeaponState Weapon::charToState(const char* state)
    677 {
    678   if (!strcmp(state, "none"))
     674WeaponState Weapon::charToState(const std::string& state)
     675{
     676  if (state == "none")
    679677    return WS_NONE;
    680   else if (!strcmp(state, "shooting"))
     678  else if (state == "shooting")
    681679    return WS_SHOOTING;
    682   else if (!strcmp(state, "charging"))
     680  else if (state == "charging")
    683681    return WS_CHARGING;
    684   else if (!strcmp(state, "reloading"))
     682  else if (state == "reloading")
    685683    return WS_RELOADING;
    686   else if (!strcmp(state, "activating"))
     684  else if (state == "activating")
    687685    return WS_ACTIVATING;
    688   else if (!strcmp(state, "deactivating"))
     686  else if (state == "deactivating")
    689687    return WS_DEACTIVATING;
    690   else if (!strcmp(state, "inactive"))
     688  else if (state == "inactive")
    691689    return WS_INACTIVE;
    692   else if (!strcmp(state, "idle"))
     690  else if (state == "idle")
    693691    return WS_IDLE;
    694692  else
    695693  {
    696     PRINTF(2)("state %s could not be identified.\n", state);
     694    PRINTF(2)("state %s could not be identified.\n", state.c_str());
    697695    return WS_NONE;
    698696  }
  • trunk/src/world_entities/weapons/weapon.h

    r7102 r7221  
    111111    inline long getCapability() const { return this->capability; };
    112112    void setProjectileType(ClassID projectile);
    113     void setProjectileTypeC(const char* projectile);
     113    void setProjectileTypeC(const std::string& projectile);
    114114    /** @returns The projectile's classID */
    115115    inline ClassID getProjectileType() { return this->projectile; };
     
    132132    // STATE CHANGES //
    133133    /** @param state the State to time @param duration the duration of the State */
    134     inline void setStateDuration(const char* state, float duration) { setStateDuration(charToState(state), duration); };
     134    inline void setStateDuration(const std::string& state, float duration) { setStateDuration(charToState(state), duration); };
    135135    /** @param state the State to time @param duration the duration of the State */
    136136    inline void setStateDuration(WeaponState state, float duration) { /*(state < WS_STATE_COUNT)?*/this->times[state] = duration; };
     
    148148    inline void setAmmoContainer(const CountPointer<AmmoContainer>& ammoContainer) { this->ammoContainer = ammoContainer;}
    149149
    150     void setActionSound(WeaponAction action, const char* soundFile);
    151     /** @see void setActionSound(WeaponAction action, const char* soundFile); */
    152     void setActionSound(const char* action, const char* soundFile) { this->setActionSound(charToAction(action), soundFile); };
     150    void setActionSound(WeaponAction action, const std::string& soundFile);
     151    /** @see void setActionSound(WeaponAction action, const std::string& soundFile); */
     152    void setActionSound(const std::string& action, const std::string& soundFile) { this->setActionSound(charToAction(action), soundFile); };
    153153
    154154    Animation3D* getAnimation(WeaponState state, PNode* node = NULL);
     
    176176
    177177    // utility:
    178     static WeaponAction  charToAction(const char* action);
     178    static WeaponAction  charToAction(const std::string& action);
    179179    static const char*   actionToChar(WeaponAction action);
    180     static WeaponState   charToState(const char* state);
     180    static WeaponState   charToState(const std::string& state);
    181181    static const char*   stateToChar(WeaponState state);
    182182
  • trunk/src/world_entities/world_entity.cc

    r7198 r7221  
    6161  this->bCollide = true;
    6262
    63   this->md2TextureFileName = NULL;
    64 
    6563  this->objectListNumber = OM_INIT;
    6664  this->objectListIterator = NULL;
     
    120118 * @param fileName the name of the model to load
    121119 * @param scaling the Scaling of the model
    122  *
    123  * @todo fix this, so it only has one loadModel-Function.
    124 */
    125 void WorldEntity::loadModel(const char* fileName, float scaling, unsigned int modelNumber)
     120 */
     121void WorldEntity::loadModel(const std::string& fileName, float scaling, unsigned int modelNumber)
    126122{
    127123  this->modelLODName = fileName;
    128124  this->scaling = scaling;
    129   if ( fileName != NULL && strcmp(fileName, "") )
     125  if (!fileName.empty())
    130126  {
    131127    // search for the special character # in the LoadParam
    132     if (strchr(fileName, '#') != NULL)
    133     {
    134       PRINTF(4)("Found # in %s... searching for LOD's\n", fileName);
    135       char* lodFile = new char[strlen(fileName)+1];
    136       strcpy(lodFile, fileName);
    137       char* depth = strchr(lodFile, '#');
     128    if (fileName.find('#') != std::string::npos)
     129    {
     130      PRINTF(4)("Found # in %s... searching for LOD's\n", fileName.c_str());
     131      std::string lodFile = fileName;
     132      unsigned int offset = lodFile.find('#');
    138133      for (unsigned int i = 0; i < 3; i++)
    139134      {
    140         *depth = 48+(int)i;
     135        lodFile[offset] = 48+(int)i;
    141136        if (ResourceManager::isInDataDir(lodFile))
    142137          this->loadModel(lodFile, scaling, i);
     
    149144      this->scaling = 1.0;
    150145    }
    151     if(strstr(fileName, ".obj"))
    152     {
    153       PRINTF(4)("fetching OBJ file: %s\n", fileName);
     146    if(fileName.find(".obj") != std::string::npos)
     147    {
     148      PRINTF(4)("fetching OBJ file: %s\n", fileName.c_str());
    154149      BaseObject* loadedModel = ResourceManager::getInstance()->load(fileName, OBJ, RP_CAMPAIGN, this->scaling);
    155150      if (loadedModel != NULL)
    156151        this->setModel(dynamic_cast<Model*>(loadedModel), modelNumber);
     152      else
     153        PRINTF(1)("OBJ-File %s not found.\n", fileName.c_str());
    157154
    158155      if( modelNumber == 0)
    159156        this->buildObbTree(4);
    160157    }
    161     else if(strstr(fileName, ".md2"))
    162     {
    163       PRINTF(4)("fetching MD2 file: %s\n", fileName);
     158    else if(fileName.find(".md2") != std::string::npos)
     159    {
     160      PRINTF(4)("fetching MD2 file: %s\n", fileName.c_str());
    164161      Model* m = new MD2Model(fileName, this->md2TextureFileName, this->scaling);
    165162      //this->setModel((Model*)ResourceManager::getInstance()->load(fileName, MD2, RP_CAMPAIGN), 0);
     
    575572    char* name = (char*)(getModel( 0 )->getName());
    576573
    577     if ( strstr(name, ResourceManager::getInstance()->getDataDir()) )
    578     {
    579       name += strlen(ResourceManager::getInstance()->getDataDir());
     574    if (  ResourceManager::getInstance()->getDataDir() == name ) /// FIXME (do not know what to do here.)
     575    {
     576      name += ResourceManager::getInstance()->getDataDir().size();
    580577    }
    581578
  • trunk/src/world_entities/world_entity.h

    r7095 r7221  
    3636  virtual void loadParams(const TiXmlElement* root);
    3737
    38   void loadModel(const char* fileName, float scaling = 1.0f, unsigned int modelNumber = 0);
     38  void loadModel(const std::string& fileName, float scaling = 1.0f, unsigned int modelNumber = 0);
    3939  void setModel(Model* model, unsigned int modelNumber = 0);
    4040  Model* getModel(unsigned int modelNumber = 0) const { return (this->models.size() > modelNumber)? this->models[modelNumber] : NULL; };
    4141
    42   inline void loadMD2Texture(const char* fileName) { this->md2TextureFileName = fileName; }
     42  inline void loadMD2Texture(const std::string& fileName) { this->md2TextureFileName = fileName; }
    4343
    4444  bool buildObbTree(unsigned int depth);
     
    113113
    114114  std::vector<Model*>     models;             //!< The model that should be loaded for this entity.
    115   const char*             md2TextureFileName; //!< the file name of the md2 model texture, only if this
    116   const char*             modelLODName;       //!< the name of the model lod file
     115  std::string             md2TextureFileName; //!< the file name of the md2 model texture, only if this
     116  std::string             modelLODName;       //!< the name of the model lod file
    117117  BVTree*                 obbTree;            //!< this is the obb tree reference needed for collision detection
    118118
Note: See TracChangeset for help on using the changeset viewer.