Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 17, 2009, 11:53:35 PM (15 years ago)
Author:
rgrieder
Message:

Found a few more C-Style casts.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/overlays/console/InGameConsole.cc

    r3280 r3300  
    332332
    333333        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);
    335335    }
    336336
     
    416416        this->windowW_ = newWidth;
    417417        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);
    422422        this->consoleOverlayNoise_->setTiling(consoleOverlayNoise_->getWidth() / (50.0f * this->noiseSize_), consoleOverlayNoise_->getHeight() / (50.0f * this->noiseSize_));
    423423
    424424        // 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;
    426426
    427427        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));
    429429        else
    430430            this->maxCharsPerLine_ = 10;
     
    433433        {
    434434            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);
    436436        }
    437437
Note: See TracChangeset for help on using the changeset viewer.