Changeset 6394 for code/branches/presentation2/src/modules
- Timestamp:
- Dec 22, 2009, 2:07:44 PM (15 years ago)
- Location:
- code/branches/presentation2/src/modules
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2/src/modules/objects/Attacher.cc
r5929 r6394 98 98 this->target_ = 0; 99 99 100 if (this->targetname_ == "")100 if (this->targetname_.empty()) 101 101 return; 102 102 … … 113 113 void Attacher::loadedNewXMLName(BaseObject* object) 114 114 { 115 if (this->target_ || this->targetname_ == "")115 if (this->target_ || this->targetname_.empty()) 116 116 return; 117 117 -
code/branches/presentation2/src/modules/objects/eventsystem/EventFilter.cc
r5929 r6394 62 62 if (this->bActive_) 63 63 { 64 COUT(2) << "Warning: Detected Event loop in EventFilter \"" << this->getName() << "\""<< std::endl;64 COUT(2) << "Warning: Detected Event loop in EventFilter \"" << this->getName() << '"' << std::endl; 65 65 return; 66 66 } -
code/branches/presentation2/src/modules/objects/eventsystem/EventListener.cc
r5929 r6394 58 58 if (this->bActive_) 59 59 { 60 COUT(2) << "Warning: Detected Event loop in EventListener \"" << this->getName() << "\""<< std::endl;60 COUT(2) << "Warning: Detected Event loop in EventListener \"" << this->getName() << '"' << std::endl; 61 61 return; 62 62 } … … 71 71 this->eventName_ = eventname; 72 72 73 if (this->eventName_ == "")73 if (this->eventName_.empty()) 74 74 return; 75 75 … … 81 81 void EventListener::loadedNewXMLName(BaseObject* object) 82 82 { 83 if (this->eventName_ == "")83 if (this->eventName_.empty()) 84 84 return; 85 85 -
code/branches/presentation2/src/modules/objects/eventsystem/EventTarget.cc
r6387 r6394 60 60 if (this->bActive_) 61 61 { 62 COUT(2) << "Warning: Detected Event loop in EventTarget \"" << this->getName() << "\""<< std::endl;62 COUT(2) << "Warning: Detected Event loop in EventTarget \"" << this->getName() << '"' << std::endl; 63 63 return; 64 64 } … … 80 80 void EventTarget::loadedNewXMLName(BaseObject* object) 81 81 { 82 if (this->target_ == "")82 if (this->target_.empty()) 83 83 return; 84 84 -
code/branches/presentation2/src/modules/objects/triggers/DistanceTrigger.cc
r5937 r6394 92 92 if (!targetId) 93 93 { 94 COUT(1) << "Error: \"" << targets << "\" is not a valid class name to include in ClassTreeMask (in " << this->getName() << ", class " << this->getIdentifier()->getName() << ")"<< std::endl;94 COUT(1) << "Error: \"" << targets << "\" is not a valid class name to include in ClassTreeMask (in " << this->getName() << ", class " << this->getIdentifier()->getName() << ')' << std::endl; 95 95 return; 96 96 } -
code/branches/presentation2/src/modules/objects/triggers/Trigger.cc
r5929 r6394 280 280 { 281 281 if (this->mode_ == TriggerMode::EventTriggerAND) 282 return std::string("and");282 return "and"; 283 283 else if (this->mode_ == TriggerMode::EventTriggerOR) 284 return std::string("or");284 return "or"; 285 285 else if (this->mode_ == TriggerMode::EventTriggerXOR) 286 return std::string("xor");286 return "xor"; 287 287 else 288 return std::string("and");288 return "and"; 289 289 } 290 290 -
code/branches/presentation2/src/modules/overlays/GUIOverlay.cc
r6387 r6394 69 69 if (this->isVisible()) 70 70 { 71 std::string str; 72 std::stringstream out; 71 std::ostringstream out; 73 72 out << reinterpret_cast<long>(this); 74 str = out.str();73 const std::string& str = out.str(); 75 74 COUT(1) << "GUIManager ptr: " << str << std::endl; 76 75 GUIManager::getInstance().showGUIExtra(this->guiName_, str); -
code/branches/presentation2/src/modules/overlays/OverlayText.cc
r5781 r6394 134 134 void OverlayText::setFont(const std::string& font) 135 135 { 136 if ( font != "")136 if (!font.empty()) 137 137 this->text_->setFontName(font); 138 138 } -
code/branches/presentation2/src/modules/overlays/hud/HUDBar.cc
r6223 r6394 72 72 73 73 // create new material 74 std::stringmaterialname = "barmaterial" + multi_cast<std::string>(materialcount_s++);74 const std::string& materialname = "barmaterial" + multi_cast<std::string>(materialcount_s++); 75 75 Ogre::MaterialPtr material = static_cast<Ogre::MaterialPtr>(Ogre::MaterialManager::getSingleton().create(materialname, "General")); 76 76 material->getTechnique(0)->getPass(0)->setSceneBlending(Ogre::SBT_TRANSPARENT_ALPHA); -
code/branches/presentation2/src/modules/overlays/hud/HUDHealthBar.h
r6054 r6394 53 53 54 54 inline void setTextFont(const std::string& font) 55 { if ( font != "") { this->textoverlay_->setFont(font); } }55 { if (!font.empty()) { this->textoverlay_->setFont(font); } } 56 56 inline const std::string& getTextFont() const 57 57 { return this->textoverlay_->getFont(); } -
code/branches/presentation2/src/modules/overlays/hud/HUDNavigation.cc
r6378 r6394 36 36 37 37 #include "util/Math.h" 38 #include "util/StringUtils.h"39 38 #include "util/Convert.h" 40 39 #include "core/CoreIncludes.h" … … 108 107 void HUDNavigation::setFont(const std::string& font) 109 108 { 110 if (this->navText_ && font != "")109 if (this->navText_ && !font.empty()) 111 110 this->navText_->setFontName(font); 112 111 } -
code/branches/presentation2/src/modules/overlays/hud/HUDRadar.cc
r5781 r6394 126 126 panel = *itRadarDots_; 127 127 ++itRadarDots_; 128 std::stringmaterialName = TextureGenerator::getMaterialName(128 const std::string& materialName = TextureGenerator::getMaterialName( 129 129 shapeMaterials_[object->getRadarObjectShape()], object->getRadarObjectColour()); 130 130 if (materialName != panel->getMaterialName()) -
code/branches/presentation2/src/modules/overlays/hud/TeamBaseMatchScore.cc
r5929 r6394 71 71 if (this->owner_) 72 72 { 73 std::string bases1 = "(" + multi_cast<std::string>(this->owner_->getTeamBases(0)) + ")";74 std::string bases2 = "(" + multi_cast<std::string>(this->owner_->getTeamBases(1)) + ")";73 const std::string& bases1 = '(' + multi_cast<std::string>(this->owner_->getTeamBases(0)) + ')'; 74 const std::string& bases2 = '(' + multi_cast<std::string>(this->owner_->getTeamBases(1)) + ')'; 75 75 76 std::stringscore1 = multi_cast<std::string>(this->owner_->getTeamPoints(0));77 std::stringscore2 = multi_cast<std::string>(this->owner_->getTeamPoints(1));76 const std::string& score1 = multi_cast<std::string>(this->owner_->getTeamPoints(0)); 77 const std::string& score2 = multi_cast<std::string>(this->owner_->getTeamPoints(1)); 78 78 79 79 std::string output1; … … 99 99 } 100 100 101 std::string output = "";101 std::string output; 102 102 if (this->bShowBases_ || this->bShowScore_) 103 103 { 104 104 if (this->bShowLeftTeam_ && this->bShowRightTeam_) 105 output = output1 + ":"+ output2;105 output = output1 + ':' + output2; 106 106 else if (this->bShowLeftTeam_ || this->bShowRightTeam_) 107 107 output = output1 + output2; -
code/branches/presentation2/src/modules/pong/PongScore.cc
r5929 r6394 77 77 std::string name2; 78 78 79 std::string score1 = "0";80 std::string score2 = "0";79 std::string score1("0"); 80 std::string score2("0"); 81 81 82 82 if (player1) … … 114 114 } 115 115 116 std::string output = "PONG";116 std::string output("PONG"); 117 117 if (this->bShowName_ || this->bShowScore_) 118 118 { 119 119 if (this->bShowLeftPlayer_ && this->bShowRightPlayer_) 120 output = output1 + ":"+ output2;120 output = output1 + ':' + output2; 121 121 else if (this->bShowLeftPlayer_ || this->bShowRightPlayer_) 122 122 output = output1 + output2; -
code/branches/presentation2/src/modules/questsystem/QuestDescription.cc
r6387 r6394 50 50 { 51 51 RegisterObject(QuestDescription); 52 53 this->title_ = "";54 this->description_ = "";55 52 } 56 53 … … 94 91 bool QuestDescription::notificationHelper(const std::string & item, const std::string & status) const 95 92 { 96 std::string message = "";93 std::string message; 97 94 if(item == "hint") 98 95 { 99 message = "You received a hint: '" + this->title_ + "'";96 message = "You received a hint: '" + this->title_ + '\''; 100 97 } 101 98 else if(item == "quest") … … 103 100 if(status == "start") 104 101 { 105 message = "You received a new quest: '" + this->title_ + "'";102 message = "You received a new quest: '" + this->title_ + '\''; 106 103 } 107 104 else if(status == "fail") 108 105 { 109 message = "You failed the quest: '" + this->title_ + "'";106 message = "You failed the quest: '" + this->title_ + '\''; 110 107 } 111 108 else if(status == "complete") 112 109 { 113 message = "You successfully completed the quest: '" + this->title_ + "'";110 message = "You successfully completed the quest: '" + this->title_ + '\''; 114 111 } 115 112 else -
code/branches/presentation2/src/modules/questsystem/QuestGUINode.cc
r6388 r6394 134 134 if(this->window_ != NULL) 135 135 { 136 buffer = (std::string)(this->window_->getName().c_str());136 buffer = this->window_->getName().c_str(); 137 137 } 138 138 else 139 139 { 140 buffer = "";140 buffer.erase(); 141 141 } 142 142 } … … 187 187 CEGUI::Window* statusWindow = this->gui_->getWindowManager()->createWindow("TaharezLook/StaticText", stream.str()); 188 188 window->addChildWindow(statusWindow); 189 std::string status = "";189 std::string status; 190 190 if(quest->isActive(this->gui_->getPlayer())) 191 191 { -
code/branches/presentation2/src/modules/questsystem/QuestItem.cc
r6387 r6394 47 47 { 48 48 RegisterObject(QuestItem); 49 50 this->id_ = "";51 49 } 52 50 -
code/branches/presentation2/src/modules/questsystem/QuestListener.cc
r6388 r6394 183 183 { 184 184 COUT(1) << "An unforseen, never to happen, Error has occurred. This is impossible!" << std::endl; 185 return "";185 return ""; 186 186 } 187 187 } -
code/branches/presentation2/src/modules/questsystem/QuestNotification.cc
r6387 r6394 32 32 namespace orxonox { 33 33 34 const std::string QuestNotification::SENDER = "questsystem";34 const std::string QuestNotification::SENDER("questsystem"); 35 35 36 36 QuestNotification::QuestNotification(BaseObject* creator) : Notification(creator) -
code/branches/presentation2/src/modules/questsystem/notifications/Notification.cc
r6387 r6394 75 75 void Notification::initialize(void) 76 76 { 77 this->message_ = "";77 this->message_.clear(); 78 78 this->sender_ = NotificationManager::NONE; 79 79 this->sent_ = false; -
code/branches/presentation2/src/modules/questsystem/notifications/NotificationManager.cc
r6182 r6394 44 44 { 45 45 46 const std::string NotificationManager::ALL = "all";47 const std::string NotificationManager::NONE = "none";46 const std::string NotificationManager::ALL("all"); 47 const std::string NotificationManager::NONE("none"); 48 48 49 49 ManageScopedSingleton(NotificationManager, ScopeID::Root, false); -
code/branches/presentation2/src/modules/questsystem/notifications/NotificationQueue.cc
r5929 r6394 46 46 CreateFactory(NotificationQueue); 47 47 48 const std::string NotificationQueue::DEFAULT_FONT = "VeraMono";49 const Vector2 NotificationQueue::DEFAULT_POSITION = Vector2(0.0,0.0);50 const float NotificationQueue::DEFAULT_FONT_SIZE 48 const std::string NotificationQueue::DEFAULT_FONT("VeraMono"); 49 const Vector2 NotificationQueue::DEFAULT_POSITION(0.0,0.0); 50 const float NotificationQueue::DEFAULT_FONT_SIZE = 0.025f; 51 51 52 52 /** … … 271 271 if(!first) 272 272 { 273 *string += ",";273 *string += ','; 274 274 } 275 275 else … … 300 300 while( index < targets.size() ) //!< Go through the string, character by character until the end is reached. 301 301 { 302 pTemp = new std::string( "");302 pTemp = new std::string(); 303 303 while(index < targets.size() && targets[index] != ',' && targets[index] != ' ') 304 304 { … … 399 399 std::ostringstream stream; 400 400 stream << reinterpret_cast<unsigned long>(notification); 401 std::string addressString = stream.str();401 const std::string& addressString = stream.str(); 402 402 container->name = "NotificationOverlay(" + timeString + ")&" + addressString; 403 403
Note: See TracChangeset
for help on using the changeset viewer.