Changeset 6502 for code/trunk/src
- Timestamp:
- Mar 11, 2010, 11:34:20 AM (15 years ago)
- Location:
- code/trunk/src
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/libraries/core/GUIManager.cc
r6417 r6502 145 145 146 146 // Align CEGUI mouse with OIS mouse 147 guiSystem_->injectMousePosition( mousePosition.first,mousePosition.second);147 guiSystem_->injectMousePosition((float)mousePosition.first, (float)mousePosition.second); 148 148 149 149 // Hide the mouse cursor unless playing in full screen mode -
code/trunk/src/libraries/core/Game.cc
r6422 r6502 284 284 uint64_t currentTime = gameClock_->getMicroseconds(); 285 285 uint64_t currentRealTime = gameClock_->getRealMicroseconds(); 286 this->statisticsTickTimes_.back().tickLength += currentRealTime - currentTime;287 this->periodTickTime_ += currentRealTime - currentTime;286 this->statisticsTickTimes_.back().tickLength += (uint32_t)(currentRealTime - currentTime); 287 this->periodTickTime_ += (uint32_t)(currentRealTime - currentTime); 288 288 if (this->periodTime_ > this->statisticsRefreshCycle_) 289 289 { … … 318 318 while (currentRealTime < nextTime - minimumSleepTime_) 319 319 { 320 usleep( nextTime - currentRealTime);320 usleep((unsigned long)(nextTime - currentRealTime)); 321 321 currentRealTime = gameClock_->getRealMicroseconds(); 322 322 } 323 323 // Integrate excess to avoid steady state error 324 excessSleepTime_ = currentRealTime - nextTime;324 excessSleepTime_ = (int)(currentRealTime - nextTime); 325 325 // Anti windup 326 326 if (excessSleepTime_ > 50000) // 20ms is about the maximum time Windows would sleep for too long -
code/trunk/src/libraries/core/GraphicsManager.cc
r6417 r6502 366 366 uint64_t timeAfterTick = time.getRealMicroseconds(); 367 367 // Subtract the time used for rendering from the tick time counter 368 Game::getInstance().subtractTickTime( timeAfterTick - timeBeforeTick);368 Game::getInstance().subtractTickTime((int32_t)(timeAfterTick - timeBeforeTick)); 369 369 370 370 // again, just to be sure OGRE works fine -
code/trunk/src/libraries/util/Math.h
r6417 r6502 79 79 inline T sgn(T x) 80 80 { 81 return (x >= 0) ? 1 :-1;81 return (x >= 0) ? (T)1 : (T)-1; 82 82 } 83 83 -
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; -
code/trunk/src/orxonox/controllers/ArtificialController.cc
r6417 r6502 65 65 { 66 66 // Multiply with 0.8 to make them a bit slower 67 this->getControllableEntity()->rotateYaw(-0.8 * sgn(coord.x) * coord.x*coord.x);68 this->getControllableEntity()->rotatePitch(0.8 * sgn(coord.y) * coord.y*coord.y);67 this->getControllableEntity()->rotateYaw(-0.8f * sgn(coord.x) * coord.x*coord.x); 68 this->getControllableEntity()->rotatePitch(0.8f * sgn(coord.y) * coord.y*coord.y); 69 69 } 70 70 71 71 if (this->target_ && distance < 200 && this->getControllableEntity()->getVelocity().squaredLength() > this->target_->getVelocity().squaredLength()) 72 this->getControllableEntity()->moveFrontBack(-0.5 ); // They don't brake with full power to give the player a chance72 this->getControllableEntity()->moveFrontBack(-0.5f); // They don't brake with full power to give the player a chance 73 73 else 74 this->getControllableEntity()->moveFrontBack(0.8 );74 this->getControllableEntity()->moveFrontBack(0.8f); 75 75 } 76 76 -
code/trunk/src/orxonox/controllers/NewHumanController.cc
r6501 r6502 74 74 RegisterObject(NewHumanController); 75 75 76 overlaySize_ = 0.08 ;77 arrowsSize_ = 0.4 ;78 79 damageOverlayTime_ = 0.6 ;76 overlaySize_ = 0.08f; 77 arrowsSize_ = 0.4f; 78 79 damageOverlayTime_ = 0.6f; 80 80 81 81 controlMode_ = 0; … … 101 101 centerOverlay_ = new OrxonoxOverlay(this); 102 102 centerOverlay_->setBackgroundMaterial("Orxonox/CenterOverlay"); 103 centerOverlay_->setSize(Vector2(overlaySize_ * 2.5 , overlaySize_ * 2.5));104 centerOverlay_->setPosition(Vector2(0.5 - overlaySize_*2.5/2.0, 0.5 - overlaySize_*2.5/2.0));103 centerOverlay_->setSize(Vector2(overlaySize_ * 2.5f, overlaySize_ * 2.5f)); 104 centerOverlay_->setPosition(Vector2(0.5f - overlaySize_*2.5f/2.0f, 0.5f - overlaySize_*2.5f/2.0f)); 105 105 centerOverlay_->hide(); 106 106 … … 109 109 damageOverlayTop_ = new OrxonoxOverlay(this); 110 110 damageOverlayTop_->setBackgroundMaterial("Orxonox/DamageOverlayTop"); 111 damageOverlayTop_->setSize(Vector2(overlaySize_ * 2.5 , overlaySize_ * 2.5));112 damageOverlayTop_->setPosition(Vector2(0.5 - overlaySize_*2.5/2.0, 0.5 - overlaySize_*2.5/2.0));111 damageOverlayTop_->setSize(Vector2(overlaySize_ * 2.5f, overlaySize_ * 2.5f)); 112 damageOverlayTop_->setPosition(Vector2(0.5f - overlaySize_*2.5f/2.0f, 0.5f - overlaySize_*2.5f/2.0f)); 113 113 damageOverlayTop_->hide(); 114 114 115 115 damageOverlayRight_ = new OrxonoxOverlay(this); 116 116 damageOverlayRight_->setBackgroundMaterial("Orxonox/DamageOverlayRight"); 117 damageOverlayRight_->setSize(Vector2(overlaySize_ * 2.5 , overlaySize_ * 2.5));118 damageOverlayRight_->setPosition(Vector2(0.5 - overlaySize_*2.5/2.0, 0.5 - overlaySize_*2.5/2.0));117 damageOverlayRight_->setSize(Vector2(overlaySize_ * 2.5f, overlaySize_ * 2.5f)); 118 damageOverlayRight_->setPosition(Vector2(0.5f - overlaySize_*2.5f/2.0f, 0.5f - overlaySize_*2.5f/2.0f)); 119 119 damageOverlayRight_->hide(); 120 120 121 121 damageOverlayBottom_ = new OrxonoxOverlay(this); 122 122 damageOverlayBottom_->setBackgroundMaterial("Orxonox/DamageOverlayBottom"); 123 damageOverlayBottom_->setSize(Vector2(overlaySize_ * 2.5 , overlaySize_ * 2.5));124 damageOverlayBottom_->setPosition(Vector2(0.5 - overlaySize_*2.5/2.0, 0.5 - overlaySize_*2.5/2.0));123 damageOverlayBottom_->setSize(Vector2(overlaySize_ * 2.5f, overlaySize_ * 2.5f)); 124 damageOverlayBottom_->setPosition(Vector2(0.5f - overlaySize_*2.5f/2.0f, 0.5f - overlaySize_*2.5f/2.0f)); 125 125 damageOverlayBottom_->hide(); 126 126 127 127 damageOverlayLeft_ = new OrxonoxOverlay(this); 128 128 damageOverlayLeft_->setBackgroundMaterial("Orxonox/DamageOverlayLeft"); 129 damageOverlayLeft_->setSize(Vector2(overlaySize_ * 2.5 , overlaySize_ * 2.5));130 damageOverlayLeft_->setPosition(Vector2(0.5 - overlaySize_*2.5/2.0, 0.5 - overlaySize_*2.5/2.0));129 damageOverlayLeft_->setSize(Vector2(overlaySize_ * 2.5f, overlaySize_ * 2.5f)); 130 damageOverlayLeft_->setPosition(Vector2(0.5f - overlaySize_*2.5f/2.0f, 0.5f - overlaySize_*2.5f/2.0f)); 131 131 damageOverlayLeft_->hide(); 132 132 } … … 136 136 arrowsOverlay1_ = new OrxonoxOverlay(this); 137 137 arrowsOverlay1_->setBackgroundMaterial("Orxonox/DirectionArrows1"); 138 arrowsOverlay1_->setSize(Vector2(0.02727 , 0.36* arrowsSize_));139 arrowsOverlay1_->setPickPoint(Vector2(0.5 , 0.5));140 arrowsOverlay1_->setPosition(Vector2(0.5 , 0.5));138 arrowsOverlay1_->setSize(Vector2(0.02727f, 0.36f * arrowsSize_)); 139 arrowsOverlay1_->setPickPoint(Vector2(0.5f, 0.5f)); 140 arrowsOverlay1_->setPosition(Vector2(0.5f, 0.5f)); 141 141 arrowsOverlay1_->hide(); 142 142 143 143 arrowsOverlay2_ = new OrxonoxOverlay(this); 144 144 arrowsOverlay2_->setBackgroundMaterial("Orxonox/DirectionArrows2"); 145 arrowsOverlay2_->setSize(Vector2(0.02727 , 0.59* arrowsSize_));146 arrowsOverlay2_->setPickPoint(Vector2(0.5 , 0.5));147 arrowsOverlay2_->setPosition(Vector2(0.5 , 0.5));145 arrowsOverlay2_->setSize(Vector2(0.02727f, 0.59f * arrowsSize_)); 146 arrowsOverlay2_->setPickPoint(Vector2(0.5f, 0.5f)); 147 arrowsOverlay2_->setPosition(Vector2(0.5f, 0.5f)); 148 148 arrowsOverlay2_->hide(); 149 149 150 150 arrowsOverlay3_ = new OrxonoxOverlay(this); 151 151 arrowsOverlay3_->setBackgroundMaterial("Orxonox/DirectionArrows3"); 152 arrowsOverlay3_->setSize(Vector2(0.02727 , 0.77* arrowsSize_));153 arrowsOverlay3_->setPickPoint(Vector2(0.5 , 0.5));154 arrowsOverlay3_->setPosition(Vector2(0.5 , 0.5));152 arrowsOverlay3_->setSize(Vector2(0.02727f, 0.77f * arrowsSize_)); 153 arrowsOverlay3_->setPickPoint(Vector2(0.5f, 0.5f)); 154 arrowsOverlay3_->setPosition(Vector2(0.5f, 0.5f)); 155 155 arrowsOverlay3_->hide(); 156 156 157 157 arrowsOverlay4_ = new OrxonoxOverlay(this); 158 158 arrowsOverlay4_->setBackgroundMaterial("Orxonox/DirectionArrows4"); 159 arrowsOverlay4_->setSize(Vector2(0.02727 , arrowsSize_));160 arrowsOverlay4_->setPickPoint(Vector2(0.5 , 0.5));161 arrowsOverlay4_->setPosition(Vector2(0.5 , 0.5));159 arrowsOverlay4_->setSize(Vector2(0.02727f, arrowsSize_)); 160 arrowsOverlay4_->setPickPoint(Vector2(0.5f, 0.5f)); 161 arrowsOverlay4_->setPosition(Vector2(0.5f, 0.5f)); 162 162 arrowsOverlay4_->hide(); 163 163 } … … 213 213 this->showOverlays(); 214 214 215 this->crossHairOverlay_->setPosition(Vector2(static_cast<float>(this->currentYaw_)/2*-1+.5 -overlaySize_/2, static_cast<float>(this->currentPitch_)/2*-1+.5-overlaySize_/2));215 this->crossHairOverlay_->setPosition(Vector2(static_cast<float>(this->currentYaw_)/2*-1+.5f-overlaySize_/2, static_cast<float>(this->currentPitch_)/2*-1+.5f-overlaySize_/2)); 216 216 217 217 if (this->controlMode_ == 0 || (this->controlMode_ == 1 && this->firemode_ == 1)) … … 299 299 relativeHit.normalise(); 300 300 301 float threshold = 0.3 ;301 float threshold = 0.3f; 302 302 if (relativeHit.x > threshold) // Left 303 303 { … … 343 343 Ogre::RaySceneQuery * rsq = HumanController::localController_s->getControllableEntity()->getScene()->getSceneManager()->createRayQuery(Ogre::Ray()); 344 344 345 Ogre::Ray mouseRay = HumanController::localController_s->getControllableEntity()->getCamera()->getOgreCamera()->getCameraToViewportRay(static_cast<float>(this->currentYaw_)/2*-1+.5 , static_cast<float>(this->currentPitch_)/2*-1+.5);345 Ogre::Ray mouseRay = HumanController::localController_s->getControllableEntity()->getCamera()->getOgreCamera()->getCameraToViewportRay(static_cast<float>(this->currentYaw_)/2*-1+.5f, static_cast<float>(this->currentPitch_)/2*-1+.5f); 346 346 347 347 rsq->setRay(mouseRay); … … 505 505 float distance = sqrt(pow(static_cast<float>(this->currentYaw_)/2*-1,2) + pow(static_cast<float>(this->currentPitch_)/2*-1,2)); 506 506 507 if (distance > 0.04 && distance <= 0.59 * arrowsSize_ / 2.0)508 { 509 this->arrowsOverlay1_->setRotation(Degree(-90 + -1.0 * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / (2.0f * Ogre::Math::PI) * 360.0f));507 if (distance > 0.04f && distance <= 0.59f * arrowsSize_ / 2.0f ) 508 { 509 this->arrowsOverlay1_->setRotation(Degree(-90 + -1.0f * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / (2.0f * Ogre::Math::PI) * 360.0f)); 510 510 this->arrowsOverlay1_->show(); 511 511 } 512 else if (distance > 0.59 * arrowsSize_ / 2.0 && distance <= 0.77 * arrowsSize_ / 2.0)513 { 514 this->arrowsOverlay2_->setRotation(Degree(-90 + -1.0 * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / (2.0f * Ogre::Math::PI) * 360.0f));512 else if (distance > 0.59f * arrowsSize_ / 2.0f && distance <= 0.77f * arrowsSize_ / 2.0f ) 513 { 514 this->arrowsOverlay2_->setRotation(Degree(-90 + -1.0f * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / (2.0f * Ogre::Math::PI) * 360.0f)); 515 515 this->arrowsOverlay2_->show(); 516 516 } 517 else if (distance > 0.77 * arrowsSize_ / 2.0 && distance <= arrowsSize_ / 2.0)518 { 519 this->arrowsOverlay3_->setRotation(Degree(-90 + -1.0 * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / (2.0f * Ogre::Math::PI) * 360.0f));517 else if (distance > 0.77f * arrowsSize_ / 2.0f && distance <= arrowsSize_ / 2.0f) 518 { 519 this->arrowsOverlay3_->setRotation(Degree(-90 + -1.0f * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / (2.0f * Ogre::Math::PI) * 360.0f)); 520 520 this->arrowsOverlay3_->show(); 521 521 } 522 else if (distance > arrowsSize_ / 2.0 )523 { 524 this->arrowsOverlay4_->setRotation(Degree(-90 + -1.0 * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / (2.0f * Ogre::Math::PI) * 360.0f));522 else if (distance > arrowsSize_ / 2.0f) 523 { 524 this->arrowsOverlay4_->setRotation(Degree(-90 + -1.0f * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / (2.0f * Ogre::Math::PI) * 360.0f)); 525 525 this->arrowsOverlay4_->show(); 526 526 } -
code/trunk/src/orxonox/controllers/WaypointPatrolController.cc
r5929 r6502 68 68 this->moveToTargetPosition(); 69 69 70 if (this->getControllableEntity() && this->isCloseAtTarget(1000) && this->isLookingAtTarget(Ogre::Math::PI / 20.0 ))70 if (this->getControllableEntity() && this->isCloseAtTarget(1000) && this->isLookingAtTarget(Ogre::Math::PI / 20.0f)) 71 71 this->getControllableEntity()->fire(0); 72 72 } … … 85 85 86 86 Vector3 myposition = this->getControllableEntity()->getPosition(); 87 float shortestsqdistance = static_cast<unsigned int>(-1);87 float shortestsqdistance = (float)static_cast<unsigned int>(-1); 88 88 89 89 for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it) -
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 } -
code/trunk/src/orxonox/pickup/PickupInventory.cc
r6417 r6502 301 301 302 302 CEGUI::Window* frame = winMgr->createWindow("TaharezLook/StaticImage", "orxonox/Inventory/Frame/" + id); 303 frame->setPosition(CEGUI::UVector2(CEGUI::UDim(0, 5 + x * 70), CEGUI::UDim(0, 5+ y * 90)));303 frame->setPosition(CEGUI::UVector2(CEGUI::UDim(0, 5.0f + x * 70), CEGUI::UDim(0, 5.0f + y * 90))); 304 304 frame->setSize(CEGUI::UVector2(CEGUI::UDim(0, 65), CEGUI::UDim(0, 65))); 305 305 frame->setRiseOnClickEnabled(false); … … 307 307 308 308 CEGUI::Window* text = winMgr->createWindow("TaharezLook/StaticText", "orxonox/Inventory/Title/" + id); 309 text->setPosition(CEGUI::UVector2(CEGUI::UDim(0, 5 + x * 70), CEGUI::UDim(0, 70+ y * 90)));309 text->setPosition(CEGUI::UVector2(CEGUI::UDim(0, 5.0f + x * 70), CEGUI::UDim(0, 70.0f + y * 90))); 310 310 text->setSize(CEGUI::UVector2(CEGUI::UDim(0, 65), CEGUI::UDim(0, 20))); 311 311 text->setProperty("FrameEnabled", "False"); … … 317 317 318 318 CEGUI::Window* btn = winMgr->createWindow("TaharezLook/Button", "orxonox/Inventory/Items/" + id); 319 btn->setPosition(CEGUI::UVector2(CEGUI::UDim(0, 8 + x * 70), CEGUI::UDim(0, 8+ y * 90)));319 btn->setPosition(CEGUI::UVector2(CEGUI::UDim(0, 8.0f + x * 70), CEGUI::UDim(0, 8.0f + y * 90))); 320 320 btn->setSize(CEGUI::UVector2(CEGUI::UDim(0, 59), CEGUI::UDim(0, 59))); 321 321 btn->subscribeScriptedEvent("Clicked", "PickupInventory.itemClicked"); -
code/trunk/src/orxonox/sound/BaseSound.cc
r6417 r6502 178 178 void BaseSound::setPitch(float pitch) 179 179 { 180 if (pitch > 2 || pitch < 0.5 )180 if (pitch > 2 || pitch < 0.5f) 181 181 { 182 182 COUT(2) << "Sound warning: pitch out of range, cropping value." << std::endl; 183 pitch = pitch > 2 ? 2: pitch;184 pitch = pitch < 0.5 ? 0.5: pitch;183 pitch = pitch > 2.0f ? 2.0f : pitch; 184 pitch = pitch < 0.5f ? 0.5f : pitch; 185 185 } 186 186 this->pitch_ = pitch; -
code/trunk/src/orxonox/sound/SoundBuffer.cc
r6417 r6502 108 108 { 109 109 case SEEK_SET: 110 stream->seek( offset);110 stream->seek((size_t)offset); 111 111 break; 112 112 case SEEK_CUR: 113 stream->skip( offset);113 stream->skip((size_t)offset); 114 114 break; 115 115 case SEEK_END: 116 stream->seek(stream->size() + offset);116 stream->seek(stream->size() + (size_t)offset); 117 117 break; 118 118 default:
Note: See TracChangeset
for help on using the changeset viewer.