Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4242 in orxonox.OLD for orxonox


Ignore:
Timestamp:
May 20, 2005, 3:55:19 AM (20 years ago)
Author:
bensch
Message:

orxonox/branches/levelLoader: better compatibility with more functions

Location:
orxonox/branches/levelLoader/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/levelLoader/src/glmenu/glmenu_imagescreen.cc

    r4241 r4242  
    5858void GLMenuImageScreen::load(TiXmlElement* root)
    5959{
    60   const char* string;
    61 
    6260  LoadParam<GLMenuImageScreen>(root, "BackgroundImage", this, &GLMenuImageScreen::setBackgroundImage);
    6361
  • orxonox/branches/levelLoader/src/util/loading/load_param.h

    r4241 r4242  
    1919{
    2020 public:
    21   // CONST CHAR*
     21  // 1. CONST CHAR*
    2222  LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(const char*))
    23     { 
     23    {
    2424      const char* loadString = grabParameter(root, paramName);
    2525      if (loadString != NULL)
     
    2727      else
    2828        PRINTF(2)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName());
    29      
     29    };
     30
     31  // 2. CONST CHAR*
     32  LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(const char*, const char*))
     33    {
     34      const char* loadString = grabParameter(root, paramName);
     35      if (loadString != NULL)
     36        {
     37          SubString subLoads(loadString);
     38          (*pt2Object.*function)(subLoads.getString(0), subLoads.getString(1));
     39        }
     40      else
     41        PRINTF(2)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName());
     42    };
     43
     44  // 3. CONST CHAR*
     45  LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(const char*, const char*, const char*))
     46    {
     47      const char* loadString = grabParameter(root, paramName);
     48      if (loadString != NULL)
     49        {
     50          SubString subLoads(loadString);
     51          (*pt2Object.*function)(subLoads.getString(0), subLoads.getString(1), subLoads.getString(2));
     52        }
     53      else
     54        PRINTF(2)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName());
     55    };
     56
     57  // 4. CONST CHAR*
     58  LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(const char*, const char*, const char*, const char*))
     59    {
     60      const char* loadString = grabParameter(root, paramName);
     61      if (loadString != NULL)
     62        {
     63          SubString subLoads(loadString);
     64          (*pt2Object.*function)(subLoads.getString(0), subLoads.getString(1), subLoads.getString(2), subLoads.getString(3));
     65        }
     66      else
     67        PRINTF(2)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName());
    3068    };
    3169
  • orxonox/branches/levelLoader/src/world_entities/skybox.cc

    r4240 r4242  
    5656  this->preInit();
    5757
    58   const char* string;
    59 
    60   // Model Loading     
    6158  LoadParam<SkyBox>(root, "Materialset", this, &SkyBox::setTexture);
    6259
     
    107104               "skybox_right.jpg", "skybox_front.jpg", "skybox_back.jpg");
    108105*/
    109 void SkyBox::setTexture(const char* name, const char* extension)
     106void SkyBox::setTextureAndType(const char* name, const char* extension)
    110107{
    111108  char* top    = new char[strlen(name)+strlen(extension)+ 10];
  • orxonox/branches/levelLoader/src/world_entities/skybox.h

    r4240 r4242  
    3232  void setSize(float size);
    3333  /** \brief assumes jpg as input-format */
    34   void setTexture(const char* name) { setTexture (name, "jpg");};
    35   void setTexture(const char* name, const char* extension);
     34  void setTexture(const char* name) { setTextureAndType (name, "jpg");};
     35  void setTextureAndType(const char* name, const char* extension);
    3636  void setTextures(const char* top, const char* bottom, const char* left, const char* right, const char* front, const char* back);
    3737
Note: See TracChangeset for help on using the changeset viewer.