Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6645 in orxonox.OLD for trunk/src/lib


Ignore:
Timestamp:
Jan 21, 2006, 4:56:43 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: totally remastered the ResourceManager.
Now it takes MultiTypes instead of (void*) as parameters

  1. This is TypeSafe
  2. This is easier to use
  3. This makes much more sense, and is objectOriented

also made some minor adjustments to the MultiType, some comparisons

also fixed the loading in all the Other classes like material md2 and so on

Location:
trunk/src/lib
Files:
7 edited

Legend:

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

    r6622 r6645  
    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;
  • trunk/src/lib/graphics/importer/md2Model.cc

    r6222 r6645  
    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");
  • trunk/src/lib/graphics/shader.cc

    r5390 r6645  
    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
  • trunk/src/lib/graphics/text_engine/text.cc

    r6349 r6645  
    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;
  • trunk/src/lib/util/executor/executor.cc

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

    r6643 r6645  
    187187 * @param type the new Type
    188188 */
    189 void MultiType::setType(int type)
     189void MultiType::setType(MT_Type type)
    190190{
    191191  if (this->type != type)
    192     this->type = (MT_Type)type;
     192    this->type = type;
    193193}
    194194
  • trunk/src/lib/util/multi_type.h

    r6644 r6645  
    3131 */
    3232class MultiType {
    33 
    3433  public:
    3534    MultiType();
     
    5554    bool operator==(char value) const { return (this->getChar() == value); };
    5655    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); }
    5758
    58     void setType(int type);
     59    void setType(MT_Type type);
    5960
    6061    void setBool(bool value);
Note: See TracChangeset for help on using the changeset viewer.