Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4370 in orxonox.OLD


Ignore:
Timestamp:
May 28, 2005, 4:20:02 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: objModel's materials should now automatically load textures

Location:
orxonox/trunk/src
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/graphics/importer/material.cc

    r4357 r4370  
    282282   \param pathName The Path to add.
    283283*/
    284 void Material::addTexturePath(char* pathName)
     284void Material::addTexturePath(const char* pathName)
    285285{
    286286  ResourceManager::getInstance()->addImageDir(pathName);
  • orxonox/trunk/src/lib/graphics/importer/material.h

    r4136 r4370  
    4848
    4949 
    50   void addTexturePath(char* pathName);
     50  static void addTexturePath(const char* pathName);
    5151 // MAPPING //
    5252  void setDiffuseMap(const char* dMap);
  • orxonox/trunk/src/lib/graphics/importer/objModel.cc

    r4118 r4370  
    7575      strncpy(this->objPath, fileName, len);
    7676      this->objPath[len] = '\0';
     77      Material::addTexturePath(this->objPath);
    7778      PRINTF(1)("Resolved file %s to Path %s.\n", fileName, this->objPath);
    7879    }
  • orxonox/trunk/src/lib/graphics/importer/texture.cc

    r4357 r4370  
    4444    glDeleteTextures(1, &this->texture);
    4545}
    46 
    47 /**
    48    \brief a Simple function that switches two char values
    49    \param a The first value
    50    \param b The second value
    51 */
    52 void Texture::swap (unsigned char &a, unsigned char &b)
    53 {
    54   unsigned char temp;
    55   temp = a;
    56   a    = b;
    57   b    = temp;
    58 }
    59 
    6046
    6147/**
  • orxonox/trunk/src/lib/graphics/importer/texture.h

    r4357 r4370  
    2323  GLuint texture;   //!< The Texture-ID of opengl from this Texture.
    2424  char* searchTextureInPaths(const char* texName) const;
    25   void swap(unsigned char &a, unsigned char &b);
    2625
    2726  bool bAlpha;           //!< if the texture has an alpha channel.
  • orxonox/trunk/src/lib/graphics/particles/particle_system.cc

    r4357 r4370  
    321321    case PARTICLE_SPRITE:
    322322      glMatrixMode(GL_MODELVIEW);
    323       //      glDisable(GL_DEPTH_TEST);
     323      glDisable(GL_DEPTH_TEST);
    324324
    325325      material->select();
  • orxonox/trunk/src/subprojects/particles/particle_fun.cc

    r4357 r4370  
    109109      else if(!strcmp(name, "SpreadAngle"))
    110110        {
    111           tmpEmit->setSpread(atof(value));
     111          tmpEmit->setSpread(atof(value), 0);
    112112          PRINT(4)("SpreadAngle set to %f\n", atof(value));
    113113        }
  • orxonox/trunk/src/util/resource_manager.cc

    r4356 r4370  
    130130   false otherwise
    131131*/
    132 bool ResourceManager::addImageDir(char* imageDir)
     132bool ResourceManager::addImageDir(const char* imageDir)
    133133{
    134134  // check if the param is a Directory
  • orxonox/trunk/src/util/resource_manager.h

    r4166 r4370  
    7878
    7979  bool checkDataDir(const char* fileInside);
    80   bool addImageDir(char* imageDir);
     80  bool addImageDir(const char* imageDir);
    8181  void* load(const char* fileName, ResourcePriority prio = RP_NO,
    8282             void* param1 = NULL, void* param2 = NULL, void* param3 = NULL);
Note: See TracChangeset for help on using the changeset viewer.