Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 22, 2009, 2:07:44 PM (15 years ago)
Author:
rgrieder
Message:

std::string tweaks:

  • Declared BLANKSTRING in UtilPrereqs.h as well (removed obsolete StringUtils.h includes to avoid dependencies)
  • Using BLANKSTRING if const std::string& return type is possible
  • Replaced a few (const) std::string arguments with const std::string&
  • if (str == "") —> if (str.empty())
  • std::string msg = name + "adsf"; —> const std::string& msg = name + "asdf";
  • std::string asdf = object→getFooBar(); —> const std::string& asdf = object→getFooBar();
  • std::string asdf = "asdf"; —> std::string asdf("asdf");
  • ostream << "."; and name + "." —> ostream << '.'; and name + '.'
  • str = ""; —> str.clear()
  • std::string asdf = ""; —> std::string asdf;
  • asdf_ = ""; (in c'tor) —> delete line
Location:
code/branches/presentation2/src/libraries/tools
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/libraries/tools/BillboardSet.cc

    r5781 r6394  
    3838#include "util/Convert.h"
    3939#include "util/Math.h"
    40 #include "util/StringUtils.h"
    4140#include "core/GameMode.h"
    4241
     
    8180        catch (...)
    8281        {
    83             COUT(1) << "Error: Couln't load billboard \"" << file << "\"" << std::endl;
     82            COUT(1) << "Error: Couln't load billboard \"" << file << '"' << std::endl;
    8483            this->billboardSet_ = 0;
    8584        }
     
    104103        catch (...)
    105104        {
    106             COUT(1) << "Error: Couln't load billboard \"" << file << "\"" << std::endl;
     105            COUT(1) << "Error: Couln't load billboard \"" << file << '"' << std::endl;
    107106            this->billboardSet_ = 0;
    108107        }
  • code/branches/presentation2/src/libraries/tools/Mesh.cc

    r5781 r6394  
    3636
    3737#include "util/Convert.h"
    38 #include "util/StringUtils.h"
    3938#include "core/GameMode.h"
    4039
     
    8483            catch (...)
    8584            {
    86                 COUT(1) << "Error: Couln't load mesh \"" << meshsource << "\"" << std::endl;
     85                COUT(1) << "Error: Couln't load mesh \"" << meshsource << '"' << std::endl;
    8786                this->entity_ = 0;
    8887            }
  • code/branches/presentation2/src/libraries/tools/ParticleInterface.cc

    r6218 r6394  
    7878            catch (...)
    7979            {
    80                 COUT(1) << "Error: Couln't load particle system \"" << templateName << "\"" << std::endl;
     80                COUT(1) << "Error: Couln't load particle system \"" << templateName << '"' << std::endl;
    8181                this->particleSystem_ = 0;
    8282            }
  • code/branches/presentation2/src/libraries/tools/ResourceLocation.cc

    r5929 r6394  
    9292    {
    9393        // Remove from Ogre paths
    94         resourceGroup_.erase();
     94        resourceGroup_.clear();
    9595        try
    9696        {
  • code/branches/presentation2/src/libraries/tools/Shader.cc

    r6218 r6394  
    5757        this->bLoadCompositor_ = GameMode::showsGraphics();
    5858        this->bViewportInitialized_ = false;
    59         this->compositor_ = "";
    60         this->oldcompositor_ = "";
    6159
    6260        if (this->bLoadCompositor_ && Ogre::Root::getSingletonPtr())
     
    111109            Ogre::Viewport* viewport = GraphicsManager::getInstance().getViewport();
    112110            assert(viewport);
    113             if (this->oldcompositor_ != "")
     111            if (!this->oldcompositor_.empty())
    114112            {
    115113                Ogre::CompositorManager::getSingleton().removeCompositor(viewport, this->oldcompositor_);
    116114                this->compositorInstance_ = 0;
    117115            }
    118             if (this->compositor_ != "")
     116            if (!this->compositor_.empty())
    119117            {
    120118                this->compositorInstance_ = Ogre::CompositorManager::getSingleton().addCompositor(viewport, this->compositor_);
     
    298296                        continue;
    299297
    300                     if (pass_pointer->getFragmentProgramName() != "")
     298                    if (!pass_pointer->getFragmentProgramName().empty())
    301299                    {
    302300                        Ogre::GpuProgramParameters* parameter_pointer = pass_pointer->getFragmentProgramParameters().get();
  • code/branches/presentation2/src/libraries/tools/TextureGenerator.cc

    r5781 r6394  
    7272        if (it == colourMap.end())
    7373        {
    74             std::string materialName = textureName + "_Material_" + multi_cast<std::string>(materialCount_s++);
     74            const std::string& materialName = textureName + "_Material_" + multi_cast<std::string>(materialCount_s++);
    7575            Ogre::MaterialPtr material = static_cast<Ogre::MaterialPtr>(Ogre::MaterialManager::getSingleton().create(materialName, "General"));
    7676            material->getTechnique(0)->getPass(0)->setSceneBlending(Ogre::SBT_TRANSPARENT_ALPHA);
Note: See TracChangeset for help on using the changeset viewer.