Changeset 3300 for code/trunk/src/orxonox/overlays
- Timestamp:
- Jul 17, 2009, 11:53:35 PM (15 years ago)
- Location:
- code/trunk/src/orxonox/overlays
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/overlays/GUIOverlay.cc
r3196 r3300 67 67 std::string str; 68 68 std::stringstream out; 69 out << (long)this;69 out << static_cast<long>(this); 70 70 str = out.str(); 71 71 GUIManager::getInstance().executeCode("showCursor()"); -
code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc
r3280 r3300 215 215 if (angle < 0.0) 216 216 angle = -angle; 217 angle -= 180.0f * (int)(angle / 180.0);217 angle -= 180.0f * static_caste<int>(angle / 180.0); 218 218 219 219 // take the reverse if angle is about 90 degrees … … 277 277 if (angle < 0.0) 278 278 angle = -angle; 279 angle -= Ogre::Math::PI * (int)(angle / (Ogre::Math::PI));279 angle -= Ogre::Math::PI * static_cast<int>(angle / (Ogre::Math::PI)); 280 280 if (angle > Ogre::Math::PI * 0.5) 281 281 angle = Ogre::Math::PI - angle; -
code/trunk/src/orxonox/overlays/console/InGameConsole.cc
r3280 r3300 332 332 333 333 this->consoleOverlayCursor_->setCaption(std::string(pos,' ') + cursorSymbol_); 334 this->consoleOverlayCursor_->setTop( (int) this->windowH_ * this->relativeHeight- 24);334 this->consoleOverlayCursor_->setTop(static_cast<int>(this->windowH_ * this->relativeHeight) - 24); 335 335 } 336 336 … … 416 416 this->windowW_ = newWidth; 417 417 this->windowH_ = newHeight; 418 this->consoleOverlayBorder_->setWidth( (int) this->windowW_* this->relativeWidth);419 this->consoleOverlayBorder_->setHeight( (int) this->windowH_ * this->relativeHeight);420 this->consoleOverlayNoise_->setWidth( (int) this->windowW_ * this->relativeWidth- 10);421 this->consoleOverlayNoise_->setHeight( (int) this->windowH_ * this->relativeHeight- 5);418 this->consoleOverlayBorder_->setWidth(static_cast<int>(this->windowW_* this->relativeWidth)); 419 this->consoleOverlayBorder_->setHeight(static_cast<int>(this->windowH_ * this->relativeHeight)); 420 this->consoleOverlayNoise_->setWidth(static_cast<int>(this->windowW_ * this->relativeWidth) - 10); 421 this->consoleOverlayNoise_->setHeight(static_cast<int>(this->windowH_ * this->relativeHeight) - 5); 422 422 this->consoleOverlayNoise_->setTiling(consoleOverlayNoise_->getWidth() / (50.0f * this->noiseSize_), consoleOverlayNoise_->getHeight() / (50.0f * this->noiseSize_)); 423 423 424 424 // now adjust the text lines... 425 this->desiredTextWidth_ = (int)(this->windowW_ * this->relativeWidth) - 12;425 this->desiredTextWidth_ = static_cast<int>(this->windowW_ * this->relativeWidth) - 12; 426 426 427 427 if (LINES > 0) 428 this->maxCharsPerLine_ = std::max( (unsigned int)10, (unsigned int) ((float)this->desiredTextWidth_/ CHAR_WIDTH));428 this->maxCharsPerLine_ = std::max(10U, static_cast<unsigned int>(static_cast<float>(this->desiredTextWidth_) / CHAR_WIDTH)); 429 429 else 430 430 this->maxCharsPerLine_ = 10; … … 433 433 { 434 434 this->consoleOverlayTextAreas_[i]->setWidth(this->desiredTextWidth_); 435 this->consoleOverlayTextAreas_[i]->setTop( (int) this->windowH_ * this->relativeHeight- 24 - 14*i);435 this->consoleOverlayTextAreas_[i]->setTop(static_cast<int>(this->windowH_ * this->relativeHeight) - 24 - 14*i); 436 436 } 437 437 -
code/trunk/src/orxonox/overlays/hud/GametypeStatus.cc
r3280 r3300 70 70 { 71 71 if (gtinfo->isStartCountdownRunning()) 72 this->setCaption(multi_cast<std::string>( (int)ceil(gtinfo->getStartCountdown())));72 this->setCaption(multi_cast<std::string>(static_cast<int>(ceil(gtinfo->getStartCountdown())))); 73 73 else if (ce->isA(Class(Spectator))) 74 74 this->setCaption("Press [Fire] to respawn"); -
code/trunk/src/orxonox/overlays/hud/HUDBar.cc
r3280 r3300 73 73 // create new material 74 74 std::string materialname = "barmaterial" + multi_cast<std::string>(materialcount_s++); 75 Ogre::MaterialPtr material = (Ogre::MaterialPtr)Ogre::MaterialManager::getSingleton().create(materialname, "General");75 Ogre::MaterialPtr material = static_cast<Ogre::MaterialPtr>(Ogre::MaterialManager::getSingleton().create(materialname, "General")); 76 76 material->getTechnique(0)->getPass(0)->setSceneBlending(Ogre::SBT_TRANSPARENT_ALPHA); 77 77 this->textureUnitState_ = material->getTechnique(0)->getPass(0)->createTextureUnitState(); -
code/trunk/src/orxonox/overlays/hud/HUDHealthBar.cc
r3280 r3300 83 83 { 84 84 this->setValue(this->owner_->getHealth() / this->owner_->getInitialHealth()); 85 this->textoverlay_->setCaption(multi_cast<std::string>( (int)this->owner_->getHealth()));85 this->textoverlay_->setCaption(multi_cast<std::string>(static_cast<int>(this->owner_->getHealth()))); 86 86 } 87 87 -
code/trunk/src/orxonox/overlays/hud/HUDTimer.cc
r3280 r3300 59 59 if (gametype->getTimerIsActive()) 60 60 { 61 this->setCaption(multi_cast<std::string>( (int)gametype->getTime() + 1));61 this->setCaption(multi_cast<std::string>(static_cast<int>(gametype->getTime()) + 1)); 62 62 } 63 63 } -
code/trunk/src/orxonox/overlays/map/Map.cc
r3196 r3300 332 332 //this->CamNodeHelper_->attachObject(this->Cam_); 333 333 this->Cam_->setPosition(0, 0, DISTANCE); 334 this->Cam_->pitch( (Degree)PITCH);334 this->Cam_->pitch( static_cast<Degree>(PITCH) ); 335 335 this->Cam_->lookAt(Vector3(0,0,0)); 336 336 //this->Cam_->setAutoTracking(true, this->playerShipNode_); … … 425 425 426 426 /* 427 singletonMap_s->CamNode_->setOrientation(singletonMap_s->CamNode_->getOrientation() * Quaternion( (Degree)(-value.y * singletonMap_s->mouseLookSpeed_) , singletonMap_s->playerShipNode_->getLocalAxes().GetColumn(1) ));427 singletonMap_s->CamNode_->setOrientation(singletonMap_s->CamNode_->getOrientation() * Quaternion( static_cast<Degree>(-value.y * singletonMap_s->mouseLookSpeed_) , singletonMap_s->playerShipNode_->getLocalAxes().GetColumn(1) )); 428 428 429 429 Map::singletonMap_s->CamNodeHelper_->setDirection(Vector3::UNIT_Y, Ogre::Node::TS_PARENT, Vector3::UNIT_Y); 430 430 Map::singletonMap_s->CamNodeHelper_->lookAt(Vector3(0,0,0), Ogre::Node::TS_PARENT); 431 431 */ 432 singletonMap_s->CamNode_->yaw( (Degree)(-value.y * singletonMap_s->mouseLookSpeed_), Ogre::Node::TS_PARENT);432 singletonMap_s->CamNode_->yaw( static_cast<Degree>(-value.y * singletonMap_s->mouseLookSpeed_), Ogre::Node::TS_PARENT); 433 433 } 434 434 … … 437 437 if(!( Map::singletonMap_s && Map::singletonMap_s->CamNode_ )) 438 438 return; 439 //singletonMap_s->Cam_->setOrientation(singletonMap_s->Cam_->getOrientation() * Quaternion( (Degree)(-value.y * singletonMap_s->mouseLookSpeed_) , Vector3::UNIT_X));440 /* singletonMap_s->CamNode_->setOrientation(singletonMap_s->CamNode_->getOrientation() * Quaternion( (Degree)(-value.y * singletonMap_s->mouseLookSpeed_) , singletonMap_s->playerShipNode_->getLocalAxes().GetColumn(0) ));439 //singletonMap_s->Cam_->setOrientation(singletonMap_s->Cam_->getOrientation() * Quaternion( static_cast<Degree>(-value.y * singletonMap_s->mouseLookSpeed_) , Vector3::UNIT_X)); 440 /* singletonMap_s->CamNode_->setOrientation(singletonMap_s->CamNode_->getOrientation() * Quaternion( static_cast<Degree>(-value.y * singletonMap_s->mouseLookSpeed_) , singletonMap_s->playerShipNode_->getLocalAxes().GetColumn(0) )); 441 441 442 442 Map::singletonMap_s->CamNodeHelper_->setDirection(Vector3::UNIT_Y, Ogre::Node::TS_PARENT, Vector3::UNIT_Y); 443 443 Map::singletonMap_s->CamNodeHelper_->lookAt(Vector3(0,0,0), Ogre::Node::TS_PARENT); 444 444 */ 445 singletonMap_s->CamNode_->pitch( (Degree)(value.y * singletonMap_s->mouseLookSpeed_), Ogre::Node::TS_LOCAL);445 singletonMap_s->CamNode_->pitch( static_cast<Degree>(value.y * singletonMap_s->mouseLookSpeed_), Ogre::Node::TS_LOCAL); 446 446 447 447 }
Note: See TracChangeset
for help on using the changeset viewer.