Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6693 in orxonox.OLD for branches/network/src/lib


Ignore:
Timestamp:
Jan 25, 2006, 2:19:46 PM (19 years ago)
Author:
patrick
Message:

branches: removed spaceshipcontrol branche

Location:
branches/network/src/lib
Files:
13 edited
3 copied

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/graphics/importer/material.cc

    r6622 r6693  
    8181    ResourceManager::getInstance()->unload(this->diffuseTexture);
    8282  if (m.diffuseTexture != NULL)
    83     this->diffuseTexture = m.diffuseTexture; /// HACK shoudl be:(Texture*)ResourceManager::getInstance()->load();
     83    this->diffuseTexture = (Texture*)ResourceManager::getInstance()->copy(m.diffuseTexture);
    8484  this->ambientTexture = NULL; /// FIXME
    8585  this->specularTexture = NULL; /// FIXME
     
    303303  //! @todo Textures from .mtl-file need special care.
    304304  if (dMap != NULL)
    305     this->diffuseTexture = (Texture*)ResourceManager::getInstance()->load(dMap, IMAGE, RP_GAME, (void*)&target);
     305    this->diffuseTexture = (Texture*)ResourceManager::getInstance()->load(dMap, IMAGE, RP_GAME, (int)target);
    306306  else
    307307    this->diffuseTexture = NULL;
  • branches/network/src/lib/graphics/importer/md2Model.cc

    r6222 r6693  
    7878{
    7979  /* this creates the data container via ressource manager */
    80   this->data = (MD2Data*)ResourceManager::getInstance()->load(modelFileName, MD2, RP_GAME, (void*)skinFileName);
     80  this->data = (MD2Data*)ResourceManager::getInstance()->load(modelFileName, MD2, RP_GAME, skinFileName);
    8181  if( unlikely(this->data == NULL))
    8282    PRINTF(0)("The model was not found, MD2Model Loader finished abnormaly. Update the data-repos\n");
  • branches/network/src/lib/graphics/shader.cc

    r5390 r6693  
    106106Shader* Shader::getShader(const char* vertexShaderFile, const char* fragmentShaderFile)
    107107{
    108   return (Shader*)ResourceManager::getInstance()->load(vertexShaderFile, SHADER,  RP_LEVEL, (void*)fragmentShaderFile);
     108  return (Shader*)ResourceManager::getInstance()->load(vertexShaderFile, SHADER,  RP_LEVEL, fragmentShaderFile);
    109109}
    110110
  • branches/network/src/lib/graphics/text_engine/text.cc

    r6349 r6693  
    9292  if (fontFile != NULL)
    9393  {
    94     tmpFont = (Font*)ResourceManager::getInstance()->load(fontFile, TTF, RP_GAME, &fontSize);
     94    tmpFont = (Font*)ResourceManager::getInstance()->load(fontFile, TTF, RP_GAME, (int)fontSize);
    9595    if (tmpFont != NULL)
    9696      this->font = tmpFont;
  • branches/network/src/lib/lang/base_object.cc

    r6634 r6693  
    1313   ### File Specific:
    1414   main-programmer: Patrick Boenzli
    15    co-programmer: ...
     15   co-programmer: Benjamin Grauer
    1616*/
    1717#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_BASE
  • branches/network/src/lib/particles/Makefile.am

    r6629 r6693  
    1111                        spark_particles.cc \
    1212                        model_particles.cc \
     13                        dot_particles.cc \
    1314                        \
    1415                        quick_animation.cc
     
    2223                        spark_particles.h \
    2324                        model_particles.h \
     25                        dot_particles.h \
    2426                        \
    2527                        quick_animation.h
  • branches/network/src/lib/particles/model_particles.cc

    r6629 r6693  
    6161*/
    6262ModelParticles::~ModelParticles()
    63 {
    64   // deleting all the living Particles
    65   while (this->particles)
    66   {
    67     Particle* tmpDelPart = this->particles;
    68     this->particles = this->particles->next;
    69     delete tmpDelPart;
    70   }
    71 
    72   // deleting all the dead particles
    73   while (this->deadList)
    74   {
    75     Particle* tmpDelPart = this->deadList;
    76     this->deadList = this->deadList->next;
    77     delete tmpDelPart;
    78   }
    79 }
     63{ }
    8064
    8165/**
  • branches/network/src/lib/particles/spark_particles.cc

    r6629 r6693  
    6060*/
    6161SparkParticles::~SparkParticles()
    62 {
    63   // deleting all the living Particles
    64   while (this->particles)
    65   {
    66     Particle* tmpDelPart = this->particles;
    67     this->particles = this->particles->next;
    68     delete tmpDelPart;
    69   }
    70 
    71   // deleting all the dead particles
    72   while (this->deadList)
    73   {
    74     Particle* tmpDelPart = this->deadList;
    75     this->deadList = this->deadList->next;
    76     delete tmpDelPart;
    77   }
    78 }
     62{ }
    7963
    8064/**
  • branches/network/src/lib/particles/sprite_particles.cc

    r6628 r6693  
    6161*/
    6262SpriteParticles::~SpriteParticles()
    63 {
    64   // deleting all the living Particles
    65   while (this->particles)
    66   {
    67     Particle* tmpDelPart = this->particles;
    68     this->particles = this->particles->next;
    69     delete tmpDelPart;
    70   }
    71 
    72   // deleting all the dead particles
    73   while (this->deadList)
    74   {
    75     Particle* tmpDelPart = this->deadList;
    76     this->deadList = this->deadList->next;
    77     delete tmpDelPart;
    78   }
    79 }
     63{ }
    8064
    8165/**
     
    125109  GLboolean checkLight = false;
    126110  glGetBooleanv(GL_LIGHTING, &checkLight);
    127   if (checkLight == GL_TRUE)
    128     glDisable(GL_LIGHTING);
     111//  if (checkLight == GL_TRUE)
     112//    glDisable(GL_LIGHTING);
    129113  glMatrixMode(GL_MODELVIEW);
    130114  glDepthMask(GL_FALSE);
  • branches/network/src/lib/util/executor/executor.cc

    r6222 r6693  
    6060  {
    6161    int type = va_arg(parameterList, int);
    62     this->defaultValue[i].setType(type);
     62    this->defaultValue[i].setType((MT_Type)type);
    6363  }
    6464}
  • branches/network/src/lib/util/multi_type.cc

    r5660 r6693  
    122122
    123123/**
     124 * @brief checks if the two Multitypes match
     125 * @param mt MultiType to check against this one
     126 * @returns true on match. false otherwise
     127 *
     128 * Two MultiType match if and only if
     129 *  1. the internal Type is the same
     130 *  2. the stored values match
     131 */
     132bool MultiType::operator==(const MultiType& mt) const
     133{
     134  if (this->type != mt.type)
     135    return false;
     136
     137  switch (this->type)
     138  {
     139    case MT_NULL:
     140      return true;
     141    case MT_BOOL:
     142      return (this->value.Bool == mt.value.Bool);
     143    case MT_INT:
     144      return (this->value.Int == mt.value.Int);
     145    case MT_CHAR:
     146      return (this->value.Char == mt.value.Char);
     147    case MT_FLOAT:
     148      return (this->value.Float == mt.value.Float);
     149    case MT_STRING:
     150      if (this->value.String != NULL && mt.value.String != NULL)
     151        return (!strcmp(this->value.String, mt.value.String));
     152      else
     153        return (this->value.String == NULL && mt.value.String == NULL);
     154  }
     155}
     156
     157/**
     158 * @brief checks if the internal value matches the boolean value.
     159 * @param value to check against this one
     160 * @returns true on match. false otherwise
     161 *
     162 * Two MultiType match if and only if
     163 *  1. the stored values match the given Value
     164 */
     165bool MultiType::operator==(const char* value) const
     166{
     167  if (this->value.String != NULL && value != NULL)
     168    return (!strcmp(this->value.String, value));
     169  else
     170    return (this->value.String == NULL && value == NULL);
     171}
     172
     173
     174/**
    124175 * initializes the MultiType
    125176 */
     
    136187 * @param type the new Type
    137188 */
    138 void MultiType::setType(int type)
     189void MultiType::setType(MT_Type type)
    139190{
    140191  if (this->type != type)
    141     this->type = (MT_Type)type;
     192    this->type = type;
    142193}
    143194
  • branches/network/src/lib/util/multi_type.h

    r5659 r6693  
    3131 */
    3232class MultiType {
    33 
    3433  public:
    3534    MultiType();
     
    4241    virtual ~MultiType();
    4342
    44     MultiType& operator= (const MultiType& mt);
     43    MultiType& operator=(const MultiType& mt);
     44    MultiType& operator=(bool value) { this->setBool(value); return *this; };
     45    MultiType& operator=(int value) { this->setInt(value); return *this; };
     46    MultiType& operator=(float value) { this->setFloat(value); return *this; };
     47    MultiType& operator=(char value) { this->setChar(value); return *this; };
     48    MultiType& operator=(const char* value) { this->setString(value); return *this; };
    4549
    46     void setType(int type);
     50    bool operator==(const MultiType& mt) const;
     51    bool operator==(bool value) const { return (this->getBool() == value); };
     52    bool operator==(int value) const { return (this->getInt() == value); };
     53    bool operator==(float value) const { return (this->getFloat() ==  value); };
     54    bool operator==(char value) const { return (this->getChar() == value); };
     55    bool operator==(const char* value) const;
     56    bool operator==(MT_Type type) const { return (this->type == type); }
     57    bool operator!=(MT_Type type) const { return (this->type != type); }
     58
     59    void setType(MT_Type type);
    4760
    4861    void setBool(bool value);
     
    5265    void setString(const char* value);
    5366
     67    // for your convenience.
    5468    inline void setValue(bool value) { this->setBool(value); };
    5569    inline void setValue(int value) { this->setInt(value); };
     
    8195
    8296  private:
    83 
    8497    union MultiTypeValue
    8598    {
  • branches/network/src/lib/util/substring.h

    r5656 r6693  
    1616  ~SubString();
    1717
     18  const char* operator[](unsigned int i) { return this->getString(i); };
     19
    1820  inline unsigned int getCount() { return this->splittersCount; };
    1921  const char* getString(unsigned int i);
Note: See TracChangeset for help on using the changeset viewer.