Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5790 in orxonox.OLD for trunk


Ignore:
Timestamp:
Nov 27, 2005, 12:17:07 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: rescale of the screen-size should reload Models too on windows

Location:
trunk/src/lib/graphics
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/graphics_engine.cc

    r5789 r5790  
    3535 #include "texture.h"
    3636 #include "list.h"
     37 #include "model.h"
    3738#endif
    3839using namespace std;
     
    308309    glViewport(0, 0, width, height);                     // Reset The Current Viewport
    309310
     311#ifdef __WIN32__
    310312    // REBUILDING TEXTURES (ON WINDOWS CONTEXT SWITCH)
    311 #ifdef __WIN32__
    312313    std::list<BaseObject*>* texList = ClassList::getList(CL_TEXTURE);
    313314    if (texList != NULL)
    314       {
    315         std::list<BaseObject*>::iterator reTex;
    316         for (reTex = texList->begin(); reTex != texList->end(); reTex++)
    317           dynamic_cast<Texture*>(*reTex)->rebuild();
    318       }
     315    {
     316      std::list<BaseObject*>::iterator reTex;
     317      for (reTex = texList->begin(); reTex != texList->end(); reTex++)
     318        dynamic_cast<Texture*>(*reTex)->rebuild();
     319    }
     320    // REBUILDING MODELS
     321    std::list<BaseObject*>* modelList = ClassList::getList(CL_MODEL);
     322    if (texList != NULL)
     323    {
     324      std::list<BaseObject*>::iterator reModel;
     325      for (reModel = modelList->begin(); reModel != modelList->end(); reModel++)
     326        dynamic_cast<Model*>(*reModel)->rebuild();
     327    }
    319328#endif /* __WIN32__ */
    320329}
  • trunk/src/lib/graphics/importer/abstract_model.h

    r5672 r5790  
    128128
    129129  public:
    130     AbstractModel() {}
    131     virtual ~AbstractModel() {}
     130    AbstractModel() { }
     131    virtual ~AbstractModel() { }
    132132
    133133    inline const modelInfo* getModelInfo() const { return this->pModelInfo; }
  • trunk/src/lib/graphics/importer/model.cc

    r5774 r5790  
    143143Model::Model(const char* modelName, MODEL_TYPE type)
    144144{
     145  this->setClassID(CL_MODEL, "Model");
    145146  PRINTF(4)("new 3D-Model is being created\n");
    146147  this->setName(modelName);
     
    178179  PRINTF(4)("Deleting Model ");
    179180  if (this->getName())
    180     {
    181       PRINT(4)("%s\n", this->getName());
    182     }
     181  {
     182    PRINT(4)("%s\n", this->getName());
     183  }
    183184  else
    184       PRINT(4)("\n");
     185  {
     186    PRINT(4)("\n");
     187  }
     188  this->cleanup();
    185189
    186190  PRINTF(5)("Deleting display Lists.\n");
     
    216220  //if (this->type == MODEL_DISPLAY_LIST)
    217221    //this->deleteArrays();
    218   this->cleanup();
     222  //  this->cleanup();
    219223
    220224  /* load the ModelInfo */
     
    230234
    231235  this->finalized = true;
     236}
     237
     238/**
     239 * rebuild the Model from the Information we got.
     240 */
     241void Model::rebuild()
     242{
     243  PRINTF(3)("Rebuilding Model '%s'\n", this->getName());
     244  this->finalize();
     245
    232246}
    233247
  • trunk/src/lib/graphics/importer/model.h

    r5774 r5790  
    114114  void draw(char* groupName) const;
    115115
     116  void rebuild();
     117
    116118  /** @returns Count of the Models (Groups) in this File */
    117119  inline int getGroupCount() const { return this->groupCount; };
  • trunk/src/lib/graphics/importer/texture.cc

    r5769 r5790  
    118118  if (this->image != NULL)
    119119    {
    120       PRINTF(1)("Reloading Texture of %s '%s'\n", this->getClassName(), this->getName());
     120      PRINTF(3)("Reloading Texture of %s '%s'\n", this->getClassName(), this->getName());
    121121      this->loadTexToGL();
    122122    }
Note: See TracChangeset for help on using the changeset viewer.