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/questsystem
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.