diff --git a/src/achievements/achievements_manager.cpp b/src/achievements/achievements_manager.cpp index 15281efeb..db24f23dc 100644 --- a/src/achievements/achievements_manager.cpp +++ b/src/achievements/achievements_manager.cpp @@ -103,6 +103,8 @@ void AchievementsManager::parseAssetFile() if(num_nodes != m_achievements_info.size()) Log::error("AchievementsManager::parseAchievements", "Multiple achievements with the same id!"); + + delete root; } diff --git a/src/guiengine/widgets/list_widget.cpp b/src/guiengine/widgets/list_widget.cpp index 419e14d1d..13cd2b7f4 100644 --- a/src/guiengine/widgets/list_widget.cpp +++ b/src/guiengine/widgets/list_widget.cpp @@ -210,16 +210,16 @@ void ListWidget::addItem( const std::string& internal_name, // ----------------------------------------------------------------------------- void ListWidget::addItem(const std::string& internal_name, - PtrVector * contents) + const std::vector& contents) { // May only be called AFTER this widget has been add()ed assert(m_element != NULL); ListItem newItem; newItem.m_internal_name = internal_name; - for(int i = 0; i < (int)contents->size(); i++) + for (unsigned int i = 0; i < contents.size(); i++) { - newItem.m_contents.push_back(*contents->get(i)); + newItem.m_contents.push_back(contents[i]); } CGUISTKListBox* list = getIrrlichtElement(); diff --git a/src/guiengine/widgets/list_widget.hpp b/src/guiengine/widgets/list_widget.hpp index fd56316ae..6e864ecea 100644 --- a/src/guiengine/widgets/list_widget.hpp +++ b/src/guiengine/widgets/list_widget.hpp @@ -132,7 +132,7 @@ namespace GUIEngine bool center = false); void addItem( const std::string& internal_name, - PtrVector * contents); + const std::vector& contents); /** * \brief erases all items in the list diff --git a/src/modes/overworld.cpp b/src/modes/overworld.cpp index 63f1f30b2..5064e254b 100644 --- a/src/modes/overworld.cpp +++ b/src/modes/overworld.cpp @@ -164,15 +164,6 @@ void OverWorld::getKartsDisplayInfo( assert(false); } // getKartsDisplayInfo -//----------------------------------------------------------------------------- -/** Override the base class method to change behavior. We don't want wrong - * direction messages in the overworld since there is no direction there. - * \param i Kart id. - */ -void OverWorld::checkForWrongDirection(unsigned int i) -{ -} // checkForWrongDirection - //----------------------------------------------------------------------------- void OverWorld::createRaceGUI() diff --git a/src/modes/overworld.hpp b/src/modes/overworld.hpp index 569a8d515..ef7807101 100644 --- a/src/modes/overworld.hpp +++ b/src/modes/overworld.hpp @@ -54,8 +54,6 @@ public: /** Returns if this race mode has laps. */ virtual bool raceHasLaps() OVERRIDE { return false; } // ------------------------------------------------------------------------ - virtual void checkForWrongDirection(unsigned int i) OVERRIDE; - // ------------------------------------------------------------------------ /** The overworld is not a race per se so it's never over */ virtual bool isRaceOver() OVERRIDE { return false; } // ------------------------------------------------------------------------ diff --git a/src/modes/world.hpp b/src/modes/world.hpp index a1d41d83d..d8fe1c6a6 100644 --- a/src/modes/world.hpp +++ b/src/modes/world.hpp @@ -202,7 +202,7 @@ public: // ------------------------------------------------------------------------ /** Returns the number of rescue positions on a given track and game * mode. */ - virtual unsigned int getNumberOfRescuePositions() const OVERRIDE = 0; + virtual unsigned int getNumberOfRescuePositions() const = 0; // ------------------------------------------------------------------------ /** Determines the rescue position index of the specified kart. */ virtual unsigned int getRescuePositionIndex(AbstractKart *kart) = 0; diff --git a/src/states_screens/addons_screen.cpp b/src/states_screens/addons_screen.cpp index 07188c449..757731251 100644 --- a/src/states_screens/addons_screen.cpp +++ b/src/states_screens/addons_screen.cpp @@ -358,9 +358,9 @@ void AddonsScreen::loadList() icon += 2; } - PtrVector * row = new PtrVector; - row->push_back(new GUIEngine::ListWidget::ListCell(s.c_str(), icon, 3, false)); - row->push_back(new GUIEngine::ListWidget::ListCell(addon->getDateAsString().c_str(), -1, 1, true)); + std::vector row; + row.push_back(GUIEngine::ListWidget::ListCell(s.c_str(), icon, 3, false)); + row.push_back(GUIEngine::ListWidget::ListCell(addon->getDateAsString().c_str(), -1, 1, true)); w_list->addItem(addon->getId(), row); // Highlight if it's not approved in artists debug mode. diff --git a/src/states_screens/online_profile_achievements.cpp b/src/states_screens/online_profile_achievements.cpp index 1c849f9f8..2390db688 100644 --- a/src/states_screens/online_profile_achievements.cpp +++ b/src/states_screens/online_profile_achievements.cpp @@ -83,10 +83,11 @@ void OnlineProfileAchievements::init() m_achievements_list_widget->clear(); const std::map & all_achievements = AchievementsManager::get()->getActive()->getAllAchievements(); std::map::const_iterator it; - for ( it = all_achievements.begin(); it != all_achievements.end(); ++it ) { - PtrVector * row = new PtrVector; - row->push_back(new GUIEngine::ListWidget::ListCell(it->second->getInfo()->getTitle(),-1,2)); - row->push_back(new GUIEngine::ListWidget::ListCell(it->second->getProgressAsString(),-1,1, true)); + for (it = all_achievements.begin(); it != all_achievements.end(); ++it ) + { + std::vector row; + row.push_back(GUIEngine::ListWidget::ListCell(it->second->getInfo()->getTitle(),-1,2)); + row.push_back(GUIEngine::ListWidget::ListCell(it->second->getProgressAsString(),-1,1, true)); m_achievements_list_widget->addItem(StringUtils::toString(it->second->getInfo()->getID()), row); } } diff --git a/src/states_screens/online_profile_friends.cpp b/src/states_screens/online_profile_friends.cpp index eea34c60f..9335a9f1e 100644 --- a/src/states_screens/online_profile_friends.cpp +++ b/src/states_screens/online_profile_friends.cpp @@ -114,13 +114,13 @@ void OnlineProfileFriends::onUpdate(float delta) m_friends_list_widget->clear(); for(unsigned int i = 0; i < m_visiting_profile->getFriends().size(); i++) { - PtrVector * row = new PtrVector; - Profile * friend_profile = ProfileManager::get()->getProfileByID(m_visiting_profile->getFriends()[i]); - row->push_back(new GUIEngine::ListWidget::ListCell(friend_profile->getUserName(),-1,2)); + std::vector row; + Profile* friend_profile = ProfileManager::get()->getProfileByID(m_visiting_profile->getFriends()[i]); + row.push_back(GUIEngine::ListWidget::ListCell(friend_profile->getUserName(),-1,2)); if(m_visiting_profile->isCurrentUser()) { Profile::RelationInfo * relation_info = friend_profile->getRelationInfo(); - row->push_back(new GUIEngine::ListWidget::ListCell(relation_info->getDate(),-1,1, true)); + row.push_back(GUIEngine::ListWidget::ListCell(relation_info->getDate(),-1,1, true)); irr::core::stringw status(""); if(relation_info->isPending()) { @@ -128,7 +128,7 @@ void OnlineProfileFriends::onUpdate(float delta) } else status = (relation_info->isOnline() ? _("Online") : _("Offline")); - row->push_back(new GUIEngine::ListWidget::ListCell(status,-1,2, true)); + row.push_back(GUIEngine::ListWidget::ListCell(status,-1,2, true)); } m_friends_list_widget->addItem("friend", row); } diff --git a/src/states_screens/online_user_search.cpp b/src/states_screens/online_user_search.cpp index 4cc6a9c57..bd694fdc7 100644 --- a/src/states_screens/online_user_search.cpp +++ b/src/states_screens/online_user_search.cpp @@ -76,12 +76,12 @@ void OnlineUserSearch::parseResult(const XMLNode * input) void OnlineUserSearch::showList() { m_user_list_widget->clear(); - for(unsigned int i=0; i < m_users.size(); i++) + for (unsigned int i=0; i < m_users.size(); i++) { - PtrVector * row = new PtrVector; + std::vector row; Profile * profile = ProfileManager::get()->getProfileByID(m_users[i]); assert(profile != NULL); - row->push_back(new GUIEngine::ListWidget::ListCell(profile->getUserName(),-1,3)); + row.push_back(GUIEngine::ListWidget::ListCell(profile->getUserName(),-1,3)); m_user_list_widget->addItem("user", row); } } diff --git a/src/states_screens/server_selection.cpp b/src/states_screens/server_selection.cpp index 3b3260a88..985e26dea 100644 --- a/src/states_screens/server_selection.cpp +++ b/src/states_screens/server_selection.cpp @@ -121,9 +121,9 @@ void ServerSelection::loadList() num_players.append(StringUtils::toWString(server->getCurrentPlayers())); num_players.append("/"); num_players.append(StringUtils::toWString(server->getMaxPlayers())); - PtrVector * row = new PtrVector; - row->push_back(new GUIEngine::ListWidget::ListCell(server->getName(),-1,3)); - row->push_back(new GUIEngine::ListWidget::ListCell(num_players,-1,1,true)); + std::vector row; + row.push_back(GUIEngine::ListWidget::ListCell(server->getName(),-1,3)); + row.push_back(GUIEngine::ListWidget::ListCell(num_players,-1,1,true)); m_server_list_widget->addItem("server", row); } } // loadList diff --git a/src/utils/cpp2011.h b/src/utils/cpp2011.h index ed33d8550..add6075f6 100644 --- a/src/utils/cpp2011.h +++ b/src/utils/cpp2011.h @@ -1,5 +1,5 @@ -#if __cplusplus >= 201103 +#if __cplusplus >= 201103 || _MSC_VER >=1800 #define OVERRIDE override