Merge pull request #228 from OpenMW/master while resolving conflicts

# Conflicts:
#	.travis.yml
#	CMakeLists.txt
#	apps/openmw/main.cpp
pull/249/merge
David Cernat 8 years ago
commit fa3baac0f3

@ -1,7 +1,7 @@
os:
- linux
# - osx
osx_image: xcode8.2
osx_image: xcode8.3
language: cpp
sudo: required
dist: trusty
@ -13,7 +13,7 @@ branches:
env:
global:
- secure: NZmvVuA0O9NJXVQ12tXQZHDJC2mbFgYNFcsicw0DgW1It2Nk5hxIkF0pfu4/Z59mhQuOPgRVjl5b0FKy2Axh0gkWc1DJEXGwNaiW5lpTMNWR1LJG5rxa8LrDUpFkycpbzfAFuTUZu5z3iYVv64XzELvBuqNGhPMu1LeBnrlech0jFNjkR9p5qtJGWb8zYcPMCC57rig8a9g1ABoVYS6UXjrKpx0946ZLRsE5ukc9pXsypGwPmOMyfzZkxxzIqFaxoE5JIEdaJTWba/6Za315ozYYIi/N35ROI1YAv5GHRe/Iw9XAa4vQpbDzjM7ZSsZdTvvQsSU598gD2xC6jFUKSrpW6GZKwM2x236fZLGnOk5Uw7DUbG+AwpcEmxBwoy9PjBl9ZF3tJykI0gROewCy8MODhdsVMKr1HGIMVBIJySm/RnNqtoDbYV8mYnSl5b8rwJiCajoiR8Zuv4CIfGneeH1a3DOQDPH/qkDsU6ilzF4ANsBlMUUpgY653KBMBmTlNuVZSH527tnD7Fg6JgHVuSQkTbRa1vSkR7Zcre604RZcAoaEdbX3bhVDasPPghU/I742L0RH3oQNlR09pPBDZ8kG7ydl4aPHwpCWnvXNM1vgxtGvnYLztwrse7IoaRXRYiMFmrso78WhMWUDKgvY4wV9aeUu0DtnMezZVIQwCKg=
- macos_qt_formula=qt@5.5
- macos_qt_formula=qt@5.7
addons:
apt:
sources:
@ -27,7 +27,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

@ -133,6 +133,7 @@ Programmers
Sebastian Wick (swick)
Sergey Shambir
ShadowRadiance
Siimacore
sir_herrbatka
smbas
Stefan Galowicz (bogglez)

@ -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 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

@ -5,13 +5,12 @@ export CC=clang
DEPENDENCIES_ROOT="/private/tmp/openmw-deps/openmw-deps"
QT_PATH=`brew --prefix $macos_qt_formula`
mkdir build
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 OPENMW_OSX_DEPLOYMENT=TRUE \

@ -363,7 +363,13 @@ 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 -Wno-variadic-macros")
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++")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_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)
@ -761,7 +767,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)
@ -846,7 +852,7 @@ if (APPLE)
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"

@ -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.

@ -1,7 +1,6 @@
#include <iostream>
#include <iomanip>
#include <vector>
#include <exception>
#include <boost/program_options.hpp>
#include <boost/filesystem.hpp>

@ -11,7 +11,6 @@
#include <components/esm/loadrace.hpp>
#include <components/esm/loadspel.hpp>
#include <components/esm/loadweap.hpp>
#include <components/esm/aipackage.hpp>
#include <boost/format.hpp>

@ -2,7 +2,7 @@
#include <iomanip>
#include <boost/shared_ptr.hpp>
#include <boost/filesystem/fstream.hpp>
#include <osgDB/ReadFile>
#include <osg/ImageUtils>
@ -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<unsigned int, boost::shared_ptr<Converter> > converters;
converters[ESM::REC_GLOB] = boost::shared_ptr<Converter>(new ConvertGlobal());
converters[ESM::REC_BOOK] = boost::shared_ptr<Converter>(new ConvertBook());
converters[ESM::REC_NPC_] = boost::shared_ptr<Converter>(new ConvertNPC());
converters[ESM::REC_CREA] = boost::shared_ptr<Converter>(new ConvertCREA());
converters[ESM::REC_NPCC] = boost::shared_ptr<Converter>(new ConvertNPCC());
converters[ESM::REC_CREC] = boost::shared_ptr<Converter>(new ConvertCREC());
converters[recREFR ] = boost::shared_ptr<Converter>(new ConvertREFR());
converters[recPCDT ] = boost::shared_ptr<Converter>(new ConvertPCDT());
converters[recFMAP ] = boost::shared_ptr<Converter>(new ConvertFMAP());
converters[recKLST ] = boost::shared_ptr<Converter>(new ConvertKLST());
converters[recSTLN ] = boost::shared_ptr<Converter>(new ConvertSTLN());
converters[recGAME ] = boost::shared_ptr<Converter>(new ConvertGAME());
converters[ESM::REC_CELL] = boost::shared_ptr<Converter>(new ConvertCell());
converters[ESM::REC_ALCH] = boost::shared_ptr<Converter>(new DefaultConverter<ESM::Potion>());
converters[ESM::REC_CLAS] = boost::shared_ptr<Converter>(new ConvertClass());
converters[ESM::REC_SPEL] = boost::shared_ptr<Converter>(new DefaultConverter<ESM::Spell>());
converters[ESM::REC_ARMO] = boost::shared_ptr<Converter>(new DefaultConverter<ESM::Armor>());
converters[ESM::REC_WEAP] = boost::shared_ptr<Converter>(new DefaultConverter<ESM::Weapon>());
converters[ESM::REC_CLOT] = boost::shared_ptr<Converter>(new DefaultConverter<ESM::Clothing>());
converters[ESM::REC_ENCH] = boost::shared_ptr<Converter>(new DefaultConverter<ESM::Enchantment>());
converters[ESM::REC_WEAP] = boost::shared_ptr<Converter>(new DefaultConverter<ESM::Weapon>());
converters[ESM::REC_LEVC] = boost::shared_ptr<Converter>(new DefaultConverter<ESM::CreatureLevList>());
converters[ESM::REC_LEVI] = boost::shared_ptr<Converter>(new DefaultConverter<ESM::ItemLevList>());
converters[ESM::REC_CNTC] = boost::shared_ptr<Converter>(new ConvertCNTC());
converters[ESM::REC_FACT] = boost::shared_ptr<Converter>(new ConvertFACT());
converters[ESM::REC_INFO] = boost::shared_ptr<Converter>(new ConvertINFO());
converters[ESM::REC_DIAL] = boost::shared_ptr<Converter>(new ConvertDIAL());
converters[ESM::REC_QUES] = boost::shared_ptr<Converter>(new ConvertQUES());
converters[recJOUR ] = boost::shared_ptr<Converter>(new ConvertJOUR());
converters[ESM::REC_SCPT] = boost::shared_ptr<Converter>(new ConvertSCPT());
std::map<unsigned int, std::shared_ptr<Converter> > converters;
converters[ESM::REC_GLOB] = std::shared_ptr<Converter>(new ConvertGlobal());
converters[ESM::REC_BOOK] = std::shared_ptr<Converter>(new ConvertBook());
converters[ESM::REC_NPC_] = std::shared_ptr<Converter>(new ConvertNPC());
converters[ESM::REC_CREA] = std::shared_ptr<Converter>(new ConvertCREA());
converters[ESM::REC_NPCC] = std::shared_ptr<Converter>(new ConvertNPCC());
converters[ESM::REC_CREC] = std::shared_ptr<Converter>(new ConvertCREC());
converters[recREFR ] = std::shared_ptr<Converter>(new ConvertREFR());
converters[recPCDT ] = std::shared_ptr<Converter>(new ConvertPCDT());
converters[recFMAP ] = std::shared_ptr<Converter>(new ConvertFMAP());
converters[recKLST ] = std::shared_ptr<Converter>(new ConvertKLST());
converters[recSTLN ] = std::shared_ptr<Converter>(new ConvertSTLN());
converters[recGAME ] = std::shared_ptr<Converter>(new ConvertGAME());
converters[ESM::REC_CELL] = std::shared_ptr<Converter>(new ConvertCell());
converters[ESM::REC_ALCH] = std::shared_ptr<Converter>(new DefaultConverter<ESM::Potion>());
converters[ESM::REC_CLAS] = std::shared_ptr<Converter>(new ConvertClass());
converters[ESM::REC_SPEL] = std::shared_ptr<Converter>(new DefaultConverter<ESM::Spell>());
converters[ESM::REC_ARMO] = std::shared_ptr<Converter>(new DefaultConverter<ESM::Armor>());
converters[ESM::REC_WEAP] = std::shared_ptr<Converter>(new DefaultConverter<ESM::Weapon>());
converters[ESM::REC_CLOT] = std::shared_ptr<Converter>(new DefaultConverter<ESM::Clothing>());
converters[ESM::REC_ENCH] = std::shared_ptr<Converter>(new DefaultConverter<ESM::Enchantment>());
converters[ESM::REC_WEAP] = std::shared_ptr<Converter>(new DefaultConverter<ESM::Weapon>());
converters[ESM::REC_LEVC] = std::shared_ptr<Converter>(new DefaultConverter<ESM::CreatureLevList>());
converters[ESM::REC_LEVI] = std::shared_ptr<Converter>(new DefaultConverter<ESM::ItemLevList>());
converters[ESM::REC_CNTC] = std::shared_ptr<Converter>(new ConvertCNTC());
converters[ESM::REC_FACT] = std::shared_ptr<Converter>(new ConvertFACT());
converters[ESM::REC_INFO] = std::shared_ptr<Converter>(new ConvertINFO());
converters[ESM::REC_DIAL] = std::shared_ptr<Converter>(new ConvertDIAL());
converters[ESM::REC_QUES] = std::shared_ptr<Converter>(new ConvertQUES());
converters[recJOUR ] = std::shared_ptr<Converter>(new ConvertJOUR());
converters[ESM::REC_SCPT] = std::shared_ptr<Converter>(new ConvertSCPT());
// TODO:
// - REGN (weather in certain regions?)
@ -312,7 +312,7 @@ namespace ESSImport
std::set<unsigned int> unknownRecords;
for (std::map<unsigned int, boost::shared_ptr<Converter> >::const_iterator it = converters.begin();
for (std::map<unsigned int, std::shared_ptr<Converter> >::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<unsigned int, boost::shared_ptr<Converter> >::iterator it = converters.find(n.intval);
std::map<unsigned int, std::shared_ptr<Converter> >::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<unsigned int, boost::shared_ptr<Converter> >::const_iterator it = converters.begin();
for (std::map<unsigned int, std::shared_ptr<Converter> >::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<unsigned int, boost::shared_ptr<Converter> >::const_iterator it = converters.begin();
for (std::map<unsigned int, std::shared_ptr<Converter> >::const_iterator it = converters.begin();
it != converters.end(); ++it)
{
if (it->second->getStage() != 1)

@ -2,8 +2,6 @@
#include <boost/program_options.hpp>
#include <boost/filesystem.hpp>
#include <boost/filesystem/path.hpp>
#include <boost/filesystem/fstream.hpp>
#include <components/files/configurationmanager.hpp>

@ -1,5 +1,6 @@
#include "graphicspage.hpp"
#include <boost/math/common_factor.hpp>
#include <QDesktopWidget>
#include <QMessageBox>
#include <QDir>
@ -12,14 +13,8 @@
#include <SDL_video.h>
#include <boost/math/common_factor.hpp>
#include <components/files/configurationmanager.hpp>
#include <components/contentselector/model/naturalsort.hpp>
#include <components/settings/settings.hpp>
QString getAspect(int x, int y)
{
int gcd = boost::math::gcd (x, y);

@ -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;
}

@ -72,6 +72,7 @@ namespace Launcher
bool setupLauncherSettings();
bool setupGameSettings();
bool setupGraphicsSettings();
bool setupGameData();
void setVersionLabel();

@ -1,17 +1,12 @@
#include "importer.hpp"
#include <ctime>
#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <algorithm>
#include <sstream>
#include <components/misc/stringops.hpp>
#include <boost/version.hpp>
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/version.hpp>
namespace bfs = boost::filesystem;

@ -1,11 +1,9 @@
#include "importer.hpp"
#include <string>
#include <iostream>
#include <boost/program_options.hpp>
#include <boost/filesystem.hpp>
#include <boost/filesystem/path.hpp>
#include <boost/filesystem/fstream.hpp>
namespace bpo = boost::program_options;

@ -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<VFS::Manager> mVFS;
std::unique_ptr<VFS::Manager> mVFS;
Files::ConfigurationManager mCfgMgr;
CSMPrefs::State mSettingsState;

@ -5,6 +5,7 @@
#include <iostream>
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#include "../world/defaultgmsts.hpp"
@ -415,9 +416,9 @@ void CSMDoc::Document::runSearch (const CSMWorld::UniversalId& searchId, const C
emit stateChanged (getState(), this);
}
void CSMDoc::Document::runMerge (std::auto_ptr<CSMDoc::Document> target)
void CSMDoc::Document::runMerge (std::unique_ptr<CSMDoc::Document> target)
{
mTools.runMerge (target);
mTools.runMerge (std::move(target));
emit stateChanged (getState(), this);
}

@ -3,7 +3,6 @@
#include <string>
#include <boost/shared_ptr.hpp>
#include <boost/filesystem/path.hpp>
#include <QUndoStack>
@ -137,7 +136,7 @@ namespace CSMDoc
void runSearch (const CSMWorld::UniversalId& searchId, const CSMTools::Search& search);
void runMerge (std::auto_ptr<CSMDoc::Document> target);
void runMerge (std::unique_ptr<CSMDoc::Document> target);
void abortOperation (int type);

@ -1,8 +1,5 @@
#include "documentmanager.hpp"
#include <algorithm>
#include <stdexcept>
#include <boost/filesystem.hpp>
#ifndef Q_MOC_RUN

@ -1,20 +1,15 @@
#include "savingstages.hpp"
#include <fstream>
#include <boost/filesystem.hpp>
#include <QUndoStack>
#include <components/esm/loaddial.hpp>
#include <components/misc/stringops.hpp>
#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)

@ -1,5 +1,7 @@
#include "savingstate.hpp"
#include <boost/filesystem/fstream.hpp>
#include "operation.hpp"
#include "document.hpp"

@ -2,7 +2,7 @@
#include <sstream>
CSMFilter::AndNode::AndNode (const std::vector<boost::shared_ptr<Node> >& nodes)
CSMFilter::AndNode::AndNode (const std::vector<std::shared_ptr<Node> >& nodes)
: NAryNode (nodes, "and")
{}

@ -9,7 +9,7 @@ namespace CSMFilter
{
public:
AndNode (const std::vector<boost::shared_ptr<Node> >& nodes);
AndNode (const std::vector<std::shared_ptr<Node> >& nodes);
virtual bool test (const CSMWorld::IdTableBase& table, int row,
const std::map<int, int>& columns) const;

@ -2,7 +2,7 @@
#include <sstream>
CSMFilter::NAryNode::NAryNode (const std::vector<boost::shared_ptr<Node> >& nodes,
CSMFilter::NAryNode::NAryNode (const std::vector<std::shared_ptr<Node> >& nodes,
const std::string& name)
: mNodes (nodes), mName (name)
{}
@ -21,7 +21,7 @@ std::vector<int> CSMFilter::NAryNode::getReferencedColumns() const
{
std::vector<int> columns;
for (std::vector<boost::shared_ptr<Node> >::const_iterator iter (mNodes.begin());
for (std::vector<std::shared_ptr<Node> >::const_iterator iter (mNodes.begin());
iter!=mNodes.end(); ++iter)
{
std::vector<int> columns2 = (*iter)->getReferencedColumns();

@ -4,20 +4,18 @@
#include <vector>
#include <string>
#include <boost/shared_ptr.hpp>
#include "node.hpp"
namespace CSMFilter
{
class NAryNode : public Node
{
std::vector<boost::shared_ptr<Node> > mNodes;
std::vector<std::shared_ptr<Node> > mNodes;
std::string mName;
public:
NAryNode (const std::vector<boost::shared_ptr<Node> >& nodes, const std::string& name);
NAryNode (const std::vector<std::shared_ptr<Node> >& nodes, const std::string& name);
int getSize() const;

@ -3,10 +3,9 @@
#include <string>
#include <map>
#include <memory>
#include <vector>
#include <boost/shared_ptr.hpp>
#include <QMetaType>
namespace CSMWorld
@ -48,6 +47,6 @@ namespace CSMFilter
};
}
Q_DECLARE_METATYPE (boost::shared_ptr<CSMFilter::Node>)
Q_DECLARE_METATYPE (std::shared_ptr<CSMFilter::Node>)
#endif

@ -1,6 +1,6 @@
#include "notnode.hpp"
CSMFilter::NotNode::NotNode (boost::shared_ptr<Node> child) : UnaryNode (child, "not") {}
CSMFilter::NotNode::NotNode (std::shared_ptr<Node> child) : UnaryNode (child, "not") {}
bool CSMFilter::NotNode::test (const CSMWorld::IdTableBase& table, int row,
const std::map<int, int>& columns) const

@ -9,7 +9,7 @@ namespace CSMFilter
{
public:
NotNode (boost::shared_ptr<Node> child);
NotNode (std::shared_ptr<Node> child);
virtual bool test (const CSMWorld::IdTableBase& table, int row,
const std::map<int, int>& columns) const;

@ -2,7 +2,7 @@
#include <sstream>
CSMFilter::OrNode::OrNode (const std::vector<boost::shared_ptr<Node> >& nodes)
CSMFilter::OrNode::OrNode (const std::vector<std::shared_ptr<Node> >& nodes)
: NAryNode (nodes, "or")
{}

@ -9,7 +9,7 @@ namespace CSMFilter
{
public:
OrNode (const std::vector<boost::shared_ptr<Node> >& nodes);
OrNode (const std::vector<std::shared_ptr<Node> >& nodes);
virtual bool test (const CSMWorld::IdTableBase& table, int row,
const std::map<int, int>& columns) const;

@ -235,7 +235,7 @@ CSMFilter::Token CSMFilter::Parser::getNextToken()
return Token (Token::Type_None);
}
boost::shared_ptr<CSMFilter::Node> CSMFilter::Parser::parseImp (bool allowEmpty, bool ignoreOneShot)
std::shared_ptr<CSMFilter::Node> CSMFilter::Parser::parseImp (bool allowEmpty, bool ignoreOneShot)
{
if (Token token = getNextToken())
{
@ -247,11 +247,11 @@ boost::shared_ptr<CSMFilter::Node> CSMFilter::Parser::parseImp (bool allowEmpty,
{
case Token::Type_Keyword_True:
return boost::shared_ptr<CSMFilter::Node> (new BooleanNode (true));
return std::shared_ptr<CSMFilter::Node> (new BooleanNode (true));
case Token::Type_Keyword_False:
return boost::shared_ptr<CSMFilter::Node> (new BooleanNode (false));
return std::shared_ptr<CSMFilter::Node> (new BooleanNode (false));
case Token::Type_Keyword_And:
case Token::Type_Keyword_Or:
@ -260,12 +260,12 @@ boost::shared_ptr<CSMFilter::Node> CSMFilter::Parser::parseImp (bool allowEmpty,
case Token::Type_Keyword_Not:
{
boost::shared_ptr<CSMFilter::Node> node = parseImp();
std::shared_ptr<CSMFilter::Node> node = parseImp();
if (mError)
return boost::shared_ptr<Node>();
return std::shared_ptr<Node>();
return boost::shared_ptr<CSMFilter::Node> (new NotNode (node));
return std::shared_ptr<CSMFilter::Node> (new NotNode (node));
}
case Token::Type_Keyword_Text:
@ -281,7 +281,7 @@ boost::shared_ptr<CSMFilter::Node> CSMFilter::Parser::parseImp (bool allowEmpty,
if (!allowEmpty)
error();
return boost::shared_ptr<Node>();
return std::shared_ptr<Node>();
default:
@ -289,27 +289,27 @@ boost::shared_ptr<CSMFilter::Node> CSMFilter::Parser::parseImp (bool allowEmpty,
}
}
return boost::shared_ptr<Node>();
return std::shared_ptr<Node>();
}
boost::shared_ptr<CSMFilter::Node> CSMFilter::Parser::parseNAry (const Token& keyword)
std::shared_ptr<CSMFilter::Node> CSMFilter::Parser::parseNAry (const Token& keyword)
{
std::vector<boost::shared_ptr<Node> > nodes;
std::vector<std::shared_ptr<Node> > nodes;
Token token = getNextToken();
if (token.mType!=Token::Type_Open)
{
error();
return boost::shared_ptr<Node>();
return std::shared_ptr<Node>();
}
for (;;)
{
boost::shared_ptr<Node> node = parseImp();
std::shared_ptr<Node> node = parseImp();
if (mError)
return boost::shared_ptr<Node>();
return std::shared_ptr<Node>();
nodes.push_back (node);
@ -318,7 +318,7 @@ boost::shared_ptr<CSMFilter::Node> CSMFilter::Parser::parseNAry (const Token& ke
if (!token || (token.mType!=Token::Type_Close && token.mType!=Token::Type_Comma))
{
error();
return boost::shared_ptr<Node>();
return std::shared_ptr<Node>();
}
if (token.mType==Token::Type_Close)
@ -328,31 +328,31 @@ boost::shared_ptr<CSMFilter::Node> CSMFilter::Parser::parseNAry (const Token& ke
if (nodes.empty())
{
error();
return boost::shared_ptr<Node>();
return std::shared_ptr<Node>();
}
switch (keyword.mType)
{
case Token::Type_Keyword_And: return boost::shared_ptr<CSMFilter::Node> (new AndNode (nodes));
case Token::Type_Keyword_Or: return boost::shared_ptr<CSMFilter::Node> (new OrNode (nodes));
default: error(); return boost::shared_ptr<Node>();
case Token::Type_Keyword_And: return std::shared_ptr<CSMFilter::Node> (new AndNode (nodes));
case Token::Type_Keyword_Or: return std::shared_ptr<CSMFilter::Node> (new OrNode (nodes));
default: error(); return std::shared_ptr<Node>();
}
}
boost::shared_ptr<CSMFilter::Node> CSMFilter::Parser::parseText()
std::shared_ptr<CSMFilter::Node> CSMFilter::Parser::parseText()
{
Token token = getNextToken();
if (token.mType!=Token::Type_Open)
{
error();
return boost::shared_ptr<Node>();
return std::shared_ptr<Node>();
}
token = getNextToken();
if (!token)
return boost::shared_ptr<Node>();
return std::shared_ptr<Node>();
// parse column ID
int columnId = -1;
@ -370,7 +370,7 @@ boost::shared_ptr<CSMFilter::Node> CSMFilter::Parser::parseText()
if (columnId<0)
{
error();
return boost::shared_ptr<Node>();
return std::shared_ptr<Node>();
}
token = getNextToken();
@ -378,7 +378,7 @@ boost::shared_ptr<CSMFilter::Node> CSMFilter::Parser::parseText()
if (token.mType!=Token::Type_Comma)
{
error();
return boost::shared_ptr<Node>();
return std::shared_ptr<Node>();
}
// parse text pattern
@ -387,7 +387,7 @@ boost::shared_ptr<CSMFilter::Node> CSMFilter::Parser::parseText()
if (!token.isString())
{
error();
return boost::shared_ptr<Node>();
return std::shared_ptr<Node>();
}
std::string text = token.mString;
@ -397,26 +397,26 @@ boost::shared_ptr<CSMFilter::Node> CSMFilter::Parser::parseText()
if (token.mType!=Token::Type_Close)
{
error();
return boost::shared_ptr<Node>();
return std::shared_ptr<Node>();
}
return boost::shared_ptr<Node> (new TextNode (columnId, text));
return std::shared_ptr<Node> (new TextNode (columnId, text));
}
boost::shared_ptr<CSMFilter::Node> CSMFilter::Parser::parseValue()
std::shared_ptr<CSMFilter::Node> CSMFilter::Parser::parseValue()
{
Token token = getNextToken();
if (token.mType!=Token::Type_Open)
{
error();
return boost::shared_ptr<Node>();
return std::shared_ptr<Node>();
}
token = getNextToken();
if (!token)
return boost::shared_ptr<Node>();
return std::shared_ptr<Node>();
// parse column ID
int columnId = -1;
@ -434,7 +434,7 @@ boost::shared_ptr<CSMFilter::Node> CSMFilter::Parser::parseValue()
if (columnId<0)
{
error();
return boost::shared_ptr<Node>();
return std::shared_ptr<Node>();
}
token = getNextToken();
@ -442,7 +442,7 @@ boost::shared_ptr<CSMFilter::Node> CSMFilter::Parser::parseValue()
if (token.mType!=Token::Type_Comma)
{
error();
return boost::shared_ptr<Node>();
return std::shared_ptr<Node>();
}
// parse value
@ -467,7 +467,7 @@ boost::shared_ptr<CSMFilter::Node> CSMFilter::Parser::parseValue()
else if (token.mType!=Token::Type_CloseSquare && token.mType!=Token::Type_Open)
{
error();
return boost::shared_ptr<Node>();
return std::shared_ptr<Node>();
}
token = getNextToken();
@ -481,7 +481,7 @@ boost::shared_ptr<CSMFilter::Node> CSMFilter::Parser::parseValue()
if (token.mType!=Token::Type_Comma)
{
error();
return boost::shared_ptr<Node>();
return std::shared_ptr<Node>();
}
}
else if (token.mType==Token::Type_Comma)
@ -491,7 +491,7 @@ boost::shared_ptr<CSMFilter::Node> CSMFilter::Parser::parseValue()
else
{
error();
return boost::shared_ptr<Node>();
return std::shared_ptr<Node>();
}
token = getNextToken();
@ -513,7 +513,7 @@ boost::shared_ptr<CSMFilter::Node> CSMFilter::Parser::parseValue()
else if (token.mType!=Token::Type_OpenSquare && token.mType!=Token::Type_Close)
{
error();
return boost::shared_ptr<Node>();
return std::shared_ptr<Node>();
}
}
@ -522,10 +522,10 @@ boost::shared_ptr<CSMFilter::Node> CSMFilter::Parser::parseValue()
if (token.mType!=Token::Type_Close)
{
error();
return boost::shared_ptr<Node>();
return std::shared_ptr<Node>();
}
return boost::shared_ptr<Node> (new ValueNode (columnId, lowerType, upperType, lower, upper));
return std::shared_ptr<Node> (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> node = parseImp (true, token!=Token (Token::Type_OneShot));
std::shared_ptr<Node> 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::Node> CSMFilter::Parser::getFilter() const
std::shared_ptr<CSMFilter::Node> CSMFilter::Parser::getFilter() const
{
if (mError)
throw std::logic_error ("No filter available");

@ -1,8 +1,6 @@
#ifndef CSM_FILTER_PARSER_H
#define CSM_FILTER_PARSER_H
#include <boost/shared_ptr.hpp>
#include "node.hpp"
namespace CSMWorld
@ -16,7 +14,7 @@ namespace CSMFilter
class Parser
{
boost::shared_ptr<Node> mFilter;
std::shared_ptr<Node> 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<Node> parseImp (bool allowEmpty = false, bool ignoreOneShot = false);
std::shared_ptr<Node> parseImp (bool allowEmpty = false, bool ignoreOneShot = false);
///< Will return a null-pointer, if there is nothing more to parse.
boost::shared_ptr<Node> parseNAry (const Token& keyword);
std::shared_ptr<Node> parseNAry (const Token& keyword);
boost::shared_ptr<Node> parseText();
std::shared_ptr<Node> parseText();
boost::shared_ptr<Node> parseValue();
std::shared_ptr<Node> parseValue();
void error();
@ -51,7 +49,7 @@ namespace CSMFilter
///
/// \return Success?
boost::shared_ptr<Node> getFilter() const;
std::shared_ptr<Node> getFilter() const;
///< Throws an exception if the last call to parse did not return true.
};
}

@ -1,6 +1,6 @@
#include "unarynode.hpp"
CSMFilter::UnaryNode::UnaryNode (boost::shared_ptr<Node> child, const std::string& name)
CSMFilter::UnaryNode::UnaryNode (std::shared_ptr<Node> child, const std::string& name)
: mChild (child), mName (name)
{}

@ -1,20 +1,18 @@
#ifndef CSM_FILTER_UNARYNODE_H
#define CSM_FILTER_UNARYNODE_H
#include <boost/shared_ptr.hpp>
#include "node.hpp"
namespace CSMFilter
{
class UnaryNode : public Node
{
boost::shared_ptr<Node> mChild;
std::shared_ptr<Node> mChild;
std::string mName;
public:
UnaryNode (boost::shared_ptr<Node> child, const std::string& name);
UnaryNode (std::shared_ptr<Node> child, const std::string& name);
const Node& getChild() const;

@ -45,9 +45,9 @@ CSMTools::MergeOperation::MergeOperation (CSMDoc::Document& document, ToUTF8::Fr
appendStage (new FinishMergedDocumentStage (mState, encoding));
}
void CSMTools::MergeOperation::setTarget (std::auto_ptr<CSMDoc::Document> document)
void CSMTools::MergeOperation::setTarget (std::unique_ptr<CSMDoc::Document> document)
{
mState.mTarget = document;
mState.mTarget = std::move(document);
}
void CSMTools::MergeOperation::operationDone()

@ -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<CSMDoc::Document> document);
void setTarget (std::unique_ptr<CSMDoc::Document> document);
protected slots:

@ -12,7 +12,7 @@ namespace CSMTools
{
struct MergeState
{
std::auto_ptr<CSMDoc::Document> mTarget;
std::unique_ptr<CSMDoc::Document> mTarget;
CSMDoc::Document& mSource;
bool mCompleted;
std::map<std::pair<uint16_t, int>, int> mTextureIndices; // (texture, content file) -> new texture

@ -1,7 +1,5 @@
#include "referencecheck.hpp"
#include <boost/lexical_cast.hpp>
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<std::string>(cellRef.mChargeFloat);
str += std::to_string(cellRef.mChargeFloat);
else
str += boost::lexical_cast<std::string>(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<std::string>(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<std::string>(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<std::string>(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<std::string>(cellRef.mEnchantmentCharge);
str += std::to_string(cellRef.mEnchantmentCharge);
messages.push_back(std::make_pair(id, id.getId() + str));
}

@ -216,7 +216,7 @@ void CSMTools::Tools::runSearch (const CSMWorld::UniversalId& searchId, const Se
mSearch.start();
}
void CSMTools::Tools::runMerge (std::auto_ptr<CSMDoc::Document> target)
void CSMTools::Tools::runMerge (std::unique_ptr<CSMDoc::Document> target)
{
// not setting an active report, because merge does not produce messages
@ -230,7 +230,7 @@ void CSMTools::Tools::runMerge (std::auto_ptr<CSMDoc::Document> target)
target->flagAsDirty();
mMergeOperation->setTarget (target);
mMergeOperation->setTarget (std::move(target));
mMerge.start();
}

@ -77,7 +77,7 @@ namespace CSMTools
void runSearch (const CSMWorld::UniversalId& searchId, const Search& search);
void runMerge (std::auto_ptr<CSMDoc::Document> target);
void runMerge (std::unique_ptr<CSMDoc::Document> target);
void abortOperation (int type);
///< \attention The operation is not aborted immediately.

@ -5,8 +5,6 @@
#include <sstream>
#include <stdexcept>
#include <boost/lexical_cast.hpp>
#include <QColor>
#include <components/esm/loadbody.hpp>

@ -138,7 +138,7 @@ void CSMWorld::CommandDispatcher::executeModify (QAbstractItemModel *model, cons
if (mLocked)
return;
std::auto_ptr<CSMWorld::UpdateCellCommand> modifyCell;
std::unique_ptr<CSMWorld::UpdateCellCommand> modifyCell;
int columnId = model->data (index, ColumnBase::Role_ColumnId).toInt();
@ -167,7 +167,7 @@ void CSMWorld::CommandDispatcher::executeModify (QAbstractItemModel *model, cons
}
}
std::auto_ptr<CSMWorld::ModifyCommand> modifyData (
std::unique_ptr<CSMWorld::ModifyCommand> modifyData (
new CSMWorld::ModifyCommand (*model, index, new_));
if (modifyCell.get())

@ -554,12 +554,12 @@ CSMWorld::Data::~Data()
delete mReader;
}
boost::shared_ptr<Resource::ResourceSystem> CSMWorld::Data::getResourceSystem()
std::shared_ptr<Resource::ResourceSystem> CSMWorld::Data::getResourceSystem()
{
return mResourceSystem;
}
boost::shared_ptr<const Resource::ResourceSystem> CSMWorld::Data::getResourceSystem() const
std::shared_ptr<const Resource::ResourceSystem> 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<ESM::ESMReader> ptr(mReader);
std::shared_ptr<ESM::ESMReader> 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<ESM::ESMReader> ptr(mReader);
std::shared_ptr<ESM::ESMReader> ptr(mReader);
mReaders.push_back(ptr);
}
else

@ -119,9 +119,9 @@ namespace CSMWorld
std::map<std::string, std::map<ESM::RefNum, std::string> > mRefLoadCache;
int mReaderIndex;
boost::shared_ptr<Resource::ResourceSystem> mResourceSystem;
std::shared_ptr<Resource::ResourceSystem> mResourceSystem;
std::vector<boost::shared_ptr<ESM::ESMReader> > mReaders;
std::vector<std::shared_ptr<ESM::ESMReader> > mReaders;
std::map<std::string, int> mContentFileNames;
@ -148,9 +148,9 @@ namespace CSMWorld
const Fallback::Map* getFallbackMap() const;
boost::shared_ptr<Resource::ResourceSystem> getResourceSystem();
std::shared_ptr<Resource::ResourceSystem> getResourceSystem();
boost::shared_ptr<const Resource::ResourceSystem> getResourceSystem() const;
std::shared_ptr<const Resource::ResourceSystem> getResourceSystem() const;
const IdCollection<ESM::Global>& getGlobals() const;

@ -1,7 +1,5 @@
#include "idcompletionmanager.hpp"
#include <boost/make_shared.hpp>
#include <QCompleter>
#include "../../view/widget/completerpopup.hpp"
@ -77,7 +75,7 @@ bool CSMWorld::IdCompletionManager::hasCompleterFor(CSMWorld::ColumnBase::Displa
return mCompleters.find(display) != mCompleters.end();
}
boost::shared_ptr<QCompleter> CSMWorld::IdCompletionManager::getCompleter(CSMWorld::ColumnBase::Display display)
std::shared_ptr<QCompleter> CSMWorld::IdCompletionManager::getCompleter(CSMWorld::ColumnBase::Display display)
{
if (!hasCompleterFor(display))
{
@ -99,7 +97,7 @@ void CSMWorld::IdCompletionManager::generateCompleters(CSMWorld::Data &data)
int idColumn = table->searchColumnIndex(CSMWorld::Columns::ColumnId_Id);
if (idColumn != -1)
{
boost::shared_ptr<QCompleter> completer = boost::make_shared<QCompleter>(table);
std::shared_ptr<QCompleter> completer = std::make_shared<QCompleter>(table);
completer->setCompletionColumn(idColumn);
// The completion role must be Qt::DisplayRole to get the ID values from the model
completer->setCompletionRole(Qt::DisplayRole);

@ -3,8 +3,7 @@
#include <vector>
#include <map>
#include <boost/shared_ptr.hpp>
#include <memory>
#include "columnbase.hpp"
#include "universalid.hpp"
@ -20,7 +19,7 @@ namespace CSMWorld
{
static const std::map<ColumnBase::Display, UniversalId::Type> sCompleterModelTypes;
std::map<ColumnBase::Display, boost::shared_ptr<QCompleter> > mCompleters;
std::map<ColumnBase::Display, std::shared_ptr<QCompleter> > 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<QCompleter> getCompleter(ColumnBase::Display display);
std::shared_ptr<QCompleter> getCompleter(ColumnBase::Display display);
};
}

@ -82,7 +82,7 @@ void CSMWorld::IdTableProxyModel::setSourceModel(QAbstractItemModel *model)
SLOT(sourceDataChanged(const QModelIndex &, const QModelIndex &)));
}
void CSMWorld::IdTableProxyModel::setFilter (const boost::shared_ptr<CSMFilter::Node>& filter)
void CSMWorld::IdTableProxyModel::setFilter (const std::shared_ptr<CSMFilter::Node>& filter)
{
beginResetModel();
mFilter = filter;

@ -3,8 +3,6 @@
#include <string>
#include <boost/shared_ptr.hpp>
#include <map>
#include <QSortFilterProxyModel>
@ -19,7 +17,7 @@ namespace CSMWorld
{
Q_OBJECT
boost::shared_ptr<CSMFilter::Node> mFilter;
std::shared_ptr<CSMFilter::Node> mFilter;
std::map<int, int> 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<CSMFilter::Node>& filter);
void setFilter (const std::shared_ptr<CSMFilter::Node>& filter);
void refreshFilter();

@ -808,7 +808,7 @@ void CSMWorld::RefIdCollection::cloneRecord(const std::string& origin,
const std::string& destination,
const CSMWorld::UniversalId::Type type)
{
std::auto_ptr<RecordBase> newRecord(mData.getRecord(mData.searchId(origin)).modifiedCopy());
std::unique_ptr<RecordBase> newRecord(mData.getRecord(mData.searchId(origin)).modifiedCopy());
mAdapters.find(type)->second->setId(*newRecord, destination);
mData.insertRecord(*newRecord, type, destination);
}

@ -389,7 +389,7 @@ void CSMWorld::RefIdData::copyTo (int index, RefIdData& target) const
std::string id = source->getId (localIndex.first);
std::auto_ptr<CSMWorld::RecordBase> newRecord (source->getRecord (localIndex.first).modifiedCopy());
std::unique_ptr<CSMWorld::RecordBase> newRecord (source->getRecord (localIndex.first).modifiedCopy());
target.insertRecord (*newRecord, localIndex.second, id);
}

@ -1,8 +1,5 @@
#include "adjusterwidget.hpp"
#include <stdexcept>
#include <string>
#include <boost/filesystem.hpp>
#include <boost/algorithm/string/case_conv.hpp>

@ -1,8 +1,6 @@
#ifndef CSV_FILTER_EDITWIDGET_H
#define CSV_FILTER_EDITWIDGET_H
#include <boost/shared_ptr.hpp>
#include <QLineEdit>
#include <QPalette>
#include <QtCore/qnamespace.h>
@ -38,7 +36,7 @@ namespace CSVFilter
signals:
void filterChanged (boost::shared_ptr<CSMFilter::Node> filter);
void filterChanged (std::shared_ptr<CSMFilter::Node> filter);
private:
std::string generateFilter(std::pair<std::string, std::vector<std::string> >& seekedString) const;

@ -21,8 +21,8 @@ CSVFilter::FilterBox::FilterBox (CSMWorld::Data& data, QWidget *parent)
setLayout (layout);
connect (mRecordFilterBox,
SIGNAL (filterChanged (boost::shared_ptr<CSMFilter::Node>)),
this, SIGNAL (recordFilterChanged (boost::shared_ptr<CSMFilter::Node>)));
SIGNAL (filterChanged (std::shared_ptr<CSMFilter::Node>)),
this, SIGNAL (recordFilterChanged (std::shared_ptr<CSMFilter::Node>)));
setAcceptDrops(true);
}

@ -41,7 +41,7 @@ namespace CSVFilter
void dragMoveEvent(QDragMoveEvent *event);
signals:
void recordFilterChanged (boost::shared_ptr<CSMFilter::Node> filter);
void recordFilterChanged (std::shared_ptr<CSMFilter::Node> filter);
void recordDropped (std::vector<CSMWorld::UniversalId>& types, Qt::DropAction action);
};

@ -23,8 +23,8 @@ CSVFilter::RecordFilterBox::RecordFilterBox (CSMWorld::Data& data, QWidget *pare
setLayout (layout);
connect (
mEdit, SIGNAL (filterChanged (boost::shared_ptr<CSMFilter::Node>)),
this, SIGNAL (filterChanged (boost::shared_ptr<CSMFilter::Node>)));
mEdit, SIGNAL (filterChanged (std::shared_ptr<CSMFilter::Node>)),
this, SIGNAL (filterChanged (std::shared_ptr<CSMFilter::Node>)));
}
void CSVFilter::RecordFilterBox::setFilter (const std::string& filter)

@ -1,8 +1,6 @@
#ifndef CSV_FILTER_RECORDFILTERBOX_H
#define CSV_FILTER_RECORDFILTERBOX_H
#include <boost/shared_ptr.hpp>
#include <QWidget>
#include <QtCore/qnamespace.h>
@ -38,7 +36,7 @@ namespace CSVFilter
signals:
void filterChanged (boost::shared_ptr<CSMFilter::Node> filter);
void filterChanged (std::shared_ptr<CSMFilter::Node> filter);
};
}

@ -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> object (new Object (mData, mCellNode, id, false));
std::unique_ptr<Object> object (new Object (mData, mCellNode, id, false));
if (mSubModeElementMask & Mask_Reference)
object->setSubMode (mSubMode);

@ -47,13 +47,13 @@ namespace CSVRender
std::string mId;
osg::ref_ptr<osg::Group> mCellNode;
std::map<std::string, Object *> mObjects;
std::auto_ptr<Terrain::TerrainGrid> mTerrain;
std::unique_ptr<Terrain::TerrainGrid> mTerrain;
CSMWorld::CellCoordinates mCoordinates;
std::auto_ptr<CellArrow> mCellArrows[4];
std::auto_ptr<CellMarker> mCellMarker;
std::auto_ptr<CellBorder> mCellBorder;
std::auto_ptr<CellWater> mCellWater;
std::auto_ptr<Pathgrid> mPathgrid;
std::unique_ptr<CellArrow> mCellArrows[4];
std::unique_ptr<CellMarker> mCellMarker;
std::unique_ptr<CellBorder> mCellBorder;
std::unique_ptr<CellWater> mCellWater;
std::unique_ptr<Pathgrid> mPathgrid;
bool mDeleted;
int mSubMode;
unsigned int mSubModeElementMask;

@ -1,15 +1,10 @@
#include "cellmarker.hpp"
#include <boost/lexical_cast.hpp>
#include <osg/AutoTransform>
#include <osg/Material>
#include <osg/Geode>
#include <osg/Group>
#include <osgText/Text>
#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<std::string>(mCoordinates.getX()) + "," +
boost::lexical_cast<std::string>(mCoordinates.getY());
std::to_string(mCoordinates.getX()) + "," +
std::to_string(mCoordinates.getY());
markerText->setText(coordinatesText);
// Add text to marker node.

@ -559,7 +559,7 @@ void CSVRender::InstanceMode::dropEvent (QDropEvent* event)
if (mode=="Create cell and insert")
{
std::auto_ptr<CSMWorld::CreateCommand> createCommand (
std::unique_ptr<CSMWorld::CreateCommand> 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<CSMWorld::CreateCommand> createCommand (
std::unique_ptr<CSMWorld::CreateCommand> createCommand (
new CSMWorld::CreateCommand (
referencesTable, document.getData().getReferences().getNewId()));

@ -3,8 +3,6 @@
#include <string>
#include <boost/shared_ptr.hpp>
#include <osg/ref_ptr>
#include <osg/Referenced>

@ -54,7 +54,7 @@ bool CSVRender::PagedWorldspaceWidget::adjustCells()
{
modified = true;
std::auto_ptr<Cell> cell (new Cell (mDocument.getData(), mRootNode,
std::unique_ptr<Cell> 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> cell (
std::unique_ptr<Cell> cell (
new Cell (mDocument.getData(), mRootNode, coordinates.getId (mWorldspace),
deleted));
EditMode *editMode = getEditMode();

@ -172,7 +172,7 @@ void CompositeViewer::update()
// ---------------------------------------------------
SceneWidget::SceneWidget(boost::shared_ptr<Resource::ResourceSystem> resourceSystem, QWidget *parent, Qt::WindowFlags f,
SceneWidget::SceneWidget(std::shared_ptr<Resource::ResourceSystem> resourceSystem, QWidget *parent, Qt::WindowFlags f,
bool retrieveInput)
: RenderWidget(parent, f)
, mResourceSystem(resourceSystem)

@ -10,8 +10,6 @@
#include <osgViewer/View>
#include <osgViewer/CompositeViewer>
#include <boost/shared_ptr.hpp>
#include "lightingday.hpp"
#include "lightingnight.hpp"
#include "lightingbright.hpp"
@ -78,7 +76,7 @@ namespace CSVRender
{
Q_OBJECT
public:
SceneWidget(boost::shared_ptr<Resource::ResourceSystem> resourceSystem, QWidget* parent = 0,
SceneWidget(std::shared_ptr<Resource::ResourceSystem> 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<Resource::ResourceSystem> mResourceSystem;
std::shared_ptr<Resource::ResourceSystem> mResourceSystem;
Lighting* mLighting;

@ -29,7 +29,7 @@ namespace CSVRender
std::string mCellId;
CSMWorld::IdTable *mCellsModel;
CSMWorld::IdTable *mReferenceablesModel;
std::auto_ptr<Cell> mCell;
std::unique_ptr<Cell> mCell;
void update();

@ -1,8 +1,6 @@
#ifndef OPENCS_VIEW_WORLDSPACEWIDGET_H
#define OPENCS_VIEW_WORLDSPACEWIDGET_H
#include <boost/shared_ptr.hpp>
#include <QTimer>
#include <osg/Vec3>

@ -127,10 +127,10 @@ void CSVTools::Merge::accept()
{
std::vector< boost::filesystem::path > files (1, mAdjuster->getPath());
std::auto_ptr<CSMDoc::Document> target (
std::unique_ptr<CSMDoc::Document> target (
mDocumentManager.makeDocument (files, files[0], true));
mDocument->runMerge (target);
mDocument->runMerge (std::move(target));
hide();
}

@ -91,7 +91,7 @@ namespace CSVWorld
Creator *CreatorFactory<CreatorT, scope>::makeCreator (CSMDoc::Document& document,
const CSMWorld::UniversalId& id) const
{
std::auto_ptr<CreatorT> creator (new CreatorT (document.getData(), document.getUndoStack(), id));
std::unique_ptr<CreatorT> creator (new CreatorT (document.getData(), document.getUndoStack(), id));
creator->setScope (scope);

@ -120,7 +120,7 @@ mIndex(index)
CSVWorld::DialogueDelegateDispatcherProxy::DialogueDelegateDispatcherProxy(QWidget* editor, CSMWorld::ColumnBase::Display display) :
mEditor(editor),
mDisplay(display),
mIndexWrapper(NULL)
mIndexWrapper(nullptr)
{
}

@ -84,7 +84,7 @@ namespace CSVWorld
CSMWorld::ColumnBase::Display mDisplay;
std::auto_ptr<refWrapper> mIndexWrapper;
std::unique_ptr<refWrapper> mIndexWrapper;
public:
DialogueDelegateDispatcherProxy(QWidget* editor,

@ -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<CSMWorld::CreateCommand> command,
void CSVWorld::GenericCreator::pushCommand (std::unique_ptr<CSMWorld::CreateCommand> command,
const std::string& id)
{
mUndoStack.push (command.release());
@ -224,7 +224,7 @@ void CSVWorld::GenericCreator::create()
{
std::string id = getId();
std::auto_ptr<CSMWorld::CreateCommand> command;
std::unique_ptr<CSMWorld::CreateCommand> 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);

@ -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<CSMWorld::CreateCommand> command,
virtual void pushCommand (std::unique_ptr<CSMWorld::CreateCommand> command,
const std::string& id);
CSMWorld::Data& getData() const;

@ -692,7 +692,7 @@ void CSVWorld::Table::requestFocus (const std::string& id)
scrollTo (index, QAbstractItemView::PositionAtTop);
}
void CSVWorld::Table::recordFilterChanged (boost::shared_ptr<CSMFilter::Node> filter)
void CSVWorld::Table::recordFilterChanged (std::shared_ptr<CSMFilter::Node> filter)
{
mProxyModel->setFilter (filter);
tableSizeUpdate();

@ -151,7 +151,7 @@ namespace CSVWorld
void requestFocus (const std::string& id);
void recordFilterChanged (boost::shared_ptr<CSMFilter::Node> filter);
void recordFilterChanged (std::shared_ptr<CSMFilter::Node> filter);
void rowAdded(const std::string &id);
};

@ -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<CSMFilter::Node>)),
mTable, SLOT (recordFilterChanged (boost::shared_ptr<CSMFilter::Node>)));
SIGNAL (recordFilterChanged (std::shared_ptr<CSMFilter::Node>)),
mTable, SLOT (recordFilterChanged (std::shared_ptr<CSMFilter::Node>)));
connect(mFilterBox, SIGNAL(recordDropped(std::vector<CSMWorld::UniversalId>&, Qt::DropAction)),
this, SLOT(createFilterRequest(std::vector<CSMWorld::UniversalId>&, Qt::DropAction)));

@ -1,6 +1,5 @@
#include "engine.hpp"
#include <stdexcept>
#include <iomanip>
#include <boost/filesystem/fstream.hpp>
@ -28,7 +27,6 @@
#include <components/sceneutil/workqueue.hpp>
#include <components/files/configurationmanager.hpp>
#include <components/translation/translation.hpp>
#include <components/version/version.hpp>
#include <components/openmw-mp/Log.hpp>

@ -71,8 +71,8 @@ namespace OMW
class Engine
{
SDL_Window* mWindow;
std::auto_ptr<VFS::Manager> mVFS;
std::auto_ptr<Resource::ResourceSystem> mResourceSystem;
std::unique_ptr<VFS::Manager> mVFS;
std::unique_ptr<Resource::ResourceSystem> mResourceSystem;
osg::ref_ptr<SceneUtil::WorkQueue> mWorkQueue;
MWBase::Environment mEnvironment;
ToUTF8::FromType mEncoding;

@ -1,5 +1,4 @@
#include <iostream>
#include <cstdio>
#include <components/version/version.hpp>
#include <components/files/configurationmanager.hpp>
@ -7,11 +6,8 @@
#include <components/fallback/validate.hpp>
#include <SDL_messagebox.h>
#include <SDL_main.h>
#include "engine.hpp"
#include <boost/iostreams/concepts.hpp>
#include <boost/iostreams/stream_buffer.hpp>
#include <boost/filesystem/fstream.hpp>
#include "mwmp/Main.hpp"
@ -38,8 +34,8 @@ extern int cc_install_handlers(int argc, char **argv, int num_signals, int *sigs
extern int is_debugger_attached(void);
#endif
#include <boost/version.hpp>
#include <components/openmw-mp/Log.hpp>
/**
* Workaround for problems with whitespaces in paths in older versions of Boost library
*/
@ -316,7 +312,7 @@ int main(int argc, char**argv)
boost::filesystem::ofstream logfile;
std::auto_ptr<OMW::Engine> engine;
std::unique_ptr<OMW::Engine> engine;
int ret = 0;
try

@ -1,9 +1,9 @@
#ifndef GAME_MWBASE_SOUNDMANAGER_H
#define GAME_MWBASE_SOUNDMANAGER_H
#include <memory>
#include <string>
#include <set>
#include <boost/shared_ptr.hpp>
#include "../mwworld/ptr.hpp"
@ -17,13 +17,13 @@ namespace MWSound
class Sound;
class Stream;
struct Sound_Decoder;
typedef boost::shared_ptr<Sound_Decoder> DecoderPtr;
typedef std::shared_ptr<Sound_Decoder> DecoderPtr;
}
namespace MWBase
{
typedef boost::shared_ptr<MWSound::Sound> SoundPtr;
typedef boost::shared_ptr<MWSound::Stream> SoundStreamPtr;
typedef std::shared_ptr<MWSound::Sound> SoundPtr;
typedef std::shared_ptr<MWSound::Stream> SoundStreamPtr;
/// \brief Interface for sound manager (implemented in MWSound)
class SoundManager

@ -388,6 +388,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;

@ -73,7 +73,7 @@ namespace MWClass
void Activator::registerSelf()
{
boost::shared_ptr<Class> instance (new Activator);
std::shared_ptr<Class> instance (new Activator);
registerClass (typeid (ESM::Activator).name(), instance);
}
@ -107,19 +107,19 @@ namespace MWClass
return info;
}
boost::shared_ptr<MWWorld::Action> Activator::activate(const MWWorld::Ptr &ptr, const MWWorld::Ptr &actor) const
std::shared_ptr<MWWorld::Action> 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<ESM::Sound>().searchRandom("WolfActivator");
boost::shared_ptr<MWWorld::Action> action(new MWWorld::FailedAction("#{sWerewolfRefusal}"));
std::shared_ptr<MWWorld::Action> action(new MWWorld::FailedAction("#{sWerewolfRefusal}"));
if(sound) action->setSound(sound->mId);
return action;
}
return boost::shared_ptr<MWWorld::Action>(new MWWorld::NullAction);
return std::shared_ptr<MWWorld::Action>(new MWWorld::NullAction);
}

@ -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<MWWorld::Action> activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const;
virtual std::shared_ptr<MWWorld::Action> activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const;
///< Generate action for activation
static void registerSelf();

@ -51,7 +51,7 @@ namespace MWClass
return ref->mBase->mName;
}
boost::shared_ptr<MWWorld::Action> Apparatus::activate (const MWWorld::Ptr& ptr,
std::shared_ptr<MWWorld::Action> 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<Class> instance (new Apparatus);
std::shared_ptr<Class> instance (new Apparatus);
registerClass (typeid (ESM::Apparatus).name(), instance);
}
@ -125,9 +125,9 @@ namespace MWClass
}
boost::shared_ptr<MWWorld::Action> Apparatus::use (const MWWorld::Ptr& ptr) const
std::shared_ptr<MWWorld::Action> Apparatus::use (const MWWorld::Ptr& ptr) const
{
return boost::shared_ptr<MWWorld::Action>(new MWWorld::ActionAlchemy());
return std::shared_ptr<MWWorld::Action>(new MWWorld::ActionAlchemy());
}
MWWorld::Ptr Apparatus::copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const

@ -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<MWWorld::Action> activate (const MWWorld::Ptr& ptr,
virtual std::shared_ptr<MWWorld::Action> 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<MWWorld::Action> use (const MWWorld::Ptr& ptr)
virtual std::shared_ptr<MWWorld::Action> use (const MWWorld::Ptr& ptr)
const;
///< Generate action for using via inventory menu

@ -57,7 +57,7 @@ namespace MWClass
return ref->mBase->mName;
}
boost::shared_ptr<MWWorld::Action> Armor::activate (const MWWorld::Ptr& ptr,
std::shared_ptr<MWWorld::Action> 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<Class> instance (new Armor);
std::shared_ptr<Class> instance (new Armor);
registerClass (typeid (ESM::Armor).name(), instance);
}
@ -354,9 +354,9 @@ namespace MWClass
return std::make_pair(1,"");
}
boost::shared_ptr<MWWorld::Action> Armor::use (const MWWorld::Ptr& ptr) const
std::shared_ptr<MWWorld::Action> Armor::use (const MWWorld::Ptr& ptr) const
{
boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionEquip(ptr));
std::shared_ptr<MWWorld::Action> action(new MWWorld::ActionEquip(ptr));
action->setSound(getUpSoundId(ptr));

@ -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<MWWorld::Action> activate (const MWWorld::Ptr& ptr,
virtual std::shared_ptr<MWWorld::Action> 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<MWWorld::Action> use (const MWWorld::Ptr& ptr)
virtual std::shared_ptr<MWWorld::Action> use (const MWWorld::Ptr& ptr)
const;
///< Generate action for using via inventory menu

@ -33,7 +33,7 @@ namespace MWClass
void BodyPart::registerSelf()
{
boost::shared_ptr<MWWorld::Class> instance (new BodyPart);
std::shared_ptr<MWWorld::Class> instance (new BodyPart);
registerClass (typeid (ESM::BodyPart).name(), instance);
}

@ -54,7 +54,7 @@ namespace MWClass
return ref->mBase->mName;
}
boost::shared_ptr<MWWorld::Action> Book::activate (const MWWorld::Ptr& ptr,
std::shared_ptr<MWWorld::Action> 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<ESM::Sound>().searchRandom("WolfItem");
boost::shared_ptr<MWWorld::Action> action(new MWWorld::FailedAction("#{sWerewolfRefusal}"));
std::shared_ptr<MWWorld::Action> action(new MWWorld::FailedAction("#{sWerewolfRefusal}"));
if(sound) action->setSound(sound->mId);
return action;
}
return boost::shared_ptr<MWWorld::Action>(new MWWorld::ActionRead(ptr));
return std::shared_ptr<MWWorld::Action>(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<Class> instance (new Book);
std::shared_ptr<Class> instance (new Book);
registerClass (typeid (ESM::Book).name(), instance);
}
@ -162,9 +162,9 @@ namespace MWClass
return record->mId;
}
boost::shared_ptr<MWWorld::Action> Book::use (const MWWorld::Ptr& ptr) const
std::shared_ptr<MWWorld::Action> Book::use (const MWWorld::Ptr& ptr) const
{
return boost::shared_ptr<MWWorld::Action>(new MWWorld::ActionRead(ptr));
return std::shared_ptr<MWWorld::Action>(new MWWorld::ActionRead(ptr));
}
MWWorld::Ptr Book::copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const

@ -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<MWWorld::Action> activate (const MWWorld::Ptr& ptr,
virtual std::shared_ptr<MWWorld::Action> 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<MWWorld::Action> use (const MWWorld::Ptr& ptr) const;
virtual std::shared_ptr<MWWorld::Action> use (const MWWorld::Ptr& ptr) const;
///< Generate action for using via inventory menu
virtual std::string getModel(const MWWorld::ConstPtr &ptr) const;

@ -53,7 +53,7 @@ namespace MWClass
return ref->mBase->mName;
}
boost::shared_ptr<MWWorld::Action> Clothing::activate (const MWWorld::Ptr& ptr,
std::shared_ptr<MWWorld::Action> 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<Class> instance (new Clothing);
std::shared_ptr<Class> instance (new Clothing);
registerClass (typeid (ESM::Clothing).name(), instance);
}
@ -243,9 +243,9 @@ namespace MWClass
return std::make_pair (1, "");
}
boost::shared_ptr<MWWorld::Action> Clothing::use (const MWWorld::Ptr& ptr) const
std::shared_ptr<MWWorld::Action> Clothing::use (const MWWorld::Ptr& ptr) const
{
boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionEquip(ptr));
std::shared_ptr<MWWorld::Action> action(new MWWorld::ActionEquip(ptr));
action->setSound(getUpSoundId(ptr));

@ -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<MWWorld::Action> activate (const MWWorld::Ptr& ptr,
virtual std::shared_ptr<MWWorld::Action> 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<MWWorld::Action> use (const MWWorld::Ptr& ptr)
virtual std::shared_ptr<MWWorld::Action> use (const MWWorld::Ptr& ptr)
const;
///< Generate action for using via inventory menu

@ -64,7 +64,7 @@ namespace MWClass
{
if (!ptr.getRefData().getCustomData())
{
std::auto_ptr<ContainerCustomData> data (new ContainerCustomData);
std::unique_ptr<ContainerCustomData> data (new ContainerCustomData);
MWWorld::LiveCellRef<ESM::Container> *ref =
ptr.get<ESM::Container>();
@ -130,18 +130,18 @@ namespace MWClass
return true;
}
boost::shared_ptr<MWWorld::Action> Container::activate (const MWWorld::Ptr& ptr,
std::shared_ptr<MWWorld::Action> Container::activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor) const
{
if (!MWBase::Environment::get().getWindowManager()->isAllowed(MWGui::GW_Inventory))
return boost::shared_ptr<MWWorld::Action> (new MWWorld::NullAction ());
return std::shared_ptr<MWWorld::Action> (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<ESM::Sound>().searchRandom("WolfContainer");
boost::shared_ptr<MWWorld::Action> action(new MWWorld::FailedAction("#{sWerewolfRefusal}"));
std::shared_ptr<MWWorld::Action> action(new MWWorld::FailedAction("#{sWerewolfRefusal}"));
if(sound) action->setSound(sound->mId);
return action;
@ -222,20 +222,20 @@ namespace MWClass
{
if(!isTrapped)
{
boost::shared_ptr<MWWorld::Action> action (new MWWorld::ActionOpen(ptr));
std::shared_ptr<MWWorld::Action> action (new MWWorld::ActionOpen(ptr));
return action;
}
else
{
// Activate trap
boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionTrap(ptr.getCellRef().getTrap(), ptr));
std::shared_ptr<MWWorld::Action> action(new MWWorld::ActionTrap(ptr.getCellRef().getTrap(), ptr));
action->setSound(trapActivationSound);
return action;
}
}
else
{
boost::shared_ptr<MWWorld::Action> action(new MWWorld::FailedAction(std::string(), ptr));
std::shared_ptr<MWWorld::Action> action(new MWWorld::FailedAction(std::string(), ptr));
action->setSound(lockedSound);
return action;
}
@ -265,7 +265,7 @@ namespace MWClass
void Container::registerSelf()
{
boost::shared_ptr<Class> instance (new Container);
std::shared_ptr<Class> instance (new Container);
registerClass (typeid (ESM::Container).name(), instance);
}
@ -349,7 +349,7 @@ namespace MWClass
if (!ptr.getRefData().getCustomData())
{
// Create a CustomData, but don't fill it from ESM records (not needed)
std::auto_ptr<ContainerCustomData> data (new ContainerCustomData);
std::unique_ptr<ContainerCustomData> data (new ContainerCustomData);
ptr.getRefData().setCustomData (data.release());
}

@ -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<MWWorld::Action> activate (const MWWorld::Ptr& ptr,
virtual std::shared_ptr<MWWorld::Action> activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor) const;
///< Generate action for activation

@ -123,7 +123,7 @@ namespace MWClass
{
if (!ptr.getRefData().getCustomData())
{
std::auto_ptr<CreatureCustomData> data (new CreatureCustomData);
std::unique_ptr<CreatureCustomData> data (new CreatureCustomData);
MWWorld::LiveCellRef<ESM::Creature> *ref = ptr.get<ESM::Creature>();
@ -544,7 +544,7 @@ namespace MWClass
*/
}
boost::shared_ptr<MWWorld::Action> Creature::activate (const MWWorld::Ptr& ptr,
std::shared_ptr<MWWorld::Action> Creature::activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor) const
{
if(actor.getClass().isNpc() && actor.getClass().getNpcStats(actor).isWerewolf())
@ -552,17 +552,17 @@ namespace MWClass
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
const ESM::Sound *sound = store.get<ESM::Sound>().searchRandom("WolfCreature");
boost::shared_ptr<MWWorld::Action> action(new MWWorld::FailedAction("#{sWerewolfRefusal}"));
std::shared_ptr<MWWorld::Action> action(new MWWorld::FailedAction("#{sWerewolfRefusal}"));
if(sound) action->setSound(sound->mId);
return action;
}
if(getCreatureStats(ptr).isDead())
return boost::shared_ptr<MWWorld::Action>(new MWWorld::ActionOpen(ptr, true));
return std::shared_ptr<MWWorld::Action>(new MWWorld::ActionOpen(ptr, true));
if(ptr.getClass().getCreatureStats(ptr).getAiSequence().isInCombat())
return boost::shared_ptr<MWWorld::Action>(new MWWorld::FailedAction(""));
return boost::shared_ptr<MWWorld::Action>(new MWWorld::ActionTalk(ptr));
return std::shared_ptr<MWWorld::Action>(new MWWorld::FailedAction(""));
return std::shared_ptr<MWWorld::Action>(new MWWorld::ActionTalk(ptr));
}
MWWorld::ContainerStore& Creature::getContainerStore (const MWWorld::Ptr& ptr) const
@ -599,7 +599,7 @@ namespace MWClass
void Creature::registerSelf()
{
boost::shared_ptr<Class> instance (new Creature);
std::shared_ptr<Class> instance (new Creature);
registerClass (typeid (ESM::Creature).name(), instance);
}
@ -852,7 +852,7 @@ namespace MWClass
if (!ptr.getRefData().getCustomData())
{
// Create a CustomData, but don't fill it from ESM records (not needed)
std::auto_ptr<CreatureCustomData> data (new CreatureCustomData);
std::unique_ptr<CreatureCustomData> data (new CreatureCustomData);
if (hasInventoryStore(ptr))
data->mContainerStore = new MWWorld::InventoryStore();

@ -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<MWWorld::Action> activate (const MWWorld::Ptr& ptr,
virtual std::shared_ptr<MWWorld::Action> activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor) const;
///< Generate action for activation

@ -70,7 +70,7 @@ namespace MWClass
void CreatureLevList::registerSelf()
{
boost::shared_ptr<Class> instance (new CreatureLevList);
std::shared_ptr<Class> instance (new CreatureLevList);
registerClass (typeid (ESM::CreatureLevList).name(), instance);
}
@ -141,7 +141,7 @@ namespace MWClass
{
if (!ptr.getRefData().getCustomData())
{
std::auto_ptr<CreatureLevListCustomData> data (new CreatureLevListCustomData);
std::unique_ptr<CreatureLevListCustomData> data (new CreatureLevListCustomData);
data->mSpawnActorId = -1;
data->mSpawn = true;

@ -111,7 +111,7 @@ namespace MWClass
return ref->mBase->mName;
}
boost::shared_ptr<MWWorld::Action> Door::activate (const MWWorld::Ptr& ptr,
std::shared_ptr<MWWorld::Action> Door::activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor) const
{
MWWorld::LiveCellRef<ESM::Door> *ref = ptr.get<ESM::Door>();
@ -144,15 +144,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;
}
}
}
@ -207,7 +211,7 @@ namespace MWClass
if(isTrapped)
{
// Trap activation
boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionTrap(ptr.getCellRef().getTrap(), ptr));
std::shared_ptr<MWWorld::Action> action(new MWWorld::ActionTrap(ptr.getCellRef().getTrap(), ptr));
action->setSound(trapActivationSound);
return action;
}
@ -217,12 +221,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<MWWorld::Action> action(new MWWorld::FailedAction);
std::shared_ptr<MWWorld::Action> action(new MWWorld::FailedAction);
return action;
}
else
{
boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionTeleport (ptr.getCellRef().getDestCell(), ptr.getCellRef().getDoorDest(), true));
std::shared_ptr<MWWorld::Action> action(new MWWorld::ActionTeleport (ptr.getCellRef().getDestCell(), ptr.getCellRef().getDoorDest(), true));
action->setSound(openSound);
return action;
}
@ -230,7 +234,7 @@ namespace MWClass
else
{
// animated door
boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionDoor(ptr));
std::shared_ptr<MWWorld::Action> action(new MWWorld::ActionDoor(ptr));
int doorstate = getDoorState(ptr);
bool opening = true;
float doorRot = ptr.getRefData().getPosition().rot[2] - ptr.getCellRef().getPosition().rot[2];
@ -264,7 +268,7 @@ namespace MWClass
else
{
// locked, and we can't open.
boost::shared_ptr<MWWorld::Action> action(new MWWorld::FailedAction(std::string(), ptr));
std::shared_ptr<MWWorld::Action> action(new MWWorld::FailedAction(std::string(), ptr));
action->setSound(lockedSound);
return action;
}
@ -305,7 +309,7 @@ namespace MWClass
void Door::registerSelf()
{
boost::shared_ptr<Class> instance (new Door);
std::shared_ptr<Class> instance (new Door);
registerClass (typeid (ESM::Door).name(), instance);
}
@ -391,7 +395,7 @@ namespace MWClass
{
if (!ptr.getRefData().getCustomData())
{
std::auto_ptr<DoorCustomData> data(new DoorCustomData);
std::unique_ptr<DoorCustomData> data(new DoorCustomData);
data->mDoorState = 0;
ptr.getRefData().setCustomData(data.release());

@ -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<MWWorld::Action> activate (const MWWorld::Ptr& ptr,
virtual std::shared_ptr<MWWorld::Action> activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor) const;
///< Generate action for activation

@ -54,7 +54,7 @@ namespace MWClass
return ref->mBase->mName;
}
boost::shared_ptr<MWWorld::Action> Ingredient::activate (const MWWorld::Ptr& ptr,
std::shared_ptr<MWWorld::Action> Ingredient::activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor) const
{
return defaultItemActivate(ptr, actor);
@ -75,9 +75,9 @@ namespace MWClass
}
boost::shared_ptr<MWWorld::Action> Ingredient::use (const MWWorld::Ptr& ptr) const
std::shared_ptr<MWWorld::Action> Ingredient::use (const MWWorld::Ptr& ptr) const
{
boost::shared_ptr<MWWorld::Action> action (new MWWorld::ActionEat (ptr));
std::shared_ptr<MWWorld::Action> action (new MWWorld::ActionEat (ptr));
action->setSound ("Swallow");
@ -86,7 +86,7 @@ namespace MWClass
void Ingredient::registerSelf()
{
boost::shared_ptr<Class> instance (new Ingredient);
std::shared_ptr<Class> instance (new Ingredient);
registerClass (typeid (ESM::Ingredient).name(), instance);
}

@ -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<MWWorld::Action> activate (const MWWorld::Ptr& ptr,
virtual std::shared_ptr<MWWorld::Action> 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<MWWorld::Action> use (const MWWorld::Ptr& ptr)
virtual std::shared_ptr<MWWorld::Action> use (const MWWorld::Ptr& ptr)
const;
///< Generate action for using via inventory menu

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save