Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 11, 2010, 11:34:20 AM (15 years ago)
Author:
rgrieder
Message:

Removed a ton of msvc warnings revealed with OGRE v1.7 (they removed the warning suppressors in OgrePrerequisites.h).
All of them are conversions from one type to another that might be lossy (mostly double to float, please always use "3.7f" instead of "3.7" as constants when using floats).

Location:
code/trunk/src/modules
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/modules/overlays/hud/HUDNavigation.cc

    r6417 r6502  
    153153        int dist = static_cast<int>(getDist2Focus());
    154154        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;
    156156
    157157        orxonox::Camera* cam = CameraManager::getInstance().getActiveCamera();
     
    191191                {
    192192                    // 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);
    197197                    navText_->setTop(navMarker_->getHeight());
    198198                }
     
    200200                {
    201201                    // 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);
    207207                }
    208208            }
     
    212212                {
    213213                    // 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());
    219219                }
    220220                else
    221221                {
    222222                    // 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);
    228228                }
    229229            }
     
    243243
    244244            // 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);
    248248
    249249/*
    250250            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);
    256256        }
    257257    }
  • code/trunk/src/modules/overlays/hud/HUDRadar.cc

    r6417 r6502  
    141141        // calc position on radar...
    142142        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 texture
    144         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);
    145145
    146146        if (bIsMarked)
    147147        {
    148148            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);
    151151        }
    152152    }
  • code/trunk/src/modules/overlays/stats/CreateLines.cc

    r6417 r6502  
    3838    {
    3939        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));
    4343
    4444        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));
    4848
    4949        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));
    5353
    5454        background_ = new Stats(0);
  • code/trunk/src/modules/overlays/stats/Scoreboard.cc

    r5980 r6502  
    7979        const std::map<PlayerInfo*, Player>& playerList = this->getGametype()->getPlayers();
    8080
    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;
    8686        while (playerList.size() > this->lines_.size())
    8787        {
  • code/trunk/src/modules/overlays/stats/Stats.cc

    r5781 r6502  
    5959        this->statsOverlayBorder_ = static_cast<Ogre::BorderPanelOverlayElement*>(ovMan->createOverlayElement("BorderPanel", "StatsBorderPanel" + getUniqueNumberString()));
    6060        //this->statsOverlayBorder_->setMaterialName("StatsCenter");
    61         this->statsOverlayBorder_->setBorderSize(0.003, 16 * 0.003);
     61        this->statsOverlayBorder_->setBorderSize(0.003f, 16.0f * 0.003f);
    6262        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);
    7171
    7272        background_->addChild(statsOverlayBorder_);
  • code/trunk/src/modules/questsystem/QuestGUINode.cc

    r6417 r6502  
    161161            const QuestDescription* description = this->item_->getDescription();
    162162            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)));
    165165            this->details_->setText(description->getTitle());
    166166            this->details_->setAlpha(1.0);
     
    173173            CEGUI::Window* window = this->gui_->getWindowManager()->createWindow("TaharezLook/ScrollablePane", stream.str());
    174174            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)));
    176176            this->details_->addChildWindow(window);
    177177
     
    203203                statusWindow->setProperty("VertFormatting", "TopAligned");
    204204                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)));
    207207                height = setHeight(statusWindow);
    208208
     
    219219            descriptionWindowTitle->setProperty("VertFormatting", "TopAligned");
    220220            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)));
    223223
    224224            offset += setHeight(descriptionWindowTitle);
     
    232232            descriptionWindow->setProperty("VertFormatting", "TopAligned");
    233233            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)));
    236236            height = setHeight(descriptionWindow);
    237237
     
    255255                            hintsTitle->setProperty("VertFormatting", "TopAligned");
    256256                            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)));
    258258                            hintsTitle->setSize(CEGUI::UVector2(CEGUI::UDim(1.0, -QuestGUINode::SCROLLBAR_WIDTH),CEGUI::UDim(1.0, 0)));
    259259                            offset += setHeight(hintsTitle);;
     
    261261                        }
    262262                        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)));
    265265                        window->addChildWindow(node->window_);
    266266                        offset += QuestGUINode::BUTTON_HEIGHT;
     
    337337
    338338        //! 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));
    340340
    341341        //! 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.
     
    357357    void QuestGUINode::updatePosition(void)
    358358    {
    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)));
    361361    }
    362362
  • code/trunk/src/modules/questsystem/notifications/NotificationQueue.cc

    r6417 r6502  
    139139            {
    140140                this->removeContainer(*it);
    141                 this->scroll(Vector2(0.0,-(1.1*this->getFontSize())));
     141                this->scroll(Vector2(0.0f,-(1.1f*this->getFontSize())));
    142142                it = this->containers_.begin(); //TODO: Needed?
    143143            }
    144144
    145             this->tickTime_ = 0.0; //!< Reset time counter.
     145            this->tickTime_ = 0.0f; //!< Reset time counter.
    146146        }
    147147    }
     
    193193            it = this->containers_.begin();
    194194            this->removeContainer(*it);
    195             this->scroll(Vector2(0.0,-(1.1*this->getFontSize())));
     195            this->scroll(Vector2(0.0f,-(1.1f*this->getFontSize())));
    196196        }
    197197
     
    375375        {
    376376            (*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));
    378378            counter++;
    379379        }
     
    407407        this->size_= this->size_+1;
    408408
    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)));
    410410    }
    411411
  • code/trunk/src/modules/weapons/projectiles/BillboardProjectile.cc

    r5781 r6502  
    4848        }
    4949
    50         this->setScale(0.2);
     50        this->setScale(0.2f);
    5151    }
    5252
  • code/trunk/src/modules/weapons/projectiles/Rocket.cc

    r6417 r6502  
    6666            Model* model = new Model(this);
    6767            model->setMeshSource("rocket.mesh");
    68             model->scale(0.7);
     68            model->scale(0.7f);
    6969            this->attach(model);
    7070            ParticleEmitter* fire = new ParticleEmitter(this);
  • code/trunk/src/modules/weapons/weaponmodes/RocketFire.cc

    r6417 r6502  
    4646        RegisterObject(RocketFire);
    4747
    48         this->reloadTime_ = 0.20;
     48        this->reloadTime_ = 0.20f;
    4949        this->bParallelReload_ = false;
    5050        this->damage_ = 100;
Note: See TracChangeset for help on using the changeset viewer.