From 4bb9622c216933c0746450cf2043aa997ece56ec Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Thu, 8 Jun 2017 22:40:31 +0400 Subject: [PATCH 01/51] Handle greetings differently from responses --- apps/openmw/mwdialogue/dialoguemanagerimp.cpp | 2 +- apps/openmw/mwgui/dialogue.cpp | 15 +++++++-------- apps/openmw/mwgui/dialogue.hpp | 5 +++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/apps/openmw/mwdialogue/dialoguemanagerimp.cpp b/apps/openmw/mwdialogue/dialoguemanagerimp.cpp index 38ad821cd..fa5bfbe2f 100644 --- a/apps/openmw/mwdialogue/dialoguemanagerimp.cpp +++ b/apps/openmw/mwdialogue/dialoguemanagerimp.cpp @@ -170,7 +170,7 @@ namespace MWDialogue parseText (info->mResponse); MWScript::InterpreterContext interpreterContext(&mActor.getRefData().getLocals(),mActor); - win->addResponse (Interpreter::fixDefinesDialog(info->mResponse, interpreterContext)); + win->addResponse (Interpreter::fixDefinesDialog(info->mResponse, interpreterContext), "", false); executeScript (info->mResultScript, mActor); mLastTopic = Misc::StringUtils::lowerCase(it->mId); diff --git a/apps/openmw/mwgui/dialogue.cpp b/apps/openmw/mwgui/dialogue.cpp index c03673b90..11c35c09e 100644 --- a/apps/openmw/mwgui/dialogue.cpp +++ b/apps/openmw/mwgui/dialogue.cpp @@ -107,24 +107,23 @@ namespace MWGui // -------------------------------------------------------------------------------------------------- - Response::Response(const std::string &text, const std::string &title) - : mTitle(title) + Response::Response(const std::string &text, const std::string &title, bool needMargin) + : mTitle(title), mNeedMargin(needMargin) { mText = text; } void Response::write(BookTypesetter::Ptr typesetter, KeywordSearchT* keywordSearch, std::map& topicLinks) const { - BookTypesetter::Style* title = typesetter->createStyle("", getDialogueTextColour("header")); + typesetter->sectionBreak(mNeedMargin ? 9 : 0); if (mTitle != "") { - typesetter->sectionBreak(9); + BookTypesetter::Style* title = typesetter->createStyle("", getDialogueTextColour("header")); typesetter->write(title, to_utf8_span(mTitle.c_str())); + typesetter->sectionBreak(); } - typesetter->sectionBreak(); - typedef std::pair Range; std::map hyperLinks; @@ -554,7 +553,7 @@ namespace MWGui mHistory->setPosition(0, static_cast(pos) * -1); } - void DialogueWindow::addResponse(const std::string &text, const std::string &title) + void DialogueWindow::addResponse(const std::string &text, const std::string &title, bool needMargin) { // This is called from the dialogue manager, so text is // case-smashed - thus we have to retrieve the correct case @@ -573,7 +572,7 @@ namespace MWGui } } - mHistoryContents.push_back(new Response(text, realTitle)); + mHistoryContents.push_back(new Response(text, realTitle, needMargin)); updateHistory(); } diff --git a/apps/openmw/mwgui/dialogue.hpp b/apps/openmw/mwgui/dialogue.hpp index d34574e89..e1e427b3f 100644 --- a/apps/openmw/mwgui/dialogue.hpp +++ b/apps/openmw/mwgui/dialogue.hpp @@ -82,10 +82,11 @@ namespace MWGui struct Response : DialogueText { - Response(const std::string& text, const std::string& title = ""); + Response(const std::string& text, const std::string& title = "", bool needMargin = true); virtual void write (BookTypesetter::Ptr typesetter, KeywordSearchT* keywordSearch, std::map& topicLinks) const; void addTopicLink (BookTypesetter::Ptr typesetter, intptr_t topicId, size_t begin, size_t end) const; std::string mTitle; + bool mNeedMargin; }; struct Message : DialogueText @@ -109,7 +110,7 @@ namespace MWGui void startDialogue(MWWorld::Ptr actor, std::string npcName, bool resetHistory); void setKeywords(std::list keyWord); - void addResponse (const std::string& text, const std::string& title=""); + void addResponse (const std::string& text, const std::string& title="", bool needMargin = true); void addMessageBox(const std::string& text); From 3190f287100ed1a152bd8203ceaaec1d88ed59de Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Fri, 9 Jun 2017 10:23:46 +0400 Subject: [PATCH 02/51] Spell priority: make AI do not cast target spells under water --- apps/openmw/mwbase/world.hpp | 1 + apps/openmw/mwmechanics/aicombataction.cpp | 7 +++++++ apps/openmw/mwworld/worldimp.hpp | 4 +--- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwbase/world.hpp b/apps/openmw/mwbase/world.hpp index 86d26d3a7..691891486 100644 --- a/apps/openmw/mwbase/world.hpp +++ b/apps/openmw/mwbase/world.hpp @@ -383,6 +383,7 @@ namespace MWBase ///Is the head of the creature underwater? virtual bool isSubmerged(const MWWorld::ConstPtr &object) const = 0; virtual bool isUnderwater(const MWWorld::CellStore* cell, const osg::Vec3f &pos) const = 0; + virtual bool isUnderwater(const MWWorld::ConstPtr &object, const float heightRatio) const = 0; virtual bool isWaterWalkingCastableOnTarget(const MWWorld::ConstPtr &target) const = 0; virtual bool isOnGround(const MWWorld::Ptr &ptr) const = 0; diff --git a/apps/openmw/mwmechanics/aicombataction.cpp b/apps/openmw/mwmechanics/aicombataction.cpp index 37b67c9b2..358e04d6b 100644 --- a/apps/openmw/mwmechanics/aicombataction.cpp +++ b/apps/openmw/mwmechanics/aicombataction.cpp @@ -545,6 +545,13 @@ namespace MWMechanics const ESM::MagicEffect* magicEffect = MWBase::Environment::get().getWorld()->getStore().get().find(effect.mEffectID); + // Underwater casting not possible + if (effect.mRange == ESM::RT_Target) + { + if (MWBase::Environment::get().getWorld()->isUnderwater(MWWorld::ConstPtr(actor), 0.75f)) + return 0; + } + rating *= magicEffect->mData.mBaseCost; if (magicEffect->mData.mFlags & ESM::MagicEffect::Harmful) diff --git a/apps/openmw/mwworld/worldimp.hpp b/apps/openmw/mwworld/worldimp.hpp index ce6e27672..eb35ad031 100644 --- a/apps/openmw/mwworld/worldimp.hpp +++ b/apps/openmw/mwworld/worldimp.hpp @@ -168,9 +168,6 @@ namespace MWWorld float mDistanceToFacedObject; - bool isUnderwater(const MWWorld::ConstPtr &object, const float heightRatio) const; - ///< helper function for implementing isSwimming(), isSubmerged(), isWading() - bool mTeleportEnabled; bool mLevitationEnabled; bool mGoToJail; @@ -490,6 +487,7 @@ namespace MWWorld virtual bool isSubmerged(const MWWorld::ConstPtr &object) const; virtual bool isSwimming(const MWWorld::ConstPtr &object) const; virtual bool isUnderwater(const MWWorld::CellStore* cell, const osg::Vec3f &pos) const; + virtual bool isUnderwater(const MWWorld::ConstPtr &object, const float heightRatio) const; virtual bool isWading(const MWWorld::ConstPtr &object) const; virtual bool isWaterWalkingCastableOnTarget(const MWWorld::ConstPtr &target) const; virtual bool isOnGround(const MWWorld::Ptr &ptr) const; From b657517bea48bd5f3ab20ad6c4f1445051d39709 Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Thu, 11 Aug 2016 14:18:57 +0200 Subject: [PATCH 03/51] use c++11 and see what happens --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b4e9ad4b..1907cf57e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -343,7 +343,7 @@ endif() # CXX Compiler settings if (CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wundef -Wno-unused-parameter -std=c++98 -pedantic -Wno-long-long") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wundef -Wno-unused-parameter -std=c++11 -pedantic -Wno-long-long") if (CMAKE_CXX_COMPILER_ID STREQUAL Clang AND NOT APPLE) if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 3.6 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 3.6) From dbc29854b2a0f9305e562fc4ae8347d548828176 Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Sat, 13 Aug 2016 13:37:38 +0200 Subject: [PATCH 04/51] try to fix enums --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1907cf57e..d36595915 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -344,6 +344,7 @@ endif() # CXX Compiler settings if (CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wundef -Wno-unused-parameter -std=c++11 -pedantic -Wno-long-long") + add_definitions( -DBOOST_NO_CXX11_SCOPED_ENUMS=ON ) if (CMAKE_CXX_COMPILER_ID STREQUAL Clang AND NOT APPLE) if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 3.6 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 3.6) From b6ee76b77b2a7b98925147c96dfb9a2ea49059a2 Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Sat, 13 Aug 2016 15:11:46 +0200 Subject: [PATCH 05/51] Switch to latest Qt5 version which is C++11-compatible --- CI/before_script.osx.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/CI/before_script.osx.sh b/CI/before_script.osx.sh index bec26caf1..a0dd1377a 100755 --- a/CI/before_script.osx.sh +++ b/CI/before_script.osx.sh @@ -5,7 +5,6 @@ export CC=clang DEPENDENCIES_ROOT="/private/tmp/openmw-deps/openmw-deps" QT_PATH=`brew --prefix $macos_qt_formula` - mkdir build cd build From 433129e72889399fa5201e5104c6459c297b8660 Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Sat, 13 Aug 2016 15:53:34 +0200 Subject: [PATCH 06/51] only bundle with Qt5, for now --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d36595915..e0de38330 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -712,7 +712,7 @@ if (WIN32) endif() # Apple bundling -if (APPLE) +if (APPLE AND DESIRED_QT_VERSION MATCHES 5) get_property(QT_COCOA_PLUGIN_PATH TARGET Qt5::QCocoaIntegrationPlugin PROPERTY LOCATION_RELEASE) get_filename_component(QT_COCOA_PLUGIN_DIR "${QT_COCOA_PLUGIN_PATH}" DIRECTORY) get_filename_component(QT_COCOA_PLUGIN_GROUP "${QT_COCOA_PLUGIN_DIR}" NAME) From 5a65d6e18d298dfc816da7e404e0694e970c5bb3 Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Sat, 13 Aug 2016 16:15:25 +0200 Subject: [PATCH 07/51] fix std::move --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e0de38330..9d8b32e75 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -344,7 +344,7 @@ endif() # CXX Compiler settings if (CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wundef -Wno-unused-parameter -std=c++11 -pedantic -Wno-long-long") - add_definitions( -DBOOST_NO_CXX11_SCOPED_ENUMS=ON ) + add_definitions( -DBOOST_NO_CXX11_SCOPED_ENUMS=ON -DBOOST_NO_CXX11_RVALUE_REFERENCES=ON ) if (CMAKE_CXX_COMPILER_ID STREQUAL Clang AND NOT APPLE) if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 3.6 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 3.6) From cb26f52032beae97d9623b780abec79ecc9d8cdc Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Sat, 13 Aug 2016 16:21:44 +0200 Subject: [PATCH 08/51] matching ifs --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d8b32e75..5406670d2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -797,7 +797,7 @@ if (APPLE AND DESIRED_QT_VERSION MATCHES 5) fixup_bundle(\"${INSTALLED_OPENCS_APP}\" \"${OPENCS_PLUGINS}\" \"\") " COMPONENT Runtime) include(CPack) -endif (APPLE) +endif (APPLE AND DESIRED_QT_VERSION MATCHES 5) # Doxygen Target -- simply run 'make doc' or 'make doc_pages' # output directory for 'make doc' is "${OpenMW_BINARY_DIR}/docs/Doxygen" From 26c023efe2b7d90b1f2b4f85f3dcd71d10c17391 Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Sat, 13 Aug 2016 16:29:49 +0200 Subject: [PATCH 09/51] stdlib to libc++ --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5406670d2..85e204299 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -343,7 +343,7 @@ endif() # CXX Compiler settings if (CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wundef -Wno-unused-parameter -std=c++11 -pedantic -Wno-long-long") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wundef -Wno-unused-parameter -std=c++11 -stdlib=libc++ -pedantic -Wno-long-long") add_definitions( -DBOOST_NO_CXX11_SCOPED_ENUMS=ON -DBOOST_NO_CXX11_RVALUE_REFERENCES=ON ) if (CMAKE_CXX_COMPILER_ID STREQUAL Clang AND NOT APPLE) From 5fa2f464997dc79a580c879cbc0449bb8fcd8a15 Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Sat, 13 Aug 2016 16:39:08 +0200 Subject: [PATCH 10/51] only set libc++ for APPLE --- CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 85e204299..614c0d61f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -343,8 +343,12 @@ endif() # CXX Compiler settings if (CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wundef -Wno-unused-parameter -std=c++11 -stdlib=libc++ -pedantic -Wno-long-long") - add_definitions( -DBOOST_NO_CXX11_SCOPED_ENUMS=ON -DBOOST_NO_CXX11_RVALUE_REFERENCES=ON ) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wundef -Wno-unused-parameter -std=c++11 -pedantic -Wno-long-long") + add_definitions( -DBOOST_NO_CXX11_SCOPED_ENUMS=ON ) + + if (APPLE) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") + endif() if (CMAKE_CXX_COMPILER_ID STREQUAL Clang AND NOT APPLE) if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 3.6 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 3.6) From 231908d9cfcf962194d29dec94fd8b8e22f0ba68 Mon Sep 17 00:00:00 2001 From: Nikolay Kasyanov Date: Sat, 17 Sep 2016 13:01:04 +0200 Subject: [PATCH 11/51] [OS X, CI] Use dependencies build against libc++ --- CI/before_install.osx.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CI/before_install.osx.sh b/CI/before_install.osx.sh index d7ef405bb..1035cbd22 100755 --- a/CI/before_install.osx.sh +++ b/CI/before_install.osx.sh @@ -6,5 +6,5 @@ brew outdated cmake || brew upgrade cmake brew outdated pkgconfig || brew upgrade pkgconfig brew install $macos_qt_formula -curl https://downloads.openmw.org/osx/dependencies/openmw-deps-c79172d.zip -o ~/openmw-deps.zip +curl http://downloads.openmw.org/osx/dependencies/openmw-deps-c++11.zip -o ~/openmw-deps.zip unzip ~/openmw-deps.zip -d /private/tmp/openmw-deps > /dev/null From 4138723bbfe7f9c5d03a5030d439a49d15837392 Mon Sep 17 00:00:00 2001 From: Nikolay Kasyanov Date: Sat, 17 Sep 2016 18:52:58 +0200 Subject: [PATCH 12/51] [OS X] Add libc++ to linker flags --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 614c0d61f..7ea3dde08 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -348,6 +348,7 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang) if (APPLE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++") endif() if (CMAKE_CXX_COMPILER_ID STREQUAL Clang AND NOT APPLE) From 6260e1585216e25a945edc89c8182b68e0b43036 Mon Sep 17 00:00:00 2001 From: Nikolay Kasyanov Date: Sat, 29 Oct 2016 18:25:59 +0200 Subject: [PATCH 13/51] [OS X] Temporarily disable OpenCS build on CI --- CI/before_script.osx.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/CI/before_script.osx.sh b/CI/before_script.osx.sh index a0dd1377a..e5ec8983b 100755 --- a/CI/before_script.osx.sh +++ b/CI/before_script.osx.sh @@ -17,5 +17,6 @@ cmake \ -D DESIRED_QT_VERSION=5 \ -D BUILD_ESMTOOL=FALSE \ -D BUILD_MYGUI_PLUGIN=FALSE \ +-D BUILD_OPENCS=FALSE \ -G"Unix Makefiles" \ .. From c16506d07cdac1d5ede912a159bfe93809ada36e Mon Sep 17 00:00:00 2001 From: Nikolay Kasyanov Date: Mon, 31 Oct 2016 17:09:29 +0100 Subject: [PATCH 14/51] [OS X, CI] Use Xcode 8/macOS 10.12 SDK --- .travis.yml | 2 +- CI/before_script.osx.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index c3f1cdfb6..892ca2ce1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ os: - linux - osx -osx_image: xcode8.2 +osx_image: xcode8 language: cpp sudo: required dist: trusty diff --git a/CI/before_script.osx.sh b/CI/before_script.osx.sh index e5ec8983b..08fbe76d6 100755 --- a/CI/before_script.osx.sh +++ b/CI/before_script.osx.sh @@ -10,9 +10,9 @@ cd build cmake \ -D CMAKE_PREFIX_PATH="$DEPENDENCIES_ROOT;$QT_PATH" \ --D CMAKE_OSX_DEPLOYMENT_TARGET="10.8" \ +-D CMAKE_OSX_DEPLOYMENT_TARGET="10.9" \ -D CMAKE_OSX_SYSROOT="macosx10.12" \ --D CMAKE_BUILD_TYPE=Release \ +-D CMAKE_BUILD_TYPE=Debug \ -D OPENMW_OSX_DEPLOYMENT=TRUE \ -D DESIRED_QT_VERSION=5 \ -D BUILD_ESMTOOL=FALSE \ From 27a5c06f04e2866443e962f1b47fba7f32030be4 Mon Sep 17 00:00:00 2001 From: Nikolay Kasyanov Date: Mon, 31 Oct 2016 18:52:29 +0100 Subject: [PATCH 15/51] [OS X, CI] Disable packaging --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 892ca2ce1..5695494c2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -63,7 +63,7 @@ before_script: ./CI/before_script.${TRAVIS_OS_NAME}.sh script: - cd ./build - if [ "$COVERITY_SCAN_BRANCH" != 1 ]; then ${ANALYZE}make -j3; fi - - if [ "$COVERITY_SCAN_BRANCH" != 1 ] && [ "${TRAVIS_OS_NAME}" = "osx" ]; then make package; fi + - if [ "$COVERITY_SCAN_BRANCH" != 1 ] && [ "${TRAVIS_OS_NAME}" = "osx" ]; then make; fi - if [ "$COVERITY_SCAN_BRANCH" != 1 ] && [ "${TRAVIS_OS_NAME}" = "linux" ]; then ./openmw_test_suite; fi - if [ "$COVERITY_SCAN_BRANCH" != 1 ] && [ "${TRAVIS_OS_NAME}" = "linux" ]; then cd .. && ./CI/check_tabs.sh; fi - cd "${TRAVIS_BUILD_DIR}" From 38a2de3c51edd808e5a3acba9e94c8ed11d227dd Mon Sep 17 00:00:00 2001 From: Ewan Higgs Date: Fri, 28 Apr 2017 17:30:26 +0200 Subject: [PATCH 16/51] convert std::autor_ptr to std::unique_ptr, originally by Ewan Higgs and updated by Bret Curtis --- apps/opencs/editor.hpp | 2 +- apps/opencs/model/doc/document.cpp | 4 ++-- apps/opencs/model/doc/document.hpp | 2 +- apps/opencs/model/tools/mergeoperation.cpp | 4 ++-- apps/opencs/model/tools/mergeoperation.hpp | 2 +- apps/opencs/model/tools/mergestate.hpp | 2 +- apps/opencs/model/tools/tools.cpp | 4 ++-- apps/opencs/model/tools/tools.hpp | 2 +- apps/opencs/model/world/commanddispatcher.cpp | 4 ++-- apps/opencs/model/world/refidcollection.cpp | 2 +- apps/opencs/model/world/refiddata.cpp | 2 +- apps/opencs/view/render/cell.cpp | 2 +- apps/opencs/view/render/cell.hpp | 12 ++++++------ apps/opencs/view/render/instancemode.cpp | 4 ++-- apps/opencs/view/render/pagedworldspacewidget.cpp | 4 ++-- .../opencs/view/render/unpagedworldspacewidget.hpp | 2 +- apps/opencs/view/tools/merge.cpp | 4 ++-- apps/opencs/view/world/creator.hpp | 2 +- apps/opencs/view/world/dialoguesubview.cpp | 2 +- apps/opencs/view/world/dialoguesubview.hpp | 2 +- apps/opencs/view/world/genericcreator.cpp | 6 +++--- apps/opencs/view/world/genericcreator.hpp | 2 +- apps/openmw/engine.hpp | 4 ++-- apps/openmw/main.cpp | 2 +- apps/openmw/mwclass/container.cpp | 4 ++-- apps/openmw/mwclass/creature.cpp | 4 ++-- apps/openmw/mwclass/creaturelevlist.cpp | 2 +- apps/openmw/mwclass/door.cpp | 2 +- apps/openmw/mwclass/npc.cpp | 4 ++-- apps/openmw/mwgui/alchemywindow.hpp | 4 +++- apps/openmw/mwgui/inventorywindow.hpp | 10 +++------- apps/openmw/mwgui/itemchargeview.hpp | 2 +- apps/openmw/mwgui/loadingscreen.hpp | 2 +- apps/openmw/mwgui/mapwindow.hpp | 4 ++-- apps/openmw/mwgui/race.hpp | 5 +++-- apps/openmw/mwgui/savegamedialog.hpp | 2 +- apps/openmw/mwgui/spellview.hpp | 2 +- apps/openmw/mwgui/videowidget.hpp | 4 ++-- apps/openmw/mwgui/windowmanagerimp.hpp | 2 +- apps/openmw/mwmechanics/actor.hpp | 2 +- apps/openmw/mwmechanics/aiactivate.cpp | 2 +- apps/openmw/mwmechanics/aicombat.cpp | 2 +- apps/openmw/mwmechanics/aiescort.cpp | 2 +- apps/openmw/mwmechanics/aifollow.cpp | 2 +- apps/openmw/mwmechanics/aipursue.cpp | 2 +- apps/openmw/mwmechanics/aisequence.cpp | 2 +- apps/openmw/mwmechanics/aitravel.cpp | 2 +- apps/openmw/mwmechanics/aiwander.cpp | 2 +- apps/openmw/mwphysics/actor.cpp | 2 +- apps/openmw/mwphysics/actor.hpp | 4 ++-- apps/openmw/mwphysics/physicssystem.cpp | 2 +- apps/openmw/mwphysics/physicssystem.hpp | 8 ++++---- apps/openmw/mwrender/characterpreview.cpp | 4 ++-- apps/openmw/mwrender/localmap.cpp | 4 ++-- apps/openmw/mwrender/renderingmanager.hpp | 14 +++++++------- apps/openmw/mwrender/sky.hpp | 6 +++--- apps/openmw/mwrender/terrainstorage.hpp | 2 +- apps/openmw/mwrender/water.hpp | 2 +- apps/openmw/mwsound/ffmpeg_decoder.cpp | 1 - apps/openmw/mwsound/openal_output.cpp | 2 +- apps/openmw/mwsound/openal_output.hpp | 2 +- apps/openmw/mwsound/soundmanagerimp.hpp | 6 ++---- apps/openmw/mwworld/scene.hpp | 2 +- components/compiler/lineparser.cpp | 2 +- components/esm/aisequence.cpp | 14 +++++++------- components/myguiplatform/myguidatamanager.cpp | 2 +- components/nifbullet/bulletnifloader.cpp | 2 +- components/resource/resourcesystem.cpp | 2 -- components/resource/resourcesystem.hpp | 8 ++++---- components/resource/scenemanager.hpp | 2 +- components/sceneutil/skeleton.hpp | 2 +- components/terrain/world.hpp | 4 ++-- extern/osg-ffmpeg-videoplayer/audiodecoder.hpp | 2 +- extern/osg-ffmpeg-videoplayer/videoplayer.hpp | 2 +- extern/osg-ffmpeg-videoplayer/videostate.hpp | 4 ++-- 75 files changed, 125 insertions(+), 131 deletions(-) diff --git a/apps/opencs/editor.hpp b/apps/opencs/editor.hpp index b088e9a44..ff670ba1b 100644 --- a/apps/opencs/editor.hpp +++ b/apps/opencs/editor.hpp @@ -47,7 +47,7 @@ namespace CS Q_OBJECT // FIXME: should be moved to document, so we can have different resources for each opened project - std::auto_ptr mVFS; + std::unique_ptr mVFS; Files::ConfigurationManager mCfgMgr; CSMPrefs::State mSettingsState; diff --git a/apps/opencs/model/doc/document.cpp b/apps/opencs/model/doc/document.cpp index 87fbccb3f..ea32a8457 100644 --- a/apps/opencs/model/doc/document.cpp +++ b/apps/opencs/model/doc/document.cpp @@ -415,9 +415,9 @@ void CSMDoc::Document::runSearch (const CSMWorld::UniversalId& searchId, const C emit stateChanged (getState(), this); } -void CSMDoc::Document::runMerge (std::auto_ptr target) +void CSMDoc::Document::runMerge (std::unique_ptr target) { - mTools.runMerge (target); + mTools.runMerge (std::move(target)); emit stateChanged (getState(), this); } diff --git a/apps/opencs/model/doc/document.hpp b/apps/opencs/model/doc/document.hpp index 41640f66d..8a9c49a09 100644 --- a/apps/opencs/model/doc/document.hpp +++ b/apps/opencs/model/doc/document.hpp @@ -137,7 +137,7 @@ namespace CSMDoc void runSearch (const CSMWorld::UniversalId& searchId, const CSMTools::Search& search); - void runMerge (std::auto_ptr target); + void runMerge (std::unique_ptr target); void abortOperation (int type); diff --git a/apps/opencs/model/tools/mergeoperation.cpp b/apps/opencs/model/tools/mergeoperation.cpp index 907d742ed..9b595046a 100644 --- a/apps/opencs/model/tools/mergeoperation.cpp +++ b/apps/opencs/model/tools/mergeoperation.cpp @@ -45,9 +45,9 @@ CSMTools::MergeOperation::MergeOperation (CSMDoc::Document& document, ToUTF8::Fr appendStage (new FinishMergedDocumentStage (mState, encoding)); } -void CSMTools::MergeOperation::setTarget (std::auto_ptr document) +void CSMTools::MergeOperation::setTarget (std::unique_ptr document) { - mState.mTarget = document; + mState.mTarget = std::move(document); } void CSMTools::MergeOperation::operationDone() diff --git a/apps/opencs/model/tools/mergeoperation.hpp b/apps/opencs/model/tools/mergeoperation.hpp index bdaeb2ccd..733fc8eba 100644 --- a/apps/opencs/model/tools/mergeoperation.hpp +++ b/apps/opencs/model/tools/mergeoperation.hpp @@ -27,7 +27,7 @@ namespace CSMTools MergeOperation (CSMDoc::Document& document, ToUTF8::FromType encoding); /// \attention Do not call this function while a merge is running. - void setTarget (std::auto_ptr document); + void setTarget (std::unique_ptr document); protected slots: diff --git a/apps/opencs/model/tools/mergestate.hpp b/apps/opencs/model/tools/mergestate.hpp index 29e1bbda7..96e6752e2 100644 --- a/apps/opencs/model/tools/mergestate.hpp +++ b/apps/opencs/model/tools/mergestate.hpp @@ -12,7 +12,7 @@ namespace CSMTools { struct MergeState { - std::auto_ptr mTarget; + std::unique_ptr mTarget; CSMDoc::Document& mSource; bool mCompleted; std::map, int> mTextureIndices; // (texture, content file) -> new texture diff --git a/apps/opencs/model/tools/tools.cpp b/apps/opencs/model/tools/tools.cpp index f538a716e..3b2c80263 100644 --- a/apps/opencs/model/tools/tools.cpp +++ b/apps/opencs/model/tools/tools.cpp @@ -216,7 +216,7 @@ void CSMTools::Tools::runSearch (const CSMWorld::UniversalId& searchId, const Se mSearch.start(); } -void CSMTools::Tools::runMerge (std::auto_ptr target) +void CSMTools::Tools::runMerge (std::unique_ptr target) { // not setting an active report, because merge does not produce messages @@ -230,7 +230,7 @@ void CSMTools::Tools::runMerge (std::auto_ptr target) target->flagAsDirty(); - mMergeOperation->setTarget (target); + mMergeOperation->setTarget (std::move(target)); mMerge.start(); } diff --git a/apps/opencs/model/tools/tools.hpp b/apps/opencs/model/tools/tools.hpp index e16a3854c..f544c8312 100644 --- a/apps/opencs/model/tools/tools.hpp +++ b/apps/opencs/model/tools/tools.hpp @@ -77,7 +77,7 @@ namespace CSMTools void runSearch (const CSMWorld::UniversalId& searchId, const Search& search); - void runMerge (std::auto_ptr target); + void runMerge (std::unique_ptr target); void abortOperation (int type); ///< \attention The operation is not aborted immediately. diff --git a/apps/opencs/model/world/commanddispatcher.cpp b/apps/opencs/model/world/commanddispatcher.cpp index ffbaa3dec..5d6a35cc5 100644 --- a/apps/opencs/model/world/commanddispatcher.cpp +++ b/apps/opencs/model/world/commanddispatcher.cpp @@ -138,7 +138,7 @@ void CSMWorld::CommandDispatcher::executeModify (QAbstractItemModel *model, cons if (mLocked) return; - std::auto_ptr modifyCell; + std::unique_ptr modifyCell; int columnId = model->data (index, ColumnBase::Role_ColumnId).toInt(); @@ -167,7 +167,7 @@ void CSMWorld::CommandDispatcher::executeModify (QAbstractItemModel *model, cons } } - std::auto_ptr modifyData ( + std::unique_ptr modifyData ( new CSMWorld::ModifyCommand (*model, index, new_)); if (modifyCell.get()) diff --git a/apps/opencs/model/world/refidcollection.cpp b/apps/opencs/model/world/refidcollection.cpp index c0ce575b7..31dae256e 100644 --- a/apps/opencs/model/world/refidcollection.cpp +++ b/apps/opencs/model/world/refidcollection.cpp @@ -808,7 +808,7 @@ void CSMWorld::RefIdCollection::cloneRecord(const std::string& origin, const std::string& destination, const CSMWorld::UniversalId::Type type) { - std::auto_ptr newRecord(mData.getRecord(mData.searchId(origin)).modifiedCopy()); + std::unique_ptr newRecord(mData.getRecord(mData.searchId(origin)).modifiedCopy()); mAdapters.find(type)->second->setId(*newRecord, destination); mData.insertRecord(*newRecord, type, destination); } diff --git a/apps/opencs/model/world/refiddata.cpp b/apps/opencs/model/world/refiddata.cpp index 2d8c9ac10..e2ffbcca6 100644 --- a/apps/opencs/model/world/refiddata.cpp +++ b/apps/opencs/model/world/refiddata.cpp @@ -389,7 +389,7 @@ void CSMWorld::RefIdData::copyTo (int index, RefIdData& target) const std::string id = source->getId (localIndex.first); - std::auto_ptr newRecord (source->getRecord (localIndex.first).modifiedCopy()); + std::unique_ptr newRecord (source->getRecord (localIndex.first).modifiedCopy()); target.insertRecord (*newRecord, localIndex.second, id); } diff --git a/apps/opencs/view/render/cell.cpp b/apps/opencs/view/render/cell.cpp index 7cf542835..48156359f 100644 --- a/apps/opencs/view/render/cell.cpp +++ b/apps/opencs/view/render/cell.cpp @@ -62,7 +62,7 @@ bool CSVRender::Cell::addObjects (int start, int end) { std::string id = Misc::StringUtils::lowerCase (collection.getRecord (i).get().mId); - std::auto_ptr object (new Object (mData, mCellNode, id, false)); + std::unique_ptr object (new Object (mData, mCellNode, id, false)); if (mSubModeElementMask & Mask_Reference) object->setSubMode (mSubMode); diff --git a/apps/opencs/view/render/cell.hpp b/apps/opencs/view/render/cell.hpp index e8e0d2c63..ca82dd580 100644 --- a/apps/opencs/view/render/cell.hpp +++ b/apps/opencs/view/render/cell.hpp @@ -47,13 +47,13 @@ namespace CSVRender std::string mId; osg::ref_ptr mCellNode; std::map mObjects; - std::auto_ptr mTerrain; + std::unique_ptr mTerrain; CSMWorld::CellCoordinates mCoordinates; - std::auto_ptr mCellArrows[4]; - std::auto_ptr mCellMarker; - std::auto_ptr mCellBorder; - std::auto_ptr mCellWater; - std::auto_ptr mPathgrid; + std::unique_ptr mCellArrows[4]; + std::unique_ptr mCellMarker; + std::unique_ptr mCellBorder; + std::unique_ptr mCellWater; + std::unique_ptr mPathgrid; bool mDeleted; int mSubMode; unsigned int mSubModeElementMask; diff --git a/apps/opencs/view/render/instancemode.cpp b/apps/opencs/view/render/instancemode.cpp index 3373daa4a..fae609af5 100644 --- a/apps/opencs/view/render/instancemode.cpp +++ b/apps/opencs/view/render/instancemode.cpp @@ -559,7 +559,7 @@ void CSVRender::InstanceMode::dropEvent (QDropEvent* event) if (mode=="Create cell and insert") { - std::auto_ptr createCommand ( + std::unique_ptr createCommand ( new CSMWorld::CreateCommand (cellTable, cellId)); int parentIndex = cellTable.findColumnIndex (CSMWorld::Columns::ColumnId_Cell); @@ -610,7 +610,7 @@ void CSVRender::InstanceMode::dropEvent (QDropEvent* event) if (mime->isReferencable (iter->getType())) { // create reference - std::auto_ptr createCommand ( + std::unique_ptr createCommand ( new CSMWorld::CreateCommand ( referencesTable, document.getData().getReferences().getNewId())); diff --git a/apps/opencs/view/render/pagedworldspacewidget.cpp b/apps/opencs/view/render/pagedworldspacewidget.cpp index e855f7e41..b5497558a 100644 --- a/apps/opencs/view/render/pagedworldspacewidget.cpp +++ b/apps/opencs/view/render/pagedworldspacewidget.cpp @@ -54,7 +54,7 @@ bool CSVRender::PagedWorldspaceWidget::adjustCells() { modified = true; - std::auto_ptr cell (new Cell (mDocument.getData(), mRootNode, + std::unique_ptr cell (new Cell (mDocument.getData(), mRootNode, iter->first.getId (mWorldspace), deleted)); delete iter->second; @@ -378,7 +378,7 @@ void CSVRender::PagedWorldspaceWidget::addCellToScene ( bool deleted = index==-1 || cells.getRecord (index).mState==CSMWorld::RecordBase::State_Deleted; - std::auto_ptr cell ( + std::unique_ptr cell ( new Cell (mDocument.getData(), mRootNode, coordinates.getId (mWorldspace), deleted)); EditMode *editMode = getEditMode(); diff --git a/apps/opencs/view/render/unpagedworldspacewidget.hpp b/apps/opencs/view/render/unpagedworldspacewidget.hpp index 57e8d1a19..5283b3a97 100644 --- a/apps/opencs/view/render/unpagedworldspacewidget.hpp +++ b/apps/opencs/view/render/unpagedworldspacewidget.hpp @@ -29,7 +29,7 @@ namespace CSVRender std::string mCellId; CSMWorld::IdTable *mCellsModel; CSMWorld::IdTable *mReferenceablesModel; - std::auto_ptr mCell; + std::unique_ptr mCell; void update(); diff --git a/apps/opencs/view/tools/merge.cpp b/apps/opencs/view/tools/merge.cpp index 566a5ee06..c49044ccd 100644 --- a/apps/opencs/view/tools/merge.cpp +++ b/apps/opencs/view/tools/merge.cpp @@ -127,10 +127,10 @@ void CSVTools::Merge::accept() { std::vector< boost::filesystem::path > files (1, mAdjuster->getPath()); - std::auto_ptr target ( + std::unique_ptr target ( mDocumentManager.makeDocument (files, files[0], true)); - mDocument->runMerge (target); + mDocument->runMerge (std::move(target)); hide(); } diff --git a/apps/opencs/view/world/creator.hpp b/apps/opencs/view/world/creator.hpp index b76348199..320bbf6ae 100644 --- a/apps/opencs/view/world/creator.hpp +++ b/apps/opencs/view/world/creator.hpp @@ -91,7 +91,7 @@ namespace CSVWorld Creator *CreatorFactory::makeCreator (CSMDoc::Document& document, const CSMWorld::UniversalId& id) const { - std::auto_ptr creator (new CreatorT (document.getData(), document.getUndoStack(), id)); + std::unique_ptr creator (new CreatorT (document.getData(), document.getUndoStack(), id)); creator->setScope (scope); diff --git a/apps/opencs/view/world/dialoguesubview.cpp b/apps/opencs/view/world/dialoguesubview.cpp index 87d5b3d7f..7b198056c 100644 --- a/apps/opencs/view/world/dialoguesubview.cpp +++ b/apps/opencs/view/world/dialoguesubview.cpp @@ -120,7 +120,7 @@ mIndex(index) CSVWorld::DialogueDelegateDispatcherProxy::DialogueDelegateDispatcherProxy(QWidget* editor, CSMWorld::ColumnBase::Display display) : mEditor(editor), mDisplay(display), -mIndexWrapper(NULL) +mIndexWrapper(nullptr) { } diff --git a/apps/opencs/view/world/dialoguesubview.hpp b/apps/opencs/view/world/dialoguesubview.hpp index bd7116ba2..cbcb9b210 100644 --- a/apps/opencs/view/world/dialoguesubview.hpp +++ b/apps/opencs/view/world/dialoguesubview.hpp @@ -84,7 +84,7 @@ namespace CSVWorld CSMWorld::ColumnBase::Display mDisplay; - std::auto_ptr mIndexWrapper; + std::unique_ptr mIndexWrapper; public: DialogueDelegateDispatcherProxy(QWidget* editor, diff --git a/apps/opencs/view/world/genericcreator.cpp b/apps/opencs/view/world/genericcreator.cpp index dd2bd82df..bf4c4967f 100644 --- a/apps/opencs/view/world/genericcreator.cpp +++ b/apps/opencs/view/world/genericcreator.cpp @@ -63,7 +63,7 @@ std::string CSVWorld::GenericCreator::getIdValidatorResult() const void CSVWorld::GenericCreator::configureCreateCommand (CSMWorld::CreateCommand& command) const {} -void CSVWorld::GenericCreator::pushCommand (std::auto_ptr command, +void CSVWorld::GenericCreator::pushCommand (std::unique_ptr command, const std::string& id) { mUndoStack.push (command.release()); @@ -224,7 +224,7 @@ void CSVWorld::GenericCreator::create() { std::string id = getId(); - std::auto_ptr command; + std::unique_ptr command; if (mCloneMode) { @@ -239,7 +239,7 @@ void CSVWorld::GenericCreator::create() } configureCreateCommand (*command); - pushCommand (command, id); + pushCommand (std::move(command), id); emit done(); emit requestFocus(id); diff --git a/apps/opencs/view/world/genericcreator.hpp b/apps/opencs/view/world/genericcreator.hpp index f3fc82ec1..60d487bc1 100644 --- a/apps/opencs/view/world/genericcreator.hpp +++ b/apps/opencs/view/world/genericcreator.hpp @@ -71,7 +71,7 @@ namespace CSVWorld /// Allow subclasses to wrap the create command together with additional commands /// into a macro. - virtual void pushCommand (std::auto_ptr command, + virtual void pushCommand (std::unique_ptr command, const std::string& id); CSMWorld::Data& getData() const; diff --git a/apps/openmw/engine.hpp b/apps/openmw/engine.hpp index d06ca594d..29419a4c2 100644 --- a/apps/openmw/engine.hpp +++ b/apps/openmw/engine.hpp @@ -71,8 +71,8 @@ namespace OMW class Engine { SDL_Window* mWindow; - std::auto_ptr mVFS; - std::auto_ptr mResourceSystem; + std::unique_ptr mVFS; + std::unique_ptr mResourceSystem; osg::ref_ptr mWorkQueue; MWBase::Environment mEnvironment; ToUTF8::FromType mEncoding; diff --git a/apps/openmw/main.cpp b/apps/openmw/main.cpp index d0abdad52..420772910 100644 --- a/apps/openmw/main.cpp +++ b/apps/openmw/main.cpp @@ -310,7 +310,7 @@ int main(int argc, char**argv) boost::filesystem::ofstream logfile; - std::auto_ptr engine; + std::unique_ptr engine; int ret = 0; try diff --git a/apps/openmw/mwclass/container.cpp b/apps/openmw/mwclass/container.cpp index fe2899aff..66074306e 100644 --- a/apps/openmw/mwclass/container.cpp +++ b/apps/openmw/mwclass/container.cpp @@ -52,7 +52,7 @@ namespace MWClass { if (!ptr.getRefData().getCustomData()) { - std::auto_ptr data (new ContainerCustomData); + std::unique_ptr data (new ContainerCustomData); MWWorld::LiveCellRef *ref = ptr.get(); @@ -308,7 +308,7 @@ namespace MWClass if (!ptr.getRefData().getCustomData()) { // Create a CustomData, but don't fill it from ESM records (not needed) - std::auto_ptr data (new ContainerCustomData); + std::unique_ptr data (new ContainerCustomData); ptr.getRefData().setCustomData (data.release()); } diff --git a/apps/openmw/mwclass/creature.cpp b/apps/openmw/mwclass/creature.cpp index 7c2e05c77..4513e428b 100644 --- a/apps/openmw/mwclass/creature.cpp +++ b/apps/openmw/mwclass/creature.cpp @@ -108,7 +108,7 @@ namespace MWClass { if (!ptr.getRefData().getCustomData()) { - std::auto_ptr data (new CreatureCustomData); + std::unique_ptr data (new CreatureCustomData); MWWorld::LiveCellRef *ref = ptr.get(); @@ -742,7 +742,7 @@ namespace MWClass if (!ptr.getRefData().getCustomData()) { // Create a CustomData, but don't fill it from ESM records (not needed) - std::auto_ptr data (new CreatureCustomData); + std::unique_ptr data (new CreatureCustomData); if (hasInventoryStore(ptr)) data->mContainerStore = new MWWorld::InventoryStore(); diff --git a/apps/openmw/mwclass/creaturelevlist.cpp b/apps/openmw/mwclass/creaturelevlist.cpp index 5941a09f5..95e52b41e 100644 --- a/apps/openmw/mwclass/creaturelevlist.cpp +++ b/apps/openmw/mwclass/creaturelevlist.cpp @@ -132,7 +132,7 @@ namespace MWClass { if (!ptr.getRefData().getCustomData()) { - std::auto_ptr data (new CreatureLevListCustomData); + std::unique_ptr data (new CreatureLevListCustomData); data->mSpawnActorId = -1; data->mSpawn = true; diff --git a/apps/openmw/mwclass/door.cpp b/apps/openmw/mwclass/door.cpp index bc3455c65..5f977174f 100644 --- a/apps/openmw/mwclass/door.cpp +++ b/apps/openmw/mwclass/door.cpp @@ -350,7 +350,7 @@ namespace MWClass { if (!ptr.getRefData().getCustomData()) { - std::auto_ptr data(new DoorCustomData); + std::unique_ptr data(new DoorCustomData); data->mDoorState = 0; ptr.getRefData().setCustomData(data.release()); diff --git a/apps/openmw/mwclass/npc.cpp b/apps/openmw/mwclass/npc.cpp index 855850dfd..277d1691b 100644 --- a/apps/openmw/mwclass/npc.cpp +++ b/apps/openmw/mwclass/npc.cpp @@ -303,7 +303,7 @@ namespace MWClass { if (!ptr.getRefData().getCustomData()) { - std::auto_ptr data(new NpcCustomData); + std::unique_ptr data(new NpcCustomData); MWWorld::LiveCellRef *ref = ptr.get(); @@ -1259,7 +1259,7 @@ namespace MWClass if (!ptr.getRefData().getCustomData()) { // Create a CustomData, but don't fill it from ESM records (not needed) - std::auto_ptr data (new NpcCustomData); + std::unique_ptr data (new NpcCustomData); ptr.getRefData().setCustomData (data.release()); } } diff --git a/apps/openmw/mwgui/alchemywindow.hpp b/apps/openmw/mwgui/alchemywindow.hpp index 69fff8c67..e1f48d4a3 100644 --- a/apps/openmw/mwgui/alchemywindow.hpp +++ b/apps/openmw/mwgui/alchemywindow.hpp @@ -3,6 +3,8 @@ #include +#include "../mwmechanics/alchemy.hpp" + #include "widgets.hpp" #include "windowbase.hpp" @@ -48,7 +50,7 @@ namespace MWGui void update(); - std::auto_ptr mAlchemy; + std::unique_ptr mAlchemy; std::vector mApparatus; std::vector mIngredients; diff --git a/apps/openmw/mwgui/inventorywindow.hpp b/apps/openmw/mwgui/inventorywindow.hpp index 11091c428..761464540 100644 --- a/apps/openmw/mwgui/inventorywindow.hpp +++ b/apps/openmw/mwgui/inventorywindow.hpp @@ -5,6 +5,7 @@ #include "mode.hpp" #include "../mwworld/ptr.hpp" +#include "../mwrender/characterpreview.hpp" namespace osg { @@ -16,11 +17,6 @@ namespace Resource class ResourceSystem; } -namespace MWRender -{ - class InventoryPreview; -} - namespace MWGui { namespace Widgets @@ -101,8 +97,8 @@ namespace MWGui int mLastXSize; int mLastYSize; - std::auto_ptr mPreviewTexture; - std::auto_ptr mPreview; + std::unique_ptr mPreviewTexture; + std::unique_ptr mPreview; bool mTrading; diff --git a/apps/openmw/mwgui/itemchargeview.hpp b/apps/openmw/mwgui/itemchargeview.hpp index 0988f655b..956272aec 100644 --- a/apps/openmw/mwgui/itemchargeview.hpp +++ b/apps/openmw/mwgui/itemchargeview.hpp @@ -69,7 +69,7 @@ namespace MWGui typedef std::vector Lines; Lines mLines; - std::auto_ptr mModel; + std::unique_ptr mModel; MyGUI::ScrollView* mScrollView; DisplayMode mDisplayMode; }; diff --git a/apps/openmw/mwgui/loadingscreen.hpp b/apps/openmw/mwgui/loadingscreen.hpp index 0b7edbc9e..100c17e11 100644 --- a/apps/openmw/mwgui/loadingscreen.hpp +++ b/apps/openmw/mwgui/loadingscreen.hpp @@ -76,7 +76,7 @@ namespace MWGui // TODO: add releaseGLObjects() for mTexture osg::ref_ptr mTexture; - std::auto_ptr mGuiTexture; + std::unique_ptr mGuiTexture; void changeWallpaper(); diff --git a/apps/openmw/mwgui/mapwindow.hpp b/apps/openmw/mwgui/mapwindow.hpp index 4e648c4b7..243b1160f 100644 --- a/apps/openmw/mwgui/mapwindow.hpp +++ b/apps/openmw/mwgui/mapwindow.hpp @@ -247,8 +247,8 @@ namespace MWGui void setGlobalMapMarkerTooltip(MyGUI::Widget* widget, int x, int y); MyGUI::ScrollView* mGlobalMap; - std::auto_ptr mGlobalMapTexture; - std::auto_ptr mGlobalMapOverlayTexture; + std::unique_ptr mGlobalMapTexture; + std::unique_ptr mGlobalMapOverlayTexture; MyGUI::ImageBox* mGlobalMapImage; MyGUI::ImageBox* mGlobalMapOverlay; MyGUI::ImageBox* mPlayerArrowLocal; diff --git a/apps/openmw/mwgui/race.hpp b/apps/openmw/mwgui/race.hpp index 42e758983..b762745cd 100644 --- a/apps/openmw/mwgui/race.hpp +++ b/apps/openmw/mwgui/race.hpp @@ -2,6 +2,7 @@ #define MWGUI_RACE_H #include "windowbase.hpp" +#include namespace MWGui @@ -115,8 +116,8 @@ namespace MWGui float mCurrentAngle; - std::auto_ptr mPreview; - std::auto_ptr mPreviewTexture; + std::unique_ptr mPreview; + std::unique_ptr mPreviewTexture; bool mPreviewDirty; }; diff --git a/apps/openmw/mwgui/savegamedialog.hpp b/apps/openmw/mwgui/savegamedialog.hpp index 6a9e59cc6..be0e47cab 100644 --- a/apps/openmw/mwgui/savegamedialog.hpp +++ b/apps/openmw/mwgui/savegamedialog.hpp @@ -48,7 +48,7 @@ namespace MWGui void fillSaveList(); - std::auto_ptr mScreenshotTexture; + std::unique_ptr mScreenshotTexture; MyGUI::ImageBox* mScreenshot; bool mSaving; diff --git a/apps/openmw/mwgui/spellview.hpp b/apps/openmw/mwgui/spellview.hpp index a4f8ddf39..7fea95cac 100644 --- a/apps/openmw/mwgui/spellview.hpp +++ b/apps/openmw/mwgui/spellview.hpp @@ -56,7 +56,7 @@ namespace MWGui private: MyGUI::ScrollView* mScrollView; - std::auto_ptr mModel; + std::unique_ptr mModel; /// tracks a row in the spell view struct LineInfo diff --git a/apps/openmw/mwgui/videowidget.hpp b/apps/openmw/mwgui/videowidget.hpp index 6b265628e..ac240e69d 100644 --- a/apps/openmw/mwgui/videowidget.hpp +++ b/apps/openmw/mwgui/videowidget.hpp @@ -51,8 +51,8 @@ namespace MWGui private: const VFS::Manager* mVFS; - std::auto_ptr mTexture; - std::auto_ptr mPlayer; + std::unique_ptr mTexture; + std::unique_ptr mPlayer; }; } diff --git a/apps/openmw/mwgui/windowmanagerimp.hpp b/apps/openmw/mwgui/windowmanagerimp.hpp index 787c88598..ea7b4c14c 100644 --- a/apps/openmw/mwgui/windowmanagerimp.hpp +++ b/apps/openmw/mwgui/windowmanagerimp.hpp @@ -397,7 +397,7 @@ namespace MWGui osgMyGUI::Platform* mGuiPlatform; osgViewer::Viewer* mViewer; - std::auto_ptr mFontLoader; + std::unique_ptr mFontLoader; bool mConsoleOnlyScripts; diff --git a/apps/openmw/mwmechanics/actor.hpp b/apps/openmw/mwmechanics/actor.hpp index 846af1467..b8e114ead 100644 --- a/apps/openmw/mwmechanics/actor.hpp +++ b/apps/openmw/mwmechanics/actor.hpp @@ -32,7 +32,7 @@ namespace MWMechanics AiState& getAiState(); private: - std::auto_ptr mCharacterController; + std::unique_ptr mCharacterController; AiState mAiState; }; diff --git a/apps/openmw/mwmechanics/aiactivate.cpp b/apps/openmw/mwmechanics/aiactivate.cpp index b1426a4c1..d38a1299f 100644 --- a/apps/openmw/mwmechanics/aiactivate.cpp +++ b/apps/openmw/mwmechanics/aiactivate.cpp @@ -55,7 +55,7 @@ namespace MWMechanics void AiActivate::writeState(ESM::AiSequence::AiSequence &sequence) const { - std::auto_ptr activate(new ESM::AiSequence::AiActivate()); + std::unique_ptr activate(new ESM::AiSequence::AiActivate()); activate->mTargetId = mObjectId; ESM::AiSequence::AiPackageContainer package; diff --git a/apps/openmw/mwmechanics/aicombat.cpp b/apps/openmw/mwmechanics/aicombat.cpp index d111eb127..a7a3d6ad7 100644 --- a/apps/openmw/mwmechanics/aicombat.cpp +++ b/apps/openmw/mwmechanics/aicombat.cpp @@ -479,7 +479,7 @@ namespace MWMechanics void AiCombat::writeState(ESM::AiSequence::AiSequence &sequence) const { - std::auto_ptr combat(new ESM::AiSequence::AiCombat()); + std::unique_ptr combat(new ESM::AiSequence::AiCombat()); combat->mTargetActorId = mTargetActorId; ESM::AiSequence::AiPackageContainer package; diff --git a/apps/openmw/mwmechanics/aiescort.cpp b/apps/openmw/mwmechanics/aiescort.cpp index 4c9b5fd4f..103ef32e1 100644 --- a/apps/openmw/mwmechanics/aiescort.cpp +++ b/apps/openmw/mwmechanics/aiescort.cpp @@ -126,7 +126,7 @@ namespace MWMechanics void AiEscort::writeState(ESM::AiSequence::AiSequence &sequence) const { - std::auto_ptr escort(new ESM::AiSequence::AiEscort()); + std::unique_ptr escort(new ESM::AiSequence::AiEscort()); escort->mData.mX = mX; escort->mData.mY = mY; escort->mData.mZ = mZ; diff --git a/apps/openmw/mwmechanics/aifollow.cpp b/apps/openmw/mwmechanics/aifollow.cpp index fd3014298..fe94246c4 100644 --- a/apps/openmw/mwmechanics/aifollow.cpp +++ b/apps/openmw/mwmechanics/aifollow.cpp @@ -188,7 +188,7 @@ bool AiFollow::isCommanded() const void AiFollow::writeState(ESM::AiSequence::AiSequence &sequence) const { - std::auto_ptr follow(new ESM::AiSequence::AiFollow()); + std::unique_ptr follow(new ESM::AiSequence::AiFollow()); follow->mData.mX = mX; follow->mData.mY = mY; follow->mData.mZ = mZ; diff --git a/apps/openmw/mwmechanics/aipursue.cpp b/apps/openmw/mwmechanics/aipursue.cpp index 2b218de03..f9884eb6d 100644 --- a/apps/openmw/mwmechanics/aipursue.cpp +++ b/apps/openmw/mwmechanics/aipursue.cpp @@ -73,7 +73,7 @@ MWWorld::Ptr AiPursue::getTarget() const void AiPursue::writeState(ESM::AiSequence::AiSequence &sequence) const { - std::auto_ptr pursue(new ESM::AiSequence::AiPursue()); + std::unique_ptr pursue(new ESM::AiSequence::AiPursue()); pursue->mTargetActorId = mTargetActorId; ESM::AiSequence::AiPackageContainer package; diff --git a/apps/openmw/mwmechanics/aisequence.cpp b/apps/openmw/mwmechanics/aisequence.cpp index 125805507..64347f161 100644 --- a/apps/openmw/mwmechanics/aisequence.cpp +++ b/apps/openmw/mwmechanics/aisequence.cpp @@ -412,7 +412,7 @@ void AiSequence::readState(const ESM::AiSequence::AiSequence &sequence) for (std::vector::const_iterator it = sequence.mPackages.begin(); it != sequence.mPackages.end(); ++it) { - std::auto_ptr package (NULL); + std::unique_ptr package (nullptr); switch (it->mType) { case ESM::AiSequence::Ai_Wander: diff --git a/apps/openmw/mwmechanics/aitravel.cpp b/apps/openmw/mwmechanics/aitravel.cpp index 7cef7aff1..36b96101f 100644 --- a/apps/openmw/mwmechanics/aitravel.cpp +++ b/apps/openmw/mwmechanics/aitravel.cpp @@ -79,7 +79,7 @@ namespace MWMechanics void AiTravel::writeState(ESM::AiSequence::AiSequence &sequence) const { - std::auto_ptr travel(new ESM::AiSequence::AiTravel()); + std::unique_ptr travel(new ESM::AiSequence::AiTravel()); travel->mData.mX = mX; travel->mData.mY = mY; travel->mData.mZ = mZ; diff --git a/apps/openmw/mwmechanics/aiwander.cpp b/apps/openmw/mwmechanics/aiwander.cpp index eba37d7a7..a992bc8d4 100644 --- a/apps/openmw/mwmechanics/aiwander.cpp +++ b/apps/openmw/mwmechanics/aiwander.cpp @@ -919,7 +919,7 @@ namespace MWMechanics else remainingDuration = mDuration; - std::auto_ptr wander(new ESM::AiSequence::AiWander()); + std::unique_ptr wander(new ESM::AiSequence::AiWander()); wander->mData.mDistance = mDistance; wander->mData.mDuration = mDuration; wander->mData.mTimeOfDay = mTimeOfDay; diff --git a/apps/openmw/mwphysics/actor.cpp b/apps/openmw/mwphysics/actor.cpp index 2730bf4f0..e5e36def8 100644 --- a/apps/openmw/mwphysics/actor.cpp +++ b/apps/openmw/mwphysics/actor.cpp @@ -18,7 +18,7 @@ namespace MWPhysics Actor::Actor(const MWWorld::Ptr& ptr, osg::ref_ptr shape, btCollisionWorld* world) : mCanWaterWalk(false), mWalkingOnWater(false) - , mCollisionObject(0), mForce(0.f, 0.f, 0.f), mOnGround(true), mOnSlope(false) + , mCollisionObject(nullptr), mForce(0.f, 0.f, 0.f), mOnGround(false), mOnSlope(false) , mInternalCollisionMode(true) , mExternalCollisionMode(true) , mCollisionWorld(world) diff --git a/apps/openmw/mwphysics/actor.hpp b/apps/openmw/mwphysics/actor.hpp index 88f7f5537..8ec94200f 100644 --- a/apps/openmw/mwphysics/actor.hpp +++ b/apps/openmw/mwphysics/actor.hpp @@ -162,10 +162,10 @@ namespace MWPhysics bool mRotationallyInvariant; - std::auto_ptr mShape; + std::unique_ptr mShape; btConvexShape* mConvexShape; - std::auto_ptr mCollisionObject; + std::unique_ptr mCollisionObject; osg::Vec3f mMeshTranslation; osg::Vec3f mHalfExtents; diff --git a/apps/openmw/mwphysics/physicssystem.cpp b/apps/openmw/mwphysics/physicssystem.cpp index d209d0d95..790ae2099 100644 --- a/apps/openmw/mwphysics/physicssystem.cpp +++ b/apps/openmw/mwphysics/physicssystem.cpp @@ -667,7 +667,7 @@ namespace MWPhysics } private: - std::auto_ptr mCollisionObject; + std::unique_ptr mCollisionObject; osg::ref_ptr mShapeInstance; std::map mRecIndexToNodePath; bool mSolid; diff --git a/apps/openmw/mwphysics/physicssystem.hpp b/apps/openmw/mwphysics/physicssystem.hpp index 5351d99dd..aaf55e2b6 100644 --- a/apps/openmw/mwphysics/physicssystem.hpp +++ b/apps/openmw/mwphysics/physicssystem.hpp @@ -181,7 +181,7 @@ namespace MWPhysics btCollisionDispatcher* mDispatcher; btCollisionWorld* mCollisionWorld; - std::auto_ptr mShapeManager; + std::unique_ptr mShapeManager; Resource::ResourceSystem* mResourceSystem; typedef std::map ObjectMap; @@ -213,10 +213,10 @@ namespace MWPhysics float mWaterHeight; bool mWaterEnabled; - std::auto_ptr mWaterCollisionObject; - std::auto_ptr mWaterCollisionShape; + std::unique_ptr mWaterCollisionObject; + std::unique_ptr mWaterCollisionShape; - std::auto_ptr mDebugDrawer; + std::unique_ptr mDebugDrawer; osg::ref_ptr mParentNode; diff --git a/apps/openmw/mwrender/characterpreview.cpp b/apps/openmw/mwrender/characterpreview.cpp index db778e88d..b0899f47e 100644 --- a/apps/openmw/mwrender/characterpreview.cpp +++ b/apps/openmw/mwrender/characterpreview.cpp @@ -111,7 +111,7 @@ namespace MWRender , mPosition(position) , mLookAt(lookAt) , mCharacter(character) - , mAnimation(NULL) + , mAnimation(nullptr) , mSizeX(sizeX) , mSizeY(sizeY) { @@ -188,7 +188,7 @@ namespace MWRender mParent->addChild(mCamera); - mCharacter.mCell = NULL; + mCharacter.mCell = nullptr; } CharacterPreview::~CharacterPreview () diff --git a/apps/openmw/mwrender/localmap.cpp b/apps/openmw/mwrender/localmap.cpp index 02bc5d01f..b78c4dcd2 100644 --- a/apps/openmw/mwrender/localmap.cpp +++ b/apps/openmw/mwrender/localmap.cpp @@ -109,7 +109,7 @@ void LocalMap::saveFogOfWar(MWWorld::CellStore* cell) if (segment.mFogOfWarImage && segment.mHasFogState) { - std::auto_ptr fog (new ESM::FogState()); + std::unique_ptr fog (new ESM::FogState()); fog->mFogTextures.push_back(ESM::FogTexture()); segment.saveFogOfWar(fog->mFogTextures.back()); @@ -126,7 +126,7 @@ void LocalMap::saveFogOfWar(MWWorld::CellStore* cell) const int segsX = static_cast(std::ceil(length.x() / mMapWorldSize)); const int segsY = static_cast(std::ceil(length.y() / mMapWorldSize)); - std::auto_ptr fog (new ESM::FogState()); + std::unique_ptr fog (new ESM::FogState()); fog->mBounds.mMinX = mBounds.xMin(); fog->mBounds.mMaxX = mBounds.xMax(); diff --git a/apps/openmw/mwrender/renderingmanager.hpp b/apps/openmw/mwrender/renderingmanager.hpp index 075357335..e575456d9 100644 --- a/apps/openmw/mwrender/renderingmanager.hpp +++ b/apps/openmw/mwrender/renderingmanager.hpp @@ -224,16 +224,16 @@ namespace MWRender osg::ref_ptr mSunLight; - std::auto_ptr mPathgrid; - std::auto_ptr mObjects; - std::auto_ptr mWater; - std::auto_ptr mTerrain; + std::unique_ptr mPathgrid; + std::unique_ptr mObjects; + std::unique_ptr mWater; + std::unique_ptr mTerrain; TerrainStorage* mTerrainStorage; - std::auto_ptr mSky; - std::auto_ptr mEffectManager; + std::unique_ptr mSky; + std::unique_ptr mEffectManager; osg::ref_ptr mPlayerAnimation; osg::ref_ptr mPlayerNode; - std::auto_ptr mCamera; + std::unique_ptr mCamera; osg::Vec3f mCurrentCameraPos; osg::ref_ptr mStateUpdater; diff --git a/apps/openmw/mwrender/sky.hpp b/apps/openmw/mwrender/sky.hpp index e047a9832..863ecc77d 100644 --- a/apps/openmw/mwrender/sky.hpp +++ b/apps/openmw/mwrender/sky.hpp @@ -189,9 +189,9 @@ namespace MWRender osg::ref_ptr mAtmosphereUpdater; - std::auto_ptr mSun; - std::auto_ptr mMasser; - std::auto_ptr mSecunda; + std::unique_ptr mSun; + std::unique_ptr mMasser; + std::unique_ptr mSecunda; osg::ref_ptr mRainNode; osg::ref_ptr mRainParticleSystem; diff --git a/apps/openmw/mwrender/terrainstorage.hpp b/apps/openmw/mwrender/terrainstorage.hpp index cf4011d45..6f716e752 100644 --- a/apps/openmw/mwrender/terrainstorage.hpp +++ b/apps/openmw/mwrender/terrainstorage.hpp @@ -29,7 +29,7 @@ namespace MWRender LandManager* getLandManager() const; private: - std::auto_ptr mLandManager; + std::unique_ptr mLandManager; Resource::ResourceSystem* mResourceSystem; }; diff --git a/apps/openmw/mwrender/water.hpp b/apps/openmw/mwrender/water.hpp index 29e78cf52..33b314c51 100644 --- a/apps/openmw/mwrender/water.hpp +++ b/apps/openmw/mwrender/water.hpp @@ -58,7 +58,7 @@ namespace MWRender const Fallback::Map* mFallback; osg::ref_ptr mIncrementalCompileOperation; - std::auto_ptr mSimulation; + std::unique_ptr mSimulation; osg::ref_ptr mRefraction; osg::ref_ptr mReflection; diff --git a/apps/openmw/mwsound/ffmpeg_decoder.cpp b/apps/openmw/mwsound/ffmpeg_decoder.cpp index 038b2338b..c0a2014b3 100644 --- a/apps/openmw/mwsound/ffmpeg_decoder.cpp +++ b/apps/openmw/mwsound/ffmpeg_decoder.cpp @@ -1,6 +1,5 @@ #include "ffmpeg_decoder.hpp" -// auto_ptr #include #include diff --git a/apps/openmw/mwsound/openal_output.cpp b/apps/openmw/mwsound/openal_output.cpp index fb259ff5f..042795a8c 100644 --- a/apps/openmw/mwsound/openal_output.cpp +++ b/apps/openmw/mwsound/openal_output.cpp @@ -217,7 +217,7 @@ private: DecoderPtr mDecoder; - std::auto_ptr mLoudnessAnalyzer; + std::unique_ptr mLoudnessAnalyzer; volatile bool mIsFinished; diff --git a/apps/openmw/mwsound/openal_output.hpp b/apps/openmw/mwsound/openal_output.hpp index 24c8609d6..ea3f393ff 100644 --- a/apps/openmw/mwsound/openal_output.hpp +++ b/apps/openmw/mwsound/openal_output.hpp @@ -33,7 +33,7 @@ namespace MWSound Environment mListenerEnv; struct StreamThread; - std::auto_ptr mStreamThread; + std::unique_ptr mStreamThread; void initCommon2D(ALuint source, const osg::Vec3f &pos, ALfloat gain, ALfloat pitch, bool loop, bool useenv); void initCommon3D(ALuint source, const osg::Vec3f &pos, ALfloat mindist, ALfloat maxdist, ALfloat gain, ALfloat pitch, bool loop, bool useenv); diff --git a/apps/openmw/mwsound/soundmanagerimp.hpp b/apps/openmw/mwsound/soundmanagerimp.hpp index abf5edb97..86e8b2bc7 100644 --- a/apps/openmw/mwsound/soundmanagerimp.hpp +++ b/apps/openmw/mwsound/soundmanagerimp.hpp @@ -47,8 +47,7 @@ namespace MWSound const VFS::Manager* mVFS; Fallback::Map mFallback; - - std::auto_ptr mOutput; + std::unique_ptr mOutput; // Caches available music tracks by std::map > mMusicFiles; @@ -66,8 +65,7 @@ namespace MWSound float mNearWaterOutdoorTolerance; std::string mNearWaterIndoorID; std::string mNearWaterOutdoorID; - - typedef std::auto_ptr > SoundBufferList; + typedef std::unique_ptr > SoundBufferList; // List of sound buffers, grown as needed. New enties are added to the // back, allowing existing Sound_Buffer references/pointers to remain // valid. diff --git a/apps/openmw/mwworld/scene.hpp b/apps/openmw/mwworld/scene.hpp index f3c2d31ca..586ac4f67 100644 --- a/apps/openmw/mwworld/scene.hpp +++ b/apps/openmw/mwworld/scene.hpp @@ -57,7 +57,7 @@ namespace MWWorld bool mCellChanged; MWPhysics::PhysicsSystem *mPhysics; MWRender::RenderingManager& mRendering; - std::auto_ptr mPreloader; + std::unique_ptr mPreloader; float mPreloadTimer; int mHalfGridSize; float mCellLoadingThreshold; diff --git a/components/compiler/lineparser.cpp b/components/compiler/lineparser.cpp index a5b67f58b..c7f82a3d0 100644 --- a/components/compiler/lineparser.cpp +++ b/components/compiler/lineparser.cpp @@ -294,7 +294,7 @@ namespace Compiler { // workaround for broken positioncell instructions. /// \todo add option to disable this - std::auto_ptr errorDowngrade (0); + std::unique_ptr errorDowngrade (nullptr); if (Misc::StringUtils::lowerCase (loc.mLiteral)=="positioncell") errorDowngrade.reset (new ErrorDowngrade (getErrorHandler())); diff --git a/components/esm/aisequence.cpp b/components/esm/aisequence.cpp index 71f87b170..c39ef8269 100644 --- a/components/esm/aisequence.cpp +++ b/components/esm/aisequence.cpp @@ -170,49 +170,49 @@ namespace AiSequence { case Ai_Wander: { - std::auto_ptr ptr (new AiWander()); + std::unique_ptr ptr (new AiWander()); ptr->load(esm); mPackages.back().mPackage = ptr.release(); break; } case Ai_Travel: { - std::auto_ptr ptr (new AiTravel()); + std::unique_ptr ptr (new AiTravel()); ptr->load(esm); mPackages.back().mPackage = ptr.release(); break; } case Ai_Escort: { - std::auto_ptr ptr (new AiEscort()); + std::unique_ptr ptr (new AiEscort()); ptr->load(esm); mPackages.back().mPackage = ptr.release(); break; } case Ai_Follow: { - std::auto_ptr ptr (new AiFollow()); + std::unique_ptr ptr (new AiFollow()); ptr->load(esm); mPackages.back().mPackage = ptr.release(); break; } case Ai_Activate: { - std::auto_ptr ptr (new AiActivate()); + std::unique_ptr ptr (new AiActivate()); ptr->load(esm); mPackages.back().mPackage = ptr.release(); break; } case Ai_Combat: { - std::auto_ptr ptr (new AiCombat()); + std::unique_ptr ptr (new AiCombat()); ptr->load(esm); mPackages.back().mPackage = ptr.release(); break; } case Ai_Pursue: { - std::auto_ptr ptr (new AiPursue()); + std::unique_ptr ptr (new AiPursue()); ptr->load(esm); mPackages.back().mPackage = ptr.release(); break; diff --git a/components/myguiplatform/myguidatamanager.cpp b/components/myguiplatform/myguidatamanager.cpp index 69bc3878d..485a87ba7 100644 --- a/components/myguiplatform/myguidatamanager.cpp +++ b/components/myguiplatform/myguidatamanager.cpp @@ -18,7 +18,7 @@ void DataManager::setResourcePath(const std::string &path) MyGUI::IDataStream *DataManager::getData(const std::string &name) { std::string fullpath = getDataPath(name); - std::auto_ptr stream; + std::unique_ptr stream; stream.reset(new boost::filesystem::ifstream); stream->open(fullpath, std::ios::binary); if (stream->fail()) diff --git a/components/nifbullet/bulletnifloader.cpp b/components/nifbullet/bulletnifloader.cpp index 1cfac15eb..e17c96b79 100644 --- a/components/nifbullet/bulletnifloader.cpp +++ b/components/nifbullet/bulletnifloader.cpp @@ -75,7 +75,7 @@ osg::ref_ptr BulletNifLoader::load(const Nif::NIFFilePtr if (findBoundingBox(node)) { - std::auto_ptr compound (new btCompoundShape); + std::unique_ptr compound (new btCompoundShape); btBoxShape* boxShape = new btBoxShape(getbtVector(mShape->mCollisionBoxHalfExtents)); btTransform transform = btTransform::getIdentity(); diff --git a/components/resource/resourcesystem.cpp b/components/resource/resourcesystem.cpp index 19b280ff1..74d89ab7a 100644 --- a/components/resource/resourcesystem.cpp +++ b/components/resource/resourcesystem.cpp @@ -28,8 +28,6 @@ namespace Resource // this has to be defined in the .cpp file as we can't delete incomplete types mResourceManagers.clear(); - - // no delete, all handled by auto_ptr } SceneManager* ResourceSystem::getSceneManager() diff --git a/components/resource/resourcesystem.hpp b/components/resource/resourcesystem.hpp index 6e308fd9b..dc608b875 100644 --- a/components/resource/resourcesystem.hpp +++ b/components/resource/resourcesystem.hpp @@ -57,10 +57,10 @@ namespace Resource void reportStats(unsigned int frameNumber, osg::Stats* stats) const; private: - std::auto_ptr mSceneManager; - std::auto_ptr mImageManager; - std::auto_ptr mNifFileManager; - std::auto_ptr mKeyframeManager; + std::unique_ptr mSceneManager; + std::unique_ptr mImageManager; + std::unique_ptr mNifFileManager; + std::unique_ptr mKeyframeManager; // Store the base classes separately to get convenient access to the common interface // Here users can register their own resourcemanager as well diff --git a/components/resource/scenemanager.hpp b/components/resource/scenemanager.hpp index 2da28eaf4..c6ff02acf 100644 --- a/components/resource/scenemanager.hpp +++ b/components/resource/scenemanager.hpp @@ -147,7 +147,7 @@ namespace Resource private: - std::auto_ptr mShaderManager; + std::unique_ptr mShaderManager; bool mForceShaders; bool mClampLighting; bool mForcePerPixelLighting; diff --git a/components/sceneutil/skeleton.hpp b/components/sceneutil/skeleton.hpp index 24dcc6b3f..542471ff1 100644 --- a/components/sceneutil/skeleton.hpp +++ b/components/sceneutil/skeleton.hpp @@ -63,7 +63,7 @@ namespace SceneUtil private: // The root bone is not a "real" bone, it has no corresponding node in the scene graph. // As far as the scene graph goes we support multiple root bones. - std::auto_ptr mRootBone; + std::unique_ptr mRootBone; typedef std::map > BoneCache; BoneCache mBoneCache; diff --git a/components/terrain/world.hpp b/components/terrain/world.hpp index 6aac963ce..1eafc8bd7 100644 --- a/components/terrain/world.hpp +++ b/components/terrain/world.hpp @@ -100,8 +100,8 @@ namespace Terrain Resource::ResourceSystem* mResourceSystem; - std::auto_ptr mTextureManager; - std::auto_ptr mChunkManager; + std::unique_ptr mTextureManager; + std::unique_ptr mChunkManager; }; } diff --git a/extern/osg-ffmpeg-videoplayer/audiodecoder.hpp b/extern/osg-ffmpeg-videoplayer/audiodecoder.hpp index a592b02d3..95644ea69 100644 --- a/extern/osg-ffmpeg-videoplayer/audiodecoder.hpp +++ b/extern/osg-ffmpeg-videoplayer/audiodecoder.hpp @@ -55,7 +55,7 @@ private: }; - std::auto_ptr mAudioResampler; + std::unique_ptr mAudioResampler; uint8_t *mDataBuf; uint8_t **mFrameData; diff --git a/extern/osg-ffmpeg-videoplayer/videoplayer.hpp b/extern/osg-ffmpeg-videoplayer/videoplayer.hpp index c118ddb7f..ddb31f306 100644 --- a/extern/osg-ffmpeg-videoplayer/videoplayer.hpp +++ b/extern/osg-ffmpeg-videoplayer/videoplayer.hpp @@ -78,7 +78,7 @@ namespace Video private: VideoState* mState; - std::auto_ptr mAudioFactory; + std::unique_ptr mAudioFactory; }; } diff --git a/extern/osg-ffmpeg-videoplayer/videostate.hpp b/extern/osg-ffmpeg-videoplayer/videostate.hpp index 2f0e8f30a..0bfe9ba50 100644 --- a/extern/osg-ffmpeg-videoplayer/videostate.hpp +++ b/extern/osg-ffmpeg-videoplayer/videostate.hpp @@ -152,8 +152,8 @@ struct VideoState { OpenThreads::Mutex pictq_mutex; OpenThreads::Condition pictq_cond; - std::auto_ptr parse_thread; - std::auto_ptr video_thread; + std::unique_ptr parse_thread; + std::unique_ptr video_thread; volatile bool mSeekRequested; uint64_t mSeekPos; From c8b67221d7559306012d7479db26f6e3a56b4af8 Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Sat, 29 Apr 2017 08:49:48 +0200 Subject: [PATCH 17/51] use nullptr instead of NULL --- apps/openmw/mwgui/bookpage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/openmw/mwgui/bookpage.cpp b/apps/openmw/mwgui/bookpage.cpp index c5c4e8d03..4cede0e18 100644 --- a/apps/openmw/mwgui/bookpage.cpp +++ b/apps/openmw/mwgui/bookpage.cpp @@ -1050,7 +1050,7 @@ public: mActiveTextFormats.clear (); - if (newBook != NULL) + if (newBook != nullptr) { createActiveFormats (newBook); From bf630b99faf0d53cf59c84e95c80e4ce8fbd8331 Mon Sep 17 00:00:00 2001 From: Nikolay Kasyanov Date: Sat, 29 Apr 2017 14:02:18 +0200 Subject: [PATCH 18/51] Use most recent Xcode --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5695494c2..4dbc7687b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ os: - linux - osx -osx_image: xcode8 +osx_image: xcode8.3 language: cpp sudo: required dist: trusty From 071419db4a3454ce2225dcb31214918be379b777 Mon Sep 17 00:00:00 2001 From: Nikolay Kasyanov Date: Mon, 1 May 2017 11:34:44 +0200 Subject: [PATCH 19/51] [macOS, CI] Enable OpenCS build and see what happens --- CI/before_script.osx.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/CI/before_script.osx.sh b/CI/before_script.osx.sh index 08fbe76d6..930d89efa 100755 --- a/CI/before_script.osx.sh +++ b/CI/before_script.osx.sh @@ -17,6 +17,5 @@ cmake \ -D DESIRED_QT_VERSION=5 \ -D BUILD_ESMTOOL=FALSE \ -D BUILD_MYGUI_PLUGIN=FALSE \ --D BUILD_OPENCS=FALSE \ -G"Unix Makefiles" \ .. From dd882b69c69ce35fb84baaaa8657180737027b76 Mon Sep 17 00:00:00 2001 From: Nikolay Kasyanov Date: Fri, 5 May 2017 13:01:47 +0300 Subject: [PATCH 20/51] [macOS, CI] Use Release configuration --- CI/before_script.osx.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CI/before_script.osx.sh b/CI/before_script.osx.sh index 930d89efa..806b545e3 100755 --- a/CI/before_script.osx.sh +++ b/CI/before_script.osx.sh @@ -12,7 +12,7 @@ cmake \ -D CMAKE_PREFIX_PATH="$DEPENDENCIES_ROOT;$QT_PATH" \ -D CMAKE_OSX_DEPLOYMENT_TARGET="10.9" \ -D CMAKE_OSX_SYSROOT="macosx10.12" \ --D CMAKE_BUILD_TYPE=Debug \ +-D CMAKE_BUILD_TYPE=Release \ -D OPENMW_OSX_DEPLOYMENT=TRUE \ -D DESIRED_QT_VERSION=5 \ -D BUILD_ESMTOOL=FALSE \ From 07f75e11049f21260ec03c8dfa8b51960268b310 Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Fri, 5 May 2017 19:26:09 +0200 Subject: [PATCH 21/51] replace boost::shared_ptr in extern and components --- apps/openmw/mwbase/soundmanager.hpp | 6 +++--- apps/openmw/mwrender/animation.cpp | 12 ++++++------ apps/openmw/mwrender/animation.hpp | 18 +++++++++--------- apps/openmw/mwrender/creatureanimation.cpp | 4 ++-- apps/openmw/mwrender/creatureanimation.hpp | 2 +- apps/openmw/mwrender/effectmanager.hpp | 7 +++---- apps/openmw/mwrender/npcanimation.cpp | 6 +++--- apps/openmw/mwrender/npcanimation.hpp | 4 ++-- apps/openmw/mwrender/ripplesimulation.cpp | 2 +- apps/openmw/mwrender/sky.cpp | 2 +- apps/openmw/mwrender/water.cpp | 2 +- apps/openmw/mwsound/movieaudiofactory.cpp | 6 +++--- apps/openmw/mwsound/movieaudiofactory.hpp | 2 +- apps/openmw/mwworld/projectilemanager.hpp | 2 +- components/files/constrainedfilestream.hpp | 2 +- components/nif/niffile.hpp | 2 +- components/nif/nifkey.hpp | 8 ++++---- components/nifosg/controller.hpp | 4 ++-- components/nifosg/nifloader.cpp | 6 +++--- components/sceneutil/controller.cpp | 10 +++++----- components/sceneutil/controller.hpp | 19 +++++++++---------- .../osg-ffmpeg-videoplayer/audiofactory.hpp | 3 +-- extern/osg-ffmpeg-videoplayer/videoplayer.cpp | 2 +- extern/osg-ffmpeg-videoplayer/videoplayer.hpp | 2 +- extern/osg-ffmpeg-videoplayer/videostate.cpp | 2 +- extern/osg-ffmpeg-videoplayer/videostate.hpp | 6 +++--- 26 files changed, 69 insertions(+), 72 deletions(-) diff --git a/apps/openmw/mwbase/soundmanager.hpp b/apps/openmw/mwbase/soundmanager.hpp index 22582c2b1..ecc056ccb 100644 --- a/apps/openmw/mwbase/soundmanager.hpp +++ b/apps/openmw/mwbase/soundmanager.hpp @@ -17,13 +17,13 @@ namespace MWSound class Sound; class Stream; struct Sound_Decoder; - typedef boost::shared_ptr DecoderPtr; + typedef std::shared_ptr DecoderPtr; } namespace MWBase { - typedef boost::shared_ptr SoundPtr; - typedef boost::shared_ptr SoundStreamPtr; + typedef std::shared_ptr SoundPtr; + typedef std::shared_ptr SoundStreamPtr; /// \brief Interface for sound manager (implemented in MWSound) class SoundManager diff --git a/apps/openmw/mwrender/animation.cpp b/apps/openmw/mwrender/animation.cpp index c825e74f2..98d29bfc9 100644 --- a/apps/openmw/mwrender/animation.cpp +++ b/apps/openmw/mwrender/animation.cpp @@ -546,7 +546,7 @@ namespace MWRender if(!mResourceSystem->getVFS()->exists(kfname)) return; - boost::shared_ptr animsrc; + std::shared_ptr animsrc; animsrc.reset(new AnimSource); animsrc->mKeyframes = mResourceSystem->getKeyframeManager()->get(kfname); @@ -598,7 +598,7 @@ namespace MWRender mStates.clear(); for(size_t i = 0;i < sNumBlendMasks;i++) - mAnimationTimePtr[i]->setTimePtr(boost::shared_ptr()); + mAnimationTimePtr[i]->setTimePtr(std::shared_ptr()); mAccumCtrl = NULL; @@ -881,12 +881,12 @@ namespace MWRender active = state; } - mAnimationTimePtr[blendMask]->setTimePtr(active == mStates.end() ? boost::shared_ptr() : active->second.mTime); + mAnimationTimePtr[blendMask]->setTimePtr(active == mStates.end() ? std::shared_ptr() : active->second.mTime); // add external controllers for the AnimSource active in this blend mask if (active != mStates.end()) { - boost::shared_ptr animsrc = active->second.mSource; + std::shared_ptr animsrc = active->second.mSource; for (AnimSource::ControllerMap::iterator it = animsrc->mControllerMap[blendMask].begin(); it != animsrc->mControllerMap[blendMask].end(); ++it) { @@ -1406,9 +1406,9 @@ namespace MWRender params.mEffectId = effectId; params.mBoneName = bonename; - params.mAnimTime = boost::shared_ptr(new EffectAnimationTime); + params.mAnimTime = std::shared_ptr(new EffectAnimationTime); - SceneUtil::AssignControllerSourcesVisitor assignVisitor(boost::shared_ptr(params.mAnimTime)); + SceneUtil::AssignControllerSourcesVisitor assignVisitor(std::shared_ptr(params.mAnimTime)); node->accept(assignVisitor); overrideFirstRootTexture(texture, mResourceSystem, node); diff --git a/apps/openmw/mwrender/animation.hpp b/apps/openmw/mwrender/animation.hpp index 202595182..5aec80f5d 100644 --- a/apps/openmw/mwrender/animation.hpp +++ b/apps/openmw/mwrender/animation.hpp @@ -69,7 +69,7 @@ private: void operator= (const PartHolder&); PartHolder(const PartHolder&); }; -typedef boost::shared_ptr PartHolderPtr; +typedef std::shared_ptr PartHolderPtr; class Animation : public osg::Referenced { @@ -146,13 +146,13 @@ protected: class AnimationTime : public SceneUtil::ControllerSource { private: - boost::shared_ptr mTimePtr; + std::shared_ptr mTimePtr; public: - void setTimePtr(boost::shared_ptr time) + void setTimePtr(std::shared_ptr time) { mTimePtr = time; } - boost::shared_ptr getTimePtr() const + std::shared_ptr getTimePtr() const { return mTimePtr; } virtual float getValue(osg::NodeVisitor* nv); @@ -170,13 +170,13 @@ protected: struct AnimSource; struct AnimState { - boost::shared_ptr mSource; + std::shared_ptr mSource; float mStartTime; float mLoopStartTime; float mLoopStopTime; float mStopTime; - typedef boost::shared_ptr TimePtr; + typedef std::shared_ptr TimePtr; TimePtr mTime; float mSpeedMult; @@ -212,7 +212,7 @@ protected: typedef std::map AnimStateMap; AnimStateMap mStates; - typedef std::vector > AnimSourceList; + typedef std::vector > AnimSourceList; AnimSourceList mAnimSources; osg::ref_ptr mInsert; @@ -234,7 +234,7 @@ protected: typedef std::multimap, osg::ref_ptr > ControllerMap; ControllerMap mActiveControllers; - boost::shared_ptr mAnimationTimePtr[sNumBlendMasks]; + std::shared_ptr mAnimationTimePtr[sNumBlendMasks]; // Stored in all lowercase for a case-insensitive lookup typedef std::map > NodeMap; @@ -251,7 +251,7 @@ protected: { std::string mModelName; // Just here so we don't add the same effect twice PartHolderPtr mObjects; - boost::shared_ptr mAnimTime; + std::shared_ptr mAnimTime; float mMaxControllerLength; int mEffectId; bool mLoop; diff --git a/apps/openmw/mwrender/creatureanimation.cpp b/apps/openmw/mwrender/creatureanimation.cpp index cb6489ef4..2ad362b33 100644 --- a/apps/openmw/mwrender/creatureanimation.cpp +++ b/apps/openmw/mwrender/creatureanimation.cpp @@ -59,7 +59,7 @@ CreatureWeaponAnimation::CreatureWeaponAnimation(const MWWorld::Ptr &ptr, const updateParts(); } - mWeaponAnimationTime = boost::shared_ptr(new WeaponAnimationTime(this)); + mWeaponAnimationTime = std::shared_ptr(new WeaponAnimationTime(this)); } void CreatureWeaponAnimation::showWeapons(bool showWeapon) @@ -143,7 +143,7 @@ void CreatureWeaponAnimation::updatePart(PartHolderPtr& scene, int slot) else mAmmunition.reset(); - boost::shared_ptr source; + std::shared_ptr source; if (slot == MWWorld::InventoryStore::Slot_CarriedRight) source = mWeaponAnimationTime; diff --git a/apps/openmw/mwrender/creatureanimation.hpp b/apps/openmw/mwrender/creatureanimation.hpp index bf813075e..ff959a551 100644 --- a/apps/openmw/mwrender/creatureanimation.hpp +++ b/apps/openmw/mwrender/creatureanimation.hpp @@ -61,7 +61,7 @@ namespace MWRender bool mShowWeapons; bool mShowCarriedLeft; - boost::shared_ptr mWeaponAnimationTime; + std::shared_ptr mWeaponAnimationTime; }; } diff --git a/apps/openmw/mwrender/effectmanager.hpp b/apps/openmw/mwrender/effectmanager.hpp index 83acc4c60..5873c00dd 100644 --- a/apps/openmw/mwrender/effectmanager.hpp +++ b/apps/openmw/mwrender/effectmanager.hpp @@ -1,13 +1,12 @@ #ifndef OPENMW_MWRENDER_EFFECTMANAGER_H #define OPENMW_MWRENDER_EFFECTMANAGER_H -#include #include +#include +#include #include -#include - namespace osg { class Group; @@ -44,7 +43,7 @@ namespace MWRender struct Effect { float mMaxControllerLength; - boost::shared_ptr mAnimTime; + std::shared_ptr mAnimTime; }; typedef std::map, Effect> EffectMap; diff --git a/apps/openmw/mwrender/npcanimation.cpp b/apps/openmw/mwrender/npcanimation.cpp index 8805b0e95..73927e0ab 100644 --- a/apps/openmw/mwrender/npcanimation.cpp +++ b/apps/openmw/mwrender/npcanimation.cpp @@ -286,8 +286,8 @@ NpcAnimation::NpcAnimation(const MWWorld::Ptr& ptr, osg::ref_ptr par { mNpc = mPtr.get()->mBase; - mHeadAnimationTime = boost::shared_ptr(new HeadAnimationTime(mPtr)); - mWeaponAnimationTime = boost::shared_ptr(new WeaponAnimationTime(this)); + mHeadAnimationTime = std::shared_ptr(new HeadAnimationTime(mPtr)); + mWeaponAnimationTime = std::shared_ptr(new WeaponAnimationTime(this)); for(size_t i = 0;i < ESM::PRT_Count;i++) { @@ -778,7 +778,7 @@ bool NpcAnimation::addOrReplaceIndividualPart(ESM::PartReferenceType type, int g osg::Node* node = mObjectParts[type]->getNode(); if (node->getNumChildrenRequiringUpdateTraversal() > 0) { - boost::shared_ptr src; + std::shared_ptr src; if (type == ESM::PRT_Head) { src = mHeadAnimationTime; diff --git a/apps/openmw/mwrender/npcanimation.hpp b/apps/openmw/mwrender/npcanimation.hpp index ad4d692c9..7f3a8da2d 100644 --- a/apps/openmw/mwrender/npcanimation.hpp +++ b/apps/openmw/mwrender/npcanimation.hpp @@ -64,8 +64,8 @@ private: // Field of view to use when rendering first person meshes float mFirstPersonFieldOfView; - boost::shared_ptr mHeadAnimationTime; - boost::shared_ptr mWeaponAnimationTime; + std::shared_ptr mHeadAnimationTime; + std::shared_ptr mWeaponAnimationTime; bool mSoundsDisabled; diff --git a/apps/openmw/mwrender/ripplesimulation.cpp b/apps/openmw/mwrender/ripplesimulation.cpp index 00082f033..141a3eb87 100644 --- a/apps/openmw/mwrender/ripplesimulation.cpp +++ b/apps/openmw/mwrender/ripplesimulation.cpp @@ -47,7 +47,7 @@ namespace } osg::ref_ptr controller (new NifOsg::FlipController(0, 0.3f/rippleFrameCount, textures)); - controller->setSource(boost::shared_ptr(new SceneUtil::FrameTimeSource)); + controller->setSource(std::shared_ptr(new SceneUtil::FrameTimeSource)); node->addUpdateCallback(controller); osg::ref_ptr stateset (new osg::StateSet); diff --git a/apps/openmw/mwrender/sky.cpp b/apps/openmw/mwrender/sky.cpp index 09c7af6a2..e6aa013ec 100644 --- a/apps/openmw/mwrender/sky.cpp +++ b/apps/openmw/mwrender/sky.cpp @@ -1525,7 +1525,7 @@ void SkyManager::setWeather(const WeatherResult& weather) } mParticleEffect = mSceneManager->getInstance(mCurrentParticleEffect, mParticleNode); - SceneUtil::AssignControllerSourcesVisitor assignVisitor(boost::shared_ptr(new SceneUtil::FrameTimeSource)); + SceneUtil::AssignControllerSourcesVisitor assignVisitor(std::shared_ptr(new SceneUtil::FrameTimeSource)); mParticleEffect->accept(assignVisitor); AlphaFader::SetupVisitor alphaFaderSetupVisitor; diff --git a/apps/openmw/mwrender/water.cpp b/apps/openmw/mwrender/water.cpp index d2ad1f9b5..ac0337af5 100644 --- a/apps/openmw/mwrender/water.cpp +++ b/apps/openmw/mwrender/water.cpp @@ -488,7 +488,7 @@ void Water::createSimpleWaterStateSet(osg::Node* node, float alpha) float fps = mFallback->getFallbackFloat("Water_SurfaceFPS"); osg::ref_ptr controller (new NifOsg::FlipController(0, 1.f/fps, textures)); - controller->setSource(boost::shared_ptr(new SceneUtil::FrameTimeSource)); + controller->setSource(std::shared_ptr(new SceneUtil::FrameTimeSource)); node->setUpdateCallback(controller); stateset->setTextureAttributeAndModes(0, textures[0], osg::StateAttribute::ON); diff --git a/apps/openmw/mwsound/movieaudiofactory.cpp b/apps/openmw/mwsound/movieaudiofactory.cpp index af9932f74..2d7f3a969 100644 --- a/apps/openmw/mwsound/movieaudiofactory.cpp +++ b/apps/openmw/mwsound/movieaudiofactory.cpp @@ -92,7 +92,7 @@ namespace MWSound } MWBase::SoundStreamPtr mAudioTrack; - boost::shared_ptr mDecoderBridge; + std::shared_ptr mDecoderBridge; }; @@ -156,9 +156,9 @@ namespace MWSound - boost::shared_ptr MovieAudioFactory::createDecoder(Video::VideoState* videoState) + std::shared_ptr MovieAudioFactory::createDecoder(Video::VideoState* videoState) { - boost::shared_ptr decoder(new MWSound::MovieAudioDecoder(videoState)); + std::shared_ptr decoder(new MWSound::MovieAudioDecoder(videoState)); decoder->setupFormat(); MWBase::SoundManager *sndMgr = MWBase::Environment::get().getSoundManager(); diff --git a/apps/openmw/mwsound/movieaudiofactory.hpp b/apps/openmw/mwsound/movieaudiofactory.hpp index 1391a0012..6ec49a4d3 100644 --- a/apps/openmw/mwsound/movieaudiofactory.hpp +++ b/apps/openmw/mwsound/movieaudiofactory.hpp @@ -8,7 +8,7 @@ namespace MWSound class MovieAudioFactory : public Video::MovieAudioFactory { - virtual boost::shared_ptr createDecoder(Video::VideoState* videoState); + virtual std::shared_ptr createDecoder(Video::VideoState* videoState); }; } diff --git a/apps/openmw/mwworld/projectilemanager.hpp b/apps/openmw/mwworld/projectilemanager.hpp index 2289706d3..bfa4980e9 100644 --- a/apps/openmw/mwworld/projectilemanager.hpp +++ b/apps/openmw/mwworld/projectilemanager.hpp @@ -73,7 +73,7 @@ namespace MWWorld struct State { osg::ref_ptr mNode; - boost::shared_ptr mEffectAnimationTime; + std::shared_ptr mEffectAnimationTime; int mActorId; diff --git a/components/files/constrainedfilestream.hpp b/components/files/constrainedfilestream.hpp index 069ceec58..6f22e31b8 100644 --- a/components/files/constrainedfilestream.hpp +++ b/components/files/constrainedfilestream.hpp @@ -17,7 +17,7 @@ public: virtual ~ConstrainedFileStream(); }; -typedef boost::shared_ptr IStreamPtr; +typedef std::shared_ptr IStreamPtr; IStreamPtr openConstrainedFileStream(const char *filename, size_t start=0, size_t length=0xFFFFFFFF); diff --git a/components/nif/niffile.hpp b/components/nif/niffile.hpp index 9a2acbb9f..9e39a37ab 100644 --- a/components/nif/niffile.hpp +++ b/components/nif/niffile.hpp @@ -92,7 +92,7 @@ public: /// Get the name of the file std::string getFilename() const { return filename; } }; -typedef boost::shared_ptr NIFFilePtr; +typedef std::shared_ptr NIFFilePtr; diff --git a/components/nif/nifkey.hpp b/components/nif/nifkey.hpp index 75353044d..5d96f456e 100644 --- a/components/nif/nifkey.hpp +++ b/components/nif/nifkey.hpp @@ -156,10 +156,10 @@ typedef KeyMapT Vector3KeyMap; typedef KeyMapT Vector4KeyMap; typedef KeyMapT QuaternionKeyMap; -typedef boost::shared_ptr FloatKeyMapPtr; -typedef boost::shared_ptr Vector3KeyMapPtr; -typedef boost::shared_ptr Vector4KeyMapPtr; -typedef boost::shared_ptr QuaternionKeyMapPtr; +typedef std::shared_ptr FloatKeyMapPtr; +typedef std::shared_ptr Vector3KeyMapPtr; +typedef std::shared_ptr Vector4KeyMapPtr; +typedef std::shared_ptr QuaternionKeyMapPtr; } // Namespace #endif //#ifndef OPENMW_COMPONENTS_NIF_NIFKEY_HPP diff --git a/components/nifosg/controller.hpp b/components/nifosg/controller.hpp index e517f9189..c2e3abb92 100644 --- a/components/nifosg/controller.hpp +++ b/components/nifosg/controller.hpp @@ -53,7 +53,7 @@ namespace NifOsg { } - ValueInterpolator(boost::shared_ptr keys, ValueT defaultVal = ValueT()) + ValueInterpolator(std::shared_ptr keys, ValueT defaultVal = ValueT()) : mKeys(keys) , mDefaultVal(defaultVal) { @@ -125,7 +125,7 @@ namespace NifOsg mutable typename MapT::MapType::const_iterator mLastLowKey; mutable typename MapT::MapType::const_iterator mLastHighKey; - boost::shared_ptr mKeys; + std::shared_ptr mKeys; ValueT mDefaultVal; }; diff --git a/components/nifosg/nifloader.cpp b/components/nifosg/nifloader.cpp index 2e591619e..05f6263b7 100644 --- a/components/nifosg/nifloader.cpp +++ b/components/nifosg/nifloader.cpp @@ -334,7 +334,7 @@ namespace NifOsg continue; osg::ref_ptr callback(new NifOsg::KeyframeController(key->data.getPtr())); - callback->setFunction(boost::shared_ptr(new NifOsg::ControllerFunction(key))); + callback->setFunction(std::shared_ptr(new NifOsg::ControllerFunction(key))); if (target.mKeyframeControllers.find(strdata->string) != target.mKeyframeControllers.end()) std::cerr << "Warning: controller " << strdata->string << " present more than once in " << nif->getFilename() << ", ignoring later version" << std::endl; @@ -411,9 +411,9 @@ namespace NifOsg { bool autoPlay = animflags & Nif::NiNode::AnimFlag_AutoPlay; if (autoPlay) - toSetup->setSource(boost::shared_ptr(new SceneUtil::FrameTimeSource)); + toSetup->setSource(std::shared_ptr(new SceneUtil::FrameTimeSource)); - toSetup->setFunction(boost::shared_ptr(new ControllerFunction(ctrl))); + toSetup->setFunction(std::shared_ptr(new ControllerFunction(ctrl))); } osg::ref_ptr handleLodNode(const Nif::NiLODNode* niLodNode) diff --git a/components/sceneutil/controller.cpp b/components/sceneutil/controller.cpp index 6cd0cb036..ee2715650 100644 --- a/components/sceneutil/controller.cpp +++ b/components/sceneutil/controller.cpp @@ -28,22 +28,22 @@ namespace SceneUtil return mSource->getValue(nv); } - void Controller::setSource(boost::shared_ptr source) + void Controller::setSource(std::shared_ptr source) { mSource = source; } - void Controller::setFunction(boost::shared_ptr function) + void Controller::setFunction(std::shared_ptr function) { mFunction = function; } - boost::shared_ptr Controller::getSource() const + std::shared_ptr Controller::getSource() const { return mSource; } - boost::shared_ptr Controller::getFunction() const + std::shared_ptr Controller::getFunction() const { return mFunction; } @@ -107,7 +107,7 @@ namespace SceneUtil { } - AssignControllerSourcesVisitor::AssignControllerSourcesVisitor(boost::shared_ptr toAssign) + AssignControllerSourcesVisitor::AssignControllerSourcesVisitor(std::shared_ptr toAssign) : ControllerVisitor() , mToAssign(toAssign) { diff --git a/components/sceneutil/controller.hpp b/components/sceneutil/controller.hpp index fd8964ae1..775cb23b0 100644 --- a/components/sceneutil/controller.hpp +++ b/components/sceneutil/controller.hpp @@ -1,8 +1,7 @@ #ifndef OPENMW_COMPONENTS_SCENEUTIL_CONTROLLER_H #define OPENMW_COMPONENTS_SCENEUTIL_CONTROLLER_H -#include - +#include #include namespace SceneUtil @@ -43,17 +42,17 @@ namespace SceneUtil float getInputValue(osg::NodeVisitor* nv); - void setSource(boost::shared_ptr source); - void setFunction(boost::shared_ptr function); + void setSource(std::shared_ptr source); + void setFunction(std::shared_ptr function); - boost::shared_ptr getSource() const; - boost::shared_ptr getFunction() const; + std::shared_ptr getSource() const; + std::shared_ptr getFunction() const; private: - boost::shared_ptr mSource; + std::shared_ptr mSource; // The source value gets passed through this function before it's passed on to the DestValue. - boost::shared_ptr mFunction; + std::shared_ptr mFunction; }; /// Pure virtual base class - visit() all controllers that are attached as UpdateCallbacks in a scene graph. @@ -78,14 +77,14 @@ namespace SceneUtil { public: AssignControllerSourcesVisitor(); - AssignControllerSourcesVisitor(boost::shared_ptr toAssign); + AssignControllerSourcesVisitor(std::shared_ptr toAssign); /// Assign the wanted ControllerSource. May be overridden in derived classes. /// By default assigns the ControllerSource passed to the constructor of this class if no ControllerSource is assigned to that controller yet. virtual void visit(osg::Node& node, Controller& ctrl); private: - boost::shared_ptr mToAssign; + std::shared_ptr mToAssign; }; /// Finds the maximum of all controller functions in the given scene graph diff --git a/extern/osg-ffmpeg-videoplayer/audiofactory.hpp b/extern/osg-ffmpeg-videoplayer/audiofactory.hpp index 06abd6a74..023d536e2 100644 --- a/extern/osg-ffmpeg-videoplayer/audiofactory.hpp +++ b/extern/osg-ffmpeg-videoplayer/audiofactory.hpp @@ -3,7 +3,6 @@ #include "audiodecoder.hpp" -#include namespace Video { @@ -11,7 +10,7 @@ namespace Video class MovieAudioFactory { public: - virtual boost::shared_ptr createDecoder(VideoState* videoState) = 0; + virtual std::shared_ptr createDecoder(VideoState* videoState) = 0; virtual ~MovieAudioFactory() {} }; diff --git a/extern/osg-ffmpeg-videoplayer/videoplayer.cpp b/extern/osg-ffmpeg-videoplayer/videoplayer.cpp index 9ec815130..c6544de9c 100644 --- a/extern/osg-ffmpeg-videoplayer/videoplayer.cpp +++ b/extern/osg-ffmpeg-videoplayer/videoplayer.cpp @@ -27,7 +27,7 @@ void VideoPlayer::setAudioFactory(MovieAudioFactory *factory) mAudioFactory.reset(factory); } -void VideoPlayer::playVideo(boost::shared_ptr inputstream, const std::string& name) +void VideoPlayer::playVideo(std::shared_ptr inputstream, const std::string& name) { if(mState) close(); diff --git a/extern/osg-ffmpeg-videoplayer/videoplayer.hpp b/extern/osg-ffmpeg-videoplayer/videoplayer.hpp index ddb31f306..351bc75b2 100644 --- a/extern/osg-ffmpeg-videoplayer/videoplayer.hpp +++ b/extern/osg-ffmpeg-videoplayer/videoplayer.hpp @@ -44,7 +44,7 @@ namespace Video /// Play the given video. If a video is already playing, the old video is closed first. /// @note The video will be unpaused by default. Use the pause() and play() methods to control pausing. /// @param name A name for the video stream - only used for logging purposes. - void playVideo (boost::shared_ptr inputstream, const std::string& name); + void playVideo (std::shared_ptr inputstream, const std::string& name); /// Get the current playback time position in the video, in seconds double getCurrentTime(); diff --git a/extern/osg-ffmpeg-videoplayer/videostate.cpp b/extern/osg-ffmpeg-videoplayer/videostate.cpp index 6779f2472..aa87069ac 100644 --- a/extern/osg-ffmpeg-videoplayer/videostate.cpp +++ b/extern/osg-ffmpeg-videoplayer/videostate.cpp @@ -626,7 +626,7 @@ int VideoState::stream_open(int stream_index, AVFormatContext *pFormatCtx) return 0; } -void VideoState::init(boost::shared_ptr inputstream, const std::string &name) +void VideoState::init(std::shared_ptr inputstream, const std::string &name) { int video_index = -1; int audio_index = -1; diff --git a/extern/osg-ffmpeg-videoplayer/videostate.hpp b/extern/osg-ffmpeg-videoplayer/videostate.hpp index 0bfe9ba50..a321d07c3 100644 --- a/extern/osg-ffmpeg-videoplayer/videostate.hpp +++ b/extern/osg-ffmpeg-videoplayer/videostate.hpp @@ -94,7 +94,7 @@ struct VideoState { void setAudioFactory(MovieAudioFactory* factory); - void init(boost::shared_ptr inputstream, const std::string& name); + void init(std::shared_ptr inputstream, const std::string& name); void deinit(); void setPaused(bool isPaused); @@ -127,11 +127,11 @@ struct VideoState { osg::ref_ptr mTexture; MovieAudioFactory* mAudioFactory; - boost::shared_ptr mAudioDecoder; + std::shared_ptr mAudioDecoder; ExternalClock mExternalClock; - boost::shared_ptr stream; + std::shared_ptr stream; AVFormatContext* format_ctx; int av_sync_type; From d785344fad7eb872b71ab5a174696e8c45dd0261 Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Fri, 5 May 2017 21:21:11 +0200 Subject: [PATCH 22/51] purge all instances of , clean up unused headers --- apps/openmw/mwbase/soundmanager.hpp | 2 +- apps/openmw/mwclass/activator.cpp | 8 +++---- apps/openmw/mwclass/activator.hpp | 2 +- apps/openmw/mwclass/apparatus.cpp | 8 +++---- apps/openmw/mwclass/apparatus.hpp | 4 ++-- apps/openmw/mwclass/armor.cpp | 8 +++---- apps/openmw/mwclass/armor.hpp | 4 ++-- apps/openmw/mwclass/bodypart.cpp | 2 +- apps/openmw/mwclass/book.cpp | 12 +++++----- apps/openmw/mwclass/book.hpp | 4 ++-- apps/openmw/mwclass/clothing.cpp | 8 +++---- apps/openmw/mwclass/clothing.hpp | 4 ++-- apps/openmw/mwclass/container.cpp | 14 ++++++------ apps/openmw/mwclass/container.hpp | 2 +- apps/openmw/mwclass/creature.cpp | 12 +++++----- apps/openmw/mwclass/creature.hpp | 2 +- apps/openmw/mwclass/creaturelevlist.cpp | 2 +- apps/openmw/mwclass/door.cpp | 14 ++++++------ apps/openmw/mwclass/door.hpp | 2 +- apps/openmw/mwclass/ingredient.cpp | 8 +++---- apps/openmw/mwclass/ingredient.hpp | 4 ++-- apps/openmw/mwclass/itemlevlist.cpp | 2 +- apps/openmw/mwclass/light.cpp | 12 +++++----- apps/openmw/mwclass/light.hpp | 4 ++-- apps/openmw/mwclass/lockpick.cpp | 8 +++---- apps/openmw/mwclass/lockpick.hpp | 4 ++-- apps/openmw/mwclass/misc.cpp | 10 ++++----- apps/openmw/mwclass/misc.hpp | 4 ++-- apps/openmw/mwclass/npc.cpp | 18 +++++++-------- apps/openmw/mwclass/npc.hpp | 2 +- apps/openmw/mwclass/potion.cpp | 8 +++---- apps/openmw/mwclass/potion.hpp | 4 ++-- apps/openmw/mwclass/probe.cpp | 8 +++---- apps/openmw/mwclass/probe.hpp | 4 ++-- apps/openmw/mwclass/repair.cpp | 8 +++---- apps/openmw/mwclass/repair.hpp | 4 ++-- apps/openmw/mwclass/static.cpp | 2 +- apps/openmw/mwclass/weapon.cpp | 8 +++---- apps/openmw/mwclass/weapon.hpp | 4 ++-- apps/openmw/mwgui/bookpage.cpp | 13 +++++------ apps/openmw/mwgui/bookpage.hpp | 5 ++--- apps/openmw/mwgui/inventorywindow.cpp | 2 +- apps/openmw/mwgui/journalviewmodel.cpp | 2 +- apps/openmw/mwgui/journalviewmodel.hpp | 3 +-- apps/openmw/mwgui/journalwindow.hpp | 4 ++-- apps/openmw/mwgui/mapwindow.cpp | 4 ++-- apps/openmw/mwgui/mapwindow.hpp | 4 +--- apps/openmw/mwgui/screenfader.hpp | 4 +--- apps/openmw/mwgui/sortfilteritemmodel.cpp | 2 +- apps/openmw/mwmechanics/aicombat.cpp | 6 ++--- apps/openmw/mwmechanics/aicombat.hpp | 2 -- apps/openmw/mwmechanics/aicombataction.cpp | 4 ++-- apps/openmw/mwmechanics/aicombataction.hpp | 4 ++-- apps/openmw/mwscript/containerextensions.cpp | 2 +- apps/openmw/mwscript/interpretercontext.cpp | 2 +- apps/openmw/mwscript/interpretercontext.hpp | 2 -- apps/openmw/mwsound/soundmanagerimp.hpp | 2 -- apps/openmw/mwworld/cellstore.hpp | 5 ++--- apps/openmw/mwworld/class.cpp | 22 +++++++++---------- apps/openmw/mwworld/class.hpp | 13 +++++------ apps/openmw/mwworld/worldimp.cpp | 2 +- apps/openmw/mwworld/worldimp.hpp | 4 +--- components/bsa/bsa_file.cpp | 1 + .../contentselector/model/loadordererror.cpp | 2 +- .../contentselector/view/contentselector.cpp | 5 +---- components/esm/npcstats.cpp | 2 ++ components/files/constrainedfilestream.hpp | 3 +-- components/nif/nifkey.hpp | 2 -- components/nif/nifstream.hpp | 1 + components/nifosg/controller.hpp | 4 ---- components/resource/imagemanager.cpp | 2 +- components/resource/resourcesystem.cpp | 2 ++ extern/osg-ffmpeg-videoplayer/videoplayer.hpp | 2 -- extern/osg-ffmpeg-videoplayer/videostate.cpp | 4 +--- extern/osg-ffmpeg-videoplayer/videostate.hpp | 2 -- 75 files changed, 179 insertions(+), 206 deletions(-) diff --git a/apps/openmw/mwbase/soundmanager.hpp b/apps/openmw/mwbase/soundmanager.hpp index ecc056ccb..9aa4bafdf 100644 --- a/apps/openmw/mwbase/soundmanager.hpp +++ b/apps/openmw/mwbase/soundmanager.hpp @@ -1,9 +1,9 @@ #ifndef GAME_MWBASE_SOUNDMANAGER_H #define GAME_MWBASE_SOUNDMANAGER_H +#include #include #include -#include #include "../mwworld/ptr.hpp" diff --git a/apps/openmw/mwclass/activator.cpp b/apps/openmw/mwclass/activator.cpp index 3e0ec366f..4910ab932 100644 --- a/apps/openmw/mwclass/activator.cpp +++ b/apps/openmw/mwclass/activator.cpp @@ -73,7 +73,7 @@ namespace MWClass void Activator::registerSelf() { - boost::shared_ptr instance (new Activator); + std::shared_ptr instance (new Activator); registerClass (typeid (ESM::Activator).name(), instance); } @@ -107,19 +107,19 @@ namespace MWClass return info; } - boost::shared_ptr Activator::activate(const MWWorld::Ptr &ptr, const MWWorld::Ptr &actor) const + std::shared_ptr Activator::activate(const MWWorld::Ptr &ptr, const MWWorld::Ptr &actor) const { if(actor.getClass().isNpc() && actor.getClass().getNpcStats(actor).isWerewolf()) { const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); const ESM::Sound *sound = store.get().searchRandom("WolfActivator"); - boost::shared_ptr action(new MWWorld::FailedAction("#{sWerewolfRefusal}")); + std::shared_ptr action(new MWWorld::FailedAction("#{sWerewolfRefusal}")); if(sound) action->setSound(sound->mId); return action; } - return boost::shared_ptr(new MWWorld::NullAction); + return std::shared_ptr(new MWWorld::NullAction); } diff --git a/apps/openmw/mwclass/activator.hpp b/apps/openmw/mwclass/activator.hpp index 4fe4dda7e..21afa7b8e 100644 --- a/apps/openmw/mwclass/activator.hpp +++ b/apps/openmw/mwclass/activator.hpp @@ -33,7 +33,7 @@ namespace MWClass virtual std::string getScript (const MWWorld::ConstPtr& ptr) const; ///< Return name of the script attached to ptr - virtual boost::shared_ptr activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const; + virtual std::shared_ptr activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const; ///< Generate action for activation static void registerSelf(); diff --git a/apps/openmw/mwclass/apparatus.cpp b/apps/openmw/mwclass/apparatus.cpp index 3642a22ed..a271dc5e9 100644 --- a/apps/openmw/mwclass/apparatus.cpp +++ b/apps/openmw/mwclass/apparatus.cpp @@ -51,7 +51,7 @@ namespace MWClass return ref->mBase->mName; } - boost::shared_ptr Apparatus::activate (const MWWorld::Ptr& ptr, + std::shared_ptr Apparatus::activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const { return defaultItemActivate(ptr, actor); @@ -73,7 +73,7 @@ namespace MWClass void Apparatus::registerSelf() { - boost::shared_ptr instance (new Apparatus); + std::shared_ptr instance (new Apparatus); registerClass (typeid (ESM::Apparatus).name(), instance); } @@ -125,9 +125,9 @@ namespace MWClass } - boost::shared_ptr Apparatus::use (const MWWorld::Ptr& ptr) const + std::shared_ptr Apparatus::use (const MWWorld::Ptr& ptr) const { - return boost::shared_ptr(new MWWorld::ActionAlchemy()); + return std::shared_ptr(new MWWorld::ActionAlchemy()); } MWWorld::Ptr Apparatus::copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const diff --git a/apps/openmw/mwclass/apparatus.hpp b/apps/openmw/mwclass/apparatus.hpp index d669b9c2d..539c1068b 100644 --- a/apps/openmw/mwclass/apparatus.hpp +++ b/apps/openmw/mwclass/apparatus.hpp @@ -23,7 +23,7 @@ namespace MWClass ///< \return name (the one that is to be presented to the user; not the internal one); /// can return an empty string. - virtual boost::shared_ptr activate (const MWWorld::Ptr& ptr, + virtual std::shared_ptr activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const; ///< Generate action for activation @@ -50,7 +50,7 @@ namespace MWClass virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const; ///< Return name of inventory icon. - virtual boost::shared_ptr use (const MWWorld::Ptr& ptr) + virtual std::shared_ptr use (const MWWorld::Ptr& ptr) const; ///< Generate action for using via inventory menu diff --git a/apps/openmw/mwclass/armor.cpp b/apps/openmw/mwclass/armor.cpp index f652cbd04..460cd517a 100644 --- a/apps/openmw/mwclass/armor.cpp +++ b/apps/openmw/mwclass/armor.cpp @@ -57,7 +57,7 @@ namespace MWClass return ref->mBase->mName; } - boost::shared_ptr Armor::activate (const MWWorld::Ptr& ptr, + std::shared_ptr Armor::activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const { return defaultItemActivate(ptr, actor); @@ -165,7 +165,7 @@ namespace MWClass void Armor::registerSelf() { - boost::shared_ptr instance (new Armor); + std::shared_ptr instance (new Armor); registerClass (typeid (ESM::Armor).name(), instance); } @@ -354,9 +354,9 @@ namespace MWClass return std::make_pair(1,""); } - boost::shared_ptr Armor::use (const MWWorld::Ptr& ptr) const + std::shared_ptr Armor::use (const MWWorld::Ptr& ptr) const { - boost::shared_ptr action(new MWWorld::ActionEquip(ptr)); + std::shared_ptr action(new MWWorld::ActionEquip(ptr)); action->setSound(getUpSoundId(ptr)); diff --git a/apps/openmw/mwclass/armor.hpp b/apps/openmw/mwclass/armor.hpp index 025bc8af1..628ac1b88 100644 --- a/apps/openmw/mwclass/armor.hpp +++ b/apps/openmw/mwclass/armor.hpp @@ -22,7 +22,7 @@ namespace MWClass ///< \return name (the one that is to be presented to the user; not the internal one); /// can return an empty string. - virtual boost::shared_ptr activate (const MWWorld::Ptr& ptr, + virtual std::shared_ptr activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const; ///< Generate action for activation @@ -73,7 +73,7 @@ namespace MWClass ///< Return 0 if player cannot equip item. 1 if can equip. 2 if it's twohanded weapon. 3 if twohanded weapon conflicts with that. \n /// Second item in the pair specifies the error message - virtual boost::shared_ptr use (const MWWorld::Ptr& ptr) + virtual std::shared_ptr use (const MWWorld::Ptr& ptr) const; ///< Generate action for using via inventory menu diff --git a/apps/openmw/mwclass/bodypart.cpp b/apps/openmw/mwclass/bodypart.cpp index be2b927cc..41a9d998e 100644 --- a/apps/openmw/mwclass/bodypart.cpp +++ b/apps/openmw/mwclass/bodypart.cpp @@ -33,7 +33,7 @@ namespace MWClass void BodyPart::registerSelf() { - boost::shared_ptr instance (new BodyPart); + std::shared_ptr instance (new BodyPart); registerClass (typeid (ESM::BodyPart).name(), instance); } diff --git a/apps/openmw/mwclass/book.cpp b/apps/openmw/mwclass/book.cpp index f2c97d770..3d6455dc6 100644 --- a/apps/openmw/mwclass/book.cpp +++ b/apps/openmw/mwclass/book.cpp @@ -54,7 +54,7 @@ namespace MWClass return ref->mBase->mName; } - boost::shared_ptr Book::activate (const MWWorld::Ptr& ptr, + std::shared_ptr Book::activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const { if(actor.getClass().isNpc() && actor.getClass().getNpcStats(actor).isWerewolf()) @@ -62,13 +62,13 @@ namespace MWClass const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); const ESM::Sound *sound = store.get().searchRandom("WolfItem"); - boost::shared_ptr action(new MWWorld::FailedAction("#{sWerewolfRefusal}")); + std::shared_ptr action(new MWWorld::FailedAction("#{sWerewolfRefusal}")); if(sound) action->setSound(sound->mId); return action; } - return boost::shared_ptr(new MWWorld::ActionRead(ptr)); + return std::shared_ptr(new MWWorld::ActionRead(ptr)); } std::string Book::getScript (const MWWorld::ConstPtr& ptr) const @@ -87,7 +87,7 @@ namespace MWClass void Book::registerSelf() { - boost::shared_ptr instance (new Book); + std::shared_ptr instance (new Book); registerClass (typeid (ESM::Book).name(), instance); } @@ -162,9 +162,9 @@ namespace MWClass return record->mId; } - boost::shared_ptr Book::use (const MWWorld::Ptr& ptr) const + std::shared_ptr Book::use (const MWWorld::Ptr& ptr) const { - return boost::shared_ptr(new MWWorld::ActionRead(ptr)); + return std::shared_ptr(new MWWorld::ActionRead(ptr)); } MWWorld::Ptr Book::copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const diff --git a/apps/openmw/mwclass/book.hpp b/apps/openmw/mwclass/book.hpp index 73bfecacd..82ca08a4d 100644 --- a/apps/openmw/mwclass/book.hpp +++ b/apps/openmw/mwclass/book.hpp @@ -20,7 +20,7 @@ namespace MWClass ///< \return name (the one that is to be presented to the user; not the internal one); /// can return an empty string. - virtual boost::shared_ptr activate (const MWWorld::Ptr& ptr, + virtual std::shared_ptr activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const; ///< Generate action for activation @@ -53,7 +53,7 @@ namespace MWClass virtual std::string applyEnchantment(const MWWorld::ConstPtr &ptr, const std::string& enchId, int enchCharge, const std::string& newName) const; ///< Creates a new record using \a ptr as template, with the given name and the given enchantment applied to it. - virtual boost::shared_ptr use (const MWWorld::Ptr& ptr) const; + virtual std::shared_ptr use (const MWWorld::Ptr& ptr) const; ///< Generate action for using via inventory menu virtual std::string getModel(const MWWorld::ConstPtr &ptr) const; diff --git a/apps/openmw/mwclass/clothing.cpp b/apps/openmw/mwclass/clothing.cpp index 1d99ee8e2..b37d1e90b 100644 --- a/apps/openmw/mwclass/clothing.cpp +++ b/apps/openmw/mwclass/clothing.cpp @@ -53,7 +53,7 @@ namespace MWClass return ref->mBase->mName; } - boost::shared_ptr Clothing::activate (const MWWorld::Ptr& ptr, + std::shared_ptr Clothing::activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const { return defaultItemActivate(ptr, actor); @@ -124,7 +124,7 @@ namespace MWClass void Clothing::registerSelf() { - boost::shared_ptr instance (new Clothing); + std::shared_ptr instance (new Clothing); registerClass (typeid (ESM::Clothing).name(), instance); } @@ -243,9 +243,9 @@ namespace MWClass return std::make_pair (1, ""); } - boost::shared_ptr Clothing::use (const MWWorld::Ptr& ptr) const + std::shared_ptr Clothing::use (const MWWorld::Ptr& ptr) const { - boost::shared_ptr action(new MWWorld::ActionEquip(ptr)); + std::shared_ptr action(new MWWorld::ActionEquip(ptr)); action->setSound(getUpSoundId(ptr)); diff --git a/apps/openmw/mwclass/clothing.hpp b/apps/openmw/mwclass/clothing.hpp index e1c0f63f7..202b6596e 100644 --- a/apps/openmw/mwclass/clothing.hpp +++ b/apps/openmw/mwclass/clothing.hpp @@ -20,7 +20,7 @@ namespace MWClass ///< \return name (the one that is to be presented to the user; not the internal one); /// can return an empty string. - virtual boost::shared_ptr activate (const MWWorld::Ptr& ptr, + virtual std::shared_ptr activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const; ///< Generate action for activation @@ -65,7 +65,7 @@ namespace MWClass ///< Return 0 if player cannot equip item. 1 if can equip. 2 if it's twohanded weapon. 3 if twohanded weapon conflicts with that. /// Second item in the pair specifies the error message - virtual boost::shared_ptr use (const MWWorld::Ptr& ptr) + virtual std::shared_ptr use (const MWWorld::Ptr& ptr) const; ///< Generate action for using via inventory menu diff --git a/apps/openmw/mwclass/container.cpp b/apps/openmw/mwclass/container.cpp index 66074306e..dc4eb844a 100644 --- a/apps/openmw/mwclass/container.cpp +++ b/apps/openmw/mwclass/container.cpp @@ -118,18 +118,18 @@ namespace MWClass return true; } - boost::shared_ptr Container::activate (const MWWorld::Ptr& ptr, + std::shared_ptr Container::activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const { if (!MWBase::Environment::get().getWindowManager()->isAllowed(MWGui::GW_Inventory)) - return boost::shared_ptr (new MWWorld::NullAction ()); + return std::shared_ptr (new MWWorld::NullAction ()); if(actor.getClass().isNpc() && actor.getClass().getNpcStats(actor).isWerewolf()) { const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); const ESM::Sound *sound = store.get().searchRandom("WolfContainer"); - boost::shared_ptr action(new MWWorld::FailedAction("#{sWerewolfRefusal}")); + std::shared_ptr action(new MWWorld::FailedAction("#{sWerewolfRefusal}")); if(sound) action->setSound(sound->mId); return action; @@ -181,20 +181,20 @@ namespace MWClass { if(!isTrapped) { - boost::shared_ptr action (new MWWorld::ActionOpen(ptr)); + std::shared_ptr action (new MWWorld::ActionOpen(ptr)); return action; } else { // Activate trap - boost::shared_ptr action(new MWWorld::ActionTrap(ptr.getCellRef().getTrap(), ptr)); + std::shared_ptr action(new MWWorld::ActionTrap(ptr.getCellRef().getTrap(), ptr)); action->setSound(trapActivationSound); return action; } } else { - boost::shared_ptr action(new MWWorld::FailedAction(std::string(), ptr)); + std::shared_ptr action(new MWWorld::FailedAction(std::string(), ptr)); action->setSound(lockedSound); return action; } @@ -224,7 +224,7 @@ namespace MWClass void Container::registerSelf() { - boost::shared_ptr instance (new Container); + std::shared_ptr instance (new Container); registerClass (typeid (ESM::Container).name(), instance); } diff --git a/apps/openmw/mwclass/container.hpp b/apps/openmw/mwclass/container.hpp index 04223f264..e38d98b5c 100644 --- a/apps/openmw/mwclass/container.hpp +++ b/apps/openmw/mwclass/container.hpp @@ -23,7 +23,7 @@ namespace MWClass ///< \return name (the one that is to be presented to the user; not the internal one); /// can return an empty string. - virtual boost::shared_ptr activate (const MWWorld::Ptr& ptr, + virtual std::shared_ptr activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const; ///< Generate action for activation diff --git a/apps/openmw/mwclass/creature.cpp b/apps/openmw/mwclass/creature.cpp index 4513e428b..ce03af7a1 100644 --- a/apps/openmw/mwclass/creature.cpp +++ b/apps/openmw/mwclass/creature.cpp @@ -434,7 +434,7 @@ namespace MWClass } } - boost::shared_ptr Creature::activate (const MWWorld::Ptr& ptr, + std::shared_ptr Creature::activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const { if(actor.getClass().isNpc() && actor.getClass().getNpcStats(actor).isWerewolf()) @@ -442,17 +442,17 @@ namespace MWClass const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); const ESM::Sound *sound = store.get().searchRandom("WolfCreature"); - boost::shared_ptr action(new MWWorld::FailedAction("#{sWerewolfRefusal}")); + std::shared_ptr action(new MWWorld::FailedAction("#{sWerewolfRefusal}")); if(sound) action->setSound(sound->mId); return action; } if(getCreatureStats(ptr).isDead()) - return boost::shared_ptr(new MWWorld::ActionOpen(ptr, true)); + return std::shared_ptr(new MWWorld::ActionOpen(ptr, true)); if(ptr.getClass().getCreatureStats(ptr).getAiSequence().isInCombat()) - return boost::shared_ptr(new MWWorld::FailedAction("")); - return boost::shared_ptr(new MWWorld::ActionTalk(ptr)); + return std::shared_ptr(new MWWorld::FailedAction("")); + return std::shared_ptr(new MWWorld::ActionTalk(ptr)); } MWWorld::ContainerStore& Creature::getContainerStore (const MWWorld::Ptr& ptr) const @@ -489,7 +489,7 @@ namespace MWClass void Creature::registerSelf() { - boost::shared_ptr instance (new Creature); + std::shared_ptr instance (new Creature); registerClass (typeid (ESM::Creature).name(), instance); } diff --git a/apps/openmw/mwclass/creature.hpp b/apps/openmw/mwclass/creature.hpp index 076bc8572..e3689204a 100644 --- a/apps/openmw/mwclass/creature.hpp +++ b/apps/openmw/mwclass/creature.hpp @@ -60,7 +60,7 @@ namespace MWClass virtual void onHit(const MWWorld::Ptr &ptr, float damage, bool ishealth, const MWWorld::Ptr &object, const MWWorld::Ptr &attacker, const osg::Vec3f &hitPosition, bool successful) const; - virtual boost::shared_ptr activate (const MWWorld::Ptr& ptr, + virtual std::shared_ptr activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const; ///< Generate action for activation diff --git a/apps/openmw/mwclass/creaturelevlist.cpp b/apps/openmw/mwclass/creaturelevlist.cpp index 95e52b41e..4a4d9793e 100644 --- a/apps/openmw/mwclass/creaturelevlist.cpp +++ b/apps/openmw/mwclass/creaturelevlist.cpp @@ -70,7 +70,7 @@ namespace MWClass void CreatureLevList::registerSelf() { - boost::shared_ptr instance (new CreatureLevList); + std::shared_ptr instance (new CreatureLevList); registerClass (typeid (ESM::CreatureLevList).name(), instance); } diff --git a/apps/openmw/mwclass/door.cpp b/apps/openmw/mwclass/door.cpp index 5f977174f..f11f8e9ec 100644 --- a/apps/openmw/mwclass/door.cpp +++ b/apps/openmw/mwclass/door.cpp @@ -99,7 +99,7 @@ namespace MWClass return ref->mBase->mName; } - boost::shared_ptr Door::activate (const MWWorld::Ptr& ptr, + std::shared_ptr Door::activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const { MWWorld::LiveCellRef *ref = ptr.get(); @@ -166,7 +166,7 @@ namespace MWClass if(isTrapped) { // Trap activation - boost::shared_ptr action(new MWWorld::ActionTrap(ptr.getCellRef().getTrap(), ptr)); + std::shared_ptr action(new MWWorld::ActionTrap(ptr.getCellRef().getTrap(), ptr)); action->setSound(trapActivationSound); return action; } @@ -176,12 +176,12 @@ namespace MWClass if (actor == MWMechanics::getPlayer() && MWBase::Environment::get().getWorld()->getDistanceToFacedObject() > MWBase::Environment::get().getWorld()->getMaxActivationDistance()) { // player activated teleport door with telekinesis - boost::shared_ptr action(new MWWorld::FailedAction); + std::shared_ptr action(new MWWorld::FailedAction); return action; } else { - boost::shared_ptr action(new MWWorld::ActionTeleport (ptr.getCellRef().getDestCell(), ptr.getCellRef().getDoorDest(), true)); + std::shared_ptr action(new MWWorld::ActionTeleport (ptr.getCellRef().getDestCell(), ptr.getCellRef().getDoorDest(), true)); action->setSound(openSound); return action; } @@ -189,7 +189,7 @@ namespace MWClass else { // animated door - boost::shared_ptr action(new MWWorld::ActionDoor(ptr)); + std::shared_ptr action(new MWWorld::ActionDoor(ptr)); int doorstate = getDoorState(ptr); bool opening = true; float doorRot = ptr.getRefData().getPosition().rot[2] - ptr.getCellRef().getPosition().rot[2]; @@ -223,7 +223,7 @@ namespace MWClass else { // locked, and we can't open. - boost::shared_ptr action(new MWWorld::FailedAction(std::string(), ptr)); + std::shared_ptr action(new MWWorld::FailedAction(std::string(), ptr)); action->setSound(lockedSound); return action; } @@ -264,7 +264,7 @@ namespace MWClass void Door::registerSelf() { - boost::shared_ptr instance (new Door); + std::shared_ptr instance (new Door); registerClass (typeid (ESM::Door).name(), instance); } diff --git a/apps/openmw/mwclass/door.hpp b/apps/openmw/mwclass/door.hpp index 3760f59c4..a2d129522 100644 --- a/apps/openmw/mwclass/door.hpp +++ b/apps/openmw/mwclass/door.hpp @@ -26,7 +26,7 @@ namespace MWClass ///< \return name (the one that is to be presented to the user; not the internal one); /// can return an empty string. - virtual boost::shared_ptr activate (const MWWorld::Ptr& ptr, + virtual std::shared_ptr activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const; ///< Generate action for activation diff --git a/apps/openmw/mwclass/ingredient.cpp b/apps/openmw/mwclass/ingredient.cpp index a9a995f2f..09d149331 100644 --- a/apps/openmw/mwclass/ingredient.cpp +++ b/apps/openmw/mwclass/ingredient.cpp @@ -54,7 +54,7 @@ namespace MWClass return ref->mBase->mName; } - boost::shared_ptr Ingredient::activate (const MWWorld::Ptr& ptr, + std::shared_ptr Ingredient::activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const { return defaultItemActivate(ptr, actor); @@ -75,9 +75,9 @@ namespace MWClass } - boost::shared_ptr Ingredient::use (const MWWorld::Ptr& ptr) const + std::shared_ptr Ingredient::use (const MWWorld::Ptr& ptr) const { - boost::shared_ptr action (new MWWorld::ActionEat (ptr)); + std::shared_ptr action (new MWWorld::ActionEat (ptr)); action->setSound ("Swallow"); @@ -86,7 +86,7 @@ namespace MWClass void Ingredient::registerSelf() { - boost::shared_ptr instance (new Ingredient); + std::shared_ptr instance (new Ingredient); registerClass (typeid (ESM::Ingredient).name(), instance); } diff --git a/apps/openmw/mwclass/ingredient.hpp b/apps/openmw/mwclass/ingredient.hpp index 9a8bdacfb..1136eb50f 100644 --- a/apps/openmw/mwclass/ingredient.hpp +++ b/apps/openmw/mwclass/ingredient.hpp @@ -20,7 +20,7 @@ namespace MWClass ///< \return name (the one that is to be presented to the user; not the internal one); /// can return an empty string. - virtual boost::shared_ptr activate (const MWWorld::Ptr& ptr, + virtual std::shared_ptr activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const; ///< Generate action for activation @@ -36,7 +36,7 @@ namespace MWClass virtual int getValue (const MWWorld::ConstPtr& ptr) const; ///< Return trade value of the object. Throws an exception, if the object can't be traded. - virtual boost::shared_ptr use (const MWWorld::Ptr& ptr) + virtual std::shared_ptr use (const MWWorld::Ptr& ptr) const; ///< Generate action for using via inventory menu diff --git a/apps/openmw/mwclass/itemlevlist.cpp b/apps/openmw/mwclass/itemlevlist.cpp index 290ac4c26..d2c246a85 100644 --- a/apps/openmw/mwclass/itemlevlist.cpp +++ b/apps/openmw/mwclass/itemlevlist.cpp @@ -12,7 +12,7 @@ namespace MWClass void ItemLevList::registerSelf() { - boost::shared_ptr instance (new ItemLevList); + std::shared_ptr instance (new ItemLevList); registerClass (typeid (ESM::ItemLevList).name(), instance); } diff --git a/apps/openmw/mwclass/light.cpp b/apps/openmw/mwclass/light.cpp index ed69ee3ac..172c16c83 100644 --- a/apps/openmw/mwclass/light.cpp +++ b/apps/openmw/mwclass/light.cpp @@ -79,15 +79,15 @@ namespace MWClass return ref->mBase->mName; } - boost::shared_ptr Light::activate (const MWWorld::Ptr& ptr, + std::shared_ptr Light::activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const { if(!MWBase::Environment::get().getWindowManager()->isAllowed(MWGui::GW_Inventory)) - return boost::shared_ptr(new MWWorld::NullAction()); + return std::shared_ptr(new MWWorld::NullAction()); MWWorld::LiveCellRef *ref = ptr.get(); if(!(ref->mBase->mData.mFlags&ESM::Light::Carry)) - return boost::shared_ptr(new MWWorld::FailedAction()); + return std::shared_ptr(new MWWorld::FailedAction()); return defaultItemActivate(ptr, actor); } @@ -120,7 +120,7 @@ namespace MWClass void Light::registerSelf() { - boost::shared_ptr instance (new Light); + std::shared_ptr instance (new Light); registerClass (typeid (ESM::Light).name(), instance); } @@ -186,9 +186,9 @@ namespace MWClass return Class::showsInInventory(ptr); } - boost::shared_ptr Light::use (const MWWorld::Ptr& ptr) const + std::shared_ptr Light::use (const MWWorld::Ptr& ptr) const { - boost::shared_ptr action(new MWWorld::ActionEquip(ptr)); + std::shared_ptr action(new MWWorld::ActionEquip(ptr)); action->setSound(getUpSoundId(ptr)); diff --git a/apps/openmw/mwclass/light.hpp b/apps/openmw/mwclass/light.hpp index 284a7d817..59085d97e 100644 --- a/apps/openmw/mwclass/light.hpp +++ b/apps/openmw/mwclass/light.hpp @@ -30,7 +30,7 @@ namespace MWClass virtual bool showsInInventory (const MWWorld::ConstPtr& ptr) const; - virtual boost::shared_ptr activate (const MWWorld::Ptr& ptr, + virtual std::shared_ptr activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const; ///< Generate action for activation @@ -55,7 +55,7 @@ namespace MWClass virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const; ///< Return name of inventory icon. - virtual boost::shared_ptr use (const MWWorld::Ptr& ptr) + virtual std::shared_ptr use (const MWWorld::Ptr& ptr) const; ///< Generate action for using via inventory menu diff --git a/apps/openmw/mwclass/lockpick.cpp b/apps/openmw/mwclass/lockpick.cpp index a335415ac..b8f6f5ecb 100644 --- a/apps/openmw/mwclass/lockpick.cpp +++ b/apps/openmw/mwclass/lockpick.cpp @@ -52,7 +52,7 @@ namespace MWClass return ref->mBase->mName; } - boost::shared_ptr Lockpick::activate (const MWWorld::Ptr& ptr, + std::shared_ptr Lockpick::activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const { return defaultItemActivate(ptr, actor); @@ -83,7 +83,7 @@ namespace MWClass void Lockpick::registerSelf() { - boost::shared_ptr instance (new Lockpick); + std::shared_ptr instance (new Lockpick); registerClass (typeid (ESM::Lockpick).name(), instance); } @@ -139,9 +139,9 @@ namespace MWClass return info; } - boost::shared_ptr Lockpick::use (const MWWorld::Ptr& ptr) const + std::shared_ptr Lockpick::use (const MWWorld::Ptr& ptr) const { - boost::shared_ptr action(new MWWorld::ActionEquip(ptr)); + std::shared_ptr action(new MWWorld::ActionEquip(ptr)); action->setSound(getUpSoundId(ptr)); diff --git a/apps/openmw/mwclass/lockpick.hpp b/apps/openmw/mwclass/lockpick.hpp index f04674f5c..efa675c95 100644 --- a/apps/openmw/mwclass/lockpick.hpp +++ b/apps/openmw/mwclass/lockpick.hpp @@ -20,7 +20,7 @@ namespace MWClass ///< \return name (the one that is to be presented to the user; not the internal one); /// can return an empty string. - virtual boost::shared_ptr activate (const MWWorld::Ptr& ptr, + virtual std::shared_ptr activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const; ///< Generate action for activation @@ -51,7 +51,7 @@ namespace MWClass virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const; ///< Return name of inventory icon. - virtual boost::shared_ptr use (const MWWorld::Ptr& ptr) + virtual std::shared_ptr use (const MWWorld::Ptr& ptr) const; ///< Generate action for using via inventory menu diff --git a/apps/openmw/mwclass/misc.cpp b/apps/openmw/mwclass/misc.cpp index 3e1d750ad..203a7bbc4 100644 --- a/apps/openmw/mwclass/misc.cpp +++ b/apps/openmw/mwclass/misc.cpp @@ -65,7 +65,7 @@ namespace MWClass return ref->mBase->mName; } - boost::shared_ptr Miscellaneous::activate (const MWWorld::Ptr& ptr, + std::shared_ptr Miscellaneous::activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const { return defaultItemActivate(ptr, actor); @@ -97,7 +97,7 @@ namespace MWClass void Miscellaneous::registerSelf() { - boost::shared_ptr instance (new Miscellaneous); + std::shared_ptr instance (new Miscellaneous); registerClass (typeid (ESM::Miscellaneous).name(), instance); } @@ -213,12 +213,12 @@ namespace MWClass return newPtr; } - boost::shared_ptr Miscellaneous::use (const MWWorld::Ptr& ptr) const + std::shared_ptr Miscellaneous::use (const MWWorld::Ptr& ptr) const { if (ptr.getCellRef().getSoul().empty()) - return boost::shared_ptr(new MWWorld::NullAction()); + return std::shared_ptr(new MWWorld::NullAction()); else - return boost::shared_ptr(new MWWorld::ActionSoulgem(ptr)); + return std::shared_ptr(new MWWorld::ActionSoulgem(ptr)); } bool Miscellaneous::canSell (const MWWorld::ConstPtr& item, int npcServices) const diff --git a/apps/openmw/mwclass/misc.hpp b/apps/openmw/mwclass/misc.hpp index 2a534f058..37e77860b 100644 --- a/apps/openmw/mwclass/misc.hpp +++ b/apps/openmw/mwclass/misc.hpp @@ -20,7 +20,7 @@ namespace MWClass ///< \return name (the one that is to be presented to the user; not the internal one); /// can return an empty string. - virtual boost::shared_ptr activate (const MWWorld::Ptr& ptr, + virtual std::shared_ptr activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const; ///< Generate action for activation @@ -49,7 +49,7 @@ namespace MWClass virtual std::string getModel(const MWWorld::ConstPtr &ptr) const; - virtual boost::shared_ptr use (const MWWorld::Ptr& ptr) + virtual std::shared_ptr use (const MWWorld::Ptr& ptr) const; ///< Generate action for using via inventory menu diff --git a/apps/openmw/mwclass/npc.cpp b/apps/openmw/mwclass/npc.cpp index 277d1691b..f8ff3da19 100644 --- a/apps/openmw/mwclass/npc.cpp +++ b/apps/openmw/mwclass/npc.cpp @@ -844,12 +844,12 @@ namespace MWClass } } - boost::shared_ptr Npc::activate (const MWWorld::Ptr& ptr, + std::shared_ptr Npc::activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const { // player got activated by another NPC if(ptr == MWMechanics::getPlayer()) - return boost::shared_ptr(new MWWorld::ActionTalk(actor)); + return std::shared_ptr(new MWWorld::ActionTalk(actor)); // Werewolfs can't activate NPCs if(actor.getClass().isNpc() && actor.getClass().getNpcStats(actor).isWerewolf()) @@ -857,23 +857,23 @@ namespace MWClass const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); const ESM::Sound *sound = store.get().searchRandom("WolfNPC"); - boost::shared_ptr action(new MWWorld::FailedAction("#{sWerewolfRefusal}")); + std::shared_ptr action(new MWWorld::FailedAction("#{sWerewolfRefusal}")); if(sound) action->setSound(sound->mId); return action; } if(getCreatureStats(ptr).isDead()) - return boost::shared_ptr(new MWWorld::ActionOpen(ptr, true)); + return std::shared_ptr(new MWWorld::ActionOpen(ptr, true)); if(ptr.getClass().getCreatureStats(ptr).getAiSequence().isInCombat()) - return boost::shared_ptr(new MWWorld::FailedAction("#{sActorInCombat}")); + return std::shared_ptr(new MWWorld::FailedAction("#{sActorInCombat}")); if(getCreatureStats(actor).getStance(MWMechanics::CreatureStats::Stance_Sneak) || ptr.getClass().getCreatureStats(ptr).getKnockedDown()) - return boost::shared_ptr(new MWWorld::ActionOpen(ptr)); // stealing + return std::shared_ptr(new MWWorld::ActionOpen(ptr)); // stealing // Can't talk to werewolfs if(ptr.getClass().isNpc() && ptr.getClass().getNpcStats(ptr).isWerewolf()) - return boost::shared_ptr (new MWWorld::FailedAction("")); - return boost::shared_ptr(new MWWorld::ActionTalk(ptr)); + return std::shared_ptr (new MWWorld::FailedAction("")); + return std::shared_ptr(new MWWorld::ActionTalk(ptr)); } MWWorld::ContainerStore& Npc::getContainerStore (const MWWorld::Ptr& ptr) @@ -1009,7 +1009,7 @@ namespace MWClass void Npc::registerSelf() { - boost::shared_ptr instance (new Npc); + std::shared_ptr instance (new Npc); registerClass (typeid (ESM::NPC).name(), instance); } diff --git a/apps/openmw/mwclass/npc.hpp b/apps/openmw/mwclass/npc.hpp index 3120c498c..e91dc7113 100644 --- a/apps/openmw/mwclass/npc.hpp +++ b/apps/openmw/mwclass/npc.hpp @@ -78,7 +78,7 @@ namespace MWClass virtual void getModelsToPreload(const MWWorld::Ptr& ptr, std::vector& models) const; ///< Get a list of models to preload that this object may use (directly or indirectly). default implementation: list getModel(). - virtual boost::shared_ptr activate (const MWWorld::Ptr& ptr, + virtual std::shared_ptr activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const; ///< Generate action for activation diff --git a/apps/openmw/mwclass/potion.cpp b/apps/openmw/mwclass/potion.cpp index 225175979..ffdccf438 100644 --- a/apps/openmw/mwclass/potion.cpp +++ b/apps/openmw/mwclass/potion.cpp @@ -55,7 +55,7 @@ namespace MWClass return ref->mBase->mName; } - boost::shared_ptr Potion::activate (const MWWorld::Ptr& ptr, + std::shared_ptr Potion::activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const { return defaultItemActivate(ptr, actor); @@ -78,7 +78,7 @@ namespace MWClass void Potion::registerSelf() { - boost::shared_ptr instance (new Potion); + std::shared_ptr instance (new Potion); registerClass (typeid (ESM::Potion).name(), instance); } @@ -139,12 +139,12 @@ namespace MWClass return info; } - boost::shared_ptr Potion::use (const MWWorld::Ptr& ptr) const + std::shared_ptr Potion::use (const MWWorld::Ptr& ptr) const { MWWorld::LiveCellRef *ref = ptr.get(); - boost::shared_ptr action ( + std::shared_ptr action ( new MWWorld::ActionApply (ptr, ref->mBase->mId)); action->setSound ("Drink"); diff --git a/apps/openmw/mwclass/potion.hpp b/apps/openmw/mwclass/potion.hpp index 9cdd58058..ad9a329c0 100644 --- a/apps/openmw/mwclass/potion.hpp +++ b/apps/openmw/mwclass/potion.hpp @@ -20,7 +20,7 @@ namespace MWClass ///< \return name (the one that is to be presented to the user; not the internal one); /// can return an empty string. - virtual boost::shared_ptr activate (const MWWorld::Ptr& ptr, + virtual std::shared_ptr activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const; ///< Generate action for activation @@ -36,7 +36,7 @@ namespace MWClass virtual int getValue (const MWWorld::ConstPtr& ptr) const; ///< Return trade value of the object. Throws an exception, if the object can't be traded. - virtual boost::shared_ptr use (const MWWorld::Ptr& ptr) const; + virtual std::shared_ptr use (const MWWorld::Ptr& ptr) const; ///< Generate action for using via inventory menu static void registerSelf(); diff --git a/apps/openmw/mwclass/probe.cpp b/apps/openmw/mwclass/probe.cpp index 185aa66cb..ecaa056f9 100644 --- a/apps/openmw/mwclass/probe.cpp +++ b/apps/openmw/mwclass/probe.cpp @@ -51,7 +51,7 @@ namespace MWClass return ref->mBase->mName; } - boost::shared_ptr Probe::activate (const MWWorld::Ptr& ptr, + std::shared_ptr Probe::activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const { return defaultItemActivate(ptr, actor); @@ -83,7 +83,7 @@ namespace MWClass void Probe::registerSelf() { - boost::shared_ptr instance (new Probe); + std::shared_ptr instance (new Probe); registerClass (typeid (ESM::Probe).name(), instance); } @@ -139,9 +139,9 @@ namespace MWClass return info; } - boost::shared_ptr Probe::use (const MWWorld::Ptr& ptr) const + std::shared_ptr Probe::use (const MWWorld::Ptr& ptr) const { - boost::shared_ptr action(new MWWorld::ActionEquip(ptr)); + std::shared_ptr action(new MWWorld::ActionEquip(ptr)); action->setSound(getUpSoundId(ptr)); diff --git a/apps/openmw/mwclass/probe.hpp b/apps/openmw/mwclass/probe.hpp index 4fc991a5f..f67d8af86 100644 --- a/apps/openmw/mwclass/probe.hpp +++ b/apps/openmw/mwclass/probe.hpp @@ -20,7 +20,7 @@ namespace MWClass ///< \return name (the one that is to be presented to the user; not the internal one); /// can return an empty string. - virtual boost::shared_ptr activate (const MWWorld::Ptr& ptr, + virtual std::shared_ptr activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const; ///< Generate action for activation @@ -51,7 +51,7 @@ namespace MWClass virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const; ///< Return name of inventory icon. - virtual boost::shared_ptr use (const MWWorld::Ptr& ptr) + virtual std::shared_ptr use (const MWWorld::Ptr& ptr) const; ///< Generate action for using via inventory menu diff --git a/apps/openmw/mwclass/repair.cpp b/apps/openmw/mwclass/repair.cpp index cbdfade2b..566d16106 100644 --- a/apps/openmw/mwclass/repair.cpp +++ b/apps/openmw/mwclass/repair.cpp @@ -51,7 +51,7 @@ namespace MWClass return ref->mBase->mName; } - boost::shared_ptr Repair::activate (const MWWorld::Ptr& ptr, + std::shared_ptr Repair::activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const { return defaultItemActivate(ptr, actor); @@ -74,7 +74,7 @@ namespace MWClass void Repair::registerSelf() { - boost::shared_ptr instance (new Repair); + std::shared_ptr instance (new Repair); registerClass (typeid (ESM::Repair).name(), instance); } @@ -149,9 +149,9 @@ namespace MWClass return MWWorld::Ptr(cell.insert(ref), &cell); } - boost::shared_ptr Repair::use (const MWWorld::Ptr& ptr) const + std::shared_ptr Repair::use (const MWWorld::Ptr& ptr) const { - return boost::shared_ptr(new MWWorld::ActionRepair(ptr)); + return std::shared_ptr(new MWWorld::ActionRepair(ptr)); } bool Repair::canSell (const MWWorld::ConstPtr& item, int npcServices) const diff --git a/apps/openmw/mwclass/repair.hpp b/apps/openmw/mwclass/repair.hpp index f0d1292f4..34ba4035b 100644 --- a/apps/openmw/mwclass/repair.hpp +++ b/apps/openmw/mwclass/repair.hpp @@ -20,7 +20,7 @@ namespace MWClass ///< \return name (the one that is to be presented to the user; not the internal one); /// can return an empty string. - virtual boost::shared_ptr activate (const MWWorld::Ptr& ptr, + virtual std::shared_ptr activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const; ///< Generate action for activation @@ -49,7 +49,7 @@ namespace MWClass virtual std::string getModel(const MWWorld::ConstPtr &ptr) const; - virtual boost::shared_ptr use (const MWWorld::Ptr& ptr) + virtual std::shared_ptr use (const MWWorld::Ptr& ptr) const; ///< Generate action for using via inventory menu (default implementation: return a /// null action). diff --git a/apps/openmw/mwclass/static.cpp b/apps/openmw/mwclass/static.cpp index 65e69ea90..40a6b998c 100644 --- a/apps/openmw/mwclass/static.cpp +++ b/apps/openmw/mwclass/static.cpp @@ -43,7 +43,7 @@ namespace MWClass void Static::registerSelf() { - boost::shared_ptr instance (new Static); + std::shared_ptr instance (new Static); registerClass (typeid (ESM::Static).name(), instance); } diff --git a/apps/openmw/mwclass/weapon.cpp b/apps/openmw/mwclass/weapon.cpp index 575accaba..efb6248af 100644 --- a/apps/openmw/mwclass/weapon.cpp +++ b/apps/openmw/mwclass/weapon.cpp @@ -54,7 +54,7 @@ namespace MWClass return ref->mBase->mName; } - boost::shared_ptr Weapon::activate (const MWWorld::Ptr& ptr, + std::shared_ptr Weapon::activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const { return defaultItemActivate(ptr, actor); @@ -143,7 +143,7 @@ namespace MWClass void Weapon::registerSelf() { - boost::shared_ptr instance (new Weapon); + std::shared_ptr instance (new Weapon); registerClass (typeid (ESM::Weapon).name(), instance); } @@ -392,9 +392,9 @@ namespace MWClass return std::make_pair(1, ""); } - boost::shared_ptr Weapon::use (const MWWorld::Ptr& ptr) const + std::shared_ptr Weapon::use (const MWWorld::Ptr& ptr) const { - boost::shared_ptr action(new MWWorld::ActionEquip(ptr)); + std::shared_ptr action(new MWWorld::ActionEquip(ptr)); action->setSound(getUpSoundId(ptr)); diff --git a/apps/openmw/mwclass/weapon.hpp b/apps/openmw/mwclass/weapon.hpp index 5fc3983f2..c14847363 100644 --- a/apps/openmw/mwclass/weapon.hpp +++ b/apps/openmw/mwclass/weapon.hpp @@ -21,7 +21,7 @@ namespace MWClass ///< \return name (the one that is to be presented to the user; not the internal one); /// can return an empty string. - virtual boost::shared_ptr activate (const MWWorld::Ptr& ptr, + virtual std::shared_ptr activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const; ///< Generate action for activation @@ -72,7 +72,7 @@ namespace MWClass ///< Return 0 if player cannot equip item. 1 if can equip. 2 if it's twohanded weapon. 3 if twohanded weapon conflicts with that. /// Second item in the pair specifies the error message - virtual boost::shared_ptr use (const MWWorld::Ptr& ptr) + virtual std::shared_ptr use (const MWWorld::Ptr& ptr) const; ///< Generate action for using via inventory menu diff --git a/apps/openmw/mwgui/bookpage.cpp b/apps/openmw/mwgui/bookpage.cpp index 4cede0e18..24dfe6024 100644 --- a/apps/openmw/mwgui/bookpage.cpp +++ b/apps/openmw/mwgui/bookpage.cpp @@ -8,7 +8,6 @@ #include #include -#include #include #include @@ -235,7 +234,7 @@ struct TypesetBookImpl::Typesetter : BookTypesetter }; typedef TypesetBookImpl Book; - typedef boost::shared_ptr BookPtr; + typedef std::shared_ptr BookPtr; typedef std::vector::const_iterator PartialTextConstIterator; int mPageWidth; @@ -259,7 +258,7 @@ struct TypesetBookImpl::Typesetter : BookTypesetter mCurrentContent (NULL), mCurrentAlignment (AlignLeft) { - mBook = boost::make_shared (); + mBook = std::make_shared (); } virtual ~Typesetter () @@ -628,7 +627,7 @@ struct TypesetBookImpl::Typesetter : BookTypesetter BookTypesetter::Ptr BookTypesetter::create (int pageWidth, int pageHeight) { - return boost::make_shared (pageWidth, pageHeight); + return std::make_shared (pageWidth, pageHeight); } namespace @@ -900,7 +899,7 @@ public: boost::function mLinkClicked; - boost::shared_ptr mBook; + std::shared_ptr mBook; MyGUI::ILayerNode* mNode; ActiveTextFormats mActiveTextFormats; @@ -1034,7 +1033,7 @@ public: void showPage (TypesetBook::Ptr book, size_t newPage) { - boost::shared_ptr newBook = boost::dynamic_pointer_cast (book); + std::shared_ptr newBook = std::dynamic_pointer_cast (book); if (mBook != newBook) { @@ -1123,7 +1122,7 @@ public: } }; - void createActiveFormats (boost::shared_ptr newBook) + void createActiveFormats (std::shared_ptr newBook) { newBook->visitRuns (0, 0x7FFFFFFF, CreateActiveFormat (this)); diff --git a/apps/openmw/mwgui/bookpage.hpp b/apps/openmw/mwgui/bookpage.hpp index c7340ec7c..8800508b4 100644 --- a/apps/openmw/mwgui/bookpage.hpp +++ b/apps/openmw/mwgui/bookpage.hpp @@ -7,7 +7,6 @@ #include #include #include -#include namespace MWGui { @@ -15,7 +14,7 @@ namespace MWGui /// the book page widget. struct TypesetBook { - typedef boost::shared_ptr Ptr; + typedef std::shared_ptr Ptr; typedef intptr_t InteractiveId; /// Returns the number of pages in the document. @@ -33,7 +32,7 @@ namespace MWGui /// A factory class for creating a typeset book instance. struct BookTypesetter { - typedef boost::shared_ptr Ptr; + typedef std::shared_ptr Ptr; typedef TypesetBook::InteractiveId InteractiveId; typedef MyGUI::Colour Colour; typedef uint8_t const * Utf8Point; diff --git a/apps/openmw/mwgui/inventorywindow.cpp b/apps/openmw/mwgui/inventorywindow.cpp index d52a307c2..a93934ecb 100644 --- a/apps/openmw/mwgui/inventorywindow.cpp +++ b/apps/openmw/mwgui/inventorywindow.cpp @@ -493,7 +493,7 @@ namespace MWGui { if (script.empty() || ptr.getRefData().getLocals().getIntVar(script, "pcskipequip") == 0) { - boost::shared_ptr action = ptr.getClass().use(ptr); + std::shared_ptr action = ptr.getClass().use(ptr); action->execute (player); } diff --git a/apps/openmw/mwgui/journalviewmodel.cpp b/apps/openmw/mwgui/journalviewmodel.cpp index 70f1305e0..a2819b749 100644 --- a/apps/openmw/mwgui/journalviewmodel.cpp +++ b/apps/openmw/mwgui/journalviewmodel.cpp @@ -356,7 +356,7 @@ struct JournalViewModelImpl : JournalViewModel JournalViewModel::Ptr JournalViewModel::create () { - return boost::make_shared (); + return std::make_shared (); } } diff --git a/apps/openmw/mwgui/journalviewmodel.hpp b/apps/openmw/mwgui/journalviewmodel.hpp index b3c6b0183..5739a311f 100644 --- a/apps/openmw/mwgui/journalviewmodel.hpp +++ b/apps/openmw/mwgui/journalviewmodel.hpp @@ -6,7 +6,6 @@ #include #include #include -#include namespace MWGui { @@ -18,7 +17,7 @@ namespace MWGui /// game data store. struct JournalViewModel { - typedef boost::shared_ptr Ptr; + typedef std::shared_ptr Ptr; typedef intptr_t QuestId; typedef intptr_t TopicId; diff --git a/apps/openmw/mwgui/journalwindow.hpp b/apps/openmw/mwgui/journalwindow.hpp index 740284e20..cc645ca44 100644 --- a/apps/openmw/mwgui/journalwindow.hpp +++ b/apps/openmw/mwgui/journalwindow.hpp @@ -1,7 +1,7 @@ #ifndef MWGUI_JOURNAL_H #define MWGUI_JOURNAL_H -#include +#include namespace MWBase { class WindowManager; } @@ -12,7 +12,7 @@ namespace MWGui struct JournalWindow { /// construct a new instance of the one JournalWindow implementation - static JournalWindow * create (boost::shared_ptr Model, bool questList); + static JournalWindow * create (std::shared_ptr Model, bool questList); /// destroy this instance of the JournalWindow implementation virtual ~JournalWindow () {}; diff --git a/apps/openmw/mwgui/mapwindow.cpp b/apps/openmw/mwgui/mapwindow.cpp index 4d4efeecb..7d81b6ab3 100644 --- a/apps/openmw/mwgui/mapwindow.cpp +++ b/apps/openmw/mwgui/mapwindow.cpp @@ -252,7 +252,7 @@ namespace MWGui osg::ref_ptr tex = mLocalMapRender->getFogOfWarTexture(x, y); if (tex) { - boost::shared_ptr myguitex (new osgMyGUI::OSGTexture(tex)); + std::shared_ptr myguitex (new osgMyGUI::OSGTexture(tex)); fog->setRenderItemTexture(myguitex.get()); fog->getSubWidgetMain()->_setUVSet(MyGUI::FloatRect(0.f, 1.f, 1.f, 0.f)); fogTextures.push_back(myguitex); @@ -382,7 +382,7 @@ namespace MWGui osg::ref_ptr texture = mLocalMapRender->getMapTexture(mapX, mapY); if (texture) { - boost::shared_ptr guiTex (new osgMyGUI::OSGTexture(texture)); + std::shared_ptr guiTex (new osgMyGUI::OSGTexture(texture)); textures.push_back(guiTex); box->setRenderItemTexture(guiTex.get()); box->getSubWidgetMain()->_setUVSet(MyGUI::FloatRect(0.f, 0.f, 1.f, 1.f)); diff --git a/apps/openmw/mwgui/mapwindow.hpp b/apps/openmw/mwgui/mapwindow.hpp index 243b1160f..312447a24 100644 --- a/apps/openmw/mwgui/mapwindow.hpp +++ b/apps/openmw/mwgui/mapwindow.hpp @@ -3,8 +3,6 @@ #include -#include - #include "windowpinnablebase.hpp" #include @@ -130,7 +128,7 @@ namespace MWGui std::vector mMapWidgets; std::vector mFogWidgets; - typedef std::vector > TextureVector; + typedef std::vector > TextureVector; TextureVector mMapTextures; TextureVector mFogTextures; diff --git a/apps/openmw/mwgui/screenfader.hpp b/apps/openmw/mwgui/screenfader.hpp index f87fd8443..b510e133a 100644 --- a/apps/openmw/mwgui/screenfader.hpp +++ b/apps/openmw/mwgui/screenfader.hpp @@ -3,8 +3,6 @@ #include -#include - #include "windowbase.hpp" namespace MWGui @@ -14,7 +12,7 @@ namespace MWGui class FadeOp { public: - typedef boost::shared_ptr Ptr; + typedef std::shared_ptr Ptr; FadeOp(ScreenFader * fader, float time, float targetAlpha); diff --git a/apps/openmw/mwgui/sortfilteritemmodel.cpp b/apps/openmw/mwgui/sortfilteritemmodel.cpp index 60111fb79..68d95fb88 100644 --- a/apps/openmw/mwgui/sortfilteritemmodel.cpp +++ b/apps/openmw/mwgui/sortfilteritemmodel.cpp @@ -143,7 +143,7 @@ namespace MWGui if ((mFilter & Filter_OnlyUsableItems) && base.getClass().getScript(base).empty()) { - boost::shared_ptr actionOnUse = base.getClass().use(base); + std::shared_ptr actionOnUse = base.getClass().use(base); if (!actionOnUse || actionOnUse->isNullAction()) return false; } diff --git a/apps/openmw/mwmechanics/aicombat.cpp b/apps/openmw/mwmechanics/aicombat.cpp index a7a3d6ad7..a00890cea 100644 --- a/apps/openmw/mwmechanics/aicombat.cpp +++ b/apps/openmw/mwmechanics/aicombat.cpp @@ -47,7 +47,7 @@ namespace MWMechanics bool mCombatMove; osg::Vec3f mLastTargetPos; const MWWorld::CellStore* mCell; - boost::shared_ptr mCurrentAction; + std::shared_ptr mCurrentAction; float mActionCooldown; float mStrength; bool mForceNoShortcut; @@ -249,7 +249,7 @@ namespace MWMechanics actorClass.getCreatureStats(actor).setMovementFlag(CreatureStats::Flag_Run, true); float& actionCooldown = storage.mActionCooldown; - boost::shared_ptr& currentAction = storage.mCurrentAction; + std::shared_ptr& currentAction = storage.mCurrentAction; if (!forceFlee) { @@ -512,7 +512,7 @@ namespace MWMechanics targetWeapon = *weaponSlot; } - boost::shared_ptr targetWeaponAction (new ActionWeapon(targetWeapon)); + std::shared_ptr targetWeaponAction (new ActionWeapon(targetWeapon)); if (targetWeaponAction.get()) { diff --git a/apps/openmw/mwmechanics/aicombat.hpp b/apps/openmw/mwmechanics/aicombat.hpp index fbe864ca0..e7d74248b 100644 --- a/apps/openmw/mwmechanics/aicombat.hpp +++ b/apps/openmw/mwmechanics/aicombat.hpp @@ -3,8 +3,6 @@ #include "aipackage.hpp" -#include - #include "../mwworld/cellstore.hpp" // for Doors #include "../mwbase/world.hpp" diff --git a/apps/openmw/mwmechanics/aicombataction.cpp b/apps/openmw/mwmechanics/aicombataction.cpp index 37b67c9b2..6d879c57d 100644 --- a/apps/openmw/mwmechanics/aicombataction.cpp +++ b/apps/openmw/mwmechanics/aicombataction.cpp @@ -709,14 +709,14 @@ namespace MWMechanics return mWeapon.get()->mBase; } - boost::shared_ptr prepareNextAction(const MWWorld::Ptr &actor, const MWWorld::Ptr &enemy) + std::shared_ptr prepareNextAction(const MWWorld::Ptr &actor, const MWWorld::Ptr &enemy) { Spells& spells = actor.getClass().getCreatureStats(actor).getSpells(); float bestActionRating = 0.f; float antiFleeRating = 0.f; // Default to hand-to-hand combat - boost::shared_ptr bestAction (new ActionWeapon(MWWorld::Ptr())); + std::shared_ptr bestAction (new ActionWeapon(MWWorld::Ptr())); if (actor.getClass().isNpc() && actor.getClass().getNpcStats(actor).isWerewolf()) { bestAction->prepare(actor); diff --git a/apps/openmw/mwmechanics/aicombataction.hpp b/apps/openmw/mwmechanics/aicombataction.hpp index 0f1f7dd5b..3db88269b 100644 --- a/apps/openmw/mwmechanics/aicombataction.hpp +++ b/apps/openmw/mwmechanics/aicombataction.hpp @@ -1,7 +1,7 @@ #ifndef OPENMW_AICOMBAT_ACTION_H #define OPENMW_AICOMBAT_ACTION_H -#include +#include #include @@ -100,7 +100,7 @@ namespace MWMechanics /// @note target may be empty float rateEffects (const ESM::EffectList& list, const MWWorld::Ptr& actor, const MWWorld::Ptr& enemy); - boost::shared_ptr prepareNextAction (const MWWorld::Ptr& actor, const MWWorld::Ptr& enemy); + std::shared_ptr prepareNextAction (const MWWorld::Ptr& actor, const MWWorld::Ptr& enemy); float getDistanceMinusHalfExtents(const MWWorld::Ptr& actor, const MWWorld::Ptr& enemy, bool minusZDist=false); float getMaxAttackDistance(const MWWorld::Ptr& actor); diff --git a/apps/openmw/mwscript/containerextensions.cpp b/apps/openmw/mwscript/containerextensions.cpp index b7a7cafe6..a65c275d6 100644 --- a/apps/openmw/mwscript/containerextensions.cpp +++ b/apps/openmw/mwscript/containerextensions.cpp @@ -199,7 +199,7 @@ namespace MWScript MWBase::Environment::get().getWindowManager()->useItem(*it); else { - boost::shared_ptr action = it->getClass().use(*it); + std::shared_ptr action = it->getClass().use(*it); // No equip sound for actors other than the player action->execute(ptr, true); } diff --git a/apps/openmw/mwscript/interpretercontext.cpp b/apps/openmw/mwscript/interpretercontext.cpp index 2462d72ae..26d7916b1 100644 --- a/apps/openmw/mwscript/interpretercontext.cpp +++ b/apps/openmw/mwscript/interpretercontext.cpp @@ -478,7 +478,7 @@ namespace MWScript void InterpreterContext::executeActivation(MWWorld::Ptr ptr, MWWorld::Ptr actor) { - boost::shared_ptr action = (ptr.getClass().activate(ptr, actor)); + std::shared_ptr action = (ptr.getClass().activate(ptr, actor)); action->execute (actor); if (action->getTarget() != MWWorld::Ptr() && action->getTarget() != ptr) { diff --git a/apps/openmw/mwscript/interpretercontext.hpp b/apps/openmw/mwscript/interpretercontext.hpp index 80861d1a7..ac8e1833b 100644 --- a/apps/openmw/mwscript/interpretercontext.hpp +++ b/apps/openmw/mwscript/interpretercontext.hpp @@ -1,8 +1,6 @@ #ifndef GAME_SCRIPT_INTERPRETERCONTEXT_H #define GAME_SCRIPT_INTERPRETERCONTEXT_H -#include - #include #include "../mwworld/ptr.hpp" diff --git a/apps/openmw/mwsound/soundmanagerimp.hpp b/apps/openmw/mwsound/soundmanagerimp.hpp index 86e8b2bc7..bf628b102 100644 --- a/apps/openmw/mwsound/soundmanagerimp.hpp +++ b/apps/openmw/mwsound/soundmanagerimp.hpp @@ -7,8 +7,6 @@ #include #include -#include - #include #include diff --git a/apps/openmw/mwworld/cellstore.hpp b/apps/openmw/mwworld/cellstore.hpp index aa7d68d8c..4452ad889 100644 --- a/apps/openmw/mwworld/cellstore.hpp +++ b/apps/openmw/mwworld/cellstore.hpp @@ -6,8 +6,7 @@ #include #include #include - -#include +#include #include "livecellref.hpp" #include "cellreflist.hpp" @@ -67,7 +66,7 @@ namespace MWWorld // Even though fog actually belongs to the player and not cells, // it makes sense to store it here since we need it once for each cell. // Note this is NULL until the cell is explored to save some memory - boost::shared_ptr mFogState; + std::shared_ptr mFogState; const ESM::Cell *mCell; State mState; diff --git a/apps/openmw/mwworld/class.cpp b/apps/openmw/mwworld/class.cpp index 72696e209..e59dde7b1 100644 --- a/apps/openmw/mwworld/class.cpp +++ b/apps/openmw/mwworld/class.cpp @@ -24,7 +24,7 @@ namespace MWWorld { - std::map > Class::sClasses; + std::map > Class::sClasses; Class::Class() {} @@ -108,14 +108,14 @@ namespace MWWorld throw std::runtime_error("class cannot be hit"); } - boost::shared_ptr Class::activate (const Ptr& ptr, const Ptr& actor) const + std::shared_ptr Class::activate (const Ptr& ptr, const Ptr& actor) const { - return boost::shared_ptr (new NullAction); + return std::shared_ptr (new NullAction); } - boost::shared_ptr Class::use (const Ptr& ptr) const + std::shared_ptr Class::use (const Ptr& ptr) const { - return boost::shared_ptr (new NullAction); + return std::shared_ptr (new NullAction); } ContainerStore& Class::getContainerStore (const Ptr& ptr) const @@ -233,7 +233,7 @@ namespace MWWorld if (key.empty()) throw std::logic_error ("Class::get(): attempting to get an empty key"); - std::map >::const_iterator iter = sClasses.find (key); + std::map >::const_iterator iter = sClasses.find (key); if (iter==sClasses.end()) throw std::logic_error ("Class::get(): unknown class key: " + key); @@ -246,7 +246,7 @@ namespace MWWorld throw std::runtime_error ("class does not support persistence"); } - void Class::registerClass(const std::string& key, boost::shared_ptr instance) + void Class::registerClass(const std::string& key, std::shared_ptr instance) { instance->mTypeName = key; sClasses.insert(std::make_pair(key, instance)); @@ -330,23 +330,23 @@ namespace MWWorld { } - boost::shared_ptr Class::defaultItemActivate(const Ptr &ptr, const Ptr &actor) const + std::shared_ptr Class::defaultItemActivate(const Ptr &ptr, const Ptr &actor) const { if(!MWBase::Environment::get().getWindowManager()->isAllowed(MWGui::GW_Inventory)) - return boost::shared_ptr(new NullAction()); + return std::shared_ptr(new NullAction()); if(actor.getClass().isNpc() && actor.getClass().getNpcStats(actor).isWerewolf()) { const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); const ESM::Sound *sound = store.get().searchRandom("WolfItem"); - boost::shared_ptr action(new MWWorld::FailedAction("#{sWerewolfRefusal}")); + std::shared_ptr action(new MWWorld::FailedAction("#{sWerewolfRefusal}")); if(sound) action->setSound(sound->mId); return action; } - boost::shared_ptr action(new ActionTake(ptr)); + std::shared_ptr action(new ActionTake(ptr)); action->setSound(getUpSoundId(ptr)); return action; diff --git a/apps/openmw/mwworld/class.hpp b/apps/openmw/mwworld/class.hpp index 3b1ddb647..42d57ffab 100644 --- a/apps/openmw/mwworld/class.hpp +++ b/apps/openmw/mwworld/class.hpp @@ -2,11 +2,10 @@ #define GAME_MWWORLD_CLASS_H #include +#include #include #include -#include - #include "ptr.hpp" namespace ESM @@ -51,7 +50,7 @@ namespace MWWorld /// \brief Base class for referenceable esm records class Class { - static std::map > sClasses; + static std::map > sClasses; std::string mTypeName; @@ -63,7 +62,7 @@ namespace MWWorld Class(); - boost::shared_ptr defaultItemActivate(const Ptr &ptr, const Ptr &actor) const; + std::shared_ptr defaultItemActivate(const Ptr &ptr, const Ptr &actor) const; ///< Generate default action for activating inventory items virtual Ptr copyToCellImpl(const ConstPtr &ptr, CellStore &cell) const; @@ -139,10 +138,10 @@ namespace MWWorld ///< \return Can the player activate this object? /// (default implementation: true if object's user-readable name is not empty, false otherwise) - virtual boost::shared_ptr activate (const Ptr& ptr, const Ptr& actor) const; + virtual std::shared_ptr activate (const Ptr& ptr, const Ptr& actor) const; ///< Generate action for activation (default implementation: return a null action). - virtual boost::shared_ptr use (const Ptr& ptr) + virtual std::shared_ptr use (const Ptr& ptr) const; ///< Generate action for using via inventory menu (default implementation: return a /// null action). @@ -332,7 +331,7 @@ namespace MWWorld static const Class& get (const std::string& key); ///< If there is no class for this \a key, an exception is thrown. - static void registerClass (const std::string& key, boost::shared_ptr instance); + static void registerClass (const std::string& key, std::shared_ptr instance); virtual int getBaseGold(const MWWorld::ConstPtr& ptr) const; diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 0421ecb24..815810d36 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -3359,7 +3359,7 @@ namespace MWWorld if (object.getRefData().activate()) { - boost::shared_ptr action = (object.getClass().activate(object, actor)); + std::shared_ptr action = (object.getClass().activate(object, actor)); action->execute (actor); } } diff --git a/apps/openmw/mwworld/worldimp.hpp b/apps/openmw/mwworld/worldimp.hpp index ce6e27672..1707d7a4b 100644 --- a/apps/openmw/mwworld/worldimp.hpp +++ b/apps/openmw/mwworld/worldimp.hpp @@ -1,8 +1,6 @@ #ifndef GAME_MWWORLD_WORLDIMP_H #define GAME_MWWORLD_WORLDIMP_H -#include - #include #include @@ -100,7 +98,7 @@ namespace MWWorld std::string mCurrentWorldSpace; - boost::shared_ptr mProjectileManager; + std::shared_ptr mProjectileManager; bool mGodMode; bool mScriptsEnabled; diff --git a/components/bsa/bsa_file.cpp b/components/bsa/bsa_file.cpp index 2b9a3f632..50b3374e5 100644 --- a/components/bsa/bsa_file.cpp +++ b/components/bsa/bsa_file.cpp @@ -24,6 +24,7 @@ #include "bsa_file.hpp" #include +#include #include #include diff --git a/components/contentselector/model/loadordererror.cpp b/components/contentselector/model/loadordererror.cpp index aa69f330e..7177e8ec1 100644 --- a/components/contentselector/model/loadordererror.cpp +++ b/components/contentselector/model/loadordererror.cpp @@ -1,5 +1,5 @@ #include "loadordererror.hpp" -#include +#include QString ContentSelectorModel::LoadOrderError::sErrorToolTips[ErrorCode_LoadOrder] = { diff --git a/components/contentselector/view/contentselector.cpp b/components/contentselector/view/contentselector.cpp index 514a0444a..b98bb667d 100644 --- a/components/contentselector/view/contentselector.cpp +++ b/components/contentselector/view/contentselector.cpp @@ -6,12 +6,9 @@ #include #include - #include -#include -#include #include -#include +#include ContentSelectorView::ContentSelector::ContentSelector(QWidget *parent) : QObject(parent) diff --git a/components/esm/npcstats.cpp b/components/esm/npcstats.cpp index 4c1095b6e..a12879109 100644 --- a/components/esm/npcstats.cpp +++ b/components/esm/npcstats.cpp @@ -1,3 +1,5 @@ +#include + #include "npcstats.hpp" #include "esmreader.hpp" diff --git a/components/files/constrainedfilestream.hpp b/components/files/constrainedfilestream.hpp index 6f22e31b8..05ae0fbec 100644 --- a/components/files/constrainedfilestream.hpp +++ b/components/files/constrainedfilestream.hpp @@ -2,8 +2,7 @@ #define OPENMW_CONSTRAINEDFILESTREAM_H #include - -#include +#include namespace Files { diff --git a/components/nif/nifkey.hpp b/components/nif/nifkey.hpp index 5d96f456e..9238a6548 100644 --- a/components/nif/nifkey.hpp +++ b/components/nif/nifkey.hpp @@ -8,8 +8,6 @@ #include #include -#include - #include "niffile.hpp" namespace Nif diff --git a/components/nif/nifstream.hpp b/components/nif/nifstream.hpp index f4163ce47..860c62e64 100644 --- a/components/nif/nifstream.hpp +++ b/components/nif/nifstream.hpp @@ -3,6 +3,7 @@ #ifndef OPENMW_COMPONENTS_NIF_NIFSTREAM_HPP #define OPENMW_COMPONENTS_NIF_NIFSTREAM_HPP +#include #include #include #include diff --git a/components/nifosg/controller.hpp b/components/nifosg/controller.hpp index c2e3abb92..5fbb172f9 100644 --- a/components/nifosg/controller.hpp +++ b/components/nifosg/controller.hpp @@ -9,8 +9,6 @@ #include #include -#include - #include //UVController // FlipController @@ -101,8 +99,6 @@ namespace NifOsg // cache for next time mLastHighKey = it; - assert (it != keys.begin()); // Shouldn't happen, was checked at beginning of this function - typename MapT::MapType::const_iterator last = --it; mLastLowKey = last; float aLastTime = last->first; diff --git a/components/resource/imagemanager.cpp b/components/resource/imagemanager.cpp index db47324fb..441fd8212 100644 --- a/components/resource/imagemanager.cpp +++ b/components/resource/imagemanager.cpp @@ -1,7 +1,7 @@ #include "imagemanager.hpp" +#include #include -#include #include diff --git a/components/resource/resourcesystem.cpp b/components/resource/resourcesystem.cpp index 74d89ab7a..8d05a1b4e 100644 --- a/components/resource/resourcesystem.cpp +++ b/components/resource/resourcesystem.cpp @@ -1,5 +1,7 @@ #include "resourcesystem.hpp" +#include + #include "scenemanager.hpp" #include "imagemanager.hpp" #include "niffilemanager.hpp" diff --git a/extern/osg-ffmpeg-videoplayer/videoplayer.hpp b/extern/osg-ffmpeg-videoplayer/videoplayer.hpp index 351bc75b2..97ef13032 100644 --- a/extern/osg-ffmpeg-videoplayer/videoplayer.hpp +++ b/extern/osg-ffmpeg-videoplayer/videoplayer.hpp @@ -10,8 +10,6 @@ #include -#include - namespace osg { class Texture2D; diff --git a/extern/osg-ffmpeg-videoplayer/videostate.cpp b/extern/osg-ffmpeg-videoplayer/videostate.cpp index aa87069ac..b7be81629 100644 --- a/extern/osg-ffmpeg-videoplayer/videostate.cpp +++ b/extern/osg-ffmpeg-videoplayer/videostate.cpp @@ -1,7 +1,7 @@ #include "videostate.hpp" +#include #include -#include #include @@ -19,8 +19,6 @@ extern "C" #include #endif - #include - #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(55,28,1) #define av_frame_alloc avcodec_alloc_frame #endif diff --git a/extern/osg-ffmpeg-videoplayer/videostate.hpp b/extern/osg-ffmpeg-videoplayer/videostate.hpp index a321d07c3..e61f4feb7 100644 --- a/extern/osg-ffmpeg-videoplayer/videostate.hpp +++ b/extern/osg-ffmpeg-videoplayer/videostate.hpp @@ -5,8 +5,6 @@ #include #include -#include - #include #include #include From 39185e6f8c99851ce99a6cfc3d4e219beea3946a Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Fri, 5 May 2017 21:42:57 +0200 Subject: [PATCH 23/51] purge the rest of boost::shared and any other boost related things that no longer are required put boost system back in, clean others up revert Qt add back boost fstream --- .travis.yml | 2 +- apps/bsatool/bsatool.cpp | 1 - apps/essimporter/importer.cpp | 72 ++++++++--------- apps/opencs/model/doc/document.hpp | 1 - apps/opencs/model/filter/andnode.cpp | 2 +- apps/opencs/model/filter/andnode.hpp | 2 +- apps/opencs/model/filter/narynode.cpp | 4 +- apps/opencs/model/filter/narynode.hpp | 6 +- apps/opencs/model/filter/node.hpp | 5 +- apps/opencs/model/filter/notnode.cpp | 2 +- apps/opencs/model/filter/notnode.hpp | 2 +- apps/opencs/model/filter/ornode.cpp | 2 +- apps/opencs/model/filter/ornode.hpp | 2 +- apps/opencs/model/filter/parser.cpp | 78 +++++++++---------- apps/opencs/model/filter/parser.hpp | 14 ++-- apps/opencs/model/filter/unarynode.cpp | 2 +- apps/opencs/model/filter/unarynode.hpp | 6 +- apps/opencs/model/world/data.cpp | 8 +- apps/opencs/model/world/data.hpp | 8 +- .../model/world/idcompletionmanager.cpp | 4 +- .../model/world/idcompletionmanager.hpp | 7 +- apps/opencs/model/world/idtableproxymodel.cpp | 2 +- apps/opencs/model/world/idtableproxymodel.hpp | 6 +- apps/opencs/view/filter/editwidget.hpp | 4 +- apps/opencs/view/filter/filterbox.cpp | 4 +- apps/opencs/view/filter/filterbox.hpp | 2 +- apps/opencs/view/filter/recordfilterbox.cpp | 4 +- apps/opencs/view/filter/recordfilterbox.hpp | 4 +- apps/opencs/view/render/object.hpp | 2 - apps/opencs/view/render/scenewidget.cpp | 2 +- apps/opencs/view/render/scenewidget.hpp | 6 +- apps/opencs/view/render/worldspacewidget.hpp | 2 - apps/opencs/view/world/table.cpp | 2 +- apps/opencs/view/world/table.hpp | 2 +- apps/opencs/view/world/tablesubview.cpp | 4 +- apps/openmw/mwrender/water.cpp | 2 - .../contentselector/view/contentselector.cpp | 4 +- .../osg-ffmpeg-videoplayer/audiodecoder.cpp | 1 + 38 files changed, 131 insertions(+), 152 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4dbc7687b..86dbdcfd4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,7 +32,7 @@ addons: # Tests libgtest-dev, google-mock, # Boost - libboost-filesystem-dev, libboost-program-options-dev, libboost-system-dev, libboost-thread-dev, + libboost-filesystem-dev, libboost-program-options-dev, libboost-system-dev, # FFmpeg libavcodec-dev, libavformat-dev, libavutil-dev, libswscale-dev, # Audio & Video diff --git a/apps/bsatool/bsatool.cpp b/apps/bsatool/bsatool.cpp index 7f305052b..54e946cbc 100644 --- a/apps/bsatool/bsatool.cpp +++ b/apps/bsatool/bsatool.cpp @@ -1,7 +1,6 @@ #include #include #include -#include #include #include diff --git a/apps/essimporter/importer.cpp b/apps/essimporter/importer.cpp index c27e15a3e..2c05f9ecb 100644 --- a/apps/essimporter/importer.cpp +++ b/apps/essimporter/importer.cpp @@ -1,8 +1,8 @@ #include "importer.hpp" #include +#include -#include #include #include @@ -272,37 +272,37 @@ namespace ESSImport const unsigned int recGAME = ESM::FourCC<'G','A','M','E'>::value; const unsigned int recJOUR = ESM::FourCC<'J','O','U','R'>::value; - std::map > converters; - converters[ESM::REC_GLOB] = boost::shared_ptr(new ConvertGlobal()); - converters[ESM::REC_BOOK] = boost::shared_ptr(new ConvertBook()); - converters[ESM::REC_NPC_] = boost::shared_ptr(new ConvertNPC()); - converters[ESM::REC_CREA] = boost::shared_ptr(new ConvertCREA()); - converters[ESM::REC_NPCC] = boost::shared_ptr(new ConvertNPCC()); - converters[ESM::REC_CREC] = boost::shared_ptr(new ConvertCREC()); - converters[recREFR ] = boost::shared_ptr(new ConvertREFR()); - converters[recPCDT ] = boost::shared_ptr(new ConvertPCDT()); - converters[recFMAP ] = boost::shared_ptr(new ConvertFMAP()); - converters[recKLST ] = boost::shared_ptr(new ConvertKLST()); - converters[recSTLN ] = boost::shared_ptr(new ConvertSTLN()); - converters[recGAME ] = boost::shared_ptr(new ConvertGAME()); - converters[ESM::REC_CELL] = boost::shared_ptr(new ConvertCell()); - converters[ESM::REC_ALCH] = boost::shared_ptr(new DefaultConverter()); - converters[ESM::REC_CLAS] = boost::shared_ptr(new ConvertClass()); - converters[ESM::REC_SPEL] = boost::shared_ptr(new DefaultConverter()); - converters[ESM::REC_ARMO] = boost::shared_ptr(new DefaultConverter()); - converters[ESM::REC_WEAP] = boost::shared_ptr(new DefaultConverter()); - converters[ESM::REC_CLOT] = boost::shared_ptr(new DefaultConverter()); - converters[ESM::REC_ENCH] = boost::shared_ptr(new DefaultConverter()); - converters[ESM::REC_WEAP] = boost::shared_ptr(new DefaultConverter()); - converters[ESM::REC_LEVC] = boost::shared_ptr(new DefaultConverter()); - converters[ESM::REC_LEVI] = boost::shared_ptr(new DefaultConverter()); - converters[ESM::REC_CNTC] = boost::shared_ptr(new ConvertCNTC()); - converters[ESM::REC_FACT] = boost::shared_ptr(new ConvertFACT()); - converters[ESM::REC_INFO] = boost::shared_ptr(new ConvertINFO()); - converters[ESM::REC_DIAL] = boost::shared_ptr(new ConvertDIAL()); - converters[ESM::REC_QUES] = boost::shared_ptr(new ConvertQUES()); - converters[recJOUR ] = boost::shared_ptr(new ConvertJOUR()); - converters[ESM::REC_SCPT] = boost::shared_ptr(new ConvertSCPT()); + std::map > converters; + converters[ESM::REC_GLOB] = std::shared_ptr(new ConvertGlobal()); + converters[ESM::REC_BOOK] = std::shared_ptr(new ConvertBook()); + converters[ESM::REC_NPC_] = std::shared_ptr(new ConvertNPC()); + converters[ESM::REC_CREA] = std::shared_ptr(new ConvertCREA()); + converters[ESM::REC_NPCC] = std::shared_ptr(new ConvertNPCC()); + converters[ESM::REC_CREC] = std::shared_ptr(new ConvertCREC()); + converters[recREFR ] = std::shared_ptr(new ConvertREFR()); + converters[recPCDT ] = std::shared_ptr(new ConvertPCDT()); + converters[recFMAP ] = std::shared_ptr(new ConvertFMAP()); + converters[recKLST ] = std::shared_ptr(new ConvertKLST()); + converters[recSTLN ] = std::shared_ptr(new ConvertSTLN()); + converters[recGAME ] = std::shared_ptr(new ConvertGAME()); + converters[ESM::REC_CELL] = std::shared_ptr(new ConvertCell()); + converters[ESM::REC_ALCH] = std::shared_ptr(new DefaultConverter()); + converters[ESM::REC_CLAS] = std::shared_ptr(new ConvertClass()); + converters[ESM::REC_SPEL] = std::shared_ptr(new DefaultConverter()); + converters[ESM::REC_ARMO] = std::shared_ptr(new DefaultConverter()); + converters[ESM::REC_WEAP] = std::shared_ptr(new DefaultConverter()); + converters[ESM::REC_CLOT] = std::shared_ptr(new DefaultConverter()); + converters[ESM::REC_ENCH] = std::shared_ptr(new DefaultConverter()); + converters[ESM::REC_WEAP] = std::shared_ptr(new DefaultConverter()); + converters[ESM::REC_LEVC] = std::shared_ptr(new DefaultConverter()); + converters[ESM::REC_LEVI] = std::shared_ptr(new DefaultConverter()); + converters[ESM::REC_CNTC] = std::shared_ptr(new ConvertCNTC()); + converters[ESM::REC_FACT] = std::shared_ptr(new ConvertFACT()); + converters[ESM::REC_INFO] = std::shared_ptr(new ConvertINFO()); + converters[ESM::REC_DIAL] = std::shared_ptr(new ConvertDIAL()); + converters[ESM::REC_QUES] = std::shared_ptr(new ConvertQUES()); + converters[recJOUR ] = std::shared_ptr(new ConvertJOUR()); + converters[ESM::REC_SCPT] = std::shared_ptr(new ConvertSCPT()); // TODO: // - REGN (weather in certain regions?) @@ -312,7 +312,7 @@ namespace ESSImport std::set unknownRecords; - for (std::map >::const_iterator it = converters.begin(); + for (std::map >::const_iterator it = converters.begin(); it != converters.end(); ++it) { it->second->setContext(context); @@ -323,7 +323,7 @@ namespace ESSImport ESM::NAME n = esm.getRecName(); esm.getRecHeader(); - std::map >::iterator it = converters.find(n.intval); + std::map >::iterator it = converters.find(n.intval); if (it != converters.end()) { it->second->read(esm); @@ -386,7 +386,7 @@ namespace ESSImport // Writing order should be Dynamic Store -> Cells -> Player, // so that references to dynamic records can be recognized when loading - for (std::map >::const_iterator it = converters.begin(); + for (std::map >::const_iterator it = converters.begin(); it != converters.end(); ++it) { if (it->second->getStage() != 0) @@ -399,7 +399,7 @@ namespace ESSImport context.mPlayerBase.save(writer); writer.endRecord(ESM::REC_NPC_); - for (std::map >::const_iterator it = converters.begin(); + for (std::map >::const_iterator it = converters.begin(); it != converters.end(); ++it) { if (it->second->getStage() != 1) diff --git a/apps/opencs/model/doc/document.hpp b/apps/opencs/model/doc/document.hpp index 8a9c49a09..030a0174e 100644 --- a/apps/opencs/model/doc/document.hpp +++ b/apps/opencs/model/doc/document.hpp @@ -3,7 +3,6 @@ #include -#include #include #include diff --git a/apps/opencs/model/filter/andnode.cpp b/apps/opencs/model/filter/andnode.cpp index 908662799..757865717 100644 --- a/apps/opencs/model/filter/andnode.cpp +++ b/apps/opencs/model/filter/andnode.cpp @@ -2,7 +2,7 @@ #include -CSMFilter::AndNode::AndNode (const std::vector >& nodes) +CSMFilter::AndNode::AndNode (const std::vector >& nodes) : NAryNode (nodes, "and") {} diff --git a/apps/opencs/model/filter/andnode.hpp b/apps/opencs/model/filter/andnode.hpp index 3838b451d..56d1d7948 100644 --- a/apps/opencs/model/filter/andnode.hpp +++ b/apps/opencs/model/filter/andnode.hpp @@ -9,7 +9,7 @@ namespace CSMFilter { public: - AndNode (const std::vector >& nodes); + AndNode (const std::vector >& nodes); virtual bool test (const CSMWorld::IdTableBase& table, int row, const std::map& columns) const; diff --git a/apps/opencs/model/filter/narynode.cpp b/apps/opencs/model/filter/narynode.cpp index f2e0e5cb2..2fa9ac6cc 100644 --- a/apps/opencs/model/filter/narynode.cpp +++ b/apps/opencs/model/filter/narynode.cpp @@ -2,7 +2,7 @@ #include -CSMFilter::NAryNode::NAryNode (const std::vector >& nodes, +CSMFilter::NAryNode::NAryNode (const std::vector >& nodes, const std::string& name) : mNodes (nodes), mName (name) {} @@ -21,7 +21,7 @@ std::vector CSMFilter::NAryNode::getReferencedColumns() const { std::vector columns; - for (std::vector >::const_iterator iter (mNodes.begin()); + for (std::vector >::const_iterator iter (mNodes.begin()); iter!=mNodes.end(); ++iter) { std::vector columns2 = (*iter)->getReferencedColumns(); diff --git a/apps/opencs/model/filter/narynode.hpp b/apps/opencs/model/filter/narynode.hpp index aa501d009..1cd93e62e 100644 --- a/apps/opencs/model/filter/narynode.hpp +++ b/apps/opencs/model/filter/narynode.hpp @@ -4,20 +4,18 @@ #include #include -#include - #include "node.hpp" namespace CSMFilter { class NAryNode : public Node { - std::vector > mNodes; + std::vector > mNodes; std::string mName; public: - NAryNode (const std::vector >& nodes, const std::string& name); + NAryNode (const std::vector >& nodes, const std::string& name); int getSize() const; diff --git a/apps/opencs/model/filter/node.hpp b/apps/opencs/model/filter/node.hpp index 58588bdc5..7295b9018 100644 --- a/apps/opencs/model/filter/node.hpp +++ b/apps/opencs/model/filter/node.hpp @@ -3,10 +3,9 @@ #include #include +#include #include -#include - #include namespace CSMWorld @@ -48,6 +47,6 @@ namespace CSMFilter }; } -Q_DECLARE_METATYPE (boost::shared_ptr) +Q_DECLARE_METATYPE (std::shared_ptr) #endif diff --git a/apps/opencs/model/filter/notnode.cpp b/apps/opencs/model/filter/notnode.cpp index ba5302bbe..81588c754 100644 --- a/apps/opencs/model/filter/notnode.cpp +++ b/apps/opencs/model/filter/notnode.cpp @@ -1,6 +1,6 @@ #include "notnode.hpp" -CSMFilter::NotNode::NotNode (boost::shared_ptr child) : UnaryNode (child, "not") {} +CSMFilter::NotNode::NotNode (std::shared_ptr child) : UnaryNode (child, "not") {} bool CSMFilter::NotNode::test (const CSMWorld::IdTableBase& table, int row, const std::map& columns) const diff --git a/apps/opencs/model/filter/notnode.hpp b/apps/opencs/model/filter/notnode.hpp index 0281d99da..e3c57cede 100644 --- a/apps/opencs/model/filter/notnode.hpp +++ b/apps/opencs/model/filter/notnode.hpp @@ -9,7 +9,7 @@ namespace CSMFilter { public: - NotNode (boost::shared_ptr child); + NotNode (std::shared_ptr child); virtual bool test (const CSMWorld::IdTableBase& table, int row, const std::map& columns) const; diff --git a/apps/opencs/model/filter/ornode.cpp b/apps/opencs/model/filter/ornode.cpp index 41ec7b5cf..9e6d8b2c4 100644 --- a/apps/opencs/model/filter/ornode.cpp +++ b/apps/opencs/model/filter/ornode.cpp @@ -2,7 +2,7 @@ #include -CSMFilter::OrNode::OrNode (const std::vector >& nodes) +CSMFilter::OrNode::OrNode (const std::vector >& nodes) : NAryNode (nodes, "or") {} diff --git a/apps/opencs/model/filter/ornode.hpp b/apps/opencs/model/filter/ornode.hpp index 07ab51a6a..b89da4e75 100644 --- a/apps/opencs/model/filter/ornode.hpp +++ b/apps/opencs/model/filter/ornode.hpp @@ -9,7 +9,7 @@ namespace CSMFilter { public: - OrNode (const std::vector >& nodes); + OrNode (const std::vector >& nodes); virtual bool test (const CSMWorld::IdTableBase& table, int row, const std::map& columns) const; diff --git a/apps/opencs/model/filter/parser.cpp b/apps/opencs/model/filter/parser.cpp index c0c089169..d2bedc666 100644 --- a/apps/opencs/model/filter/parser.cpp +++ b/apps/opencs/model/filter/parser.cpp @@ -235,7 +235,7 @@ CSMFilter::Token CSMFilter::Parser::getNextToken() return Token (Token::Type_None); } -boost::shared_ptr CSMFilter::Parser::parseImp (bool allowEmpty, bool ignoreOneShot) +std::shared_ptr CSMFilter::Parser::parseImp (bool allowEmpty, bool ignoreOneShot) { if (Token token = getNextToken()) { @@ -247,11 +247,11 @@ boost::shared_ptr CSMFilter::Parser::parseImp (bool allowEmpty, { case Token::Type_Keyword_True: - return boost::shared_ptr (new BooleanNode (true)); + return std::shared_ptr (new BooleanNode (true)); case Token::Type_Keyword_False: - return boost::shared_ptr (new BooleanNode (false)); + return std::shared_ptr (new BooleanNode (false)); case Token::Type_Keyword_And: case Token::Type_Keyword_Or: @@ -260,12 +260,12 @@ boost::shared_ptr CSMFilter::Parser::parseImp (bool allowEmpty, case Token::Type_Keyword_Not: { - boost::shared_ptr node = parseImp(); + std::shared_ptr node = parseImp(); if (mError) - return boost::shared_ptr(); + return std::shared_ptr(); - return boost::shared_ptr (new NotNode (node)); + return std::shared_ptr (new NotNode (node)); } case Token::Type_Keyword_Text: @@ -281,7 +281,7 @@ boost::shared_ptr CSMFilter::Parser::parseImp (bool allowEmpty, if (!allowEmpty) error(); - return boost::shared_ptr(); + return std::shared_ptr(); default: @@ -289,27 +289,27 @@ boost::shared_ptr CSMFilter::Parser::parseImp (bool allowEmpty, } } - return boost::shared_ptr(); + return std::shared_ptr(); } -boost::shared_ptr CSMFilter::Parser::parseNAry (const Token& keyword) +std::shared_ptr CSMFilter::Parser::parseNAry (const Token& keyword) { - std::vector > nodes; + std::vector > nodes; Token token = getNextToken(); if (token.mType!=Token::Type_Open) { error(); - return boost::shared_ptr(); + return std::shared_ptr(); } for (;;) { - boost::shared_ptr node = parseImp(); + std::shared_ptr node = parseImp(); if (mError) - return boost::shared_ptr(); + return std::shared_ptr(); nodes.push_back (node); @@ -318,7 +318,7 @@ boost::shared_ptr CSMFilter::Parser::parseNAry (const Token& ke if (!token || (token.mType!=Token::Type_Close && token.mType!=Token::Type_Comma)) { error(); - return boost::shared_ptr(); + return std::shared_ptr(); } if (token.mType==Token::Type_Close) @@ -328,31 +328,31 @@ boost::shared_ptr CSMFilter::Parser::parseNAry (const Token& ke if (nodes.empty()) { error(); - return boost::shared_ptr(); + return std::shared_ptr(); } switch (keyword.mType) { - case Token::Type_Keyword_And: return boost::shared_ptr (new AndNode (nodes)); - case Token::Type_Keyword_Or: return boost::shared_ptr (new OrNode (nodes)); - default: error(); return boost::shared_ptr(); + case Token::Type_Keyword_And: return std::shared_ptr (new AndNode (nodes)); + case Token::Type_Keyword_Or: return std::shared_ptr (new OrNode (nodes)); + default: error(); return std::shared_ptr(); } } -boost::shared_ptr CSMFilter::Parser::parseText() +std::shared_ptr CSMFilter::Parser::parseText() { Token token = getNextToken(); if (token.mType!=Token::Type_Open) { error(); - return boost::shared_ptr(); + return std::shared_ptr(); } token = getNextToken(); if (!token) - return boost::shared_ptr(); + return std::shared_ptr(); // parse column ID int columnId = -1; @@ -370,7 +370,7 @@ boost::shared_ptr CSMFilter::Parser::parseText() if (columnId<0) { error(); - return boost::shared_ptr(); + return std::shared_ptr(); } token = getNextToken(); @@ -378,7 +378,7 @@ boost::shared_ptr CSMFilter::Parser::parseText() if (token.mType!=Token::Type_Comma) { error(); - return boost::shared_ptr(); + return std::shared_ptr(); } // parse text pattern @@ -387,7 +387,7 @@ boost::shared_ptr CSMFilter::Parser::parseText() if (!token.isString()) { error(); - return boost::shared_ptr(); + return std::shared_ptr(); } std::string text = token.mString; @@ -397,26 +397,26 @@ boost::shared_ptr CSMFilter::Parser::parseText() if (token.mType!=Token::Type_Close) { error(); - return boost::shared_ptr(); + return std::shared_ptr(); } - return boost::shared_ptr (new TextNode (columnId, text)); + return std::shared_ptr (new TextNode (columnId, text)); } -boost::shared_ptr CSMFilter::Parser::parseValue() +std::shared_ptr CSMFilter::Parser::parseValue() { Token token = getNextToken(); if (token.mType!=Token::Type_Open) { error(); - return boost::shared_ptr(); + return std::shared_ptr(); } token = getNextToken(); if (!token) - return boost::shared_ptr(); + return std::shared_ptr(); // parse column ID int columnId = -1; @@ -434,7 +434,7 @@ boost::shared_ptr CSMFilter::Parser::parseValue() if (columnId<0) { error(); - return boost::shared_ptr(); + return std::shared_ptr(); } token = getNextToken(); @@ -442,7 +442,7 @@ boost::shared_ptr CSMFilter::Parser::parseValue() if (token.mType!=Token::Type_Comma) { error(); - return boost::shared_ptr(); + return std::shared_ptr(); } // parse value @@ -467,7 +467,7 @@ boost::shared_ptr CSMFilter::Parser::parseValue() else if (token.mType!=Token::Type_CloseSquare && token.mType!=Token::Type_Open) { error(); - return boost::shared_ptr(); + return std::shared_ptr(); } token = getNextToken(); @@ -481,7 +481,7 @@ boost::shared_ptr CSMFilter::Parser::parseValue() if (token.mType!=Token::Type_Comma) { error(); - return boost::shared_ptr(); + return std::shared_ptr(); } } else if (token.mType==Token::Type_Comma) @@ -491,7 +491,7 @@ boost::shared_ptr CSMFilter::Parser::parseValue() else { error(); - return boost::shared_ptr(); + return std::shared_ptr(); } token = getNextToken(); @@ -513,7 +513,7 @@ boost::shared_ptr CSMFilter::Parser::parseValue() else if (token.mType!=Token::Type_OpenSquare && token.mType!=Token::Type_Close) { error(); - return boost::shared_ptr(); + return std::shared_ptr(); } } @@ -522,10 +522,10 @@ boost::shared_ptr CSMFilter::Parser::parseValue() if (token.mType!=Token::Type_Close) { error(); - return boost::shared_ptr(); + return std::shared_ptr(); } - return boost::shared_ptr (new ValueNode (columnId, lowerType, upperType, lower, upper)); + return std::shared_ptr (new ValueNode (columnId, lowerType, upperType, lower, upper)); } void CSMFilter::Parser::error() @@ -556,7 +556,7 @@ bool CSMFilter::Parser::parse (const std::string& filter, bool allowPredefined) } else if (!allowPredefined || token==Token (Token::Type_OneShot)) { - boost::shared_ptr node = parseImp (true, token!=Token (Token::Type_OneShot)); + std::shared_ptr node = parseImp (true, token!=Token (Token::Type_OneShot)); if (mError) return false; @@ -612,7 +612,7 @@ bool CSMFilter::Parser::parse (const std::string& filter, bool allowPredefined) } } -boost::shared_ptr CSMFilter::Parser::getFilter() const +std::shared_ptr CSMFilter::Parser::getFilter() const { if (mError) throw std::logic_error ("No filter available"); diff --git a/apps/opencs/model/filter/parser.hpp b/apps/opencs/model/filter/parser.hpp index 5700102cf..344c552ef 100644 --- a/apps/opencs/model/filter/parser.hpp +++ b/apps/opencs/model/filter/parser.hpp @@ -1,8 +1,6 @@ #ifndef CSM_FILTER_PARSER_H #define CSM_FILTER_PARSER_H -#include - #include "node.hpp" namespace CSMWorld @@ -16,7 +14,7 @@ namespace CSMFilter class Parser { - boost::shared_ptr mFilter; + std::shared_ptr mFilter; std::string mInput; int mIndex; bool mError; @@ -31,14 +29,14 @@ namespace CSMFilter Token checkKeywords (const Token& token); ///< Turn string token into keyword token, if possible. - boost::shared_ptr parseImp (bool allowEmpty = false, bool ignoreOneShot = false); + std::shared_ptr parseImp (bool allowEmpty = false, bool ignoreOneShot = false); ///< Will return a null-pointer, if there is nothing more to parse. - boost::shared_ptr parseNAry (const Token& keyword); + std::shared_ptr parseNAry (const Token& keyword); - boost::shared_ptr parseText(); + std::shared_ptr parseText(); - boost::shared_ptr parseValue(); + std::shared_ptr parseValue(); void error(); @@ -51,7 +49,7 @@ namespace CSMFilter /// /// \return Success? - boost::shared_ptr getFilter() const; + std::shared_ptr getFilter() const; ///< Throws an exception if the last call to parse did not return true. }; } diff --git a/apps/opencs/model/filter/unarynode.cpp b/apps/opencs/model/filter/unarynode.cpp index cbdadf6fc..7211f78b0 100644 --- a/apps/opencs/model/filter/unarynode.cpp +++ b/apps/opencs/model/filter/unarynode.cpp @@ -1,6 +1,6 @@ #include "unarynode.hpp" -CSMFilter::UnaryNode::UnaryNode (boost::shared_ptr child, const std::string& name) +CSMFilter::UnaryNode::UnaryNode (std::shared_ptr child, const std::string& name) : mChild (child), mName (name) {} diff --git a/apps/opencs/model/filter/unarynode.hpp b/apps/opencs/model/filter/unarynode.hpp index 6bbc96092..cbee4e0ba 100644 --- a/apps/opencs/model/filter/unarynode.hpp +++ b/apps/opencs/model/filter/unarynode.hpp @@ -1,20 +1,18 @@ #ifndef CSM_FILTER_UNARYNODE_H #define CSM_FILTER_UNARYNODE_H -#include - #include "node.hpp" namespace CSMFilter { class UnaryNode : public Node { - boost::shared_ptr mChild; + std::shared_ptr mChild; std::string mName; public: - UnaryNode (boost::shared_ptr child, const std::string& name); + UnaryNode (std::shared_ptr child, const std::string& name); const Node& getChild() const; diff --git a/apps/opencs/model/world/data.cpp b/apps/opencs/model/world/data.cpp index 5a59f19f7..8b7faf2ed 100644 --- a/apps/opencs/model/world/data.cpp +++ b/apps/opencs/model/world/data.cpp @@ -554,12 +554,12 @@ CSMWorld::Data::~Data() delete mReader; } -boost::shared_ptr CSMWorld::Data::getResourceSystem() +std::shared_ptr CSMWorld::Data::getResourceSystem() { return mResourceSystem; } -boost::shared_ptr CSMWorld::Data::getResourceSystem() const +std::shared_ptr CSMWorld::Data::getResourceSystem() const { return mResourceSystem; } @@ -891,7 +891,7 @@ void CSMWorld::Data::merge() int CSMWorld::Data::startLoading (const boost::filesystem::path& path, bool base, bool project) { // Don't delete the Reader yet. Some record types store a reference to the Reader to handle on-demand loading - boost::shared_ptr ptr(mReader); + std::shared_ptr ptr(mReader); mReaders.push_back(ptr); mReader = 0; @@ -945,7 +945,7 @@ bool CSMWorld::Data::continueLoading (CSMDoc::Messages& messages) // Don't delete the Reader yet. Some record types store a reference to the Reader to handle on-demand loading. // We don't store non-base reader, because everything going into modified will be // fully loaded during the initial loading process. - boost::shared_ptr ptr(mReader); + std::shared_ptr ptr(mReader); mReaders.push_back(ptr); } else diff --git a/apps/opencs/model/world/data.hpp b/apps/opencs/model/world/data.hpp index dc00a33d2..f96003e44 100644 --- a/apps/opencs/model/world/data.hpp +++ b/apps/opencs/model/world/data.hpp @@ -119,9 +119,9 @@ namespace CSMWorld std::map > mRefLoadCache; int mReaderIndex; - boost::shared_ptr mResourceSystem; + std::shared_ptr mResourceSystem; - std::vector > mReaders; + std::vector > mReaders; std::map mContentFileNames; @@ -148,9 +148,9 @@ namespace CSMWorld const Fallback::Map* getFallbackMap() const; - boost::shared_ptr getResourceSystem(); + std::shared_ptr getResourceSystem(); - boost::shared_ptr getResourceSystem() const; + std::shared_ptr getResourceSystem() const; const IdCollection& getGlobals() const; diff --git a/apps/opencs/model/world/idcompletionmanager.cpp b/apps/opencs/model/world/idcompletionmanager.cpp index 7f3221342..a6de2c8f5 100644 --- a/apps/opencs/model/world/idcompletionmanager.cpp +++ b/apps/opencs/model/world/idcompletionmanager.cpp @@ -77,7 +77,7 @@ bool CSMWorld::IdCompletionManager::hasCompleterFor(CSMWorld::ColumnBase::Displa return mCompleters.find(display) != mCompleters.end(); } -boost::shared_ptr CSMWorld::IdCompletionManager::getCompleter(CSMWorld::ColumnBase::Display display) +std::shared_ptr CSMWorld::IdCompletionManager::getCompleter(CSMWorld::ColumnBase::Display display) { if (!hasCompleterFor(display)) { @@ -99,7 +99,7 @@ void CSMWorld::IdCompletionManager::generateCompleters(CSMWorld::Data &data) int idColumn = table->searchColumnIndex(CSMWorld::Columns::ColumnId_Id); if (idColumn != -1) { - boost::shared_ptr completer = boost::make_shared(table); + std::shared_ptr completer = std::make_shared(table); completer->setCompletionColumn(idColumn); // The completion role must be Qt::DisplayRole to get the ID values from the model completer->setCompletionRole(Qt::DisplayRole); diff --git a/apps/opencs/model/world/idcompletionmanager.hpp b/apps/opencs/model/world/idcompletionmanager.hpp index 7944e6777..e48360432 100644 --- a/apps/opencs/model/world/idcompletionmanager.hpp +++ b/apps/opencs/model/world/idcompletionmanager.hpp @@ -3,8 +3,7 @@ #include #include - -#include +#include #include "columnbase.hpp" #include "universalid.hpp" @@ -20,7 +19,7 @@ namespace CSMWorld { static const std::map sCompleterModelTypes; - std::map > mCompleters; + std::map > mCompleters; // Don't allow copying IdCompletionManager(const IdCompletionManager &); @@ -34,7 +33,7 @@ namespace CSMWorld IdCompletionManager(Data &data); bool hasCompleterFor(ColumnBase::Display display) const; - boost::shared_ptr getCompleter(ColumnBase::Display display); + std::shared_ptr getCompleter(ColumnBase::Display display); }; } diff --git a/apps/opencs/model/world/idtableproxymodel.cpp b/apps/opencs/model/world/idtableproxymodel.cpp index fbf7b6cf3..6d50e9edb 100644 --- a/apps/opencs/model/world/idtableproxymodel.cpp +++ b/apps/opencs/model/world/idtableproxymodel.cpp @@ -82,7 +82,7 @@ void CSMWorld::IdTableProxyModel::setSourceModel(QAbstractItemModel *model) SLOT(sourceDataChanged(const QModelIndex &, const QModelIndex &))); } -void CSMWorld::IdTableProxyModel::setFilter (const boost::shared_ptr& filter) +void CSMWorld::IdTableProxyModel::setFilter (const std::shared_ptr& filter) { beginResetModel(); mFilter = filter; diff --git a/apps/opencs/model/world/idtableproxymodel.hpp b/apps/opencs/model/world/idtableproxymodel.hpp index cf31b5c11..dd7ab41eb 100644 --- a/apps/opencs/model/world/idtableproxymodel.hpp +++ b/apps/opencs/model/world/idtableproxymodel.hpp @@ -3,8 +3,6 @@ #include -#include - #include #include @@ -19,7 +17,7 @@ namespace CSMWorld { Q_OBJECT - boost::shared_ptr mFilter; + std::shared_ptr mFilter; std::map mColumnMap; // column ID, column index in this model (or -1) // Cache of enum values for enum columns (e.g. Modified, Record Type). @@ -43,7 +41,7 @@ namespace CSMWorld virtual void setSourceModel(QAbstractItemModel *model); - void setFilter (const boost::shared_ptr& filter); + void setFilter (const std::shared_ptr& filter); void refreshFilter(); diff --git a/apps/opencs/view/filter/editwidget.hpp b/apps/opencs/view/filter/editwidget.hpp index f672877d9..51a36969a 100644 --- a/apps/opencs/view/filter/editwidget.hpp +++ b/apps/opencs/view/filter/editwidget.hpp @@ -1,8 +1,6 @@ #ifndef CSV_FILTER_EDITWIDGET_H #define CSV_FILTER_EDITWIDGET_H -#include - #include #include #include @@ -38,7 +36,7 @@ namespace CSVFilter signals: - void filterChanged (boost::shared_ptr filter); + void filterChanged (std::shared_ptr filter); private: std::string generateFilter(std::pair >& seekedString) const; diff --git a/apps/opencs/view/filter/filterbox.cpp b/apps/opencs/view/filter/filterbox.cpp index 4c252e7d9..461b131db 100644 --- a/apps/opencs/view/filter/filterbox.cpp +++ b/apps/opencs/view/filter/filterbox.cpp @@ -21,8 +21,8 @@ CSVFilter::FilterBox::FilterBox (CSMWorld::Data& data, QWidget *parent) setLayout (layout); connect (mRecordFilterBox, - SIGNAL (filterChanged (boost::shared_ptr)), - this, SIGNAL (recordFilterChanged (boost::shared_ptr))); + SIGNAL (filterChanged (std::shared_ptr)), + this, SIGNAL (recordFilterChanged (std::shared_ptr))); setAcceptDrops(true); } diff --git a/apps/opencs/view/filter/filterbox.hpp b/apps/opencs/view/filter/filterbox.hpp index c765164e7..e794a9880 100644 --- a/apps/opencs/view/filter/filterbox.hpp +++ b/apps/opencs/view/filter/filterbox.hpp @@ -41,7 +41,7 @@ namespace CSVFilter void dragMoveEvent(QDragMoveEvent *event); signals: - void recordFilterChanged (boost::shared_ptr filter); + void recordFilterChanged (std::shared_ptr filter); void recordDropped (std::vector& types, Qt::DropAction action); }; diff --git a/apps/opencs/view/filter/recordfilterbox.cpp b/apps/opencs/view/filter/recordfilterbox.cpp index 2bf589215..d24465897 100644 --- a/apps/opencs/view/filter/recordfilterbox.cpp +++ b/apps/opencs/view/filter/recordfilterbox.cpp @@ -23,8 +23,8 @@ CSVFilter::RecordFilterBox::RecordFilterBox (CSMWorld::Data& data, QWidget *pare setLayout (layout); connect ( - mEdit, SIGNAL (filterChanged (boost::shared_ptr)), - this, SIGNAL (filterChanged (boost::shared_ptr))); + mEdit, SIGNAL (filterChanged (std::shared_ptr)), + this, SIGNAL (filterChanged (std::shared_ptr))); } void CSVFilter::RecordFilterBox::setFilter (const std::string& filter) diff --git a/apps/opencs/view/filter/recordfilterbox.hpp b/apps/opencs/view/filter/recordfilterbox.hpp index 29d12529a..77a07c92b 100644 --- a/apps/opencs/view/filter/recordfilterbox.hpp +++ b/apps/opencs/view/filter/recordfilterbox.hpp @@ -1,8 +1,6 @@ #ifndef CSV_FILTER_RECORDFILTERBOX_H #define CSV_FILTER_RECORDFILTERBOX_H -#include - #include #include @@ -38,7 +36,7 @@ namespace CSVFilter signals: - void filterChanged (boost::shared_ptr filter); + void filterChanged (std::shared_ptr filter); }; } diff --git a/apps/opencs/view/render/object.hpp b/apps/opencs/view/render/object.hpp index d3cba6c55..e28e2562c 100644 --- a/apps/opencs/view/render/object.hpp +++ b/apps/opencs/view/render/object.hpp @@ -3,8 +3,6 @@ #include -#include - #include #include diff --git a/apps/opencs/view/render/scenewidget.cpp b/apps/opencs/view/render/scenewidget.cpp index a072cd0aa..82eebf127 100644 --- a/apps/opencs/view/render/scenewidget.cpp +++ b/apps/opencs/view/render/scenewidget.cpp @@ -172,7 +172,7 @@ void CompositeViewer::update() // --------------------------------------------------- -SceneWidget::SceneWidget(boost::shared_ptr resourceSystem, QWidget *parent, Qt::WindowFlags f, +SceneWidget::SceneWidget(std::shared_ptr resourceSystem, QWidget *parent, Qt::WindowFlags f, bool retrieveInput) : RenderWidget(parent, f) , mResourceSystem(resourceSystem) diff --git a/apps/opencs/view/render/scenewidget.hpp b/apps/opencs/view/render/scenewidget.hpp index c5d9cdfce..cc3191c81 100644 --- a/apps/opencs/view/render/scenewidget.hpp +++ b/apps/opencs/view/render/scenewidget.hpp @@ -10,8 +10,6 @@ #include #include -#include - #include "lightingday.hpp" #include "lightingnight.hpp" #include "lightingbright.hpp" @@ -78,7 +76,7 @@ namespace CSVRender { Q_OBJECT public: - SceneWidget(boost::shared_ptr resourceSystem, QWidget* parent = 0, + SceneWidget(std::shared_ptr resourceSystem, QWidget* parent = 0, Qt::WindowFlags f = 0, bool retrieveInput = true); virtual ~SceneWidget(); @@ -98,7 +96,7 @@ namespace CSVRender virtual void mouseMoveEvent (QMouseEvent *event); virtual void wheelEvent (QWheelEvent *event); - boost::shared_ptr mResourceSystem; + std::shared_ptr mResourceSystem; Lighting* mLighting; diff --git a/apps/opencs/view/render/worldspacewidget.hpp b/apps/opencs/view/render/worldspacewidget.hpp index b30d7de8a..08b97e1be 100644 --- a/apps/opencs/view/render/worldspacewidget.hpp +++ b/apps/opencs/view/render/worldspacewidget.hpp @@ -1,8 +1,6 @@ #ifndef OPENCS_VIEW_WORLDSPACEWIDGET_H #define OPENCS_VIEW_WORLDSPACEWIDGET_H -#include - #include #include diff --git a/apps/opencs/view/world/table.cpp b/apps/opencs/view/world/table.cpp index 07db5b477..30dba4241 100644 --- a/apps/opencs/view/world/table.cpp +++ b/apps/opencs/view/world/table.cpp @@ -692,7 +692,7 @@ void CSVWorld::Table::requestFocus (const std::string& id) scrollTo (index, QAbstractItemView::PositionAtTop); } -void CSVWorld::Table::recordFilterChanged (boost::shared_ptr filter) +void CSVWorld::Table::recordFilterChanged (std::shared_ptr filter) { mProxyModel->setFilter (filter); tableSizeUpdate(); diff --git a/apps/opencs/view/world/table.hpp b/apps/opencs/view/world/table.hpp index 768ff185d..26f6e7899 100644 --- a/apps/opencs/view/world/table.hpp +++ b/apps/opencs/view/world/table.hpp @@ -151,7 +151,7 @@ namespace CSVWorld void requestFocus (const std::string& id); - void recordFilterChanged (boost::shared_ptr filter); + void recordFilterChanged (std::shared_ptr filter); void rowAdded(const std::string &id); }; diff --git a/apps/opencs/view/world/tablesubview.cpp b/apps/opencs/view/world/tablesubview.cpp index fcf66ed81..6664a3771 100644 --- a/apps/opencs/view/world/tablesubview.cpp +++ b/apps/opencs/view/world/tablesubview.cpp @@ -78,8 +78,8 @@ CSVWorld::TableSubView::TableSubView (const CSMWorld::UniversalId& id, CSMDoc::D mTable, SLOT (requestFocus (const std::string&))); connect (mFilterBox, - SIGNAL (recordFilterChanged (boost::shared_ptr)), - mTable, SLOT (recordFilterChanged (boost::shared_ptr))); + SIGNAL (recordFilterChanged (std::shared_ptr)), + mTable, SLOT (recordFilterChanged (std::shared_ptr))); connect(mFilterBox, SIGNAL(recordDropped(std::vector&, Qt::DropAction)), this, SLOT(createFilterRequest(std::vector&, Qt::DropAction))); diff --git a/apps/openmw/mwrender/water.cpp b/apps/openmw/mwrender/water.cpp index ac0337af5..02882adbe 100644 --- a/apps/openmw/mwrender/water.cpp +++ b/apps/openmw/mwrender/water.cpp @@ -28,11 +28,9 @@ #include #include -#include #include -#include #include diff --git a/components/contentselector/view/contentselector.cpp b/components/contentselector/view/contentselector.cpp index b98bb667d..f4da7e6ad 100644 --- a/components/contentselector/view/contentselector.cpp +++ b/components/contentselector/view/contentselector.cpp @@ -6,9 +6,11 @@ #include #include + #include +#include +#include #include -#include ContentSelectorView::ContentSelector::ContentSelector(QWidget *parent) : QObject(parent) diff --git a/extern/osg-ffmpeg-videoplayer/audiodecoder.cpp b/extern/osg-ffmpeg-videoplayer/audiodecoder.cpp index 096a17a64..09de3bc44 100644 --- a/extern/osg-ffmpeg-videoplayer/audiodecoder.cpp +++ b/extern/osg-ffmpeg-videoplayer/audiodecoder.cpp @@ -1,6 +1,7 @@ #include "audiodecoder.hpp" #include +#include extern "C" { From d97aa9152bdf15eb167e51def6cb5aae4187264c Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Sat, 6 May 2017 13:23:44 +0200 Subject: [PATCH 24/51] remove more unused imports, including boost headers --- apps/opencs/model/world/idcompletionmanager.cpp | 2 -- apps/openmw/mwgui/bookpage.cpp | 4 ---- apps/openmw/mwgui/journalviewmodel.cpp | 2 -- 3 files changed, 8 deletions(-) diff --git a/apps/opencs/model/world/idcompletionmanager.cpp b/apps/opencs/model/world/idcompletionmanager.cpp index a6de2c8f5..9fa6e3add 100644 --- a/apps/opencs/model/world/idcompletionmanager.cpp +++ b/apps/opencs/model/world/idcompletionmanager.cpp @@ -1,7 +1,5 @@ #include "idcompletionmanager.hpp" -#include - #include #include "../../view/widget/completerpopup.hpp" diff --git a/apps/openmw/mwgui/bookpage.cpp b/apps/openmw/mwgui/bookpage.cpp index 24dfe6024..883195f51 100644 --- a/apps/openmw/mwgui/bookpage.cpp +++ b/apps/openmw/mwgui/bookpage.cpp @@ -6,10 +6,6 @@ #include "MyGUI_TextureUtility.h" #include "MyGUI_FactoryManager.h" -#include -#include -#include - #include namespace MWGui diff --git a/apps/openmw/mwgui/journalviewmodel.cpp b/apps/openmw/mwgui/journalviewmodel.cpp index a2819b749..2e0d07787 100644 --- a/apps/openmw/mwgui/journalviewmodel.cpp +++ b/apps/openmw/mwgui/journalviewmodel.cpp @@ -2,7 +2,6 @@ #include #include -#include #include @@ -15,7 +14,6 @@ #include "../mwbase/environment.hpp" #include "../mwbase/windowmanager.hpp" -#include "../mwdialogue/journalentry.hpp" #include "../mwdialogue/keywordsearch.hpp" namespace MWGui { From b7c27e5e9658381b62e1b870dcfef353321a6c2d Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Sat, 6 May 2017 13:29:47 +0200 Subject: [PATCH 25/51] remove boost/tuple --- apps/openmw/mwgui/spellview.hpp | 2 +- components/misc/utf8stream.hpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwgui/spellview.hpp b/apps/openmw/mwgui/spellview.hpp index 7fea95cac..0eb69f6ba 100644 --- a/apps/openmw/mwgui/spellview.hpp +++ b/apps/openmw/mwgui/spellview.hpp @@ -1,7 +1,7 @@ #ifndef OPENMW_GUI_SPELLVIEW_H #define OPENMW_GUI_SPELLVIEW_H -#include +#include #include diff --git a/components/misc/utf8stream.hpp b/components/misc/utf8stream.hpp index 4856d6503..760015902 100644 --- a/components/misc/utf8stream.hpp +++ b/components/misc/utf8stream.hpp @@ -1,7 +1,7 @@ #ifndef MISC_UTF8ITER_HPP #define MISC_UTF8ITER_HPP -#include +#include class Utf8Stream { @@ -60,7 +60,7 @@ public: int octets; UnicodeChar chr; - boost::tie (octets, chr) = octet_count (*cur++); + std::tie (octets, chr) = octet_count (*cur++); if (octets > 5) return std::make_pair (sBadChar(), cur); @@ -104,7 +104,7 @@ private: void next () { - boost::tie (val, nxt) = decode (nxt, end); + std::tie (val, nxt) = decode (nxt, end); } Point cur; From 98752a97029a42640c08ff9abd331e2ce7101e6c Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Sat, 6 May 2017 15:12:06 +0200 Subject: [PATCH 26/51] replace boost::bind --- apps/openmw/mwgui/dialogue.cpp | 4 +--- apps/openmw/mwgui/journalwindow.cpp | 5 ++--- components/files/configurationmanager.cpp | 3 +-- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/apps/openmw/mwgui/dialogue.cpp b/apps/openmw/mwgui/dialogue.cpp index c03673b90..2c5adfbab 100644 --- a/apps/openmw/mwgui/dialogue.cpp +++ b/apps/openmw/mwgui/dialogue.cpp @@ -1,7 +1,5 @@ #include "dialogue.hpp" -#include - #include #include #include @@ -281,7 +279,7 @@ namespace MWGui mScrollBar->eventScrollChangePosition += MyGUI::newDelegate(this, &DialogueWindow::onScrollbarMoved); mHistory->eventMouseWheel += MyGUI::newDelegate(this, &DialogueWindow::onMouseWheel); - BookPage::ClickCallback callback = boost::bind (&DialogueWindow::notifyLinkClicked, this, _1); + BookPage::ClickCallback callback = std::bind (&DialogueWindow::notifyLinkClicked, this, std::placeholders::_1); mHistory->adviseLinkClicked(callback); mMainWidget->castType()->eventWindowChangeCoord += MyGUI::newDelegate(this, &DialogueWindow::onWindowResize); diff --git a/apps/openmw/mwgui/journalwindow.cpp b/apps/openmw/mwgui/journalwindow.cpp index 9af87c7ae..5f309f148 100644 --- a/apps/openmw/mwgui/journalwindow.cpp +++ b/apps/openmw/mwgui/journalwindow.cpp @@ -9,7 +9,6 @@ #include #include -#include #include #include @@ -124,7 +123,7 @@ namespace { MWGui::BookPage::ClickCallback callback; - callback = boost::bind (&JournalWindowImpl::notifyTopicClicked, this, _1); + callback = std::bind (&JournalWindowImpl::notifyTopicClicked, this, std::placeholders::_1); getPage (LeftBookPage)->adviseLinkClicked (callback); getPage (RightBookPage)->adviseLinkClicked (callback); @@ -136,7 +135,7 @@ namespace { MWGui::BookPage::ClickCallback callback; - callback = boost::bind (&JournalWindowImpl::notifyIndexLinkClicked, this, _1); + callback = std::bind(&JournalWindowImpl::notifyIndexLinkClicked, this, std::placeholders::_1); getPage (LeftTopicIndex)->adviseLinkClicked (callback); getPage (RightTopicIndex)->adviseLinkClicked (callback); diff --git a/components/files/configurationmanager.cpp b/components/files/configurationmanager.cpp index b53e3834a..46dbca8dc 100644 --- a/components/files/configurationmanager.cpp +++ b/components/files/configurationmanager.cpp @@ -7,7 +7,6 @@ #include -#include #include #include #include @@ -130,7 +129,7 @@ void ConfigurationManager::processPaths(Files::PathContainer& dataDirs, bool cre } dataDirs.erase(std::remove_if(dataDirs.begin(), dataDirs.end(), - boost::bind(&boost::filesystem::path::empty, _1)), dataDirs.end()); + std::bind(&boost::filesystem::path::empty, std::placeholders::_1)), dataDirs.end()); } bool ConfigurationManager::loadConfig(const boost::filesystem::path& path, From d48b829b45eabc34990c990e9698e9d0a99f98b6 Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Sat, 6 May 2017 23:05:13 +0200 Subject: [PATCH 27/51] replace and purge boost::lexical_cast --- apps/opencs/model/tools/referencecheck.cpp | 14 ++++++-------- apps/opencs/model/world/columnimp.hpp | 2 -- apps/opencs/view/render/cellmarker.cpp | 9 ++------- apps/openmw/mwclass/misc.cpp | 7 +------ apps/openmw/mwgui/enchantingdialog.cpp | 4 ---- apps/openmw/mwgui/spellmodel.cpp | 10 ++++------ apps/openmw/mwinput/inputmanagerimp.cpp | 14 +++++--------- components/esm/loadmgef.cpp | 5 +---- components/fallback/fallback.cpp | 14 ++++++++------ components/shader/shadermanager.cpp | 6 ++---- components/shader/shadervisitor.cpp | 4 +--- components/widgets/numericeditbox.cpp | 6 ++---- extern/oics/ICSInputControlSystem.h | 2 -- 13 files changed, 32 insertions(+), 65 deletions(-) diff --git a/apps/opencs/model/tools/referencecheck.cpp b/apps/opencs/model/tools/referencecheck.cpp index be9663e7a..7f247741c 100644 --- a/apps/opencs/model/tools/referencecheck.cpp +++ b/apps/opencs/model/tools/referencecheck.cpp @@ -1,7 +1,5 @@ #include "referencecheck.hpp" -#include - CSMTools::ReferenceCheckStage::ReferenceCheckStage( const CSMWorld::RefCollection& references, const CSMWorld::RefIdCollection& referencables, @@ -40,9 +38,9 @@ void CSMTools::ReferenceCheckStage::perform(int stage, CSMDoc::Messages &message if ((isLight && cellRef.mChargeFloat < -1) || (!isLight && cellRef.mChargeInt < -1)) { std::string str = " has invalid charge "; if (localIndex.second == CSMWorld::UniversalId::Type_Light) - str += boost::lexical_cast(cellRef.mChargeFloat); + str += std::to_string(cellRef.mChargeFloat); else - str += boost::lexical_cast(cellRef.mChargeInt); + str += std::to_string(cellRef.mChargeInt); messages.push_back(std::make_pair(id, id.getId() + str)); } } @@ -66,9 +64,9 @@ void CSMTools::ReferenceCheckStage::perform(int stage, CSMDoc::Messages &message // Check item's faction rank if (hasFaction && cellRef.mFactionRank < -1) - messages.push_back(std::make_pair(id, " has faction set but has invalid faction rank " + boost::lexical_cast(cellRef.mFactionRank))); + messages.push_back(std::make_pair(id, " has faction set but has invalid faction rank " + std::to_string(cellRef.mFactionRank))); else if (!hasFaction && cellRef.mFactionRank != -2) - messages.push_back(std::make_pair(id, " has invalid faction rank " + boost::lexical_cast(cellRef.mFactionRank))); + messages.push_back(std::make_pair(id, " has invalid faction rank " + std::to_string(cellRef.mFactionRank))); // If door have destination cell, check if that reference is valid if (!cellRef.mDestCell.empty()) @@ -79,7 +77,7 @@ void CSMTools::ReferenceCheckStage::perform(int stage, CSMDoc::Messages &message if (cellRef.mScale < 0) { std::string str = " has negative scale "; - str += boost::lexical_cast(cellRef.mScale); + str += std::to_string(cellRef.mScale); messages.push_back(std::make_pair(id, id.getId() + str)); } @@ -87,7 +85,7 @@ void CSMTools::ReferenceCheckStage::perform(int stage, CSMDoc::Messages &message if (cellRef.mEnchantmentCharge < 0 && cellRef.mEnchantmentCharge != -1) { std::string str = " has negative enchantment points "; - str += boost::lexical_cast(cellRef.mEnchantmentCharge); + str += std::to_string(cellRef.mEnchantmentCharge); messages.push_back(std::make_pair(id, id.getId() + str)); } diff --git a/apps/opencs/model/world/columnimp.hpp b/apps/opencs/model/world/columnimp.hpp index 33a71e97a..154bdab82 100644 --- a/apps/opencs/model/world/columnimp.hpp +++ b/apps/opencs/model/world/columnimp.hpp @@ -5,8 +5,6 @@ #include #include -#include - #include #include diff --git a/apps/opencs/view/render/cellmarker.cpp b/apps/opencs/view/render/cellmarker.cpp index 980ed305a..d0521a7b7 100644 --- a/apps/opencs/view/render/cellmarker.cpp +++ b/apps/opencs/view/render/cellmarker.cpp @@ -1,15 +1,10 @@ #include "cellmarker.hpp" -#include - #include #include #include -#include #include -#include "mask.hpp" - CSVRender::CellMarkerTag::CellMarkerTag(CellMarker *marker) : TagBase(Mask_CellMarker), mMarker(marker) {} @@ -42,8 +37,8 @@ void CSVRender::CellMarker::buildMarker() // Add text containing cell's coordinates. std::string coordinatesText = - boost::lexical_cast(mCoordinates.getX()) + "," + - boost::lexical_cast(mCoordinates.getY()); + std::to_string(mCoordinates.getX()) + "," + + std::to_string(mCoordinates.getY()); markerText->setText(coordinatesText); // Add text to marker node. diff --git a/apps/openmw/mwclass/misc.cpp b/apps/openmw/mwclass/misc.cpp index 203a7bbc4..a68176226 100644 --- a/apps/openmw/mwclass/misc.cpp +++ b/apps/openmw/mwclass/misc.cpp @@ -1,14 +1,11 @@ #include "misc.hpp" -#include - #include #include "../mwbase/environment.hpp" #include "../mwbase/world.hpp" #include "../mwbase/windowmanager.hpp" -#include "../mwworld/ptr.hpp" #include "../mwworld/actiontake.hpp" #include "../mwworld/cellstore.hpp" #include "../mwworld/esmstore.hpp" @@ -22,8 +19,6 @@ #include "../mwrender/objects.hpp" #include "../mwrender/renderinginterface.hpp" -#include - namespace MWClass { bool Miscellaneous::isGold (const MWWorld::ConstPtr& ptr) const @@ -146,7 +141,7 @@ namespace MWClass if (!gold) countString = MWGui::ToolTips::getCountString(count); else // gold displays its count also if it's 1. - countString = " (" + boost::lexical_cast(count) + ")"; + countString = " (" + std::to_string(count) + ")"; info.caption = ref->mBase->mName + countString; info.icon = ref->mBase->mIcon; diff --git a/apps/openmw/mwgui/enchantingdialog.cpp b/apps/openmw/mwgui/enchantingdialog.cpp index e44dc6fcc..a4728218a 100644 --- a/apps/openmw/mwgui/enchantingdialog.cpp +++ b/apps/openmw/mwgui/enchantingdialog.cpp @@ -2,16 +2,12 @@ #include -#include - #include #include #include #include -#include "../mwbase/environment.hpp" -#include "../mwbase/world.hpp" #include "../mwbase/soundmanager.hpp" #include "../mwbase/dialoguemanager.hpp" #include "../mwbase/mechanicsmanager.hpp" diff --git a/apps/openmw/mwgui/spellmodel.cpp b/apps/openmw/mwgui/spellmodel.cpp index d4ab552ff..6953d682b 100644 --- a/apps/openmw/mwgui/spellmodel.cpp +++ b/apps/openmw/mwgui/spellmodel.cpp @@ -2,8 +2,6 @@ #include -#include - #include "../mwbase/environment.hpp" #include "../mwbase/world.hpp" #include "../mwbase/windowmanager.hpp" @@ -61,8 +59,8 @@ namespace MWGui if (spell->mData.mType == ESM::Spell::ST_Spell) { newSpell.mType = Spell::Type_Spell; - std::string cost = boost::lexical_cast(spell->mData.mCost); - std::string chance = boost::lexical_cast(int(MWMechanics::getSpellSuccessChance(spell, mActor))); + std::string cost = std::to_string(spell->mData.mCost); + std::string chance = std::to_string(int(MWMechanics::getSpellSuccessChance(spell, mActor))); newSpell.mCostColumn = cost + "/" + chance; } else @@ -112,11 +110,11 @@ namespace MWGui int castCost = MWMechanics::getEffectiveEnchantmentCastCost(static_cast(enchant->mData.mCost), mActor); - std::string cost = boost::lexical_cast(castCost); + std::string cost = std::to_string(castCost); int currentCharge = int(item.getCellRef().getEnchantmentCharge()); if (currentCharge == -1) currentCharge = enchant->mData.mCharge; - std::string charge = boost::lexical_cast(currentCharge); + std::string charge = std::to_string(currentCharge); newSpell.mCostColumn = cost + "/" + charge; newSpell.mActive = invStore.isEquipped(item); diff --git a/apps/openmw/mwinput/inputmanagerimp.cpp b/apps/openmw/mwinput/inputmanagerimp.cpp index 234a17cc3..19b746d5d 100644 --- a/apps/openmw/mwinput/inputmanagerimp.cpp +++ b/apps/openmw/mwinput/inputmanagerimp.cpp @@ -1,9 +1,5 @@ #include "inputmanagerimp.hpp" -#include - -#include - #include #include @@ -1175,7 +1171,7 @@ namespace MWInput bool controlExists = mInputBinder->getChannel(i)->getControlsCount () != 0; if (!controlExists) { - control = new ICS::Control(boost::lexical_cast(i), false, true, 0, ICS::ICS_MAX, ICS::ICS_MAX); + control = new ICS::Control(std::to_string(i), false, true, 0, ICS::ICS_MAX, ICS::ICS_MAX); mInputBinder->addControl(control); control->attachChannel(mInputBinder->getChannel(i), ICS::Channel::DIRECT); } @@ -1247,7 +1243,7 @@ namespace MWInput if (defaultButtonBindings.find(i) != defaultButtonBindings.end()) initial = 0.0f; else initial = 0.5f; - control = new ICS::Control(boost::lexical_cast(i), false, true, initial, ICS::ICS_MAX, ICS::ICS_MAX); + control = new ICS::Control(std::to_string(i), false, true, initial, ICS::ICS_MAX, ICS::ICS_MAX); mInputBinder->addControl(control); control->attachChannel(mInputBinder->getChannel(i), ICS::Channel::DIRECT); } @@ -1336,7 +1332,7 @@ namespace MWInput if (key != SDL_SCANCODE_UNKNOWN) return MyGUI::TextIterator::toTagsString(mInputBinder->scancodeToString (key)); else if (mouse != ICS_MAX_DEVICE_BUTTONS) - return "#{sMouse} " + boost::lexical_cast(mouse); + return "#{sMouse} " + std::to_string(mouse); else return "#{sNone}"; } @@ -1391,7 +1387,7 @@ namespace MWInput case SDL_CONTROLLER_BUTTON_Y: return "Y Button"; default: - return "Button " + boost::lexical_cast(button); + return "Button " + std::to_string(button); } } std::string InputManager::sdlControllerAxisToString(int axis) @@ -1411,7 +1407,7 @@ namespace MWInput case SDL_CONTROLLER_AXIS_TRIGGERRIGHT: return "Right Trigger"; default: - return "Axis " + boost::lexical_cast(axis); + return "Axis " + std::to_string(axis); } } diff --git a/components/esm/loadmgef.cpp b/components/esm/loadmgef.cpp index dc8266132..3a918cf19 100644 --- a/components/esm/loadmgef.cpp +++ b/components/esm/loadmgef.cpp @@ -1,10 +1,7 @@ #include "loadmgef.hpp" -#include #include -#include - #include "esmreader.hpp" #include "esmwriter.hpp" #include "defs.hpp" @@ -524,7 +521,7 @@ const std::string &MagicEffect::effectIdToString(short effectID) { std::map::const_iterator name = sNames.find(effectID); if(name == sNames.end()) - throw std::runtime_error(std::string("Unimplemented effect ID ")+boost::lexical_cast(effectID)); + throw std::runtime_error(std::string("Unimplemented effect ID ")+std::to_string(effectID)); return name->second; } diff --git a/components/fallback/fallback.cpp b/components/fallback/fallback.cpp index 354595660..9b058f104 100644 --- a/components/fallback/fallback.cpp +++ b/components/fallback/fallback.cpp @@ -1,9 +1,11 @@ #include "fallback.hpp" -#include - namespace Fallback { + bool stob(std::string const& s) { + return s != "0"; + } + Map::Map(const std::map& fallback):mFallbackMap(fallback) {} @@ -22,7 +24,7 @@ namespace Fallback if(fallback.empty()) return 0; else - return boost::lexical_cast(fallback); + return std::stof(fallback); } int Map::getFallbackInt(const std::string& fall) const { @@ -30,7 +32,7 @@ namespace Fallback if(fallback.empty()) return 0; else - return boost::lexical_cast(fallback); + return std::stoi(fallback); } bool Map::getFallbackBool(const std::string& fall) const @@ -39,7 +41,7 @@ namespace Fallback if(fallback.empty()) return false; else - return boost::lexical_cast(fallback); + return stob(fallback); } osg::Vec4f Map::getFallbackColour(const std::string& fall) const { @@ -55,7 +57,7 @@ namespace Fallback else if (sum[i] != ' ') ret[j]+=sum[i]; } - return osg::Vec4f(boost::lexical_cast(ret[0])/255.f,boost::lexical_cast(ret[1])/255.f,boost::lexical_cast(ret[2])/255.f, 1.f); + return osg::Vec4f(std::stoi(ret[0])/255.f,std::stoi(ret[1])/255.f,std::stoi(ret[2])/255.f, 1.f); } } diff --git a/components/shader/shadermanager.cpp b/components/shader/shadermanager.cpp index ce77f46dc..2bfb17b5c 100644 --- a/components/shader/shadermanager.cpp +++ b/components/shader/shadermanager.cpp @@ -3,16 +3,14 @@ #include #include #include +#include #include -#include #include #include #include -#include - namespace Shader { @@ -139,7 +137,7 @@ namespace Shader shader->setShaderSource(shaderSource); // Assign a unique name to allow the SharedStateManager to compare shaders efficiently static unsigned int counter = 0; - shader->setName(boost::lexical_cast(counter++)); + shader->setName(std::to_string(counter++)); shaderIt = mShaders.insert(std::make_pair(std::make_pair(shaderTemplate, defines), shader)).first; } diff --git a/components/shader/shadervisitor.cpp b/components/shader/shadervisitor.cpp index b68d419a3..d85b72203 100644 --- a/components/shader/shadervisitor.cpp +++ b/components/shader/shadervisitor.cpp @@ -5,11 +5,9 @@ #include #include #include -#include #include -#include #include #include @@ -263,7 +261,7 @@ namespace Shader for (std::map::const_iterator texIt = reqs.mTextures.begin(); texIt != reqs.mTextures.end(); ++texIt) { defineMap[texIt->second] = "1"; - defineMap[texIt->second + std::string("UV")] = boost::lexical_cast(texIt->first); + defineMap[texIt->second + std::string("UV")] = std::to_string(texIt->first); } if (!reqs.mColorMaterial) diff --git a/components/widgets/numericeditbox.cpp b/components/widgets/numericeditbox.cpp index 5361b3127..d59deb378 100644 --- a/components/widgets/numericeditbox.cpp +++ b/components/widgets/numericeditbox.cpp @@ -1,7 +1,5 @@ #include "numericeditbox.hpp" -#include - namespace Gui { @@ -30,7 +28,7 @@ namespace Gui try { - mValue = boost::lexical_cast(newCaption); + mValue = std::stoi(newCaption); int capped = std::min(mMaxValue, std::max(mValue, mMinValue)); if (capped != mValue) { @@ -38,7 +36,7 @@ namespace Gui setCaption(MyGUI::utility::toString(mValue)); } } - catch (boost::bad_lexical_cast&) + catch (...) { setCaption(MyGUI::utility::toString(mValue)); } diff --git a/extern/oics/ICSInputControlSystem.h b/extern/oics/ICSInputControlSystem.h index 691a93725..308b54c3b 100644 --- a/extern/oics/ICSInputControlSystem.h +++ b/extern/oics/ICSInputControlSystem.h @@ -32,8 +32,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "ICSControl.h" #include "ICSChannel.h" -#include "boost/lexical_cast.hpp" - #define ICS_LOG(text) if(mLog) mLog->logMessage( ("ICS: " + std::string(text)).c_str() ); #define ICS_MAX_JOYSTICK_AXIS 16 #define ICS_MOUSE_BINDING_MARGIN 30 From 154d7cffa2b186529551ccb4627811e291f24030 Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Sun, 7 May 2017 00:04:46 +0200 Subject: [PATCH 28/51] replace and purge boost::function --- apps/openmw/mwgui/bookpage.cpp | 6 +++--- apps/openmw/mwgui/bookpage.hpp | 3 +-- apps/openmw/mwgui/journalviewmodel.cpp | 14 ++++++-------- apps/openmw/mwgui/journalviewmodel.hpp | 13 ++++++------- apps/openmw/mwgui/journalwindow.cpp | 2 -- apps/openmw/mwgui/tradewindow.cpp | 2 ++ components/sceneutil/lightmanager.cpp | 9 ++------- 7 files changed, 20 insertions(+), 29 deletions(-) diff --git a/apps/openmw/mwgui/bookpage.cpp b/apps/openmw/mwgui/bookpage.cpp index 883195f51..5def91eb8 100644 --- a/apps/openmw/mwgui/bookpage.cpp +++ b/apps/openmw/mwgui/bookpage.cpp @@ -892,7 +892,7 @@ public: Style* mFocusItem; bool mItemActive; MyGUI::MouseButton mLastDown; - boost::function mLinkClicked; + std::function mLinkClicked; std::shared_ptr mBook; @@ -1260,14 +1260,14 @@ public: mPageDisplay->showPage (book, page); } - void adviseLinkClicked (boost::function linkClicked) + void adviseLinkClicked (std::function linkClicked) { mPageDisplay->mLinkClicked = linkClicked; } void unadviseLinkClicked () { - mPageDisplay->mLinkClicked = boost::function (); + mPageDisplay->mLinkClicked = std::function (); } protected: diff --git a/apps/openmw/mwgui/bookpage.hpp b/apps/openmw/mwgui/bookpage.hpp index 8800508b4..e75e1e1d3 100644 --- a/apps/openmw/mwgui/bookpage.hpp +++ b/apps/openmw/mwgui/bookpage.hpp @@ -6,7 +6,6 @@ #include #include -#include namespace MWGui { @@ -101,7 +100,7 @@ namespace MWGui public: typedef TypesetBook::InteractiveId InteractiveId; - typedef boost::function ClickCallback; + typedef std::function ClickCallback; /// Make the widget display the specified page from the specified book. virtual void showPage (TypesetBook::Ptr Book, size_t Page) = 0; diff --git a/apps/openmw/mwgui/journalviewmodel.cpp b/apps/openmw/mwgui/journalviewmodel.cpp index 2e0d07787..b5d08eec6 100644 --- a/apps/openmw/mwgui/journalviewmodel.cpp +++ b/apps/openmw/mwgui/journalviewmodel.cpp @@ -5,8 +5,6 @@ #include -#include - #include #include "../mwbase/world.hpp" @@ -149,7 +147,7 @@ struct JournalViewModelImpl : JournalViewModel return toUtf8Span (utf8text); } - void visitSpans (boost::function < void (TopicId, size_t, size_t)> visitor) const + void visitSpans (std::function < void (TopicId, size_t, size_t)> visitor) const { ensureLoaded (); mModel->ensureKeyWordSearchLoaded (); @@ -193,7 +191,7 @@ struct JournalViewModelImpl : JournalViewModel }; - void visitQuestNames (bool active_only, boost::function visitor) const + void visitQuestNames (bool active_only, std::function visitor) const { MWBase::Journal * journal = MWBase::Environment::get ().getJournal (); @@ -268,7 +266,7 @@ struct JournalViewModelImpl : JournalViewModel } }; - void visitJournalEntries (const std::string& questName, boost::function visitor) const + void visitJournalEntries (const std::string& questName, std::function visitor) const { MWBase::Journal * journal = MWBase::Environment::get().getJournal(); @@ -301,13 +299,13 @@ struct JournalViewModelImpl : JournalViewModel } } - void visitTopicName (TopicId topicId, boost::function visitor) const + void visitTopicName (TopicId topicId, std::function visitor) const { MWDialogue::Topic const & topic = * reinterpret_cast (topicId); visitor (toUtf8Span (topic.getName())); } - void visitTopicNamesStartingWith (char character, boost::function < void (const std::string&) > visitor) const + void visitTopicNamesStartingWith (char character, std::function < void (const std::string&) > visitor) const { MWBase::Journal * journal = MWBase::Environment::get().getJournal(); @@ -341,7 +339,7 @@ struct JournalViewModelImpl : JournalViewModel }; - void visitTopicEntries (TopicId topicId, boost::function visitor) const + void visitTopicEntries (TopicId topicId, std::function visitor) const { typedef MWDialogue::Topic::TEntryIter iterator_t; diff --git a/apps/openmw/mwgui/journalviewmodel.hpp b/apps/openmw/mwgui/journalviewmodel.hpp index 5739a311f..3edde3d31 100644 --- a/apps/openmw/mwgui/journalviewmodel.hpp +++ b/apps/openmw/mwgui/journalviewmodel.hpp @@ -5,7 +5,6 @@ #include #include #include -#include namespace MWGui { @@ -37,7 +36,7 @@ namespace MWGui /// Visits each subset of text in the body, delivering the beginning /// and end of the span relative to the body, and a valid topic ID if /// the span represents a keyword, or zero if not. - virtual void visitSpans (boost::function visitor) const = 0; + virtual void visitSpans (std::function visitor) const = 0; }; /// An interface to topic data. @@ -67,20 +66,20 @@ namespace MWGui virtual bool isEmpty () const = 0; /// walks the active and optionally completed, quests providing the name and completed status - virtual void visitQuestNames (bool active_only, boost::function visitor) const = 0; + virtual void visitQuestNames (bool active_only, std::function visitor) const = 0; /// walks over the journal entries related to all quests with the given name /// If \a questName is empty, simply visits all journal entries - virtual void visitJournalEntries (const std::string& questName, boost::function visitor) const = 0; + virtual void visitJournalEntries (const std::string& questName, std::function visitor) const = 0; /// provides the name of the topic specified by its id - virtual void visitTopicName (TopicId topicId, boost::function visitor) const = 0; + virtual void visitTopicName (TopicId topicId, std::function visitor) const = 0; /// walks over the topics whose names start with the specified character providing the topics name - virtual void visitTopicNamesStartingWith (char character, boost::function < void (const std::string&) > visitor) const = 0; + virtual void visitTopicNamesStartingWith (char character, std::function < void (const std::string&) > visitor) const = 0; /// walks over the topic entries for the topic specified by its identifier - virtual void visitTopicEntries (TopicId topicId, boost::function visitor) const = 0; + virtual void visitTopicEntries (TopicId topicId, std::function visitor) const = 0; // create an instance of the default journal view model implementation static Ptr create (); diff --git a/apps/openmw/mwgui/journalwindow.cpp b/apps/openmw/mwgui/journalwindow.cpp index 5f309f148..879f1b417 100644 --- a/apps/openmw/mwgui/journalwindow.cpp +++ b/apps/openmw/mwgui/journalwindow.cpp @@ -9,8 +9,6 @@ #include #include -#include - #include #include #include diff --git a/apps/openmw/mwgui/tradewindow.cpp b/apps/openmw/mwgui/tradewindow.cpp index e191c16bb..fbdda8395 100644 --- a/apps/openmw/mwgui/tradewindow.cpp +++ b/apps/openmw/mwgui/tradewindow.cpp @@ -1,5 +1,7 @@ #include "tradewindow.hpp" +#include + #include #include #include diff --git a/components/sceneutil/lightmanager.cpp b/components/sceneutil/lightmanager.cpp index 341bc8034..bc042f7d6 100644 --- a/components/sceneutil/lightmanager.cpp +++ b/components/sceneutil/lightmanager.cpp @@ -1,15 +1,9 @@ #include "lightmanager.hpp" -#include - -#include - #include #include -#include - namespace SceneUtil { @@ -220,7 +214,8 @@ namespace SceneUtil // possible optimization: return a StateSet containing all requested lights plus some extra lights (if a suitable one exists) size_t hash = 0; for (unsigned int i=0; imLightSource->getId()); + hash = hash ^ (lightList[i]->mLightSource->getId() << 1); // or use boost::hash_combine + // original: boost::hash_combine(hash, lightList[i]->mLightSource->getId()); LightStateSetMap& stateSetCache = mStateSetCache[frameNum%2]; From d799954ca0a17cba35736dbb07e6457b42ab9ed6 Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Sun, 7 May 2017 00:19:45 +0200 Subject: [PATCH 29/51] replace and purge boost::math::gcd and other non-used headers --- apps/essimporter/main.cpp | 2 -- apps/launcher/graphicspage.cpp | 8 +------- apps/openmw/main.cpp | 6 ------ apps/openmw/mwgui/settingswindow.cpp | 5 +---- 4 files changed, 2 insertions(+), 19 deletions(-) diff --git a/apps/essimporter/main.cpp b/apps/essimporter/main.cpp index a4ad114ec..d593669c3 100644 --- a/apps/essimporter/main.cpp +++ b/apps/essimporter/main.cpp @@ -2,8 +2,6 @@ #include #include -#include -#include #include diff --git a/apps/launcher/graphicspage.cpp b/apps/launcher/graphicspage.cpp index 622db4da4..022404ec8 100644 --- a/apps/launcher/graphicspage.cpp +++ b/apps/launcher/graphicspage.cpp @@ -12,17 +12,11 @@ #include -#include - #include -#include - -#include - QString getAspect(int x, int y) { - int gcd = boost::math::gcd (x, y); + int gcd = std::__gcd (x, y); int xaspect = x / gcd; int yaspect = y / gcd; // special case: 8 : 5 is usually referred to as 16:10 diff --git a/apps/openmw/main.cpp b/apps/openmw/main.cpp index 420772910..be860118e 100644 --- a/apps/openmw/main.cpp +++ b/apps/openmw/main.cpp @@ -1,5 +1,4 @@ #include -#include #include #include @@ -7,13 +6,8 @@ #include #include -#include #include "engine.hpp" -#include -#include -#include - #if defined(_WIN32) // For OutputDebugString #ifndef WIN32_LEAN_AND_MEAN diff --git a/apps/openmw/mwgui/settingswindow.cpp b/apps/openmw/mwgui/settingswindow.cpp index c167164d9..398fe8ae7 100644 --- a/apps/openmw/mwgui/settingswindow.cpp +++ b/apps/openmw/mwgui/settingswindow.cpp @@ -3,17 +3,14 @@ #include #include #include -#include #include #include #include #include -#include #include -#include #include #include @@ -57,7 +54,7 @@ namespace std::string getAspect (int x, int y) { - int gcd = boost::math::gcd (x, y); + int gcd = std::__gcd (x, y); int xaspect = x / gcd; int yaspect = y / gcd; // special case: 8 : 5 is usually referred to as 16:10 From c781d1f8edee2a27cc1c001103c6333694c5069b Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Sun, 7 May 2017 01:04:24 +0200 Subject: [PATCH 30/51] purge unnecessary imports add fstream back add fstream back add fstream back add fstream back add fstream back add fstream back add fstream back --- apps/esmtool/labels.cpp | 1 - apps/essimporter/importer.cpp | 2 +- apps/mwiniimporter/importer.cpp | 7 +------ apps/mwiniimporter/main.cpp | 2 -- apps/opencs/model/doc/document.cpp | 1 + apps/opencs/model/doc/documentmanager.cpp | 3 --- apps/opencs/model/doc/savingstages.cpp | 5 ----- apps/opencs/model/doc/savingstate.cpp | 2 ++ apps/opencs/view/doc/adjusterwidget.cpp | 3 --- apps/openmw/engine.cpp | 2 -- apps/openmw/main.cpp | 3 ++- apps/openmw/mwgui/race.cpp | 3 --- apps/openmw/mwmechanics/npcstats.cpp | 6 ------ apps/openmw/mwrender/water.cpp | 2 -- apps/openmw/mwscript/containerextensions.cpp | 1 - apps/openmw/mwstate/character.cpp | 6 ------ apps/openmw/mwstate/charactermanager.cpp | 2 -- apps/openmw/mwstate/statemanagerimp.cpp | 3 --- components/bsa/bsa_file.cpp | 1 - components/files/configurationmanager.cpp | 5 ----- components/files/escape.cpp | 1 - components/files/linuxpath.cpp | 3 --- components/files/multidircollection.cpp | 6 ------ components/myguiplatform/myguiloglistener.cpp | 3 --- components/settings/settings.cpp | 2 -- components/translation/translation.cpp | 2 -- 26 files changed, 7 insertions(+), 70 deletions(-) diff --git a/apps/esmtool/labels.cpp b/apps/esmtool/labels.cpp index 883a9e728..ea7b50129 100644 --- a/apps/esmtool/labels.cpp +++ b/apps/esmtool/labels.cpp @@ -11,7 +11,6 @@ #include #include #include -#include #include diff --git a/apps/essimporter/importer.cpp b/apps/essimporter/importer.cpp index 2c05f9ecb..d38069d89 100644 --- a/apps/essimporter/importer.cpp +++ b/apps/essimporter/importer.cpp @@ -1,8 +1,8 @@ #include "importer.hpp" #include -#include +#include #include #include diff --git a/apps/mwiniimporter/importer.cpp b/apps/mwiniimporter/importer.cpp index fb3144814..24646b844 100644 --- a/apps/mwiniimporter/importer.cpp +++ b/apps/mwiniimporter/importer.cpp @@ -1,17 +1,12 @@ #include "importer.hpp" -#include #include -#include -#include -#include -#include #include #include -#include #include #include +#include namespace bfs = boost::filesystem; diff --git a/apps/mwiniimporter/main.cpp b/apps/mwiniimporter/main.cpp index a3f115fcf..8a2aeb603 100644 --- a/apps/mwiniimporter/main.cpp +++ b/apps/mwiniimporter/main.cpp @@ -1,11 +1,9 @@ #include "importer.hpp" -#include #include #include #include -#include #include namespace bpo = boost::program_options; diff --git a/apps/opencs/model/doc/document.cpp b/apps/opencs/model/doc/document.cpp index ea32a8457..ef984c0ca 100644 --- a/apps/opencs/model/doc/document.cpp +++ b/apps/opencs/model/doc/document.cpp @@ -5,6 +5,7 @@ #include #include +#include #include "../world/defaultgmsts.hpp" diff --git a/apps/opencs/model/doc/documentmanager.cpp b/apps/opencs/model/doc/documentmanager.cpp index 87fb960c1..098d7bad5 100644 --- a/apps/opencs/model/doc/documentmanager.cpp +++ b/apps/opencs/model/doc/documentmanager.cpp @@ -1,8 +1,5 @@ #include "documentmanager.hpp" -#include -#include - #include #ifndef Q_MOC_RUN diff --git a/apps/opencs/model/doc/savingstages.cpp b/apps/opencs/model/doc/savingstages.cpp index 82a965ae4..f9c028e29 100644 --- a/apps/opencs/model/doc/savingstages.cpp +++ b/apps/opencs/model/doc/savingstages.cpp @@ -1,20 +1,15 @@ #include "savingstages.hpp" -#include - #include #include #include -#include - #include "../world/infocollection.hpp" #include "../world/cellcoordinates.hpp" #include "document.hpp" -#include "savingstate.hpp" CSMDoc::OpenSaveStage::OpenSaveStage (Document& document, SavingState& state, bool projectFile) : mDocument (document), mState (state), mProjectFile (projectFile) diff --git a/apps/opencs/model/doc/savingstate.cpp b/apps/opencs/model/doc/savingstate.cpp index 10539c1b5..7214735f0 100644 --- a/apps/opencs/model/doc/savingstate.cpp +++ b/apps/opencs/model/doc/savingstate.cpp @@ -1,5 +1,7 @@ #include "savingstate.hpp" +#include + #include "operation.hpp" #include "document.hpp" diff --git a/apps/opencs/view/doc/adjusterwidget.cpp b/apps/opencs/view/doc/adjusterwidget.cpp index 620d853ac..06da68ed8 100644 --- a/apps/opencs/view/doc/adjusterwidget.cpp +++ b/apps/opencs/view/doc/adjusterwidget.cpp @@ -1,8 +1,5 @@ #include "adjusterwidget.hpp" -#include -#include - #include #include diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp index 81fb2e6a7..b1c1311bc 100644 --- a/apps/openmw/engine.cpp +++ b/apps/openmw/engine.cpp @@ -1,6 +1,5 @@ #include "engine.hpp" -#include #include #include @@ -28,7 +27,6 @@ #include #include -#include #include diff --git a/apps/openmw/main.cpp b/apps/openmw/main.cpp index be860118e..a7e522acd 100644 --- a/apps/openmw/main.cpp +++ b/apps/openmw/main.cpp @@ -8,6 +8,8 @@ #include #include "engine.hpp" +#include + #if defined(_WIN32) // For OutputDebugString #ifndef WIN32_LEAN_AND_MEAN @@ -31,7 +33,6 @@ extern int cc_install_handlers(int argc, char **argv, int num_signals, int *sigs extern int is_debugger_attached(void); #endif -#include /** * Workaround for problems with whitespaces in paths in older versions of Boost library */ diff --git a/apps/openmw/mwgui/race.cpp b/apps/openmw/mwgui/race.cpp index c4a27f7ed..047f65263 100644 --- a/apps/openmw/mwgui/race.cpp +++ b/apps/openmw/mwgui/race.cpp @@ -2,13 +2,10 @@ #include #include -#include #include #include -#include - #include #include "../mwworld/esmstore.hpp" diff --git a/apps/openmw/mwmechanics/npcstats.cpp b/apps/openmw/mwmechanics/npcstats.cpp index 41f2a9b51..5f8967cf4 100644 --- a/apps/openmw/mwmechanics/npcstats.cpp +++ b/apps/openmw/mwmechanics/npcstats.cpp @@ -1,15 +1,9 @@ #include "npcstats.hpp" -#include -#include -#include -#include - #include #include -#include #include #include #include diff --git a/apps/openmw/mwrender/water.cpp b/apps/openmw/mwrender/water.cpp index 02882adbe..0ed389bdf 100644 --- a/apps/openmw/mwrender/water.cpp +++ b/apps/openmw/mwrender/water.cpp @@ -10,8 +10,6 @@ #include #include #include -#include -#include #include diff --git a/apps/openmw/mwscript/containerextensions.cpp b/apps/openmw/mwscript/containerextensions.cpp index a65c275d6..dfc066bcd 100644 --- a/apps/openmw/mwscript/containerextensions.cpp +++ b/apps/openmw/mwscript/containerextensions.cpp @@ -10,7 +10,6 @@ #include #include -#include #include #include diff --git a/apps/openmw/mwstate/character.cpp b/apps/openmw/mwstate/character.cpp index 733ac1171..4f7d365b4 100644 --- a/apps/openmw/mwstate/character.cpp +++ b/apps/openmw/mwstate/character.cpp @@ -1,18 +1,12 @@ #include "character.hpp" -#include - #include -#include -#include #include #include #include -#include - bool MWState::operator< (const Slot& left, const Slot& right) { return left.mTimeStamp -#include -#include // std::isalnum #include diff --git a/apps/openmw/mwstate/statemanagerimp.cpp b/apps/openmw/mwstate/statemanagerimp.cpp index 64c543fb1..68b0e4ecb 100644 --- a/apps/openmw/mwstate/statemanagerimp.cpp +++ b/apps/openmw/mwstate/statemanagerimp.cpp @@ -7,8 +7,6 @@ #include -#include - #include #include @@ -35,7 +33,6 @@ #include "../mwworld/inventorystore.hpp" #include "../mwmechanics/npcstats.hpp" -#include "../mwmechanics/creaturestats.hpp" #include "../mwmechanics/actorutil.hpp" #include "../mwscript/globalscripts.hpp" diff --git a/components/bsa/bsa_file.cpp b/components/bsa/bsa_file.cpp index 50b3374e5..c4be428b3 100644 --- a/components/bsa/bsa_file.cpp +++ b/components/bsa/bsa_file.cpp @@ -23,7 +23,6 @@ #include "bsa_file.hpp" -#include #include #include diff --git a/components/files/configurationmanager.cpp b/components/files/configurationmanager.cpp index 46dbca8dc..5316255ad 100644 --- a/components/files/configurationmanager.cpp +++ b/components/files/configurationmanager.cpp @@ -1,17 +1,12 @@ #include "configurationmanager.hpp" -#include #include -#include -#include #include #include #include #include -#include - /** * \namespace Files */ diff --git a/components/files/escape.cpp b/components/files/escape.cpp index c5d2c041e..f28870c70 100644 --- a/components/files/escape.cpp +++ b/components/files/escape.cpp @@ -1,7 +1,6 @@ #include "escape.hpp" #include -#include namespace Files { diff --git a/components/files/linuxpath.cpp b/components/files/linuxpath.cpp index 89b4bf45a..fce7cd02c 100644 --- a/components/files/linuxpath.cpp +++ b/components/files/linuxpath.cpp @@ -2,10 +2,7 @@ #if defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) -#include -#include #include -#include #include #include diff --git a/components/files/multidircollection.cpp b/components/files/multidircollection.cpp index b37a95b2f..93db6834d 100644 --- a/components/files/multidircollection.cpp +++ b/components/files/multidircollection.cpp @@ -1,15 +1,9 @@ #include "multidircollection.hpp" -#include - -#include -#include #include #include -#include - namespace Files { struct NameEqual diff --git a/components/myguiplatform/myguiloglistener.cpp b/components/myguiplatform/myguiloglistener.cpp index b36e0d852..a22ac8fc5 100644 --- a/components/myguiplatform/myguiloglistener.cpp +++ b/components/myguiplatform/myguiloglistener.cpp @@ -1,9 +1,6 @@ #include "myguiloglistener.hpp" #include -#include - -#include namespace osgMyGUI { diff --git a/components/settings/settings.cpp b/components/settings/settings.cpp index 0c0600cc0..e93642ee2 100644 --- a/components/settings/settings.cpp +++ b/components/settings/settings.cpp @@ -1,13 +1,11 @@ #include "settings.hpp" -#include #include #include #include #include -#include #include namespace diff --git a/components/translation/translation.cpp b/components/translation/translation.cpp index 51947f6f9..14a32f178 100644 --- a/components/translation/translation.cpp +++ b/components/translation/translation.cpp @@ -2,8 +2,6 @@ #include -#include - namespace Translation { Storage::Storage() From 4600f24e27dfa77dffdc966374af976a909086e4 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Fri, 9 Jun 2017 22:52:40 +0400 Subject: [PATCH 31/51] Playing sound when AI is opening a door --- apps/openmw/mwmechanics/aipackage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/openmw/mwmechanics/aipackage.cpp b/apps/openmw/mwmechanics/aipackage.cpp index abdc57042..08fe0b28c 100644 --- a/apps/openmw/mwmechanics/aipackage.cpp +++ b/apps/openmw/mwmechanics/aipackage.cpp @@ -182,7 +182,7 @@ void MWMechanics::AiPackage::evadeObstacles(const MWWorld::Ptr& actor, float dur if (getTypeId() != TypeIdWander && !door.getCellRef().getTeleport() && door.getCellRef().getTrap().empty() && door.getCellRef().getLockLevel() <= 0 && door.getClass().getDoorState(door) == 0) { - MWBase::Environment::get().getWorld()->activateDoor(door, 1); + MWBase::Environment::get().getWorld()->activate(door, actor); } } else // any other obstacle (NPC, crate, etc.) From dbf149f9b22acc6c984ee7e168f535f2c4d74607 Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Sat, 10 Jun 2017 00:51:19 +0200 Subject: [PATCH 32/51] gcd is not available in msvc until 2017.3 P2, back to boost::math::gcd for now --- apps/launcher/graphicspage.cpp | 3 ++- apps/openmw/mwgui/settingswindow.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/launcher/graphicspage.cpp b/apps/launcher/graphicspage.cpp index 022404ec8..d3dbfa559 100644 --- a/apps/launcher/graphicspage.cpp +++ b/apps/launcher/graphicspage.cpp @@ -1,5 +1,6 @@ #include "graphicspage.hpp" +#include #include #include #include @@ -16,7 +17,7 @@ QString getAspect(int x, int y) { - int gcd = std::__gcd (x, y); + int gcd = boost::math::gcd (x, y); int xaspect = x / gcd; int yaspect = y / gcd; // special case: 8 : 5 is usually referred to as 16:10 diff --git a/apps/openmw/mwgui/settingswindow.cpp b/apps/openmw/mwgui/settingswindow.cpp index 398fe8ae7..f46199c80 100644 --- a/apps/openmw/mwgui/settingswindow.cpp +++ b/apps/openmw/mwgui/settingswindow.cpp @@ -8,6 +8,7 @@ #include #include +#include #include @@ -54,7 +55,7 @@ namespace std::string getAspect (int x, int y) { - int gcd = std::__gcd (x, y); + int gcd = boost::math::gcd (x, y); int xaspect = x / gcd; int yaspect = y / gcd; // special case: 8 : 5 is usually referred to as 16:10 From 11c4aed4e568f0b88d5a0d746351fc90c6ddd15e Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Sat, 10 Jun 2017 09:09:30 +0200 Subject: [PATCH 33/51] algo needed for std::min/max in msvc2013 --- extern/osg-ffmpeg-videoplayer/audiodecoder.cpp | 1 + extern/osg-ffmpeg-videoplayer/videostate.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/extern/osg-ffmpeg-videoplayer/audiodecoder.cpp b/extern/osg-ffmpeg-videoplayer/audiodecoder.cpp index 09de3bc44..ee6400177 100644 --- a/extern/osg-ffmpeg-videoplayer/audiodecoder.cpp +++ b/extern/osg-ffmpeg-videoplayer/audiodecoder.cpp @@ -1,5 +1,6 @@ #include "audiodecoder.hpp" +#include #include #include diff --git a/extern/osg-ffmpeg-videoplayer/videostate.cpp b/extern/osg-ffmpeg-videoplayer/videostate.cpp index b7be81629..9fd209d56 100644 --- a/extern/osg-ffmpeg-videoplayer/videostate.cpp +++ b/extern/osg-ffmpeg-videoplayer/videostate.cpp @@ -1,5 +1,6 @@ #include "videostate.hpp" +#include #include #include From 8a5c62de97262c56317ed353880b890791f2eafc Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sat, 10 Jun 2017 14:50:43 +0100 Subject: [PATCH 34/51] needs this head for getuid --- components/files/linuxpath.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/components/files/linuxpath.cpp b/components/files/linuxpath.cpp index fce7cd02c..1f6a3d913 100644 --- a/components/files/linuxpath.cpp +++ b/components/files/linuxpath.cpp @@ -3,6 +3,7 @@ #if defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) #include +#include #include #include From 188424d5d336151d7363aca49c8b996eec9773e5 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Sat, 10 Jun 2017 22:31:17 +0400 Subject: [PATCH 35/51] Allow AI to use keys to open doors --- apps/openmw/mwmechanics/aipackage.cpp | 30 ++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwmechanics/aipackage.cpp b/apps/openmw/mwmechanics/aipackage.cpp index 08fe0b28c..62fd56bec 100644 --- a/apps/openmw/mwmechanics/aipackage.cpp +++ b/apps/openmw/mwmechanics/aipackage.cpp @@ -12,6 +12,7 @@ #include "../mwworld/action.hpp" #include "../mwworld/class.hpp" #include "../mwworld/cellstore.hpp" +#include "../mwworld/inventorystore.hpp" #include "creaturestats.hpp" #include "movement.hpp" @@ -179,10 +180,33 @@ void MWMechanics::AiPackage::evadeObstacles(const MWWorld::Ptr& actor, float dur if (door != MWWorld::Ptr()) { // note: AiWander currently does not open doors - if (getTypeId() != TypeIdWander && !door.getCellRef().getTeleport() && door.getCellRef().getTrap().empty() - && door.getCellRef().getLockLevel() <= 0 && door.getClass().getDoorState(door) == 0) + if (getTypeId() != TypeIdWander && !door.getCellRef().getTeleport() && door.getClass().getDoorState(door) == 0) { - MWBase::Environment::get().getWorld()->activate(door, actor); + if ((door.getCellRef().getTrap().empty() && door.getCellRef().getLockLevel() <= 0 )) + MWBase::Environment::get().getWorld()->activate(door, actor); + + std::string keyId = door.getCellRef().getKey(); + if (keyId.empty()) + return; + + bool hasKey = false; + const MWWorld::ContainerStore &invStore = actor.getClass().getContainerStore(actor); + + // make key id lowercase + Misc::StringUtils::lowerCaseInPlace(keyId); + for (MWWorld::ConstContainerStoreIterator it = invStore.cbegin(); it != invStore.cend(); ++it) + { + std::string refId = it->getCellRef().getRefId(); + Misc::StringUtils::lowerCaseInPlace(refId); + if (refId == keyId) + { + hasKey = true; + break; + } + } + + if (hasKey) + MWBase::Environment::get().getWorld()->activate(door, actor); } } else // any other obstacle (NPC, crate, etc.) From cab51d26cc4f106ee5cb516f9655ede6e48357ce Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Sat, 10 Jun 2017 22:33:14 +0400 Subject: [PATCH 36/51] Doors: small key search optimizations --- apps/openmw/mwclass/door.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/apps/openmw/mwclass/door.cpp b/apps/openmw/mwclass/door.cpp index 5f977174f..bbaff6338 100644 --- a/apps/openmw/mwclass/door.cpp +++ b/apps/openmw/mwclass/door.cpp @@ -132,15 +132,19 @@ namespace MWClass // make key id lowercase std::string keyId = ptr.getCellRef().getKey(); - Misc::StringUtils::lowerCaseInPlace(keyId); - for (MWWorld::ConstContainerStoreIterator it = invStore.cbegin(); it != invStore.cend(); ++it) + if (!keyId.empty()) { - std::string refId = it->getCellRef().getRefId(); - Misc::StringUtils::lowerCaseInPlace(refId); - if (refId == keyId) + Misc::StringUtils::lowerCaseInPlace(keyId); + for (MWWorld::ConstContainerStoreIterator it = invStore.cbegin(); it != invStore.cend(); ++it) { - hasKey = true; - keyName = it->getClass().getName(*it); + std::string refId = it->getCellRef().getRefId(); + Misc::StringUtils::lowerCaseInPlace(refId); + if (refId == keyId) + { + hasKey = true; + keyName = it->getClass().getName(*it); + break; + } } } From b0abed00e59aa8472daf0bb55bd6f5096e1d013b Mon Sep 17 00:00:00 2001 From: Siimacore Date: Sat, 10 Jun 2017 21:36:35 +0200 Subject: [PATCH 37/51] Correcting https://bugs.openmw.org/issues/3906 --- apps/launcher/maindialog.cpp | 8 +++++++- apps/launcher/maindialog.hpp | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/launcher/maindialog.cpp b/apps/launcher/maindialog.cpp index 94e186db8..46340dd9e 100644 --- a/apps/launcher/maindialog.cpp +++ b/apps/launcher/maindialog.cpp @@ -172,6 +172,9 @@ Launcher::FirstRunDialogResult Launcher::MainDialog::showFirstRunDialog() } } + if(!setupGameData()) + return FirstRunDialogResultFailure; + return setup() ? FirstRunDialogResultContinue : FirstRunDialogResultFailure; } @@ -344,6 +347,10 @@ bool Launcher::MainDialog::setupGameSettings() file.close(); } + return true; +} + +bool Launcher::MainDialog::setupGameData() { QStringList dataDirs; // Check if the paths actually contain data files @@ -379,7 +386,6 @@ bool Launcher::MainDialog::setupGameSettings() } } } - return true; } diff --git a/apps/launcher/maindialog.hpp b/apps/launcher/maindialog.hpp index 96b5c0b97..8d0d61b8f 100644 --- a/apps/launcher/maindialog.hpp +++ b/apps/launcher/maindialog.hpp @@ -72,6 +72,7 @@ namespace Launcher bool setupLauncherSettings(); bool setupGameSettings(); bool setupGraphicsSettings(); + bool setupGameData(); void setVersionLabel(); From 9fdfb2a83f488fec895461d1f24b153533effe69 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Sun, 11 Jun 2017 10:13:00 +0400 Subject: [PATCH 38/51] Spell priority: make AI do not cast target spells when enemy is under water --- apps/openmw/mwmechanics/aicombataction.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwmechanics/aicombataction.cpp b/apps/openmw/mwmechanics/aicombataction.cpp index 358e04d6b..f9b793f94 100644 --- a/apps/openmw/mwmechanics/aicombataction.cpp +++ b/apps/openmw/mwmechanics/aicombataction.cpp @@ -549,7 +549,13 @@ namespace MWMechanics if (effect.mRange == ESM::RT_Target) { if (MWBase::Environment::get().getWorld()->isUnderwater(MWWorld::ConstPtr(actor), 0.75f)) - return 0; + return 0.f; + + if (enemy.isEmpty()) + return 0.f; + + if (MWBase::Environment::get().getWorld()->isUnderwater(MWWorld::ConstPtr(enemy), 0.75f)) + return 0.f; } rating *= magicEffect->mData.mBaseCost; From 913601facc5a6a335e5a9f24ed222ec2f113cefb Mon Sep 17 00:00:00 2001 From: Nikolay Kasyanov Date: Sun, 11 Jun 2017 11:18:39 +0200 Subject: [PATCH 39/51] [macOS, CI] reenable packaging to make nightlies work --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 86dbdcfd4..668cfe7e2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -63,7 +63,7 @@ before_script: ./CI/before_script.${TRAVIS_OS_NAME}.sh script: - cd ./build - if [ "$COVERITY_SCAN_BRANCH" != 1 ]; then ${ANALYZE}make -j3; fi - - if [ "$COVERITY_SCAN_BRANCH" != 1 ] && [ "${TRAVIS_OS_NAME}" = "osx" ]; then make; fi + - if [ "$COVERITY_SCAN_BRANCH" != 1 ] && [ "${TRAVIS_OS_NAME}" = "osx" ]; then make package; fi - if [ "$COVERITY_SCAN_BRANCH" != 1 ] && [ "${TRAVIS_OS_NAME}" = "linux" ]; then ./openmw_test_suite; fi - if [ "$COVERITY_SCAN_BRANCH" != 1 ] && [ "${TRAVIS_OS_NAME}" = "linux" ]; then cd .. && ./CI/check_tabs.sh; fi - cd "${TRAVIS_BUILD_DIR}" From e9d0bf7c1270652394ac17081a306007d521fbc7 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Sun, 11 Jun 2017 15:06:44 +0400 Subject: [PATCH 40/51] Added missed return statement --- apps/openmw/mwmechanics/aipackage.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/openmw/mwmechanics/aipackage.cpp b/apps/openmw/mwmechanics/aipackage.cpp index 62fd56bec..529e7ca41 100644 --- a/apps/openmw/mwmechanics/aipackage.cpp +++ b/apps/openmw/mwmechanics/aipackage.cpp @@ -183,7 +183,10 @@ void MWMechanics::AiPackage::evadeObstacles(const MWWorld::Ptr& actor, float dur if (getTypeId() != TypeIdWander && !door.getCellRef().getTeleport() && door.getClass().getDoorState(door) == 0) { if ((door.getCellRef().getTrap().empty() && door.getCellRef().getLockLevel() <= 0 )) + { MWBase::Environment::get().getWorld()->activate(door, actor); + return; + } std::string keyId = door.getCellRef().getKey(); if (keyId.empty()) From fb7479c1946609faf5306887fcfc15fa99cb3769 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sun, 11 Jun 2017 23:52:01 +0200 Subject: [PATCH 41/51] Update CONTRIBUTING.md --- CONTRIBUTING.md | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a9cd6a690..466910ca3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,16 +1,35 @@ -Description -=========== +How to contribute to OpenMW +======================= -Your pull request description should include (if applicable): +Not sure what to do with all your free time? Pick out a task from here: + +http://bugs.openmw.org/ + +Currently, we are focused on completing the MW game experience and general polishing. Features out of this scope may be approved in some cases, but you should probably start a discussion first. + +Note: +- Tasks set to 'openmw-future' are usually out of the current scope of the project and can't be started yet. +- Bugs that are not 'Confirmed' should be confirmed first. +- Larger Features should have a discussion before you start implementing. +- In many cases, it's best to have a discussion about possible solutions before you jump into coding. + +Aside from coding, you can also help by triaging the issues list. Check for bugs that are 'Unconfirmed' and try to confirm them on your end, working out any details that may be necessary. Check for bugs that do not conform to [Bug reporting guidelines](https://wiki.openmw.org/index.php?title=Bug_Reporting_Guidelines) and improve them to do so! + +There are various [Tools](https://wiki.openmw.org/index.php?title=Tools) to facilitate testing/development. + +Pull Request Guidelines +======================= + +Thought of a change? Great! To facilitate the review process, your pull request description should include the following (if applicable): * A link back to the bug report or forum discussion that prompted the change * Summary of the changes made * Reasoning / motivation behind the change * What testing you have carried out to verify the change -Other notes -=========== +Furthermore, we advise to: * Separate your work into multiple pull requests whenever possible. As a rule of thumb, each feature and each bugfix should go into a separate PR, unless they are closely related or dependent upon each other. Small pull requests are easier to review, and are less likely to require further changes before we can merge them. A "mega" pull request with lots of unrelated commits in it is likely to get held up in review for a long time. * Feel free to submit incomplete pull requests. Even if the work can not be merged yet, pull requests are a great place to collect early feedback. Just make sure to mark it as *[Incomplete]* or *[Do not merge yet]* in the title. * If you plan on contributing often, please read the [Developer Reference](https://wiki.openmw.org/index.php?title=Developer_Reference) on our wiki, especially the [Policies and Standards](https://wiki.openmw.org/index.php?title=Policies_and_Standards). +* Make sure each of your changes has a clear objective. Unnecessary changes may lead to merge conflicts, clutter the commit history and slow down review. Code formatting 'fixes' should be avoided, unless you were already changing that particular line anyway. From f0b21cca228475b1b31edf62ed91d23615d70675 Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Sat, 10 Jun 2017 23:02:56 +0200 Subject: [PATCH 42/51] use own inline hash_combine function --- components/sceneutil/lightmanager.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/components/sceneutil/lightmanager.cpp b/components/sceneutil/lightmanager.cpp index bc042f7d6..018abeefc 100644 --- a/components/sceneutil/lightmanager.cpp +++ b/components/sceneutil/lightmanager.cpp @@ -209,13 +209,21 @@ namespace SceneUtil mLights.push_back(l); } + /* similar to the boost::hash_combine */ + template + inline void hash_combine(std::size_t& seed, const T& v) + { + std::hash hasher; + seed ^= hasher(v) + 0x9e3779b9 + (seed<<6) + (seed>>2); + } + osg::ref_ptr LightManager::getLightListStateSet(const LightList &lightList, unsigned int frameNum) { + // possible optimization: return a StateSet containing all requested lights plus some extra lights (if a suitable one exists) size_t hash = 0; for (unsigned int i=0; imLightSource->getId() << 1); // or use boost::hash_combine - // original: boost::hash_combine(hash, lightList[i]->mLightSource->getId()); + hash_combine(hash, lightList[i]->mLightSource->getId()); LightStateSetMap& stateSetCache = mStateSetCache[frameNum%2]; From 7c758a629363d3a7b8fcd88fd2d40ab618c2591d Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Sun, 11 Jun 2017 09:23:19 +0200 Subject: [PATCH 43/51] std::stof can not handle comma in us localization and can not handle period in french localization, using std::replace is not a solution, going back to boost::lexical_cast --- components/fallback/fallback.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/components/fallback/fallback.cpp b/components/fallback/fallback.cpp index 9b058f104..010e1025c 100644 --- a/components/fallback/fallback.cpp +++ b/components/fallback/fallback.cpp @@ -1,5 +1,8 @@ #include "fallback.hpp" +#include + + namespace Fallback { bool stob(std::string const& s) { @@ -23,8 +26,9 @@ namespace Fallback std::string fallback=getFallbackString(fall); if(fallback.empty()) return 0; - else - return std::stof(fallback); + else { + return boost::lexical_cast(fallback); + } } int Map::getFallbackInt(const std::string& fall) const { From c6805314c22a1837c03faeb2e3a045936ad1b776 Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Sun, 11 Jun 2017 09:32:30 +0200 Subject: [PATCH 44/51] be explicit about what we are trying to catch instead of catching everything and fixed up formatting use Allman style brackets not K&R style, additional formatting for fallback.cpp which needed some love revert allman formatting changes --- components/fallback/fallback.cpp | 8 +++++--- components/widgets/numericeditbox.cpp | 8 +++++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/components/fallback/fallback.cpp b/components/fallback/fallback.cpp index 010e1025c..11a577a45 100644 --- a/components/fallback/fallback.cpp +++ b/components/fallback/fallback.cpp @@ -21,15 +21,16 @@ namespace Fallback } return it->second; } + float Map::getFallbackFloat(const std::string& fall) const { std::string fallback=getFallbackString(fall); if(fallback.empty()) return 0; - else { - return boost::lexical_cast(fallback); - } + else + return boost::lexical_cast(fallback); } + int Map::getFallbackInt(const std::string& fall) const { std::string fallback=getFallbackString(fall); @@ -47,6 +48,7 @@ namespace Fallback else return stob(fallback); } + osg::Vec4f Map::getFallbackColour(const std::string& fall) const { std::string sum=getFallbackString(fall); diff --git a/components/widgets/numericeditbox.cpp b/components/widgets/numericeditbox.cpp index d59deb378..828a84589 100644 --- a/components/widgets/numericeditbox.cpp +++ b/components/widgets/numericeditbox.cpp @@ -1,3 +1,5 @@ +#include + #include "numericeditbox.hpp" namespace Gui @@ -36,7 +38,11 @@ namespace Gui setCaption(MyGUI::utility::toString(mValue)); } } - catch (...) + catch (std::invalid_argument) + { + setCaption(MyGUI::utility::toString(mValue)); + } + catch (std::out_of_range) { setCaption(MyGUI::utility::toString(mValue)); } From 63f101e0cdfd58e0a88f7676b299a915faae4200 Mon Sep 17 00:00:00 2001 From: scrawl Date: Mon, 12 Jun 2017 23:48:06 +0200 Subject: [PATCH 45/51] Update AUTHORS.md --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index d119c9b1a..a75c475be 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -133,6 +133,7 @@ Programmers Sebastian Wick (swick) Sergey Shambir ShadowRadiance + Siimacore sir_herrbatka smbas Stefan Galowicz (bogglez) From 016da1f10cf856740cdea348250e17846f3c38b7 Mon Sep 17 00:00:00 2001 From: Nikolay Kasyanov Date: Tue, 13 Jun 2017 08:44:55 +0200 Subject: [PATCH 46/51] [macOS, CI] Use most recent dependencies --- CI/before_install.osx.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CI/before_install.osx.sh b/CI/before_install.osx.sh index 1035cbd22..ee2cc9cc9 100755 --- a/CI/before_install.osx.sh +++ b/CI/before_install.osx.sh @@ -6,5 +6,5 @@ brew outdated cmake || brew upgrade cmake brew outdated pkgconfig || brew upgrade pkgconfig brew install $macos_qt_formula -curl http://downloads.openmw.org/osx/dependencies/openmw-deps-c++11.zip -o ~/openmw-deps.zip +curl https://downloads.openmw.org/osx/dependencies/openmw-deps-eaf8112.zip -o ~/openmw-deps.zip unzip ~/openmw-deps.zip -d /private/tmp/openmw-deps > /dev/null From 87939bf3b16e61b2741a6d1ceb4d7ff641ffe7b6 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Tue, 13 Jun 2017 11:02:40 +0400 Subject: [PATCH 47/51] Use mRange to check spell range instead of mArea. --- apps/openmw/mwmechanics/aicombataction.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwmechanics/aicombataction.cpp b/apps/openmw/mwmechanics/aicombataction.cpp index f9b793f94..f5d6d8357 100644 --- a/apps/openmw/mwmechanics/aicombataction.cpp +++ b/apps/openmw/mwmechanics/aicombataction.cpp @@ -889,7 +889,7 @@ namespace MWMechanics for (std::vector::const_iterator effectIt = spell->mEffects.mList.begin(); effectIt != spell->mEffects.mList.end(); ++effectIt) { - if (effectIt->mArea == ESM::RT_Target) + if (effectIt->mRange == ESM::RT_Target) { const ESM::MagicEffect* effect = MWBase::Environment::get().getWorld()->getStore().get().find(effectIt->mEffectID); dist = effect->mData.mSpeed; @@ -906,7 +906,7 @@ namespace MWMechanics for (std::vector::const_iterator effectIt = ench->mEffects.mList.begin(); effectIt != ench->mEffects.mList.end(); ++effectIt) { - if (effectIt->mArea == ESM::RT_Target) + if (effectIt->mRange == ESM::RT_Target) { const ESM::MagicEffect* effect = MWBase::Environment::get().getWorld()->getStore().get().find(effectIt->mEffectID); dist = effect->mData.mSpeed; @@ -1029,7 +1029,7 @@ namespace MWMechanics for (std::vector::const_iterator effectIt = spell->mEffects.mList.begin(); effectIt != spell->mEffects.mList.end(); ++effectIt) { - if (effectIt->mArea == ESM::RT_Target) + if (effectIt->mRange == ESM::RT_Target) { if (!MWBase::Environment::get().getWorld()->isSwimming(enemy)) mult = fAIRangeMagicSpellMult; From 97c3c45ba8575edc1e4a4453f5bf3f7f22ff3330 Mon Sep 17 00:00:00 2001 From: Nikolay Kasyanov Date: Tue, 13 Jun 2017 09:18:02 +0200 Subject: [PATCH 48/51] [macOS, CI] Use Qt 5.7 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 668cfe7e2..48836b7bb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,7 @@ env: - secure: "MegynKyJpyL7XDwdWVEbypQh7CLjqOqOi9lGF97G7Fq0HosVZTmnwjHhmIPZspTP7ES4UbxM3rs/f3ce7sp9JN2ShRJpduD6UEFc8egQXBte9J3obUBIdUxPTRdhnht7VJ+u+pksK1S/Bm1Cs6l0eEluP3vmcaXWMykVQcZsPhY=" # macOS builds FTP upload password - secure: "jQcAaWAdDy0+vlNu4POMX8322HanCOQEUTdpviWTAUjWQTjMa0UTM4+zVVgrtEaHMpBaVYYbTT3Rg5BQ9oG+2SiVLJBQQ2XoMcos/YrjPVT6inB02Gs0vFjP29LdPAQVrB8CkAcfQr6u+Z2C+RqAtwhE09LsBUMXjRDzPAtr1CM=" - - macos_qt_formula=qt@5.5 + - macos_qt_formula=qt@5.7 addons: apt: sources: From 6af470ff03fd463965b3eb9191c16a8839bce9f2 Mon Sep 17 00:00:00 2001 From: Siimacore Date: Tue, 13 Jun 2017 12:00:55 +0200 Subject: [PATCH 49/51] Stopping the thread in the wizard that prevented it to stop correctly --- apps/wizard/unshield/unshieldworker.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/wizard/unshield/unshieldworker.cpp b/apps/wizard/unshield/unshieldworker.cpp index d3ccfe03a..020de9f80 100644 --- a/apps/wizard/unshield/unshieldworker.cpp +++ b/apps/wizard/unshield/unshieldworker.cpp @@ -46,6 +46,7 @@ Wizard::UnshieldWorker::~UnshieldWorker() void Wizard::UnshieldWorker::stopWorker() { mStopped = true; + mWait.wakeOne(); } void Wizard::UnshieldWorker::setInstallComponent(Wizard::Component component, bool install) @@ -448,6 +449,10 @@ bool Wizard::UnshieldWorker::setupComponent(Component component) QReadLocker readLock(&mLock); emit requestFileDialog(component); mWait.wait(&mLock); + if(mStopped) { + qDebug() << "We are asked to stop !!"; + break; + } disk.setPath(getDiskPath()); } else { disk.setPath(getDiskPath()); From 42402976e3a247ca70b87a806c26777d646f0cef Mon Sep 17 00:00:00 2001 From: Allofich Date: Tue, 13 Jun 2017 18:55:22 +0900 Subject: [PATCH 50/51] Fixes for building in MSVC --- apps/openmw/mwgui/containeritemmodel.cpp | 2 ++ apps/openmw/mwscript/skyextensions.cpp | 2 ++ apps/openmw/mwsound/ffmpeg_decoder.cpp | 1 + apps/openmw/mwsound/loudness.cpp | 1 + apps/openmw/mwsound/sound.hpp | 2 ++ apps/openmw/mwstate/charactermanager.cpp | 2 +- components/files/constrainedfilestream.cpp | 1 + components/sceneutil/controller.cpp | 2 ++ 8 files changed, 12 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwgui/containeritemmodel.cpp b/apps/openmw/mwgui/containeritemmodel.cpp index 1e4749695..d62cd16b0 100644 --- a/apps/openmw/mwgui/containeritemmodel.cpp +++ b/apps/openmw/mwgui/containeritemmodel.cpp @@ -1,5 +1,7 @@ #include "containeritemmodel.hpp" +#include + #include "../mwworld/containerstore.hpp" #include "../mwworld/class.hpp" diff --git a/apps/openmw/mwscript/skyextensions.cpp b/apps/openmw/mwscript/skyextensions.cpp index e0fccd16d..479c9d70c 100644 --- a/apps/openmw/mwscript/skyextensions.cpp +++ b/apps/openmw/mwscript/skyextensions.cpp @@ -1,5 +1,7 @@ #include "skyextensions.hpp" +#include + #include #include diff --git a/apps/openmw/mwsound/ffmpeg_decoder.cpp b/apps/openmw/mwsound/ffmpeg_decoder.cpp index c0a2014b3..1f1834761 100644 --- a/apps/openmw/mwsound/ffmpeg_decoder.cpp +++ b/apps/openmw/mwsound/ffmpeg_decoder.cpp @@ -4,6 +4,7 @@ #include #include +#include #include diff --git a/apps/openmw/mwsound/loudness.cpp b/apps/openmw/mwsound/loudness.cpp index 19e5cd586..ae31d6094 100644 --- a/apps/openmw/mwsound/loudness.cpp +++ b/apps/openmw/mwsound/loudness.cpp @@ -2,6 +2,7 @@ #include #include +#include #include "soundmanagerimp.hpp" diff --git a/apps/openmw/mwsound/sound.hpp b/apps/openmw/mwsound/sound.hpp index a59027fc1..8c663fb1e 100644 --- a/apps/openmw/mwsound/sound.hpp +++ b/apps/openmw/mwsound/sound.hpp @@ -1,6 +1,8 @@ #ifndef GAME_SOUND_SOUND_H #define GAME_SOUND_SOUND_H +#include + #include "sound_output.hpp" namespace MWSound diff --git a/apps/openmw/mwstate/charactermanager.cpp b/apps/openmw/mwstate/charactermanager.cpp index 62ddd649a..a91bd4e8c 100644 --- a/apps/openmw/mwstate/charactermanager.cpp +++ b/apps/openmw/mwstate/charactermanager.cpp @@ -58,7 +58,7 @@ MWState::Character* MWState::CharacterManager::createCharacter(const std::string // The character name is user-supplied, so we need to escape the path for (std::string::const_iterator it = name.begin(); it != name.end(); ++it) { - if (std::isalnum(*it)) // Ignores multibyte characters and non alphanumeric characters + if (isalnum(*it)) // Ignores multibyte characters and non alphanumeric characters stream << *it; else stream << "_"; diff --git a/components/files/constrainedfilestream.cpp b/components/files/constrainedfilestream.cpp index cd9a3c8f5..4f76139d9 100644 --- a/components/files/constrainedfilestream.cpp +++ b/components/files/constrainedfilestream.cpp @@ -1,6 +1,7 @@ #include "constrainedfilestream.hpp" #include +#include #include "lowlevelfile.hpp" diff --git a/components/sceneutil/controller.cpp b/components/sceneutil/controller.cpp index ee2715650..8fef00333 100644 --- a/components/sceneutil/controller.cpp +++ b/components/sceneutil/controller.cpp @@ -1,5 +1,7 @@ #include "controller.hpp" +#include + #include "statesetupdater.hpp" #include From 028762a7dcbd9c80f8b695cdec606d4a5830e0b3 Mon Sep 17 00:00:00 2001 From: Allofich Date: Sun, 30 Apr 2017 02:40:52 +0900 Subject: [PATCH 51/51] Make guards that are attacked try to arrest player (Fixes #3706) --- apps/openmw/mwmechanics/aisequence.cpp | 10 ++++++++++ apps/openmw/mwmechanics/aisequence.hpp | 3 +++ .../mwmechanics/mechanicsmanagerimp.cpp | 20 ++++++++++++++----- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/apps/openmw/mwmechanics/aisequence.cpp b/apps/openmw/mwmechanics/aisequence.cpp index 64347f161..82a2e2c3d 100644 --- a/apps/openmw/mwmechanics/aisequence.cpp +++ b/apps/openmw/mwmechanics/aisequence.cpp @@ -121,6 +121,16 @@ bool AiSequence::isInCombat() const return false; } +bool AiSequence::hasPackage(int typeId) const +{ + for (std::list::const_iterator it = mPackages.begin(); it != mPackages.end(); ++it) + { + if ((*it)->getTypeId() == typeId) + return true; + } + return false; +} + bool AiSequence::isInCombat(const MWWorld::Ptr &actor) const { for(std::list::const_iterator it = mPackages.begin(); it != mPackages.end(); ++it) diff --git a/apps/openmw/mwmechanics/aisequence.hpp b/apps/openmw/mwmechanics/aisequence.hpp index 4b6ec156a..41d204ee2 100644 --- a/apps/openmw/mwmechanics/aisequence.hpp +++ b/apps/openmw/mwmechanics/aisequence.hpp @@ -85,6 +85,9 @@ namespace MWMechanics /// Is there any combat package? bool isInCombat () const; + /// Does this AI sequence have the given package type? + bool hasPackage(int typeId) const; + /// Are we in combat with this particular actor? bool isInCombat (const MWWorld::Ptr& actor) const; diff --git a/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp b/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp index 930049ba0..62ac9bd40 100644 --- a/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp +++ b/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp @@ -1042,7 +1042,13 @@ namespace MWMechanics if (crimeSeen) reportCrime(player, victim, type, arg); else if (type == OT_Assault && !victim.isEmpty()) - startCombat(victim, player); // TODO: combat should be started with an "unaware" flag, which makes the victim flee? + { + if (victim.getClass().isClass(victim, "guard") + && !victim.getClass().getCreatureStats(victim).getAiSequence().hasPackage(AiPackage::TypeIdPursue)) + reportCrime(player, victim, type, arg); + else + startCombat(victim, player); // TODO: combat should be started with an "unaware" flag, which makes the victim flee? + } return crimeSeen; } @@ -1145,7 +1151,8 @@ namespace MWMechanics // once the bounty has been paid. it->getClass().getNpcStats(*it).setCrimeId(id); - it->getClass().getCreatureStats(*it).getAiSequence().stack(AiPursue(player), *it); + if (!it->getClass().getCreatureStats(*it).getAiSequence().hasPackage(AiPackage::TypeIdPursue)) + it->getClass().getCreatureStats(*it).getAiSequence().stack(AiPursue(player), *it); } else { @@ -1213,7 +1220,8 @@ namespace MWMechanics { // Attacker is in combat with us, but we are not in combat with the attacker yet. Time to fight back. // Note: accidental or collateral damage attacks are ignored. - startCombat(victim, player); + if (!victim.getClass().getCreatureStats(victim).getAiSequence().hasPackage(AiPackage::TypeIdPursue)) + startCombat(victim, player); // Set the crime ID, which we will use to calm down participants // once the bounty has been paid. @@ -1256,7 +1264,8 @@ namespace MWMechanics } if (target.getClass().isNpc() && !attacker.isEmpty() && !seq.isInCombat(attacker) - && !isAggressive(target, attacker) && !isFightingNpc) + && !isAggressive(target, attacker) && !isFightingNpc + && !target.getClass().getCreatureStats(target).getAiSequence().hasPackage(AiPackage::TypeIdPursue)) commitCrime(attacker, target, MWBase::MechanicsManager::OT_Assault); if (!attacker.isEmpty() && (attacker.getClass().getCreatureStats(attacker).getAiSequence().isInCombat(target) @@ -1265,7 +1274,8 @@ namespace MWMechanics { // Attacker is in combat with us, but we are not in combat with the attacker yet. Time to fight back. // Note: accidental or collateral damage attacks are ignored. - startCombat(target, attacker); + if (!target.getClass().getCreatureStats(target).getAiSequence().hasPackage(AiPackage::TypeIdPursue)) + startCombat(target, attacker); } return true;