Changeset 4253 in orxonox.OLD for orxonox/branches/levelLoader/src
- Timestamp:
- May 21, 2005, 11:58:49 PM (20 years ago)
- Location:
- orxonox/branches/levelLoader/src
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/levelLoader/src/glmenu/glmenu_imagescreen.cc
r4242 r4253 38 38 \param root The Element to load the GLMenu from 39 39 */ 40 GLMenuImageScreen::GLMenuImageScreen (TiXmlElement* root)40 GLMenuImageScreen::GLMenuImageScreen(const TiXmlElement* root) 41 41 { 42 42 this->init(); 43 this->load(root); 44 43 this->loadParams(root); 45 44 } 46 45 … … 56 55 \li ElementCount: INT: how many elements will be loaded 57 56 */ 58 void GLMenuImageScreen::load (TiXmlElement* root)57 void GLMenuImageScreen::loadParams(const TiXmlElement* root) 59 58 { 60 59 LoadParam<GLMenuImageScreen>(root, "BackgroundImage", this, &GLMenuImageScreen::setBackgroundImage); -
orxonox/branches/levelLoader/src/glmenu/glmenu_imagescreen.h
r4241 r4253 17 17 public: 18 18 GLMenuImageScreen (); 19 GLMenuImageScreen ( TiXmlElement* root);20 void load (TiXmlElement* root);19 GLMenuImageScreen (const TiXmlElement* root); 20 void loadParams(const TiXmlElement* root); 21 21 virtual ~GLMenuImageScreen (); 22 22 -
orxonox/branches/levelLoader/src/story_entities/world.cc
r4248 r4253 121 121 CREATE_FACTORY(World); 122 122 123 World::World( TiXmlElement* root)123 World::World(const TiXmlElement* root) 124 124 { 125 125 this->constuctorInit("", -1); 126 126 this->path = NULL; 127 const char *string; 128 char *name; 129 int id; 130 131 PRINTF0("Creating a World\n"); 132 133 // identifier 134 string = grabParameter( root, "identifier"); 135 if( string == NULL || sscanf(string, "%d", &id) != 1) 136 { 137 PRINTF0("World is missing a proper 'identifier'\n"); 138 this->setStoryID( -1); 139 } 140 else setStoryID( id); 141 142 // next id 143 string = grabParameter( root, "nextid"); 144 if( string == NULL || sscanf(string, "%d", &id) != 1) 145 { 146 PRINTF0("World is missing a proper 'nextid'\n"); 147 this->setStoryID( -1); 148 } 149 else setNextStoryID( id); 150 151 152 // path 153 string = grabParameter( root, "path"); 154 if( string == NULL) 155 { 156 PRINTF0("World is missing a proper 'path'\n"); 157 this->setPath( NULL); 158 } 159 else 160 { 161 name = new char[strlen(string + 2)]; 162 strcpy( name, string); 163 this->setPath( name); 164 } 127 128 this->loadParams(root); 165 129 } 166 130 … … 234 198 this->debugWorldNr = worldID; 235 199 this->entities = new tList<WorldEntity>(); 200 } 201 202 void World::loadParams(const TiXmlElement* root) 203 { 204 const char *string; 205 char *name; 206 int id; 207 208 PRINTF0("Creating a World\n"); 209 210 // identifier 211 string = grabParameter( root, "identifier"); 212 if( string == NULL || sscanf(string, "%d", &id) != 1) 213 { 214 PRINTF0("World is missing a proper 'identifier'\n"); 215 this->setStoryID( -1); 216 } 217 else setStoryID( id); 218 219 // next id 220 string = grabParameter( root, "nextid"); 221 if( string == NULL || sscanf(string, "%d", &id) != 1) 222 { 223 PRINTF0("World is missing a proper 'nextid'\n"); 224 this->setStoryID( -1); 225 } 226 else setNextStoryID( id); 227 228 229 // path 230 string = grabParameter( root, "path"); 231 if( string == NULL) 232 { 233 PRINTF0("World is missing a proper 'path'\n"); 234 this->setPath( NULL); 235 } 236 else 237 { 238 name = new char[strlen(string + 2)]; 239 strcpy( name, string); 240 this->setPath( name); 241 } 236 242 } 237 243 … … 332 338 else 333 339 { 334 this->glmis->load (element);340 this->glmis->loadParams(element); 335 341 this->glmis->draw(); 336 342 } -
orxonox/branches/levelLoader/src/story_entities/world.h
r4239 r4253 56 56 World (char* name); 57 57 World (int worldID); 58 World ( TiXmlElement* root);58 World (const TiXmlElement* root = NULL); 59 59 virtual ~World (); 60 61 void loadParams(const TiXmlElement* root); 60 62 61 63 double getGameTime(); -
orxonox/branches/levelLoader/src/util/loading/factory.cc
r4250 r4253 65 65 \brief generates the associated object from data 66 66 */ 67 BaseObject* Factory::fabricate( TiXmlElement* data)67 BaseObject* Factory::fabricate(const TiXmlElement* data) 68 68 { 69 69 return NULL; -
orxonox/branches/levelLoader/src/util/loading/factory.h
r4252 r4253 46 46 47 47 48 virtual BaseObject* fabricate( TiXmlElement* root);48 virtual BaseObject* fabricate(const TiXmlElement* root); 49 49 void initialize(); 50 50 void registerFactory( Factory* factory); … … 67 67 68 68 private: 69 BaseObject* fabricate( TiXmlElement* root);69 BaseObject* fabricate(const TiXmlElement* root); 70 70 }; 71 71 … … 82 82 83 83 template<class T> 84 BaseObject* tFactory<T>::fabricate( TiXmlElement* root)84 BaseObject* tFactory<T>::fabricate(const TiXmlElement* root) 85 85 { 86 86 if(!strcmp(root->Value(), getFactoryName())) -
orxonox/branches/levelLoader/src/util/loading/load_param.h
r4252 r4253 157 157 158 158 #define CREATE_LOAD_DOC(CLASS_NAME) \ 159 160 /* void documentLoadClass(void) \ 159 void documentLoadClass##CLASS_NAME(void) \ 161 160 { \ 162 161 if(LoadClassDescription::parametersDescription) \ 163 162 { \ 164 163 CLASS_NAME docuClass; \ 165 docuClass.load (NULL); \166 } \ 167 } \168 documentLoadClass();169 */ 164 docuClass.loadParams(NULL); \ 165 } \ 166 } 167 // documentLoadClass(); 168 170 169 171 170 class LoadParamDescription -
orxonox/branches/levelLoader/src/world_entities/player.cc
r4114 r4253 80 80 \todo add more parameters to load 81 81 */ 82 Player::Player( TiXmlElement* root) : WorldEntity(root)82 Player::Player(const TiXmlElement* root) : WorldEntity(root) 83 83 { 84 84 this->weapons = new tList<Weapon>(); -
orxonox/branches/levelLoader/src/world_entities/player.h
r4010 r4253 22 22 public: 23 23 Player(); 24 Player( TiXmlElement* root);24 Player(const TiXmlElement* root); 25 25 virtual ~Player(); 26 26 -
orxonox/branches/levelLoader/src/world_entities/skybox.cc
r4251 r4253 45 45 } 46 46 47 SkyBox::SkyBox( TiXmlElement* root) : WorldEntity(root)47 SkyBox::SkyBox(const TiXmlElement* root) : WorldEntity(root) 48 48 { 49 49 this->preInit(); 50 50 51 this->load (root);51 this->loadParams(root); 52 52 53 53 this->postInit(); 54 54 } 55 55 56 void SkyBox::load (TiXmlElement* root)56 void SkyBox::loadParams(const TiXmlElement* root) 57 57 { 58 58 LoadParam<SkyBox>(root, "Materialset", this, &SkyBox::setTexture); -
orxonox/branches/levelLoader/src/world_entities/skybox.h
r4251 r4253 22 22 public: 23 23 SkyBox(const char* fileName = NULL); 24 SkyBox( TiXmlElement* root);24 SkyBox(const TiXmlElement* root); 25 25 26 26 virtual ~SkyBox(); 27 27 28 void load (TiXmlElement* root);28 void loadParams(const TiXmlElement* root); 29 29 30 30 void preInit(void); -
orxonox/branches/levelLoader/src/world_entities/world_entity.cc
r4251 r4253 28 28 \brief Loads the WordEntity-specific Part of any derived Class 29 29 */ 30 WorldEntity::WorldEntity( TiXmlElement* root)30 WorldEntity::WorldEntity(const TiXmlElement* root) 31 31 { 32 32 this->setClassName ("WorldEntity"); … … 34 34 35 35 if (root) 36 this->load (root);36 this->loadParams(root); 37 37 38 38 this->bDraw = true; 39 39 } 40 40 41 void WorldEntity::load (TiXmlElement* root)41 void WorldEntity::loadParams(const TiXmlElement* root) 42 42 { 43 43 // name setup -
orxonox/branches/levelLoader/src/world_entities/world_entity.h
r4251 r4253 23 23 24 24 public: 25 WorldEntity( TiXmlElement* root = NULL);25 WorldEntity(const TiXmlElement* root = NULL); 26 26 virtual ~WorldEntity (); 27 27 28 void load (TiXmlElement* root);28 void loadParams(const TiXmlElement* root); 29 29 void loadModel(const char* fileName); 30 30
Note: See TracChangeset
for help on using the changeset viewer.