- Timestamp:
- May 7, 2005, 1:55:44 PM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/glmenu/glmenu_imagescreen.cc
r4101 r4104 29 29 /** 30 30 \brief standard constructor 31 32 \todo this constructor is not jet implemented - do it33 31 */ 34 32 GLMenuImageScreen::GLMenuImageScreen () 35 33 { 36 this->setClassName ("GLMenuImageScreen");37 34 this->init(); 38 35 } 39 36 40 37 /** 38 \param root The Element to load the GLMenu from 39 */ 41 40 GLMenuImageScreen::GLMenuImageScreen (TiXmlElement* root) 42 41 { 43 42 this->init(); 44 43 this->load(root); 44 45 } 46 47 /** 48 \brief Loads a GLMenu from an inputElement 49 \param root The Element to load the GLMenu from 50 51 Tags are: 52 \li BackgroundImage STRING: the background Image 53 \li BarImage: STRING: the Image on the Bar 54 \li BackgroundPS: FLOAT FLOAT FLOAT FLOAT: posX posY scaleX scaleY 55 \li BarPS: FLOAT FLOAT FLOAT FLOAT: posX posY scaleX scaleY 56 \li ElementCount: INT: how many elements will be loaded 57 */ 58 void GLMenuImageScreen::load(TiXmlElement* root) 59 { 45 60 const char* string; 46 61 … … 49 64 if( string != NULL) 50 65 this->setBackgroundImage(string); 51 66 67 string = grabParameter(root, "BackgroundPS"); 68 if (string != NULL) 69 { 70 float f1, f2, f3, f4; 71 sscanf (string, "%f %f %f %f", &f1, &f2, &f3, &f4); 72 this->setPosition(f1,f2); 73 this->setScale(f3,f4); 74 } 75 52 76 string = grabParameter( root, "BarImage"); 53 77 if (string != NULL) 54 78 this->setBarImage(string); 55 56 } 57 79 string = grabParameter(root, "BarPS"); 80 if (string != NULL) 81 { 82 float f1, f2, f3, f4; 83 sscanf (string, "%f %f %f %f", &f1, &f2, &f3, &f4); 84 this->setBarPosScale(f1,f2,f3,f4); 85 } 86 87 string = grabParameter( root, "ElementCount"); 88 if (string != NULL) 89 this->setMaximum(atoi(string)); 90 } 58 91 59 92 /** … … 72 105 void GLMenuImageScreen::init () 73 106 { 107 this->setClassName ("GLMenuImageScreen"); 108 74 109 // Select Our VU Meter Background Texture 75 110 this->backMat = new Material("load_screen"); … … 200 235 201 236 PRINTF(4)("GLMenuImagEscreen::draw() - drawing step %i/%i\n", 202 this->currentValue, this->maxValue);237 this->currentValue, this->maxValue); 203 238 204 239 /* screen size */ … … 218 253 int barH = (int)(this->barH *screenHeight); 219 254 220 int val = (int)(((float)this->currentValue/(float)this->maxValue)221 * this->barW * (float)screenWidth);255 float val = (float)this->currentValue/(float)this->maxValue; 256 222 257 if( val > barW) 223 258 val = barW; … … 248 283 barMat->select(); 249 284 glBegin(GL_TRIANGLE_STRIP); 250 glTexCoord2 i(0, 0); glVertex2i(barX, barY + barH);251 glTexCoord2 i(1, 0); glVertex2i(barX + val, barY + barH);252 glTexCoord2 i(0, 1); glVertex2i(barX, barY);253 glTexCoord2 i(1, 1); glVertex2i(barX + val, barY);285 glTexCoord2f(0, 0); glVertex2i(barX, barY + barH); 286 glTexCoord2f(val, 0); glVertex2i(barX + (int)(val * this->barW * (float)screenWidth), barY + barH); 287 glTexCoord2f(0, 1); glVertex2i(barX, barY); 288 glTexCoord2f(val, 1); glVertex2i(barX + (int)(val * this->barW * (float)screenWidth), barY); 254 289 glEnd(); 255 290 -
orxonox/trunk/src/glmenu/glmenu_imagescreen.h
r4101 r4104 18 18 GLMenuImageScreen (); 19 19 GLMenuImageScreen (TiXmlElement* root); 20 void load(TiXmlElement* root); 20 21 virtual ~GLMenuImageScreen (); 21 22 -
orxonox/trunk/src/story_entities/world.cc
r4099 r4104 268 268 ErrorMessage World::load() 269 269 { 270 PRINTF( 0)("> Loading world: '%s'\n", getPath());271 270 PRINTF(3)("> Loading world: '%s'\n", getPath()); 271 TiXmlElement* element; 272 272 GameLoader* loader = GameLoader::getInstance(); 273 273 274 274 if( getPath() == NULL) 275 275 { 276 PRINTF 0("World has no path specified for loading");276 PRINTF(1)("World has no path specified for loading"); 277 277 return (ErrorMessage){213,"Path not specified","World::load()"}; 278 278 } … … 280 280 TiXmlDocument* XMLDoc = new TiXmlDocument( path); 281 281 // load the campaign document 282 if( !XMLDoc->LoadFile()) 283 //this->glmis->step(); 284 282 if( !XMLDoc->LoadFile()) 285 283 { 286 284 // report an error 287 PRINTF 0("Errorloading XML File: %s @ %d:%d\n", XMLDoc->ErrorDesc(), XMLDoc->ErrorRow(), XMLDoc->ErrorCol());285 PRINTF(1)("loading XML File: %s @ %d:%d\n", XMLDoc->ErrorDesc(), XMLDoc->ErrorRow(), XMLDoc->ErrorCol()); 288 286 delete XMLDoc; 289 287 return (ErrorMessage){213,"XML File parsing error","World::load()"}; … … 297 295 { 298 296 // report an error 299 PRINTF 0("Specified XML File is not an orxonox world data file (WorldDataFile element missing)\n");297 PRINTF(1)("Specified XML File is not an orxonox world data file (WorldDataFile element missing)\n"); 300 298 delete XMLDoc; 301 299 return (ErrorMessage){213,"Path not a WorldDataFile","World::load()"}; … … 308 306 if( string == NULL) 309 307 { 310 PRINTF 0("World is missing a proper 'name'\n");308 PRINTF(2)("World is missing a proper 'name'\n"); 311 309 string = "Unknown"; 312 310 temp = new char[strlen(string + 2)]; … … 320 318 this->worldName = temp; 321 319 } 322 323 320 //////////////// 321 // LOADSCREEN // 322 //////////////// 323 element = root->FirstChildElement("LoadScreen"); 324 if (element == NULL) 325 { 326 PRINTF(2)("no LoadScreen specified, loading default\n"); 327 328 glmis->setBackgroundImage("pictures/load_screen.jpg"); 329 this->glmis->setMaximum(8); 330 this->glmis->draw(); 331 } 332 else 333 { 334 this->glmis->load(element); 335 this->glmis->draw(); 336 } 337 this->glmis->draw(); 324 338 // find WorldEntities 325 TiXmlElement* element = root->FirstChildElement("WorldEntities");339 element = root->FirstChildElement("WorldEntities"); 326 340 327 341 if( element == NULL) 328 342 { 329 PRINTF 0("World is missing 'WorldEntities'\n");343 PRINTF(1)("World is missing 'WorldEntities'\n"); 330 344 } 331 345 else … … 333 347 element = element->FirstChildElement(); 334 348 // load Players/Objects/Whatever 335 PRINTF 0("Loading WorldEntities\n");349 PRINTF(4)("Loading WorldEntities\n"); 336 350 while( element != NULL) 337 351 { … … 345 359 glmis->step(); //! \todo temporary 346 360 } 347 PRINTF 0("Done loading WorldEntities\n");361 PRINTF(4)("Done loading WorldEntities\n"); 348 362 } 349 363 … … 831 845 glmis->setBackgroundImage("pictures/load_screen.jpg"); 832 846 this->glmis->setMaximum(8); 833 this->glmis->draw();847 // this->glmis->draw(); 834 848 835 849 PRINTF(3)("World::displayLoadScreen - end\n");
Note: See TracChangeset
for help on using the changeset viewer.