Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 2, 2015, 11:22:03 PM (9 years ago)
Author:
landauf
Message:

use actual types instead of 'auto'. only exception is for complicated template types, e.g. when iterating over a map

Location:
code/branches/cpp11_v2/src/modules/overlays/hud
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v2/src/modules/overlays/hud/ChatOverlay.cc

    r10821 r10916  
    5858    ChatOverlay::~ChatOverlay()
    5959    {
    60         for (const auto & elem : this->timers_)
    61             delete (elem);
     60        for (Timer* timer : this->timers_)
     61            delete timer;
    6262    }
    6363
     
    9292        this->text_->setCaption("");
    9393
    94         for (auto & elem : this->messages_)
     94        for (const Ogre::DisplayString& message : this->messages_)
    9595        {
    96             this->text_->setCaption(this->text_->getCaption() + "\n" + (elem));
     96            this->text_->setCaption(this->text_->getCaption() + "\n" + message);
    9797        }
    9898    }
  • code/branches/cpp11_v2/src/modules/overlays/hud/HUDNavigation.cc

    r10821 r10916  
    131131        }
    132132        this->fontName_ = font;
    133         for (auto & elem : this->activeObjectList_)
    134         {
    135             if (elem.second.text_ != nullptr)
    136                 elem.second.text_->setFontName(this->fontName_);
     133        for (auto& mapEntry : this->activeObjectList_)
     134        {
     135            if (mapEntry.second.text_ != nullptr)
     136                mapEntry.second.text_->setFontName(this->fontName_);
    137137        }
    138138    }
     
    151151        }
    152152        this->textSize_ = size;
    153         for (auto & elem : this->activeObjectList_)
    154         {
    155             if (elem.second.text_)
    156                 elem.second.text_->setCharHeight(size);
     153        for (auto& mapEntry : this->activeObjectList_)
     154        {
     155            if (mapEntry.second.text_)
     156                mapEntry.second.text_->setCharHeight(size);
    157157        }
    158158    }
     
    186186        const Matrix4& camTransform = cam->getOgreCamera()->getProjectionMatrix() * cam->getOgreCamera()->getViewMatrix();
    187187
    188         for (auto & elem : this->sortedObjectList_)
    189         elem.second = (int)((elem.first->getRVWorldPosition() - HumanController::getLocalControllerSingleton()->getControllableEntity()->getWorldPosition()).length() + 0.5f);
     188        for (std::pair<RadarViewable*, unsigned int>& pair : this->sortedObjectList_)
     189        pair.second = (int)((pair.first->getRVWorldPosition() - HumanController::getLocalControllerSingleton()->getControllableEntity()->getWorldPosition()).length() + 0.5f);
    190190
    191191        this->sortedObjectList_.sort(compareDistance);
     
    531531        float yScale = this->getActualSize().y;
    532532
    533         for (auto & elem : this->activeObjectList_)
    534         {
    535             if (elem.second.health_ != nullptr)
    536                 elem.second.health_->setDimensions(this->healthMarkerSize_ * xScale, this->healthMarkerSize_ * yScale);
    537             if (elem.second.healthLevel_ != nullptr)
    538                 elem.second.healthLevel_->setDimensions(this->healthLevelMarkerSize_ * xScale, this->healthLevelMarkerSize_ * yScale);
    539             if (elem.second.panel_ != nullptr)
    540                 elem.second.panel_->setDimensions(this->navMarkerSize_ * xScale, this->navMarkerSize_ * yScale);
    541             if (elem.second.text_ != nullptr)
    542                 elem.second.text_->setCharHeight(this->textSize_ * yScale);
    543             if (elem.second.target_ != nullptr)
    544                 elem.second.target_->setDimensions(this->aimMarkerSize_ * xScale, this->aimMarkerSize_ * yScale);
     533        for (auto& mapEntry : this->activeObjectList_)
     534        {
     535            if (mapEntry.second.health_ != nullptr)
     536                mapEntry.second.health_->setDimensions(this->healthMarkerSize_ * xScale, this->healthMarkerSize_ * yScale);
     537            if (mapEntry.second.healthLevel_ != nullptr)
     538                mapEntry.second.healthLevel_->setDimensions(this->healthLevelMarkerSize_ * xScale, this->healthLevelMarkerSize_ * yScale);
     539            if (mapEntry.second.panel_ != nullptr)
     540                mapEntry.second.panel_->setDimensions(this->navMarkerSize_ * xScale, this->navMarkerSize_ * yScale);
     541            if (mapEntry.second.text_ != nullptr)
     542                mapEntry.second.text_->setCharHeight(this->textSize_ * yScale);
     543            if (mapEntry.second.target_ != nullptr)
     544                mapEntry.second.target_->setDimensions(this->aimMarkerSize_ * xScale, this->aimMarkerSize_ * yScale);
    545545        }
    546546    }
     
    670670    {
    671671        const std::set<RadarViewable*>& respawnObjects = this->getOwner()->getScene()->getRadar()->getRadarObjects();
    672         for (const auto & respawnObject : respawnObjects)
    673         {
    674             if (!(respawnObject)->isHumanShip_)
     672        for (RadarViewable* respawnObject : respawnObjects)
     673        {
     674            if (!respawnObject->isHumanShip_)
    675675            this->addObject(respawnObject);
    676676        }
  • code/branches/cpp11_v2/src/modules/overlays/hud/HUDRadar.cc

    r10821 r10916  
    9292            Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->map3DBack_);
    9393
    94             for (auto & elem : this->radarObjects_)
    95             {
    96                 Ogre::OverlayManager::getSingleton().destroyOverlayElement(elem.second);
     94            for (auto& mapEntry : this->radarObjects_)
     95            {
     96                Ogre::OverlayManager::getSingleton().destroyOverlayElement(mapEntry.second);
    9797            }
    9898        }
Note: See TracChangeset for help on using the changeset viewer.