Changeset 4242 in orxonox.OLD for orxonox/branches/levelLoader
- Timestamp:
- May 20, 2005, 3:55:19 AM (20 years ago)
- Location:
- orxonox/branches/levelLoader/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/levelLoader/src/glmenu/glmenu_imagescreen.cc
r4241 r4242 58 58 void GLMenuImageScreen::load(TiXmlElement* root) 59 59 { 60 const char* string;61 62 60 LoadParam<GLMenuImageScreen>(root, "BackgroundImage", this, &GLMenuImageScreen::setBackgroundImage); 63 61 -
orxonox/branches/levelLoader/src/util/loading/load_param.h
r4241 r4242 19 19 { 20 20 public: 21 // CONST CHAR*21 // 1. CONST CHAR* 22 22 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(const char*)) 23 { 23 { 24 24 const char* loadString = grabParameter(root, paramName); 25 25 if (loadString != NULL) … … 27 27 else 28 28 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()); 30 68 }; 31 69 -
orxonox/branches/levelLoader/src/world_entities/skybox.cc
r4240 r4242 56 56 this->preInit(); 57 57 58 const char* string;59 60 // Model Loading61 58 LoadParam<SkyBox>(root, "Materialset", this, &SkyBox::setTexture); 62 59 … … 107 104 "skybox_right.jpg", "skybox_front.jpg", "skybox_back.jpg"); 108 105 */ 109 void SkyBox::setTexture (const char* name, const char* extension)106 void SkyBox::setTextureAndType(const char* name, const char* extension) 110 107 { 111 108 char* top = new char[strlen(name)+strlen(extension)+ 10]; -
orxonox/branches/levelLoader/src/world_entities/skybox.h
r4240 r4242 32 32 void setSize(float size); 33 33 /** \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); 36 36 void setTextures(const char* top, const char* bottom, const char* left, const char* right, const char* front, const char* back); 37 37
Note: See TracChangeset
for help on using the changeset viewer.