Changeset 6502 for code/trunk/src/modules
- Timestamp:
- Mar 11, 2010, 11:34:20 AM (15 years ago)
- Location:
- code/trunk/src/modules
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/overlays/hud/HUDNavigation.cc
r6417 r6502 153 153 int dist = static_cast<int>(getDist2Focus()); 154 154 navText_->setCaption(multi_cast<std::string>(dist)); 155 float textLength = multi_cast<std::string>(dist).size() * navText_->getCharHeight() * 0.3 ;155 float textLength = multi_cast<std::string>(dist).size() * navText_->getCharHeight() * 0.3f; 156 156 157 157 orxonox::Camera* cam = CameraManager::getInstance().getActiveCamera(); … … 191 191 { 192 192 // up 193 float position = pos.x / pos.y + 1.0 ;194 navMarker_->setPosition((position - navMarker_->getWidth()) * 0.5 , 0.0);195 navMarker_->setUV(0.5 , 0.0, 1.0, 0.5);196 navText_->setLeft((position - textLength) * 0.5 );193 float position = pos.x / pos.y + 1.0f; 194 navMarker_->setPosition((position - navMarker_->getWidth()) * 0.5f, 0.0f); 195 navMarker_->setUV(0.5f, 0.0f, 1.0f, 0.5f); 196 navText_->setLeft((position - textLength) * 0.5f); 197 197 navText_->setTop(navMarker_->getHeight()); 198 198 } … … 200 200 { 201 201 // left 202 float position = pos.y / pos.x + 1.0 ;203 navMarker_->setPosition(0.0 , (position - navMarker_->getWidth()) * 0.5);204 navMarker_->setUV(0.0 , 0.0, 0.5, 0.5);205 navText_->setLeft(navMarker_->getWidth() + 0.01 );206 navText_->setTop((position - navText_->getCharHeight()) * 0.5 );202 float position = pos.y / pos.x + 1.0f; 203 navMarker_->setPosition(0.0f, (position - navMarker_->getWidth()) * 0.5f); 204 navMarker_->setUV(0.0f, 0.0f, 0.5f, 0.5f); 205 navText_->setLeft(navMarker_->getWidth() + 0.01f); 206 navText_->setTop((position - navText_->getCharHeight()) * 0.5f); 207 207 } 208 208 } … … 212 212 { 213 213 // down 214 float position = -pos.x / pos.y + 1.0 ;215 navMarker_->setPosition((position - navMarker_->getWidth()) * 0.5 , 1.0- navMarker_->getHeight());216 navMarker_->setUV(0.0 , 0.5, 0.5, 1.0);217 navText_->setLeft((position - textLength) * 0.5 );218 navText_->setTop(1.0 - navMarker_->getHeight() - navText_->getCharHeight());214 float position = -pos.x / pos.y + 1.0f; 215 navMarker_->setPosition((position - navMarker_->getWidth()) * 0.5f, 1.0f - navMarker_->getHeight()); 216 navMarker_->setUV(0.0f, 0.5f, 0.5f, 1.0f); 217 navText_->setLeft((position - textLength) * 0.5f); 218 navText_->setTop(1.0f - navMarker_->getHeight() - navText_->getCharHeight()); 219 219 } 220 220 else 221 221 { 222 222 // right 223 float position = -pos.y / pos.x + 1.0 ;224 navMarker_->setPosition(1.0 - navMarker_->getWidth(), (position - navMarker_->getHeight()) * 0.5);225 navMarker_->setUV(0.5 , 0.5, 1.0, 1.0);226 navText_->setLeft(1.0 - navMarker_->getWidth() - textLength - 0.01);227 navText_->setTop((position - navText_->getCharHeight()) * 0.5 );223 float position = -pos.y / pos.x + 1.0f; 224 navMarker_->setPosition(1.0f - navMarker_->getWidth(), (position - navMarker_->getHeight()) * 0.5f); 225 navMarker_->setUV(0.5f, 0.5f, 1.0f, 1.0f); 226 navText_->setLeft(1.0f - navMarker_->getWidth() - textLength - 0.01f); 227 navText_->setTop((position - navText_->getCharHeight()) * 0.5f); 228 228 } 229 229 } … … 243 243 244 244 // object is in view 245 navMarker_->setUV(0.0 , 0.0, 1.0, 1.0);246 navMarker_->setLeft((pos.x + 1.0 - navMarker_->getWidth()) * 0.5);247 navMarker_->setTop((-pos.y + 1.0 - navMarker_->getHeight()) * 0.5);245 navMarker_->setUV(0.0f, 0.0f, 1.0f, 1.0f); 246 navMarker_->setLeft((pos.x + 1.0f - navMarker_->getWidth()) * 0.5f); 247 navMarker_->setTop((-pos.y + 1.0f - navMarker_->getHeight()) * 0.5f); 248 248 249 249 /* 250 250 aimMarker_->show(); 251 aimMarker_->setLeft((aimpos.x + 1.0 - aimMarker_->getWidth()) * 0.5);252 aimMarker_->setTop((-aimpos.y + 1.0 - aimMarker_->getHeight()) * 0.5);253 */ 254 navText_->setLeft((pos.x + 1.0 + navMarker_->getWidth()) * 0.5);255 navText_->setTop((-pos.y + 1.0 + navMarker_->getHeight()) * 0.5);251 aimMarker_->setLeft((aimpos.x + 1.0f - aimMarker_->getWidth()) * 0.5f); 252 aimMarker_->setTop((-aimpos.y + 1.0f - aimMarker_->getHeight()) * 0.5f); 253 */ 254 navText_->setLeft((pos.x + 1.0f + navMarker_->getWidth()) * 0.5f); 255 navText_->setTop((-pos.y + 1.0f + navMarker_->getHeight()) * 0.5f); 256 256 } 257 257 } -
code/trunk/src/modules/overlays/hud/HUDRadar.cc
r6417 r6502 141 141 // calc position on radar... 142 142 Vector2 coord = get2DViewcoordinates(this->owner_->getPosition(), this->owner_->getOrientation() * WorldEntity::FRONT, this->owner_->getOrientation() * WorldEntity::UP, wePointer->getWorldPosition()); 143 coord *= Ogre::Math::PI / 3.5 ; // small adjustment to make it fit the texture144 panel->setPosition((1.0 + coord.x - size) * 0.5, (1.0 - coord.y - size) * 0.5);143 coord *= Ogre::Math::PI / 3.5f; // small adjustment to make it fit the texture 144 panel->setPosition((1.0f + coord.x - size) * 0.5f, (1.0f - coord.y - size) * 0.5f); 145 145 146 146 if (bIsMarked) 147 147 { 148 148 this->marker_->show(); 149 this->marker_->setDimensions(size * 1.5 , size * 1.5);150 this->marker_->setPosition((1.0 + coord.x - size * 1.5) * 0.5, (1.0 - coord.y - size * 1.5) * 0.5);149 this->marker_->setDimensions(size * 1.5f, size * 1.5f); 150 this->marker_->setPosition((1.0f + coord.x - size * 1.5f) * 0.5f, (1.0f - coord.y - size * 1.5f) * 0.5f); 151 151 } 152 152 } -
code/trunk/src/modules/overlays/stats/CreateLines.cc
r6417 r6502 38 38 { 39 39 playerNameText_ = new OverlayText(0); 40 playerNameText_->setTextSize(0.04 );41 playerNameText_->setColour(ColourValue(0 , 0.75, 0.2, 1));42 playerNameText_->setPosition(Vector2(0.1 , topOffset + 0.01));40 playerNameText_->setTextSize(0.04f); 41 playerNameText_->setColour(ColourValue(0.0f, 0.75f, 0.2f, 1.0f)); 42 playerNameText_->setPosition(Vector2(0.1f, topOffset + 0.01f)); 43 43 44 44 scoreText_ = new OverlayText(0); 45 scoreText_->setTextSize(0.04 );46 scoreText_->setColour(ColourValue(0 , 0.75, 0.2, 1));47 scoreText_->setPosition(Vector2(0.6 , topOffset + 0.01));45 scoreText_->setTextSize(0.04f); 46 scoreText_->setColour(ColourValue(0.0f, 0.75f, 0.2f, 1.0f)); 47 scoreText_->setPosition(Vector2(0.6f, topOffset + 0.01f)); 48 48 49 49 deathsText_ = new OverlayText(0); 50 deathsText_->setTextSize(0.04 );51 deathsText_->setColour(ColourValue(0, 0.75 , 0.2, 1));52 deathsText_->setPosition(Vector2(0.8 , topOffset + 0.01));50 deathsText_->setTextSize(0.04f); 51 deathsText_->setColour(ColourValue(0, 0.75f, 0.2f, 1.0f)); 52 deathsText_->setPosition(Vector2(0.8f, topOffset + 0.01f)); 53 53 54 54 background_ = new Stats(0); -
code/trunk/src/modules/overlays/stats/Scoreboard.cc
r5980 r6502 79 79 const std::map<PlayerInfo*, Player>& playerList = this->getGametype()->getPlayers(); 80 80 81 const float topOffset = 0.2 ;82 const float leftOffset = 0.075 ;83 const float distance = 0.01 ;84 const float width = 0.85 ;85 const float height = 0.05 ;81 const float topOffset = 0.2f; 82 const float leftOffset = 0.075f; 83 const float distance = 0.01f; 84 const float width = 0.85f; 85 const float height = 0.05f; 86 86 while (playerList.size() > this->lines_.size()) 87 87 { -
code/trunk/src/modules/overlays/stats/Stats.cc
r5781 r6502 59 59 this->statsOverlayBorder_ = static_cast<Ogre::BorderPanelOverlayElement*>(ovMan->createOverlayElement("BorderPanel", "StatsBorderPanel" + getUniqueNumberString())); 60 60 //this->statsOverlayBorder_->setMaterialName("StatsCenter"); 61 this->statsOverlayBorder_->setBorderSize(0.003 , 16 * 0.003);61 this->statsOverlayBorder_->setBorderSize(0.003f, 16.0f * 0.003f); 62 62 this->statsOverlayBorder_->setBorderMaterialName("StatsBorder"); 63 this->statsOverlayBorder_->setTopBorderUV(0.49 , 0.0, 0.51, 0.5);64 this->statsOverlayBorder_->setTopLeftBorderUV(0.0 , 0.0, 0.5, 0.5);65 this->statsOverlayBorder_->setTopRightBorderUV(0.5 , 0.0, 1.0, 0.5);66 this->statsOverlayBorder_->setLeftBorderUV(0.0 , 0.49, 0.5, 0.51);67 this->statsOverlayBorder_->setRightBorderUV(0.5 , 0.49, 1.0, 0.5);68 this->statsOverlayBorder_->setBottomBorderUV(0.49 , 0.5, 0.51, 1.0);69 this->statsOverlayBorder_->setBottomLeftBorderUV(0.0 , 0.5, 0.5, 1.0);70 this->statsOverlayBorder_->setBottomRightBorderUV(0.5 , 0.5, 1.0, 1.0);63 this->statsOverlayBorder_->setTopBorderUV(0.49f, 0.0f, 0.51f, 0.5f); 64 this->statsOverlayBorder_->setTopLeftBorderUV(0.0f, 0.0f, 0.5f, 0.5f); 65 this->statsOverlayBorder_->setTopRightBorderUV(0.5f, 0.0f, 1.0f, 0.5f); 66 this->statsOverlayBorder_->setLeftBorderUV(0.0f, 0.49f, 0.5f, 0.51f); 67 this->statsOverlayBorder_->setRightBorderUV(0.5f, 0.49f, 1.0f, 0.5f); 68 this->statsOverlayBorder_->setBottomBorderUV(0.49f, 0.5f, 0.51f, 1.0f); 69 this->statsOverlayBorder_->setBottomLeftBorderUV(0.0f, 0.5f, 0.5f, 1.0f); 70 this->statsOverlayBorder_->setBottomRightBorderUV(0.5f, 0.5f, 1.0f, 1.0f); 71 71 72 72 background_->addChild(statsOverlayBorder_); -
code/trunk/src/modules/questsystem/QuestGUINode.cc
r6417 r6502 161 161 const QuestDescription* description = this->item_->getDescription(); 162 162 this->details_ = this->gui_->getWindowManager()->createWindow("TaharezLook/FrameWindow", stream.str()); 163 this->details_->setSize(CEGUI::UVector2(CEGUI::UDim(0.7 , 0),CEGUI::UDim(0.7, 0)));164 this->details_->setPosition(CEGUI::UVector2(CEGUI::UDim(0.1 , 0),CEGUI::UDim(0.1, 0)));163 this->details_->setSize(CEGUI::UVector2(CEGUI::UDim(0.7f, 0),CEGUI::UDim(0.7f, 0))); 164 this->details_->setPosition(CEGUI::UVector2(CEGUI::UDim(0.1f, 0),CEGUI::UDim(0.1f, 0))); 165 165 this->details_->setText(description->getTitle()); 166 166 this->details_->setAlpha(1.0); … … 173 173 CEGUI::Window* window = this->gui_->getWindowManager()->createWindow("TaharezLook/ScrollablePane", stream.str()); 174 174 window->setSize(CEGUI::UVector2(CEGUI::UDim(1.0, -2*QuestGUINode::BORDER_WIDTH),CEGUI::UDim(1.0, -QuestGUINode::TITLE_HEIGHT))); 175 window->setPosition(CEGUI::UVector2(CEGUI::UDim(0, QuestGUINode::BORDER_WIDTH),CEGUI::UDim(0,QuestGUINode::TITLE_HEIGHT)));175 window->setPosition(CEGUI::UVector2(CEGUI::UDim(0, (float)QuestGUINode::BORDER_WIDTH),CEGUI::UDim(0, (float)QuestGUINode::TITLE_HEIGHT))); 176 176 this->details_->addChildWindow(window); 177 177 … … 203 203 statusWindow->setProperty("VertFormatting", "TopAligned"); 204 204 statusWindow->setText(status); 205 statusWindow->setPosition(CEGUI::UVector2(CEGUI::UDim(0, 0),CEGUI::UDim(0, offset)));206 statusWindow->setSize(CEGUI::UVector2(CEGUI::UDim(1.0, -QuestGUINode::SCROLLBAR_WIDTH),CEGUI::UDim(1.0, 0)));205 statusWindow->setPosition(CEGUI::UVector2(CEGUI::UDim(0, 0),CEGUI::UDim(0, (float)offset))); 206 statusWindow->setSize(CEGUI::UVector2(CEGUI::UDim(1.0, (float)-QuestGUINode::SCROLLBAR_WIDTH),CEGUI::UDim(1.0f, 0))); 207 207 height = setHeight(statusWindow); 208 208 … … 219 219 descriptionWindowTitle->setProperty("VertFormatting", "TopAligned"); 220 220 descriptionWindowTitle->setText("Description:"); 221 descriptionWindowTitle->setPosition(CEGUI::UVector2(CEGUI::UDim(0, 0),CEGUI::UDim(0, offset)));222 descriptionWindowTitle->setSize(CEGUI::UVector2(CEGUI::UDim(1.0 , -QuestGUINode::SCROLLBAR_WIDTH),CEGUI::UDim(1.0, 0)));221 descriptionWindowTitle->setPosition(CEGUI::UVector2(CEGUI::UDim(0, 0),CEGUI::UDim(0, (float)offset))); 222 descriptionWindowTitle->setSize(CEGUI::UVector2(CEGUI::UDim(1.0f, -QuestGUINode::SCROLLBAR_WIDTH),CEGUI::UDim(1.0f, 0))); 223 223 224 224 offset += setHeight(descriptionWindowTitle); … … 232 232 descriptionWindow->setProperty("VertFormatting", "TopAligned"); 233 233 descriptionWindow->setText(description->getDescription()); 234 descriptionWindow->setPosition(CEGUI::UVector2(CEGUI::UDim(0, 0),CEGUI::UDim(0, offset)));235 descriptionWindow->setSize(CEGUI::UVector2(CEGUI::UDim(1.0, -QuestGUINode::SCROLLBAR_WIDTH),CEGUI::UDim(1.0, 0)));234 descriptionWindow->setPosition(CEGUI::UVector2(CEGUI::UDim(0, 0),CEGUI::UDim(0, (float)offset))); 235 descriptionWindow->setSize(CEGUI::UVector2(CEGUI::UDim(1.0, (float)-QuestGUINode::SCROLLBAR_WIDTH),CEGUI::UDim(1.0f, 0))); 236 236 height = setHeight(descriptionWindow); 237 237 … … 255 255 hintsTitle->setProperty("VertFormatting", "TopAligned"); 256 256 hintsTitle->setText("Hints:"); 257 hintsTitle->setPosition(CEGUI::UVector2(CEGUI::UDim(0, 0),CEGUI::UDim(0, offset)));257 hintsTitle->setPosition(CEGUI::UVector2(CEGUI::UDim(0, 0),CEGUI::UDim(0, (float)offset))); 258 258 hintsTitle->setSize(CEGUI::UVector2(CEGUI::UDim(1.0, -QuestGUINode::SCROLLBAR_WIDTH),CEGUI::UDim(1.0, 0))); 259 259 offset += setHeight(hintsTitle);; … … 261 261 } 262 262 QuestGUINode* node = *it; 263 node->window_->setSize(CEGUI::UVector2(CEGUI::UDim(1.0 , -QuestGUINode::SCROLLBAR_WIDTH),CEGUI::UDim(0,QuestGUINode::BUTTON_HEIGHT)));264 node->window_->setPosition(CEGUI::UVector2(CEGUI::UDim(0, 0),CEGUI::UDim(0, offset)));263 node->window_->setSize(CEGUI::UVector2(CEGUI::UDim(1.0f, (float)-QuestGUINode::SCROLLBAR_WIDTH),CEGUI::UDim(0, (float)QuestGUINode::BUTTON_HEIGHT))); 264 node->window_->setPosition(CEGUI::UVector2(CEGUI::UDim(0, 0),CEGUI::UDim(0, (float)offset))); 265 265 window->addChildWindow(node->window_); 266 266 offset += QuestGUINode::BUTTON_HEIGHT; … … 337 337 338 338 //! Get the formatted line count - using the formatting area obtained above. 339 const float lines = window->getFont()->getFormattedLineCount(window->getText(), formattedArea, CEGUI::WordWrapLeftAligned);339 const float lines = (float)(window->getFont()->getFormattedLineCount(window->getText(), formattedArea, CEGUI::WordWrapLeftAligned)); 340 340 341 341 //! Calculate pixel height of window, which is the number of formatted lines multiplied by the spacing of the font, plus the pixel height of the frame. … … 357 357 void QuestGUINode::updatePosition(void) 358 358 { 359 this->window_->setPosition(CEGUI::UVector2(CEGUI::UDim(0, QuestGUINode::INDENT_WIDTH*this->depth_),CEGUI::UDim(0, QuestGUINode::BUTTON_HEIGHT*this->index_)));360 this->window_->setSize(CEGUI::UVector2(CEGUI::UDim(1, -QuestGUINode::INDENT_WIDTH*this->depth_-QuestGUINode::SCROLLBAR_WIDTH),CEGUI::UDim(0,QuestGUINode::BUTTON_HEIGHT)));359 this->window_->setPosition(CEGUI::UVector2(CEGUI::UDim(0, (float)(QuestGUINode::INDENT_WIDTH*this->depth_)),CEGUI::UDim(0, (float)(QuestGUINode::BUTTON_HEIGHT*this->index_)))); 360 this->window_->setSize(CEGUI::UVector2(CEGUI::UDim(1, (float)(-QuestGUINode::INDENT_WIDTH*this->depth_-QuestGUINode::SCROLLBAR_WIDTH)),CEGUI::UDim(0, (float)QuestGUINode::BUTTON_HEIGHT))); 361 361 } 362 362 -
code/trunk/src/modules/questsystem/notifications/NotificationQueue.cc
r6417 r6502 139 139 { 140 140 this->removeContainer(*it); 141 this->scroll(Vector2(0.0 ,-(1.1*this->getFontSize())));141 this->scroll(Vector2(0.0f,-(1.1f*this->getFontSize()))); 142 142 it = this->containers_.begin(); //TODO: Needed? 143 143 } 144 144 145 this->tickTime_ = 0.0 ; //!< Reset time counter.145 this->tickTime_ = 0.0f; //!< Reset time counter. 146 146 } 147 147 } … … 193 193 it = this->containers_.begin(); 194 194 this->removeContainer(*it); 195 this->scroll(Vector2(0.0 ,-(1.1*this->getFontSize())));195 this->scroll(Vector2(0.0f,-(1.1f*this->getFontSize()))); 196 196 } 197 197 … … 375 375 { 376 376 (*it)->overlay->setPosition(this->getPosition()); 377 (*it)->overlay->scroll(Vector2(0.0 ,(1.1*this->getFontSize())*counter));377 (*it)->overlay->scroll(Vector2(0.0f,(1.1f*this->getFontSize())*counter)); 378 378 counter++; 379 379 } … … 407 407 this->size_= this->size_+1; 408 408 409 container->overlay->scroll(Vector2(0.0 ,(1.1*this->getFontSize())*(this->getSize()-1)));409 container->overlay->scroll(Vector2(0.0f,(1.1f*this->getFontSize())*(this->getSize()-1))); 410 410 } 411 411 -
code/trunk/src/modules/weapons/projectiles/BillboardProjectile.cc
r5781 r6502 48 48 } 49 49 50 this->setScale(0.2 );50 this->setScale(0.2f); 51 51 } 52 52 -
code/trunk/src/modules/weapons/projectiles/Rocket.cc
r6417 r6502 66 66 Model* model = new Model(this); 67 67 model->setMeshSource("rocket.mesh"); 68 model->scale(0.7 );68 model->scale(0.7f); 69 69 this->attach(model); 70 70 ParticleEmitter* fire = new ParticleEmitter(this); -
code/trunk/src/modules/weapons/weaponmodes/RocketFire.cc
r6417 r6502 46 46 RegisterObject(RocketFire); 47 47 48 this->reloadTime_ = 0.20 ;48 this->reloadTime_ = 0.20f; 49 49 this->bParallelReload_ = false; 50 50 this->damage_ = 100;
Note: See TracChangeset
for help on using the changeset viewer.