Changeset 6502 for code/trunk/src/orxonox/overlays
- Timestamp:
- Mar 11, 2010, 11:34:20 AM (15 years ago)
- Location:
- code/trunk/src/orxonox/overlays
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/overlays/InGameConsole.cc
r6417 r6502 200 200 this->consoleOverlayBorder_->setBorderSize(16, 16, 0, 16); 201 201 this->consoleOverlayBorder_->setBorderMaterialName("ConsoleBorder"); 202 this->consoleOverlayBorder_->setLeftBorderUV(0.0 , 0.49, 0.5, 0.51);203 this->consoleOverlayBorder_->setRightBorderUV(0.5 , 0.49, 1.0, 0.5);204 this->consoleOverlayBorder_->setBottomBorderUV(0.49 , 0.5, 0.51, 1.0);205 this->consoleOverlayBorder_->setBottomLeftBorderUV(0.0 , 0.5, 0.5, 1.0);206 this->consoleOverlayBorder_->setBottomRightBorderUV(0.5 , 0.5, 1.0, 1.0);202 this->consoleOverlayBorder_->setLeftBorderUV(0.0f, 0.49f, 0.5f, 0.51f); 203 this->consoleOverlayBorder_->setRightBorderUV(0.5f, 0.49f, 1.0f, 0.5f); 204 this->consoleOverlayBorder_->setBottomBorderUV(0.49f, 0.5f, 0.51f, 1.0f); 205 this->consoleOverlayBorder_->setBottomLeftBorderUV(0.0f, 0.5f, 0.5f, 1.0f); 206 this->consoleOverlayBorder_->setBottomRightBorderUV(0.5f, 0.5f, 1.0f, 1.0f); 207 207 this->consoleOverlayContainer_->addChild(this->consoleOverlayBorder_); 208 208 … … 254 254 // move overlay "above" the top edge of the screen 255 255 // we take -1.3 because the border makes the panel bigger 256 this->consoleOverlayContainer_->setTop(-1.3 * this->relativeHeight);256 this->consoleOverlayContainer_->setTop(-1.3f * this->relativeHeight); 257 257 258 258 COUT(4) << "Info: InGameConsole initialized" << std::endl; … … 332 332 333 333 this->consoleOverlayCursor_->setCaption(std::string(pos,' ') + cursorSymbol_); 334 this->consoleOverlayCursor_->setTop(static_cast<int>(this->windowH_ * this->relativeHeight) - 24 );334 this->consoleOverlayCursor_->setTop(static_cast<int>(this->windowH_ * this->relativeHeight) - 24.0f); 335 335 } 336 336 … … 369 369 // enlarge oldTop a little bit so that this exponential function 370 370 // reaches 0 before infinite time has passed... 371 float deltaScroll = (oldTop - 0.01 ) * time.getDeltaTime() * this->scrollSpeed_;371 float deltaScroll = (oldTop - 0.01f) * time.getDeltaTime() * this->scrollSpeed_; 372 372 if (oldTop - deltaScroll >= 0) 373 373 { … … 384 384 // scrolling up 385 385 // note: +0.01 for the same reason as when scrolling down 386 float deltaScroll = (1.3 * this->relativeHeight + 0.01+ oldTop) * time.getDeltaTime() * this->scrollSpeed_;386 float deltaScroll = (1.3f * this->relativeHeight + 0.01f + oldTop) * time.getDeltaTime() * this->scrollSpeed_; 387 387 if (oldTop - deltaScroll <= -1.3 * this->relativeHeight) 388 388 { 389 389 // window has completely scrolled up 390 this->consoleOverlayContainer_->setTop(-1.3 * this->relativeHeight);390 this->consoleOverlayContainer_->setTop(-1.3f * this->relativeHeight); 391 391 this->scroll_ = 0; 392 392 this->consoleOverlay_->hide(); … … 424 424 this->windowW_ = newWidth; 425 425 this->windowH_ = newHeight; 426 this->consoleOverlayBorder_->setWidth( static_cast<int>(this->windowW_* this->relativeWidth));427 this->consoleOverlayBorder_->setHeight( static_cast<int>(this->windowH_ * this->relativeHeight));428 this->consoleOverlayNoise_->setWidth( static_cast<int>(this->windowW_ * this->relativeWidth) - 10);429 this->consoleOverlayNoise_->setHeight( static_cast<int>(this->windowH_ * this->relativeHeight) - 5);426 this->consoleOverlayBorder_->setWidth((float)(int)(this->windowW_* this->relativeWidth)); 427 this->consoleOverlayBorder_->setHeight((float)(int)(this->windowH_ * this->relativeHeight)); 428 this->consoleOverlayNoise_->setWidth((float)(int)(this->windowW_ * this->relativeWidth) - 10.0f); 429 this->consoleOverlayNoise_->setHeight((float)(int)(this->windowH_ * this->relativeHeight) - 5.0f); 430 430 this->consoleOverlayNoise_->setTiling(consoleOverlayNoise_->getWidth() / (50.0f * this->noiseSize_), consoleOverlayNoise_->getHeight() / (50.0f * this->noiseSize_)); 431 431 … … 440 440 for (int i = 0; i < LINES; i++) 441 441 { 442 this->consoleOverlayTextAreas_[i]->setWidth( this->desiredTextWidth_);443 this->consoleOverlayTextAreas_[i]->setTop( static_cast<int>(this->windowH_ * this->relativeHeight) - 24 - 14*i);442 this->consoleOverlayTextAreas_[i]->setWidth((float)this->desiredTextWidth_); 443 this->consoleOverlayTextAreas_[i]->setTop((float)(int)(this->windowH_ * this->relativeHeight) - 24 - 14*i); 444 444 } 445 445 … … 556 556 switch (type) 557 557 { 558 case Shell::Error: colourTop = ColourValue(0.95 , 0.25, 0.25, 1.00);559 colourBottom = ColourValue(1.00 , 0.50, 0.50, 1.00); break;560 561 case Shell::Warning: colourTop = ColourValue(0.95 , 0.50, 0.20, 1.00);562 colourBottom = ColourValue(1.00 , 0.70, 0.50, 1.00); break;563 564 case Shell::Info: colourTop = ColourValue(0.50 , 0.50, 0.95, 1.00);565 colourBottom = ColourValue(0.80 , 0.80, 1.00, 1.00); break;566 567 case Shell::Debug: colourTop = ColourValue(0.65 , 0.48, 0.44, 1.00);568 colourBottom = ColourValue(1.00 , 0.90, 0.90, 1.00); break;569 570 case Shell::Verbose: colourTop = ColourValue(0.40 , 0.20, 0.40, 1.00);571 colourBottom = ColourValue(0.80 , 0.60, 0.80, 1.00); break;572 573 case Shell::Ultra: colourTop = ColourValue(0.21 , 0.69, 0.21, 1.00);574 colourBottom = ColourValue(0.80 , 1.00, 0.80, 1.00); break;575 576 case Shell::Command: colourTop = ColourValue(0.80 , 0.80, 0.80, 1.00);577 colourBottom = ColourValue(0.90 , 0.90, 0.90, 0.90); break;578 579 case Shell::Hint: colourTop = ColourValue(0.80 , 0.80, 0.80, 1.00);580 colourBottom = ColourValue(0.90 , 0.90, 0.90, 1.00); break;581 582 default: colourTop = ColourValue(0.90 , 0.90, 0.90, 1.00);583 colourBottom = ColourValue(1.00 , 1.00, 1.00, 1.00); break;558 case Shell::Error: colourTop = ColourValue(0.95f, 0.25f, 0.25f, 1.00f); 559 colourBottom = ColourValue(1.00f, 0.50f, 0.50f, 1.00f); break; 560 561 case Shell::Warning: colourTop = ColourValue(0.95f, 0.50f, 0.20f, 1.00f); 562 colourBottom = ColourValue(1.00f, 0.70f, 0.50f, 1.00f); break; 563 564 case Shell::Info: colourTop = ColourValue(0.50f, 0.50f, 0.95f, 1.00f); 565 colourBottom = ColourValue(0.80f, 0.80f, 1.00f, 1.00f); break; 566 567 case Shell::Debug: colourTop = ColourValue(0.65f, 0.48f, 0.44f, 1.00f); 568 colourBottom = ColourValue(1.00f, 0.90f, 0.90f, 1.00f); break; 569 570 case Shell::Verbose: colourTop = ColourValue(0.40f, 0.20f, 0.40f, 1.00f); 571 colourBottom = ColourValue(0.80f, 0.60f, 0.80f, 1.00f); break; 572 573 case Shell::Ultra: colourTop = ColourValue(0.21f, 0.69f, 0.21f, 1.00f); 574 colourBottom = ColourValue(0.80f, 1.00f, 0.80f, 1.00f); break; 575 576 case Shell::Command: colourTop = ColourValue(0.80f, 0.80f, 0.80f, 1.00f); 577 colourBottom = ColourValue(0.90f, 0.90f, 0.90f, 0.90f); break; 578 579 case Shell::Hint: colourTop = ColourValue(0.80f, 0.80f, 0.80f, 1.00f); 580 colourBottom = ColourValue(0.90f, 0.90f, 0.90f, 1.00f); break; 581 582 default: colourTop = ColourValue(0.90f, 0.90f, 0.90f, 1.00f); 583 colourBottom = ColourValue(1.00f, 1.00f, 1.00f, 1.00f); break; 584 584 } 585 585 -
code/trunk/src/orxonox/overlays/Map.cc
r6417 r6502 179 179 //m_pOverlayPanel->setPosition(10, 10); 180 180 //m_pOverlayPanel->setDimensions(600, 400); 181 m_pOverlayPanel->setPosition(0.01 , 0.003);182 m_pOverlayPanel->setDimensions(0.5 , 0.4);181 m_pOverlayPanel->setPosition(0.01f, 0.003f); 182 m_pOverlayPanel->setDimensions(0.5f, 0.4f); 183 183 // Give overlay a texture 184 184 m_pOverlayPanel->setMaterialName("RttMat"); … … 187 187 //Add Borders 188 188 Ogre::BorderPanelOverlayElement* oBorder = static_cast<Ogre::BorderPanelOverlayElement*>(Ogre::OverlayManager::getSingletonPtr()->createOverlayElement("BorderPanel", "MapBorderPanel" + getUniqueNumberString())); 189 oBorder->setBorderSize( 0.003 , 0.003);190 oBorder->setDimensions(0.5 , 0.4);189 oBorder->setBorderSize( 0.003f, 0.003f ); 190 oBorder->setDimensions(0.5f, 0.4f); 191 191 oBorder->setBorderMaterialName("StatsBorder"); 192 oBorder->setTopBorderUV(0.49 , 0.0, 0.51, 0.5);193 oBorder->setTopLeftBorderUV(0.0 , 0.0, 0.5, 0.5);194 oBorder->setTopRightBorderUV(0.5 , 0.0, 1.0, 0.5);195 oBorder->setLeftBorderUV(0.0 , 0.49, 0.5, 0.51);196 oBorder->setRightBorderUV(0.5 , 0.49, 1.0, 0.5);197 oBorder->setBottomBorderUV(0.49 , 0.5, 0.51, 1.0);198 oBorder->setBottomLeftBorderUV(0.0 , 0.5, 0.5, 1.0);199 oBorder->setBottomRightBorderUV(0.5 , 0.5, 1.0, 1.0);192 oBorder->setTopBorderUV(0.49f, 0.0f, 0.51f, 0.5f); 193 oBorder->setTopLeftBorderUV(0.0f, 0.0f, 0.5f, 0.5f); 194 oBorder->setTopRightBorderUV(0.5f, 0.0f, 1.0f, 0.5f); 195 oBorder->setLeftBorderUV(0.0f, 0.49f, 0.5f, 0.51f); 196 oBorder->setRightBorderUV(0.5f, 0.49f, 1.0f, 0.5f); 197 oBorder->setBottomBorderUV(0.49f, 0.5f, 0.51f, 1.0f); 198 oBorder->setBottomLeftBorderUV(0.0f, 0.5f, 0.5f, 1.0f); 199 oBorder->setBottomRightBorderUV(0.5f, 0.5f, 1.0f, 1.0f); 200 200 //overlay_->add2D(oBorder); 201 201 m_pOverlayPanel->addChild(oBorder); … … 329 329 //this->CamNodeHelper_ = this->CamNode_->createChildSceneNode(); 330 330 //this->CamNodeHelper_->attachObject(this->Cam_); 331 this->Cam_->setPosition(0, 0, DISTANCE);332 this->Cam_->pitch( static_cast<Degree>( PITCH) );331 this->Cam_->setPosition(0, 0, (float)DISTANCE); 332 this->Cam_->pitch( static_cast<Degree>((float)PITCH) ); 333 333 this->Cam_->lookAt(this->playerShipNode_->getPosition()); 334 334 //this->Cam_->setAutoTracking(true, this->playerShipNode_); -
code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc
r6417 r6502 226 226 if (angle > 89.0f && angle < 91.0f) 227 227 { 228 tempAspect = 1.0 / this->windowAspectRatio_;228 tempAspect = 1.0f / this->windowAspectRatio_; 229 229 rotState_ = Vertical; 230 230 }
Note: See TracChangeset
for help on using the changeset viewer.