Changeset 4251 in orxonox.OLD
- Timestamp:
- May 21, 2005, 11:17:18 PM (19 years ago)
- Location:
- orxonox/branches/levelLoader/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/levelLoader/src/util/loading/load_param.cc
r4250 r4251 16 16 #include "load_param.h" 17 17 18 //void BaseLoadParam::description(const char* paramDescription)19 //{20 18 21 //} 19 BaseLoadParam::BaseLoadParam(BaseObject* object, const char* type1, const char* type2, 20 const char* type3, const char* type4, const char* type5) 21 { 22 23 } 22 24 23 25 /** 26 \brief if the description of Parameters should be executed 27 */ 28 bool LoadClassDescription::ParametersDescription = false; -
orxonox/branches/levelLoader/src/util/loading/load_param.h
r4250 r4251 25 25 #include "debug.h" 26 26 #include "substring.h" 27 28 // Forward Declaration // 29 template<class T> class tList; 27 30 28 31 /** … … 37 40 #define l_INT_TYPE int 38 41 #define l_INT_FUNC atoi 42 #define l_INT_NAME "int" 39 43 40 44 #define l_LONG_TYPE long 41 45 #define l_LONG_FUNC atol 46 #define l_LONG_NAME "long" 42 47 43 48 #define l_SHORT_TYPE short 44 49 #define l_SHORT_FUNC atoi 50 #define l_SHORT_NAME "short" 45 51 46 52 #define l_FLOAT_TYPE float 47 53 #define l_FLOAT_FUNC atof 54 #define l_FLOAT_NAME "float" 48 55 49 56 #define l_STRING_TYPE const char* 50 #define l_STRING_FUNC 57 #define l_STRING_FUNC 58 #define l_STRING_NAME "string" 51 59 52 60 … … 57 65 #define LoadParam1(type1) \ 58 66 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE)) \ 67 : BaseLoadParam(pt2Object, type1##_NAME) \ 59 68 { \ 60 69 const char* loadString = grabParameter(root, paramName); \ … … 62 71 (*pt2Object.*function)(type1##_FUNC(loadString)); \ 63 72 else \ 64 PRINTF( 2)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName()); \73 PRINTF(4)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName()); \ 65 74 } 66 75 … … 69 78 #define LoadParam2(type1, type2) \ 70 79 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE)) \ 80 : BaseLoadParam(pt2Object, type1##_NAME, type2##_NAME) \ 71 81 { \ 72 82 const char* loadString = grabParameter(root, paramName); \ … … 81 91 } \ 82 92 else \ 83 PRINTF( 2)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName()); \84 } ;93 PRINTF(4)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName()); \ 94 } 85 95 86 96 87 97 // 3. TYPES 88 98 #define LoadParam3(type1, type2, type3) \ 89 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE, type3##_TYPE)) \ 99 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE, type3##_TYPE))\ 100 : BaseLoadParam(pt2Object, type1##_NAME, type2##_NAME, type3##_NAME) \ 90 101 { \ 91 102 const char* loadString = grabParameter(root, paramName); \ … … 100 111 } \ 101 112 else \ 102 PRINTF( 2)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName()); \103 } ;113 PRINTF(4)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName()); \ 114 } 104 115 105 116 … … 107 118 #define LoadParam4(type1, type2, type3, type4) \ 108 119 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE, type3##_TYPE, type4##_TYPE)) \ 120 : BaseLoadParam(pt2Object, type1##_NAME, type2##_NAME, type3##_NAME, type2##_NAME, type4##_NAME) \ 109 121 { \ 110 122 const char* loadString = grabParameter(root, paramName); \ … … 119 131 } \ 120 132 else \ 121 PRINTF( 2)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName()); \122 } ;133 PRINTF(4)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName()); \ 134 } 123 135 124 136 … … 126 138 #define LoadParam5(type1, type2, type3, type4, type5) \ 127 139 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE, type3##_TYPE, type4##_TYPE, type5##_TYPE)) \ 140 : BaseLoadParam(pt2Object, type1##_NAME, type2##_NAME, type3##_NAME, type2##_NAME, type4##_NAME, type5##_NAME) \ 128 141 { \ 129 142 const char* loadString = grabParameter(root, paramName); \ … … 138 151 } \ 139 152 else \ 140 PRINTF(2)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName()); \ 141 }; 153 PRINTF(4)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName()); \ 154 } 155 142 156 143 157 … … 147 161 int paramCount; 148 162 char** types; 163 const char* className; 164 165 }; 166 167 class LoadClassDescription 168 { 169 public: 170 171 172 static bool ParametersDescription; 173 174 private: 175 tList<LoadParamDescription>* paramList; 149 176 }; 150 177 … … 152 179 class BaseLoadParam 153 180 { 154 public: 181 protected: 182 BaseLoadParam(BaseObject* object, const char* type1 = NULL, const char* type2 = NULL, 183 const char* type3 = NULL, const char* type4 = NULL, const char* type5 = NULL); 184 185 protected: 186 LoadParamDescription* description; 155 187 }; 156 188 -
orxonox/branches/levelLoader/src/world_entities/skybox.cc
r4250 r4251 49 49 this->preInit(); 50 50 51 this->load(root); 52 53 this->postInit(); 54 } 55 56 void SkyBox::load(TiXmlElement* root) 57 { 51 58 LoadParam<SkyBox>(root, "Materialset", this, &SkyBox::setTexture); 52 53 this->postInit();54 59 } 55 60 … … 208 213 this->skyModel->addFace (4, VERTEX_TEXCOORD_NORMAL, 0,0,0, 1,1,0, 3,2,0, 2,3,0); // right 209 214 this->skyModel->setMaterial(material[4]); 210 this->skyModel->addFace (4, VERTEX_TEXCOORD_NORMAL, 1,0,5, 7,1,5, 5,2,5, 3,3, 6); // front215 this->skyModel->addFace (4, VERTEX_TEXCOORD_NORMAL, 1,0,5, 7,1,5, 5,2,5, 3,3,5); // front 211 216 this->skyModel->setMaterial(material[5]); 212 217 this->skyModel->addFace (4, VERTEX_TEXCOORD_NORMAL, 6,0,4, 0,1,4, 2,2,4, 4,3,4); // back -
orxonox/branches/levelLoader/src/world_entities/skybox.h
r4249 r4251 26 26 virtual ~SkyBox(); 27 27 28 void load(TiXmlElement* root); 29 28 30 void preInit(void); 29 31 void postInit(void); -
orxonox/branches/levelLoader/src/world_entities/world_entity.cc
r4240 r4251 26 26 27 27 /** 28 \brief standard constructor29 */ 30 WorldEntity::WorldEntity ()28 \brief Loads the WordEntity-specific Part of any derived Class 29 */ 30 WorldEntity::WorldEntity(TiXmlElement* root) 31 31 { 32 32 this->setClassName ("WorldEntity"); 33 this->model = NULL; 34 35 if (root) 36 this->load(root); 37 33 38 this->bDraw = true; 34 this->model = NULL; 35 // collisioncluster = NULL; 36 } 37 38 /** 39 \brief Loads the WordEntity-specific Part of any derived Class 40 */ 41 WorldEntity::WorldEntity(TiXmlElement* root) 42 { 43 this->setClassName ("WorldEntity"); 44 // Name Setup 39 } 40 41 void WorldEntity::load(TiXmlElement* root) 42 { 43 // name setup 45 44 LoadParam<WorldEntity>(root, "name", this, &WorldEntity::setName); 45 46 46 // Model Loading 47 this->model = NULL;48 47 LoadParam<WorldEntity>(root, "model", this, &WorldEntity::loadModel); 49 50 this->bDraw = true;51 48 } 52 49 -
orxonox/branches/levelLoader/src/world_entities/world_entity.h
r4239 r4251 23 23 24 24 public: 25 WorldEntity (void); 26 WorldEntity(TiXmlElement* root); 25 WorldEntity(TiXmlElement* root = NULL); 27 26 virtual ~WorldEntity (); 28 27 28 void load(TiXmlElement* root); 29 29 void loadModel(const char* fileName); 30 30
Note: See TracChangeset
for help on using the changeset viewer.