forked from mirror/openmw-tes3mp
Compare commits
14 commits
Author | SHA1 | Date | |
---|---|---|---|
|
44364edfcf | ||
|
95ae862ed1 | ||
|
c2efafb313 | ||
|
366fb9f098 | ||
|
829b22b9de | ||
|
fc17e47ecb | ||
|
b2a1c940b0 | ||
|
c5ae95aedd | ||
|
91d1bab4ac | ||
|
3c76764ef4 | ||
|
ff108b4c6b | ||
|
35bbb7d552 | ||
|
17cea2676d | ||
|
3fe4f44bdd |
321 changed files with 1284 additions and 1259 deletions
|
@ -5,6 +5,7 @@ language: cpp
|
|||
branches:
|
||||
only:
|
||||
- master
|
||||
- c++11
|
||||
- coverity_scan
|
||||
- /openmw-.*$/
|
||||
env:
|
||||
|
|
|
@ -190,7 +190,7 @@ if (HAVE_UNORDERED_MAP)
|
|||
endif ()
|
||||
|
||||
|
||||
set(BOOST_COMPONENTS system filesystem program_options thread)
|
||||
set(BOOST_COMPONENTS system filesystem program_options)
|
||||
if(WIN32)
|
||||
set(BOOST_COMPONENTS ${BOOST_COMPONENTS} locale)
|
||||
endif(WIN32)
|
||||
|
@ -279,7 +279,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 -Wno-unused-parameter -std=c++98 -pedantic -Wno-long-long")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-parameter -std=c++0x -pedantic -Wno-long-long -DBOOST_NO_SCOPED_ENUMS -DBOOST_NO_CXX11_SCOPED_ENUMS")
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL Clang AND NOT APPLE)
|
||||
execute_process(COMMAND ${CMAKE_C_COMPILER} --version OUTPUT_VARIABLE CLANG_VERSION)
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#define OPENMW_ESSIMPORT_CONVERTER_H
|
||||
|
||||
#include <limits>
|
||||
#include <stdexcept>
|
||||
|
||||
#include <osg/Image>
|
||||
#include <osg/ref_ptr>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include <iomanip>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
|
||||
#include <osgDB/ReadFile>
|
||||
#include <osg/ImageUtils>
|
||||
|
@ -260,37 +260,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?)
|
||||
|
@ -300,7 +300,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);
|
||||
|
@ -311,7 +311,7 @@ namespace ESSImport
|
|||
ESM::NAME n = esm.getRecName();
|
||||
esm.getRecHeader();
|
||||
|
||||
std::map<unsigned int, boost::shared_ptr<Converter> >::iterator it = converters.find(n.val);
|
||||
std::map<unsigned int, std::shared_ptr<Converter> >::iterator it = converters.find(n.val);
|
||||
if (it != converters.end())
|
||||
{
|
||||
it->second->read(esm);
|
||||
|
@ -370,7 +370,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)
|
||||
|
@ -383,7 +383,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)
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
CS::Editor::Editor ()
|
||||
: mUserSettings (mCfgMgr), mDocumentManager (mCfgMgr),
|
||||
mViewManager (mDocumentManager), mPid(""),
|
||||
mLock(), mIpcServerName ("org.openmw.OpenCS"), mServer(NULL), mClientSocket(NULL)
|
||||
mLock(), mIpcServerName ("org.openmw.OpenCS"), mServer(nullptr), mClientSocket(nullptr)
|
||||
{
|
||||
std::pair<Files::PathContainer, std::vector<std::string> > config = readConfig();
|
||||
|
||||
|
@ -332,7 +332,7 @@ bool CS::Editor::makeIPCServer()
|
|||
}
|
||||
|
||||
mServer->close();
|
||||
mServer = NULL;
|
||||
mServer = nullptr;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,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;
|
||||
CSMSettings::UserSettings mUserSettings;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include <string>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
#include <boost/filesystem/path.hpp>
|
||||
|
||||
#include <QUndoStack>
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#include "document.hpp"
|
||||
|
||||
CSMDoc::DocumentManager::DocumentManager (const Files::ConfigurationManager& configuration)
|
||||
: mConfiguration (configuration), mEncoding (ToUTF8::WINDOWS_1252), mVFS(NULL)
|
||||
: mConfiguration (configuration), mEncoding (ToUTF8::WINDOWS_1252), mVFS(nullptr)
|
||||
{
|
||||
boost::filesystem::path projectPath = configuration.getUserDataPath() / "projects";
|
||||
|
||||
|
|
|
@ -3,7 +3,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;
|
||||
|
|
|
@ -3,7 +3,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)
|
||||
{}
|
||||
|
@ -22,7 +22,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,7 +4,7 @@
|
|||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
|
||||
#include "node.hpp"
|
||||
|
||||
|
@ -12,12 +12,12 @@ 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;
|
||||
|
||||
|
|
|
@ -4,8 +4,7 @@
|
|||
#include <string>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <memory>
|
||||
|
||||
#include <QMetaType>
|
||||
|
||||
|
@ -48,6 +47,6 @@ namespace CSMFilter
|
|||
};
|
||||
}
|
||||
|
||||
Q_DECLARE_METATYPE (boost::shared_ptr<CSMFilter::Node>)
|
||||
Q_DECLARE_METATYPE (std::shared_ptr<CSMFilter::Node>)
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
#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;
|
||||
|
|
|
@ -3,7 +3,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;
|
||||
|
|
|
@ -236,7 +236,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())
|
||||
{
|
||||
|
@ -248,11 +248,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:
|
||||
|
@ -261,12 +261,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:
|
||||
|
@ -282,7 +282,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:
|
||||
|
||||
|
@ -290,27 +290,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);
|
||||
|
||||
|
@ -319,7 +319,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)
|
||||
|
@ -329,31 +329,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;
|
||||
|
@ -371,7 +371,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();
|
||||
|
@ -379,7 +379,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
|
||||
|
@ -388,7 +388,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;
|
||||
|
@ -398,26 +398,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;
|
||||
|
@ -435,7 +435,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();
|
||||
|
@ -443,7 +443,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
|
||||
|
@ -468,7 +468,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();
|
||||
|
@ -482,7 +482,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)
|
||||
|
@ -492,7 +492,7 @@ boost::shared_ptr<CSMFilter::Node> CSMFilter::Parser::parseValue()
|
|||
else
|
||||
{
|
||||
error();
|
||||
return boost::shared_ptr<Node>();
|
||||
return std::shared_ptr<Node>();
|
||||
}
|
||||
|
||||
token = getNextToken();
|
||||
|
@ -514,7 +514,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>();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -523,10 +523,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()
|
||||
|
@ -557,7 +557,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;
|
||||
|
@ -613,7 +613,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,7 +1,7 @@
|
|||
#ifndef CSM_FILTER_PARSER_H
|
||||
#define CSM_FILTER_PARSER_H
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
|
||||
#include "node.hpp"
|
||||
|
||||
|
@ -16,7 +16,7 @@ namespace CSMFilter
|
|||
|
||||
class Parser
|
||||
{
|
||||
boost::shared_ptr<Node> mFilter;
|
||||
std::shared_ptr<Node> mFilter;
|
||||
std::string mInput;
|
||||
int mIndex;
|
||||
bool mError;
|
||||
|
@ -31,14 +31,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 +51,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,7 +1,7 @@
|
|||
|
||||
#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,7 +1,7 @@
|
|||
#ifndef CSM_FILTER_UNARYNODE_H
|
||||
#define CSM_FILTER_UNARYNODE_H
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
|
||||
#include "node.hpp"
|
||||
|
||||
|
@ -9,12 +9,12 @@ 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;
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ CSMSettings::UserSettings *CSMSettings::UserSettings::sUserSettingsInstance = 0;
|
|||
|
||||
CSMSettings::UserSettings::UserSettings (const Files::ConfigurationManager& configurationManager)
|
||||
: mCfgMgr (configurationManager)
|
||||
, mSettingDefinitions(NULL)
|
||||
, mSettingDefinitions(nullptr)
|
||||
{
|
||||
assert(!sUserSettingsInstance);
|
||||
sUserSettingsInstance = this;
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -62,7 +62,7 @@ void CSMWorld::CreateCommand::applyModifications()
|
|||
if (!mNestedValues.empty())
|
||||
{
|
||||
CSMWorld::IdTree *tree = dynamic_cast<CSMWorld::IdTree *>(&mModel);
|
||||
if (tree == NULL)
|
||||
if (tree == nullptr)
|
||||
{
|
||||
throw std::logic_error("CSMWorld::CreateCommand: Attempt to add nested values to the non-nested model");
|
||||
}
|
||||
|
|
|
@ -858,7 +858,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;
|
||||
|
||||
|
@ -896,7 +896,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
|
||||
|
|
|
@ -115,7 +115,7 @@ namespace CSMWorld
|
|||
|
||||
Resource::ResourceSystem mResourceSystem;
|
||||
|
||||
std::vector<boost::shared_ptr<ESM::ESMReader> > mReaders;
|
||||
std::vector<std::shared_ptr<ESM::ESMReader> > mReaders;
|
||||
|
||||
// not implemented
|
||||
Data (const Data&);
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
#include "idcompletionmanager.hpp"
|
||||
|
||||
#include <boost/make_shared.hpp>
|
||||
|
||||
#include <QCompleter>
|
||||
|
||||
#include "../../view/widget/completerpopup.hpp"
|
||||
|
@ -73,7 +71,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))
|
||||
{
|
||||
|
@ -90,12 +88,12 @@ void CSMWorld::IdCompletionManager::generateCompleters(CSMWorld::Data &data)
|
|||
{
|
||||
QAbstractItemModel *model = data.getTableModel(current->second);
|
||||
CSMWorld::IdTableBase *table = dynamic_cast<CSMWorld::IdTableBase *>(model);
|
||||
if (table != NULL)
|
||||
if (table != nullptr)
|
||||
{
|
||||
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);
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ QModelIndex CSMWorld::IdTableProxyModel::getModelIndex (const std::string& id, i
|
|||
return mapFromSource (dynamic_cast<IdTableBase&> (*sourceModel()).getModelIndex (id, column));
|
||||
}
|
||||
|
||||
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,7 +3,7 @@
|
|||
|
||||
#include <string>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
|
||||
#include <map>
|
||||
|
||||
|
@ -17,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)
|
||||
|
||||
private:
|
||||
|
@ -30,7 +30,7 @@ namespace CSMWorld
|
|||
|
||||
virtual QModelIndex getModelIndex (const std::string& id, int column) const;
|
||||
|
||||
void setFilter (const boost::shared_ptr<CSMFilter::Node>& filter);
|
||||
void setFilter (const std::shared_ptr<CSMFilter::Node>& filter);
|
||||
|
||||
void refreshFilter();
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace
|
|||
CSMWorld::InfoTableProxyModel::InfoTableProxyModel(CSMWorld::UniversalId::Type type, QObject *parent)
|
||||
: IdTableProxyModel(parent),
|
||||
mType(type),
|
||||
mSourceModel(NULL),
|
||||
mSourceModel(nullptr),
|
||||
mInfoColumnId(type == UniversalId::Type_TopicInfos ? Columns::ColumnId_Topic :
|
||||
Columns::ColumnId_Journal)
|
||||
{
|
||||
|
@ -27,7 +27,7 @@ void CSMWorld::InfoTableProxyModel::setSourceModel(QAbstractItemModel *sourceMod
|
|||
{
|
||||
IdTableProxyModel::setSourceModel(sourceModel);
|
||||
mSourceModel = dynamic_cast<IdTableBase *>(sourceModel);
|
||||
if (mSourceModel != NULL)
|
||||
if (mSourceModel != nullptr)
|
||||
{
|
||||
connect(mSourceModel,
|
||||
SIGNAL(rowsInserted(const QModelIndex &, int, int)),
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
#define CSM_WORLD_LAND_H
|
||||
|
||||
#include <string>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <memory>
|
||||
|
||||
#include <components/esm/loadland.hpp>
|
||||
|
||||
namespace CSMWorld
|
||||
|
@ -15,7 +16,7 @@ namespace CSMWorld
|
|||
{
|
||||
Land();
|
||||
|
||||
boost::shared_ptr<ESM::Land> mLand;
|
||||
std::shared_ptr<ESM::Land> mLand;
|
||||
|
||||
std::string mId;
|
||||
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
|
||||
#include <QVariant>
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
#include <components/esm/loadpgrd.hpp>
|
||||
#include <components/esm/effectlist.hpp>
|
||||
#include <components/esm/loadmgef.hpp> // for converting magic effect id to string & back
|
||||
|
|
|
@ -295,13 +295,13 @@ void CSMWorld::ContainerRefIdAdapter::setData (const RefIdColumn *column, RefIdD
|
|||
|
||||
CSMWorld::CreatureColumns::CreatureColumns (const ActorColumns& actorColumns)
|
||||
: ActorColumns (actorColumns),
|
||||
mType(NULL),
|
||||
mSoul(NULL),
|
||||
mScale(NULL),
|
||||
mOriginal(NULL),
|
||||
mCombat(NULL),
|
||||
mMagic(NULL),
|
||||
mStealth(NULL)
|
||||
mType(nullptr),
|
||||
mSoul(nullptr),
|
||||
mScale(nullptr),
|
||||
mOriginal(nullptr),
|
||||
mCombat(nullptr),
|
||||
mMagic(nullptr),
|
||||
mStealth(nullptr)
|
||||
{}
|
||||
|
||||
CSMWorld::CreatureRefIdAdapter::CreatureRefIdAdapter (const CreatureColumns& columns)
|
||||
|
@ -543,14 +543,14 @@ void CSMWorld::MiscRefIdAdapter::setData (const RefIdColumn *column, RefIdData&
|
|||
|
||||
CSMWorld::NpcColumns::NpcColumns (const ActorColumns& actorColumns)
|
||||
: ActorColumns (actorColumns),
|
||||
mRace(NULL),
|
||||
mClass(NULL),
|
||||
mFaction(NULL),
|
||||
mHair(NULL),
|
||||
mHead(NULL),
|
||||
mAttributes(NULL),
|
||||
mSkills(NULL),
|
||||
mMisc(NULL)
|
||||
mRace(nullptr),
|
||||
mClass(nullptr),
|
||||
mFaction(nullptr),
|
||||
mHair(nullptr),
|
||||
mHead(nullptr),
|
||||
mAttributes(nullptr),
|
||||
mSkills(nullptr),
|
||||
mMisc(nullptr)
|
||||
{}
|
||||
|
||||
CSMWorld::NpcRefIdAdapter::NpcRefIdAdapter (const NpcColumns& columns)
|
||||
|
|
|
@ -738,7 +738,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);
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include <stdexcept>
|
||||
|
||||
CSMWorld::ResourcesManager::ResourcesManager()
|
||||
: mVFS(NULL)
|
||||
: mVFS(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -184,7 +184,7 @@ void CSVDoc::FileDialog::slotRejected()
|
|||
if(mFileWidget)
|
||||
{
|
||||
delete mFileWidget;
|
||||
mFileWidget = NULL;
|
||||
mFileWidget = nullptr;
|
||||
}
|
||||
close();
|
||||
}
|
||||
|
@ -195,7 +195,7 @@ void CSVDoc::FileDialog::slotNewFile()
|
|||
if(mFileWidget)
|
||||
{
|
||||
delete mFileWidget;
|
||||
mFileWidget = NULL;
|
||||
mFileWidget = nullptr;
|
||||
}
|
||||
disconnect (ui.projectButtonBox, SIGNAL (accepted()), this, SLOT (slotNewFile()));
|
||||
close();
|
||||
|
|
|
@ -536,7 +536,7 @@ void CSVDoc::View::addSubView (const CSMWorld::UniversalId& id, const std::strin
|
|||
return;
|
||||
}
|
||||
|
||||
SubView *view = NULL;
|
||||
SubView *view = nullptr;
|
||||
if(isReferenceable)
|
||||
{
|
||||
view = mSubViewFactory.makeSubView (CSMWorld::UniversalId(CSMWorld::UniversalId::Type_Referenceable, id.getId()), *mDocument);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef CSV_FILTER_EDITWIDGET_H
|
||||
#define CSV_FILTER_EDITWIDGET_H
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
|
||||
#include <QLineEdit>
|
||||
#include <QPalette>
|
||||
|
@ -35,7 +35,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;
|
||||
|
|
|
@ -22,8 +22,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);
|
||||
};
|
||||
|
||||
|
|
|
@ -24,8 +24,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,7 +1,7 @@
|
|||
#ifndef CSV_FILTER_RECORDFILTERBOX_H
|
||||
#define CSV_FILTER_RECORDFILTERBOX_H
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
|
||||
#include <QWidget>
|
||||
#include <QtCore/qnamespace.h>
|
||||
|
@ -38,7 +38,7 @@ namespace CSVFilter
|
|||
|
||||
signals:
|
||||
|
||||
void filterChanged (boost::shared_ptr<CSMFilter::Node> filter);
|
||||
void filterChanged (std::shared_ptr<CSMFilter::Node> filter);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@ CSVRender::Cell::Cell (CSMWorld::Data& data, osg::Group* rootNode, const std::st
|
|||
const ESM::Land* esmLand = land.getRecord(mId).get().mLand.get();
|
||||
if(esmLand && esmLand->mDataTypes&ESM::Land::DATA_VHGT)
|
||||
{
|
||||
mTerrain.reset(new Terrain::TerrainGrid(mCellNode, data.getResourceSystem(), NULL, new TerrainStorage(mData), Element_Terrain<<1));
|
||||
mTerrain.reset(new Terrain::TerrainGrid(mCellNode, data.getResourceSystem(), nullptr, new TerrainStorage(mData), Element_Terrain<<1));
|
||||
mTerrain->loadCell(esmLand->mX,
|
||||
esmLand->mY);
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include <map>
|
||||
#include <memory>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
|
||||
#include <osg/ref_ptr>
|
||||
|
||||
|
@ -35,7 +35,7 @@ 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;
|
||||
int mX;
|
||||
int mY;
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include <string>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
|
||||
#include <osg/ref_ptr>
|
||||
|
||||
|
|
|
@ -184,7 +184,7 @@ std::string CSVRender::PagedWorldspaceWidget::getStartupInstruction()
|
|||
|
||||
CSVRender::PagedWorldspaceWidget::PagedWorldspaceWidget (QWidget* parent, CSMDoc::Document& document)
|
||||
: WorldspaceWidget (document, parent), mDocument (document), mWorldspace ("std::default"),
|
||||
mControlElements(NULL), mDisplayCellCoord(true)
|
||||
mControlElements(nullptr), mDisplayCellCoord(true)
|
||||
{
|
||||
QAbstractItemModel *cells =
|
||||
document.getData().getTableModel (CSMWorld::UniversalId::Type_Cells);
|
||||
|
|
|
@ -135,7 +135,7 @@ void CompositeViewer::update()
|
|||
SceneWidget::SceneWidget(Resource::SceneManager* sceneManager, QWidget *parent, Qt::WindowFlags f)
|
||||
: RenderWidget(parent, f)
|
||||
, mSceneManager(sceneManager)
|
||||
, mLighting(NULL)
|
||||
, mLighting(nullptr)
|
||||
, mHasDefaultAmbient(false)
|
||||
{
|
||||
// we handle lighting manually
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace CSVRender
|
|||
// has to wrap the vertices of the last row and column to the next cell, which may be a nonexisting cell
|
||||
int index = mData.getLand().searchId(stream.str());
|
||||
if (index == -1)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
ESM::Land* land = mData.getLand().getRecord(index).get().mLand.get();
|
||||
int mask = ESM::Land::DATA_VHGT | ESM::Land::DATA_VNML | ESM::Land::DATA_VCLR | ESM::Land::DATA_VTEX;
|
||||
|
|
|
@ -28,7 +28,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,7 +1,7 @@
|
|||
#ifndef OPENCS_VIEW_WORLDSPACEWIDGET_H
|
||||
#define OPENCS_VIEW_WORLDSPACEWIDGET_H
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
|
||||
#include "scenewidget.hpp"
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include "view.hpp"
|
||||
|
||||
CSVSettings::SettingWindow::SettingWindow(QWidget *parent)
|
||||
: QMainWindow(parent), mModel(NULL)
|
||||
: QMainWindow(parent), mModel(nullptr)
|
||||
{}
|
||||
|
||||
void CSVSettings::SettingWindow::createPages()
|
||||
|
|
|
@ -46,7 +46,7 @@ void CSVWidget::ColorPickerPopup::showPicker(const QPoint &position, const QColo
|
|||
void CSVWidget::ColorPickerPopup::mousePressEvent(QMouseEvent *event)
|
||||
{
|
||||
QPushButton *button = qobject_cast<QPushButton *>(parentWidget());
|
||||
if (button != NULL)
|
||||
if (button != nullptr)
|
||||
{
|
||||
QStyleOptionButton option;
|
||||
option.init(button);
|
||||
|
|
|
@ -11,7 +11,7 @@ CSVWidget::CompleterPopup::CompleterPopup(QWidget *parent)
|
|||
|
||||
int CSVWidget::CompleterPopup::sizeHintForRow(int row) const
|
||||
{
|
||||
if (model() == NULL)
|
||||
if (model() == nullptr)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ std::string CSVWorld::CellCreator::getId() const
|
|||
void CSVWorld::CellCreator::configureCreateCommand(CSMWorld::CreateCommand& command) const
|
||||
{
|
||||
CSMWorld::IdTree *model = dynamic_cast<CSMWorld::IdTree *>(getData().getTableModel(getCollectionId()));
|
||||
Q_ASSERT(model != NULL);
|
||||
Q_ASSERT(model != nullptr);
|
||||
int parentIndex = model->findColumnIndex(CSMWorld::Columns::ColumnId_Cell);
|
||||
int index = model->findNestedColumnIndex(parentIndex, CSMWorld::Columns::ColumnId_Interior);
|
||||
command.addNestedValue(parentIndex, index, mType->currentIndex() == 0);
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ void CSVWorld::NotEditableSubDelegate::setEditorData (QWidget* editor, const QMo
|
|||
|
||||
CSMWorld::Columns::ColumnId columnId = static_cast<CSMWorld::Columns::ColumnId> (
|
||||
mTable->getColumnId (index.column()));
|
||||
|
||||
|
||||
if (QVariant::String == v.type())
|
||||
{
|
||||
label->setText(v.toString());
|
||||
|
@ -75,7 +75,7 @@ void CSVWorld::NotEditableSubDelegate::setEditorData (QWidget* editor, const QMo
|
|||
{
|
||||
int data = v.toInt();
|
||||
std::vector<std::string> enumNames (CSMWorld::Columns::getEnums (columnId));
|
||||
|
||||
|
||||
label->setText(QString::fromUtf8(enumNames.at(data).c_str()));
|
||||
}
|
||||
else
|
||||
|
@ -116,7 +116,7 @@ mIndex(index)
|
|||
CSVWorld::DialogueDelegateDispatcherProxy::DialogueDelegateDispatcherProxy(QWidget* editor, CSMWorld::ColumnBase::Display display) :
|
||||
mEditor(editor),
|
||||
mDisplay(display),
|
||||
mIndexWrapper(NULL)
|
||||
mIndexWrapper(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -154,7 +154,7 @@ mNotEditableDelegate(table, parent)
|
|||
|
||||
CSVWorld::CommandDelegate* CSVWorld::DialogueDelegateDispatcher::makeDelegate(CSMWorld::ColumnBase::Display display)
|
||||
{
|
||||
CommandDelegate *delegate = NULL;
|
||||
CommandDelegate *delegate = nullptr;
|
||||
std::map<int, CommandDelegate*>::const_iterator delegateIt(mDelegates.find(display));
|
||||
if (delegateIt == mDelegates.end())
|
||||
{
|
||||
|
@ -247,11 +247,11 @@ QWidget* CSVWorld::DialogueDelegateDispatcher::makeEditor(CSMWorld::ColumnBase::
|
|||
variant = index.data(Qt::DisplayRole);
|
||||
if (!variant.isValid())
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
QWidget* editor = NULL;
|
||||
QWidget* editor = nullptr;
|
||||
if (! (mTable->flags (index) & Qt::ItemIsEditable))
|
||||
{
|
||||
return mNotEditableDelegate.createEditor(qobject_cast<QWidget*>(mParent),
|
||||
|
@ -321,21 +321,21 @@ CSVWorld::IdContextMenu::IdContextMenu(QWidget *widget, CSMWorld::ColumnBase::Di
|
|||
mWidget(widget),
|
||||
mIdType(CSMWorld::TableMimeData::convertEnums(display))
|
||||
{
|
||||
Q_ASSERT(mWidget != NULL);
|
||||
Q_ASSERT(mWidget != nullptr);
|
||||
Q_ASSERT(CSMWorld::ColumnBase::isId(display));
|
||||
Q_ASSERT(mIdType != CSMWorld::UniversalId::Type_None);
|
||||
|
||||
|
||||
mWidget->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
connect(mWidget,
|
||||
SIGNAL(customContextMenuRequested(const QPoint &)),
|
||||
this,
|
||||
connect(mWidget,
|
||||
SIGNAL(customContextMenuRequested(const QPoint &)),
|
||||
this,
|
||||
SLOT(showContextMenu(const QPoint &)));
|
||||
|
||||
mEditIdAction = new QAction(this);
|
||||
connect(mEditIdAction, SIGNAL(triggered()), this, SLOT(editIdRequest()));
|
||||
|
||||
QLineEdit *lineEdit = qobject_cast<QLineEdit *>(mWidget);
|
||||
if (lineEdit != NULL)
|
||||
if (lineEdit != nullptr)
|
||||
{
|
||||
mContextMenu = lineEdit->createStandardContextMenu();
|
||||
}
|
||||
|
@ -352,15 +352,15 @@ void CSVWorld::IdContextMenu::excludeId(const std::string &id)
|
|||
|
||||
QString CSVWorld::IdContextMenu::getWidgetValue() const
|
||||
{
|
||||
QLineEdit *lineEdit = qobject_cast<QLineEdit *>(mWidget);
|
||||
QLineEdit *lineEdit = qobject_cast<QLineEdit *>(mWidget);
|
||||
QLabel *label = qobject_cast<QLabel *>(mWidget);
|
||||
|
||||
QString value = "";
|
||||
if (lineEdit != NULL)
|
||||
if (lineEdit != nullptr)
|
||||
{
|
||||
value = lineEdit->text();
|
||||
}
|
||||
else if (label != NULL)
|
||||
else if (label != nullptr)
|
||||
{
|
||||
value = label->text();
|
||||
}
|
||||
|
@ -411,7 +411,7 @@ void CSVWorld::IdContextMenu::showContextMenu(const QPoint &pos)
|
|||
{
|
||||
removeEditIdActionFromMenu();
|
||||
}
|
||||
|
||||
|
||||
if (!mContextMenu->actions().isEmpty())
|
||||
{
|
||||
mContextMenu->exec(mWidget->mapToGlobal(pos));
|
||||
|
@ -432,7 +432,7 @@ void CSVWorld::EditWidget::createEditorContextMenu(QWidget *editor,
|
|||
CSMWorld::ColumnBase::Display display,
|
||||
int currentRow) const
|
||||
{
|
||||
Q_ASSERT(editor != NULL);
|
||||
Q_ASSERT(editor != nullptr);
|
||||
|
||||
if (CSMWorld::ColumnBase::isId(display) &&
|
||||
CSMWorld::TableMimeData::convertEnums(display) != CSMWorld::UniversalId::Type_None)
|
||||
|
@ -466,11 +466,11 @@ CSVWorld::EditWidget::EditWidget(QWidget *parent,
|
|||
int row, CSMWorld::IdTable* table, CSMWorld::CommandDispatcher& commandDispatcher,
|
||||
CSMDoc::Document& document, bool createAndDelete) :
|
||||
QScrollArea(parent),
|
||||
mWidgetMapper(NULL),
|
||||
mNestedTableMapper(NULL),
|
||||
mDispatcher(NULL),
|
||||
mNestedTableDispatcher(NULL),
|
||||
mMainWidget(NULL),
|
||||
mWidgetMapper(nullptr),
|
||||
mNestedTableMapper(nullptr),
|
||||
mDispatcher(nullptr),
|
||||
mNestedTableDispatcher(nullptr),
|
||||
mMainWidget(nullptr),
|
||||
mTable(table),
|
||||
mCommandDispatcher (commandDispatcher),
|
||||
mDocument (document)
|
||||
|
@ -588,9 +588,9 @@ void CSVWorld::EditWidget::remake(int row)
|
|||
tablesLayout->addWidget(label);
|
||||
tablesLayout->addWidget(table);
|
||||
|
||||
connect(table,
|
||||
SIGNAL(editRequest(const CSMWorld::UniversalId &, const std::string &)),
|
||||
this,
|
||||
connect(table,
|
||||
SIGNAL(editRequest(const CSMWorld::UniversalId &, const std::string &)),
|
||||
this,
|
||||
SIGNAL(editIdRequest(const CSMWorld::UniversalId &, const std::string &)));
|
||||
}
|
||||
else if (!(flags & CSMWorld::ColumnBase::Flag_Dialogue_List))
|
||||
|
@ -725,7 +725,7 @@ bool CSVWorld::SimpleDialogueSubView::isLocked() const
|
|||
CSVWorld::SimpleDialogueSubView::SimpleDialogueSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document) :
|
||||
SubView (id),
|
||||
mEditWidget(0),
|
||||
mMainLayout(NULL),
|
||||
mMainLayout(nullptr),
|
||||
mTable(dynamic_cast<CSMWorld::IdTable*>(document.getData().getTableModel(id))),
|
||||
mLocked(false),
|
||||
mDocument(document),
|
||||
|
@ -854,7 +854,7 @@ CSVWorld::DialogueSubView::DialogueSubView (const CSMWorld::UniversalId& id,
|
|||
connect (mButtons, SIGNAL (showPreview()), this, SLOT (showPreview()));
|
||||
connect (mButtons, SIGNAL (viewRecord()), this, SLOT (viewRecord()));
|
||||
connect (mButtons, SIGNAL (switchToRow (int)), this, SLOT (switchToRow (int)));
|
||||
|
||||
|
||||
connect (this, SIGNAL (universalIdChanged (const CSMWorld::UniversalId&)),
|
||||
mButtons, SLOT (universalIdChanged (const CSMWorld::UniversalId&)));
|
||||
}
|
||||
|
@ -908,7 +908,7 @@ void CSVWorld::DialogueSubView::switchToRow (int row)
|
|||
|
||||
setUniversalId (CSMWorld::UniversalId (type, id));
|
||||
updateCurrentId();
|
||||
|
||||
|
||||
getEditWidget().remake (row);
|
||||
|
||||
int stateColumn = getTable().findColumnIndex (CSMWorld::Columns::ColumnId_Modification);
|
||||
|
@ -923,5 +923,5 @@ void CSVWorld::DialogueSubView::requestFocus (const std::string& id)
|
|||
QModelIndex index = getTable().getModelIndex (id, 0);
|
||||
|
||||
if (index.isValid())
|
||||
switchToRow (index.row());
|
||||
switchToRow (index.row());
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ namespace CSVWorld
|
|||
|
||||
CSMWorld::ColumnBase::Display mDisplay;
|
||||
|
||||
std::auto_ptr<refWrapper> mIndexWrapper;
|
||||
std::unique_ptr<refWrapper> mIndexWrapper;
|
||||
|
||||
public:
|
||||
DialogueDelegateDispatcherProxy(QWidget* editor,
|
||||
|
|
|
@ -12,7 +12,7 @@ const CSMWorld::TableMimeData *CSVWorld::DragDropUtils::getTableMimeData(const Q
|
|||
bool CSVWorld::DragDropUtils::canAcceptData(const QDropEvent &event, CSMWorld::ColumnBase::Display type)
|
||||
{
|
||||
const CSMWorld::TableMimeData *data = getTableMimeData(event);
|
||||
return data != NULL && data->holdsType(type);
|
||||
return data != nullptr && data->holdsType(type);
|
||||
}
|
||||
|
||||
CSMWorld::UniversalId CSVWorld::DragDropUtils::getAcceptedData(const QDropEvent &event,
|
||||
|
|
|
@ -83,7 +83,7 @@ void CSVWorld::DragRecordTable::dropEvent(QDropEvent *event)
|
|||
|
||||
CSMWorld::ColumnBase::Display CSVWorld::DragRecordTable::getIndexDisplayType(const QModelIndex &index) const
|
||||
{
|
||||
Q_ASSERT(model() != NULL);
|
||||
Q_ASSERT(model() != nullptr);
|
||||
|
||||
if (index.isValid())
|
||||
{
|
||||
|
|
|
@ -28,7 +28,7 @@ namespace CSVWorld
|
|||
bool mEditLock;
|
||||
|
||||
public:
|
||||
DragRecordTable(CSMDoc::Document& document, QWidget* parent = NULL);
|
||||
DragRecordTable(CSMDoc::Document& document, QWidget* parent = nullptr);
|
||||
|
||||
virtual std::vector<CSMWorld::UniversalId> getDraggedRecords() const = 0;
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ std::string CSVWorld::GenericCreator::getId() 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());
|
||||
|
@ -202,7 +202,7 @@ void CSVWorld::GenericCreator::create()
|
|||
{
|
||||
std::string id = getId();
|
||||
|
||||
std::auto_ptr<CSMWorld::CreateCommand> command;
|
||||
std::unique_ptr<CSMWorld::CreateCommand> command;
|
||||
|
||||
if (mCloneMode)
|
||||
{
|
||||
|
@ -217,7 +217,7 @@ void CSVWorld::GenericCreator::create()
|
|||
}
|
||||
|
||||
configureCreateCommand (*command);
|
||||
pushCommand (command, id);
|
||||
pushCommand (std::move (command), id);
|
||||
|
||||
emit done();
|
||||
emit requestFocus(id);
|
||||
|
|
|
@ -65,7 +65,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;
|
||||
|
|
|
@ -24,7 +24,7 @@ QWidget *CSVWorld::IdCompletionDelegate::createEditor(QWidget *parent,
|
|||
{
|
||||
if (!index.data(Qt::EditRole).isValid() && !index.data(Qt::DisplayRole).isValid())
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
CSMWorld::IdCompletionManager &completionManager = getDocument().getIdCompletionManager();
|
||||
|
|
|
@ -38,7 +38,7 @@ namespace CSVWorld
|
|||
NestedTable(CSMDoc::Document& document,
|
||||
CSMWorld::UniversalId id,
|
||||
CSMWorld::NestedTableProxyModel* model,
|
||||
QWidget* parent = NULL);
|
||||
QWidget* parent = nullptr);
|
||||
|
||||
virtual std::vector<CSMWorld::UniversalId> getDraggedRecords() const;
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ void CSVWorld::ReferenceCreator::configureCreateCommand (CSMWorld::CreateCommand
|
|||
command.addValue (refNumColumn, getRefNumCount());
|
||||
}
|
||||
|
||||
void CSVWorld::ReferenceCreator::pushCommand (std::auto_ptr<CSMWorld::CreateCommand> command,
|
||||
void CSVWorld::ReferenceCreator::pushCommand (std::unique_ptr<CSMWorld::CreateCommand> command,
|
||||
const std::string& id)
|
||||
{
|
||||
// get the old count
|
||||
|
@ -51,11 +51,11 @@ void CSVWorld::ReferenceCreator::pushCommand (std::auto_ptr<CSMWorld::CreateComm
|
|||
int count = cellTable.data (countIndex).toInt();
|
||||
|
||||
// command for incrementing counter
|
||||
std::auto_ptr<CSMWorld::ModifyCommand> increment (new CSMWorld::ModifyCommand
|
||||
std::unique_ptr<CSMWorld::ModifyCommand> increment (new CSMWorld::ModifyCommand
|
||||
(cellTable, countIndex, count+1));
|
||||
|
||||
getUndoStack().beginMacro (command->text());
|
||||
GenericCreator::pushCommand (command, id);
|
||||
GenericCreator::pushCommand (std::move (command), id);
|
||||
getUndoStack().push (increment.release());
|
||||
getUndoStack().endMacro();
|
||||
}
|
||||
|
@ -148,11 +148,11 @@ void CSVWorld::ReferenceCreator::cloneMode(const std::string& originId,
|
|||
cellChanged(); //otherwise ok button will remain disabled
|
||||
}
|
||||
|
||||
CSVWorld::Creator *CSVWorld::ReferenceCreatorFactory::makeCreator (CSMDoc::Document& document,
|
||||
CSVWorld::Creator *CSVWorld::ReferenceCreatorFactory::makeCreator (CSMDoc::Document& document,
|
||||
const CSMWorld::UniversalId& id) const
|
||||
{
|
||||
return new ReferenceCreator(document.getData(),
|
||||
document.getUndoStack(),
|
||||
return new ReferenceCreator(document.getData(),
|
||||
document.getUndoStack(),
|
||||
id,
|
||||
document.getIdCompletionManager());
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace CSVWorld
|
|||
|
||||
virtual void configureCreateCommand (CSMWorld::CreateCommand& command) const;
|
||||
|
||||
virtual void pushCommand (std::auto_ptr<CSMWorld::CreateCommand> command,
|
||||
virtual void pushCommand (std::unique_ptr<CSMWorld::CreateCommand> command,
|
||||
const std::string& id);
|
||||
|
||||
int getRefNumCount() const;
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include "creator.hpp"
|
||||
|
||||
CSVWorld::SceneSubView::SceneSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document)
|
||||
: SubView (id), mScene(NULL), mLayout(new QHBoxLayout), mDocument(document), mToolbar(NULL)
|
||||
: SubView (id), mScene(nullptr), mLayout(new QHBoxLayout), mDocument(document), mToolbar(nullptr)
|
||||
{
|
||||
QVBoxLayout *layout = new QVBoxLayout;
|
||||
|
||||
|
@ -37,7 +37,7 @@ CSVWorld::SceneSubView::SceneSubView (const CSMWorld::UniversalId& id, CSMDoc::D
|
|||
|
||||
mLayout->setContentsMargins (QMargins (0, 0, 0, 0));
|
||||
|
||||
CSVRender::WorldspaceWidget* worldspaceWidget = NULL;
|
||||
CSVRender::WorldspaceWidget* worldspaceWidget = nullptr;
|
||||
widgetType whatWidget;
|
||||
|
||||
if (id.getId()=="sys::default")
|
||||
|
@ -197,9 +197,9 @@ void CSVWorld::SceneSubView::cellSelectionChanged (const CSMWorld::CellSelection
|
|||
|
||||
void CSVWorld::SceneSubView::handleDrop (const std::vector< CSMWorld::UniversalId >& data)
|
||||
{
|
||||
CSVRender::PagedWorldspaceWidget* pagedNewWidget = NULL;
|
||||
CSVRender::UnpagedWorldspaceWidget* unPagedNewWidget = NULL;
|
||||
CSVWidget::SceneToolbar* toolbar = NULL;
|
||||
CSVRender::PagedWorldspaceWidget* pagedNewWidget = nullptr;
|
||||
CSVRender::UnpagedWorldspaceWidget* unPagedNewWidget = nullptr;
|
||||
CSVWidget::SceneToolbar* toolbar = nullptr;
|
||||
|
||||
CSVRender::WorldspaceWidget::DropType type = CSVRender::WorldspaceWidget::getDropType (data);
|
||||
|
||||
|
|
|
@ -672,7 +672,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();
|
||||
|
|
|
@ -136,7 +136,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 updateUserSetting (const QString &name, const QStringList &list);
|
||||
|
||||
|
|
|
@ -76,8 +76,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)));
|
||||
|
|
|
@ -130,7 +130,7 @@ void CSVWorld::CommandDelegate::setModelDataImp (QWidget *editor, QAbstractItemM
|
|||
QVariant new_;
|
||||
// Color columns use a custom editor, so we need explicitly extract a data from it
|
||||
CSVWidget::ColorEditor *colorEditor = qobject_cast<CSVWidget::ColorEditor *>(editor);
|
||||
if (colorEditor != NULL)
|
||||
if (colorEditor != nullptr)
|
||||
{
|
||||
new_ = colorEditor->color();
|
||||
}
|
||||
|
@ -307,7 +307,7 @@ void CSVWorld::CommandDelegate::setEditorData (QWidget *editor, const QModelInde
|
|||
|
||||
// Color columns use a custom editor, so we need explicitly set a data for it
|
||||
CSVWidget::ColorEditor *colorEditor = qobject_cast<CSVWidget::ColorEditor *>(editor);
|
||||
if (colorEditor != NULL)
|
||||
if (colorEditor != nullptr)
|
||||
{
|
||||
colorEditor->setColor(index.data().value<QColor>());
|
||||
return;
|
||||
|
|
|
@ -117,7 +117,6 @@ include_directories(${SOUND_INPUT_INCLUDES})
|
|||
target_link_libraries(openmw
|
||||
${OPENSCENEGRAPH_LIBRARIES}
|
||||
${Boost_SYSTEM_LIBRARY}
|
||||
${Boost_THREAD_LIBRARY}
|
||||
${Boost_FILESYSTEM_LIBRARY}
|
||||
${Boost_PROGRAM_OPTIONS_LIBRARY}
|
||||
${OPENAL_LIBRARY}
|
||||
|
|
|
@ -63,7 +63,7 @@ static const struct {
|
|||
{ "Illegal instruction", SIGILL },
|
||||
{ "FPU exception", SIGFPE },
|
||||
{ "System BUS error", SIGBUS },
|
||||
{ NULL, 0 }
|
||||
{ nullptr, 0 }
|
||||
};
|
||||
|
||||
static const struct {
|
||||
|
@ -80,7 +80,7 @@ static const struct {
|
|||
{ ILL_COPROC, "Coprocessor error" },
|
||||
{ ILL_BADSTK, "Internal stack error" },
|
||||
#endif
|
||||
{ 0, NULL }
|
||||
{ 0, nullptr }
|
||||
};
|
||||
|
||||
static const struct {
|
||||
|
@ -95,7 +95,7 @@ static const struct {
|
|||
{ FPE_FLTRES, "Floating point inexact result" },
|
||||
{ FPE_FLTINV, "Floating point invalid operation" },
|
||||
{ FPE_FLTSUB, "Subscript out of range" },
|
||||
{ 0, NULL }
|
||||
{ 0, nullptr }
|
||||
};
|
||||
|
||||
static const struct {
|
||||
|
@ -106,7 +106,7 @@ static const struct {
|
|||
{ SEGV_MAPERR, "Address not mapped to object" },
|
||||
{ SEGV_ACCERR, "Invalid permissions for mapped object" },
|
||||
#endif
|
||||
{ 0, NULL }
|
||||
{ 0, nullptr }
|
||||
};
|
||||
|
||||
static const struct {
|
||||
|
@ -118,7 +118,7 @@ static const struct {
|
|||
{ BUS_ADRERR, "Non-existent physical address" },
|
||||
{ BUS_OBJERR, "Object specific hardware error" },
|
||||
#endif
|
||||
{ 0, NULL }
|
||||
{ 0, nullptr }
|
||||
};
|
||||
|
||||
static int (*cc_user_info)(char*, char*);
|
||||
|
@ -132,7 +132,7 @@ static void gdb_info(pid_t pid)
|
|||
|
||||
/* Create a temp file to put gdb commands into */
|
||||
strcpy(respfile, "/tmp/gdb-respfile-XXXXXX");
|
||||
if((fd=mkstemp(respfile)) >= 0 && (f=fdopen(fd, "w")) != NULL)
|
||||
if((fd=mkstemp(respfile)) >= 0 && (f=fdopen(fd, "w")) != nullptr)
|
||||
{
|
||||
fprintf(f, "attach %d\n"
|
||||
"shell echo \"\"\n"
|
||||
|
@ -255,7 +255,7 @@ static void crash_catcher(int signum, siginfo_t *siginfo, void *context)
|
|||
close(fd[0]);
|
||||
close(fd[1]);
|
||||
|
||||
execl(argv0, argv0, crash_switch, NULL);
|
||||
execl(argv0, argv0, crash_switch, nullptr);
|
||||
|
||||
safe_write(STDERR_FILENO, exec_err, sizeof(exec_err)-1);
|
||||
_exit(1);
|
||||
|
@ -390,7 +390,7 @@ static void crash_handler(const char *logfile)
|
|||
if(logfile)
|
||||
{
|
||||
std::string message = "OpenMW has encountered a fatal error.\nCrash log saved to '" + std::string(logfile) + "'.\n Please report this to https://bugs.openmw.org !";
|
||||
SDL_ShowSimpleMessageBox(0, "Fatal Error", message.c_str(), NULL);
|
||||
SDL_ShowSimpleMessageBox(0, "Fatal Error", message.c_str(), nullptr);
|
||||
}
|
||||
exit(0);
|
||||
}
|
||||
|
@ -426,7 +426,7 @@ int cc_install_handlers(int argc, char **argv, int num_signals, int *signals, co
|
|||
altss.ss_sp = altstack;
|
||||
altss.ss_flags = 0;
|
||||
altss.ss_size = sizeof(altstack);
|
||||
sigaltstack(&altss, NULL);
|
||||
sigaltstack(&altss, nullptr);
|
||||
|
||||
memset(&sa, 0, sizeof(sa));
|
||||
sa.sa_sigaction = crash_catcher;
|
||||
|
@ -437,7 +437,7 @@ int cc_install_handlers(int argc, char **argv, int num_signals, int *signals, co
|
|||
while(num_signals--)
|
||||
{
|
||||
if((*signals != SIGSEGV && *signals != SIGILL && *signals != SIGFPE && *signals != SIGABRT &&
|
||||
*signals != SIGBUS) || sigaction(*signals, &sa, NULL) == -1)
|
||||
*signals != SIGBUS) || sigaction(*signals, &sa, nullptr) == -1)
|
||||
{
|
||||
*signals = 0;
|
||||
retval = -1;
|
||||
|
|
|
@ -193,9 +193,9 @@ void OMW::Engine::frame(float frametime)
|
|||
}
|
||||
|
||||
OMW::Engine::Engine(Files::ConfigurationManager& configurationManager)
|
||||
: mWindow(NULL)
|
||||
: mWindow(nullptr)
|
||||
, mEncoding(ToUTF8::WINDOWS_1252)
|
||||
, mEncoder(NULL)
|
||||
, mEncoder(nullptr)
|
||||
, mVerboseScripts (false)
|
||||
, mSkipMenu (false)
|
||||
, mUseSound (true)
|
||||
|
@ -233,16 +233,16 @@ OMW::Engine::~Engine()
|
|||
mEnvironment.cleanup();
|
||||
|
||||
delete mScriptContext;
|
||||
mScriptContext = NULL;
|
||||
mScriptContext = nullptr;
|
||||
|
||||
mResourceSystem.reset();
|
||||
|
||||
mViewer = NULL;
|
||||
mViewer = nullptr;
|
||||
|
||||
if (mWindow)
|
||||
{
|
||||
SDL_DestroyWindow(mWindow);
|
||||
mWindow = NULL;
|
||||
mWindow = nullptr;
|
||||
}
|
||||
|
||||
SDL_Quit();
|
||||
|
|
|
@ -66,8 +66,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;
|
||||
MWBase::Environment mEnvironment;
|
||||
ToUTF8::FromType mEncoding;
|
||||
ToUTF8::Utf8Encoder* mEncoder;
|
||||
|
|
|
@ -340,7 +340,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
|
||||
|
@ -370,7 +370,7 @@ int main(int argc, char**argv)
|
|||
if ((argc == 2 && strcmp(argv[1], "--cc-handle-crash") == 0) || !is_debugger_attached())
|
||||
{
|
||||
int s[5] = { SIGSEGV, SIGILL, SIGFPE, SIGBUS, SIGABRT };
|
||||
cc_install_handlers(argc, argv, 5, s, (cfgMgr.getLogPath() / "crash.log").string().c_str(), NULL);
|
||||
cc_install_handlers(argc, argv, 5, s, (cfgMgr.getLogPath() / "crash.log").string().c_str(), nullptr);
|
||||
std::cout << "Installing crash catcher" << std::endl;
|
||||
}
|
||||
else
|
||||
|
@ -395,7 +395,7 @@ int main(int argc, char**argv)
|
|||
#if (defined(__APPLE__) || defined(__linux) || defined(__unix) || defined(__posix))
|
||||
if (!isatty(fileno(stdin)))
|
||||
#endif
|
||||
SDL_ShowSimpleMessageBox(0, "OpenMW: Fatal error", e.what(), NULL);
|
||||
SDL_ShowSimpleMessageBox(0, "OpenMW: Fatal error", e.what(), nullptr);
|
||||
|
||||
std::cerr << "\nERROR: " << e.what() << std::endl;
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include <string>
|
||||
#include <set>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <memory>
|
||||
|
||||
#include "../mwworld/ptr.hpp"
|
||||
|
||||
|
@ -16,12 +16,12 @@ namespace MWSound
|
|||
{
|
||||
class Sound;
|
||||
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 std::shared_ptr<MWSound::Sound> SoundPtr;
|
||||
|
||||
/// \brief Interface for sound manager (implemented in MWSound)
|
||||
class SoundManager
|
||||
|
|
|
@ -50,7 +50,7 @@ namespace MWClass
|
|||
{
|
||||
MWWorld::LiveCellRef<ESM::Activator> *ref =
|
||||
ptr.get<ESM::Activator>();
|
||||
assert(ref->mBase != NULL);
|
||||
assert(ref->mBase != nullptr);
|
||||
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
|
@ -77,7 +77,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);
|
||||
}
|
||||
|
@ -109,19 +109,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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ namespace MWClass
|
|||
virtual std::string getScript (const MWWorld::Ptr& 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();
|
||||
|
|
|
@ -42,7 +42,7 @@ namespace MWClass
|
|||
{
|
||||
MWWorld::LiveCellRef<ESM::Apparatus> *ref =
|
||||
ptr.get<ESM::Apparatus>();
|
||||
assert(ref->mBase != NULL);
|
||||
assert(ref->mBase != nullptr);
|
||||
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
|
@ -59,7 +59,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);
|
||||
|
@ -83,7 +83,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);
|
||||
}
|
||||
|
@ -138,9 +138,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
|
||||
|
|
|
@ -27,7 +27,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
|
|||
virtual std::string getInventoryIcon (const MWWorld::Ptr& 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
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ namespace MWClass
|
|||
{
|
||||
MWWorld::LiveCellRef<ESM::Armor> *ref =
|
||||
ptr.get<ESM::Armor>();
|
||||
assert(ref->mBase != NULL);
|
||||
assert(ref->mBase != nullptr);
|
||||
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
|
@ -64,7 +64,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);
|
||||
|
@ -180,7 +180,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);
|
||||
}
|
||||
|
@ -367,9 +367,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));
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
@ -77,7 +77,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
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ namespace MWClass
|
|||
{
|
||||
MWWorld::LiveCellRef<ESM::Book> *ref =
|
||||
ptr.get<ESM::Book>();
|
||||
assert(ref->mBase != NULL);
|
||||
assert(ref->mBase != nullptr);
|
||||
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
|
@ -61,7 +61,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())
|
||||
|
@ -69,13 +69,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::Ptr& ptr) const
|
||||
|
@ -96,7 +96,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);
|
||||
}
|
||||
|
@ -176,9 +176,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
|
||||
|
|
|
@ -24,7 +24,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
|
||||
|
||||
|
@ -57,7 +57,7 @@ namespace MWClass
|
|||
virtual std::string applyEnchantment(const MWWorld::Ptr &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::Ptr &ptr) const;
|
||||
|
|
|
@ -44,7 +44,7 @@ namespace MWClass
|
|||
{
|
||||
MWWorld::LiveCellRef<ESM::Clothing> *ref =
|
||||
ptr.get<ESM::Clothing>();
|
||||
assert(ref->mBase != NULL);
|
||||
assert(ref->mBase != nullptr);
|
||||
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
|
@ -61,7 +61,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);
|
||||
|
@ -136,7 +136,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);
|
||||
}
|
||||
|
@ -262,9 +262,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));
|
||||
|
||||
|
|
|
@ -24,7 +24,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
|
||||
|
||||
|
@ -69,7 +69,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
|
||||
|
||||
|
|
|
@ -54,7 +54,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>();
|
||||
|
@ -75,7 +75,7 @@ namespace MWClass
|
|||
ptr.get<ESM::Container>();
|
||||
if (ref->mBase->mFlags & ESM::Container::Respawn)
|
||||
{
|
||||
ptr.getRefData().setCustomData(NULL);
|
||||
ptr.getRefData().setCustomData(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -108,7 +108,7 @@ namespace MWClass
|
|||
{
|
||||
MWWorld::LiveCellRef<ESM::Container> *ref =
|
||||
ptr.get<ESM::Container>();
|
||||
assert(ref->mBase != NULL);
|
||||
assert(ref->mBase != nullptr);
|
||||
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
|
@ -117,18 +117,18 @@ namespace MWClass
|
|||
return "";
|
||||
}
|
||||
|
||||
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;
|
||||
|
@ -171,20 +171,20 @@ namespace MWClass
|
|||
{
|
||||
if(ptr.getCellRef().getTrap().empty())
|
||||
{
|
||||
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(actor, ptr.getCellRef().getTrap(), ptr));
|
||||
std::shared_ptr<MWWorld::Action> action(new MWWorld::ActionTrap(actor, ptr.getCellRef().getTrap(), ptr));
|
||||
action->setSound(trapActivationSound);
|
||||
return action;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
boost::shared_ptr<MWWorld::Action> action(new MWWorld::FailedAction);
|
||||
std::shared_ptr<MWWorld::Action> action(new MWWorld::FailedAction);
|
||||
action->setSound(lockedSound);
|
||||
return action;
|
||||
}
|
||||
|
@ -216,7 +216,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);
|
||||
}
|
||||
|
@ -299,7 +299,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());
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,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
|
||||
|
||||
|
|
|
@ -92,7 +92,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>();
|
||||
|
||||
|
@ -184,7 +184,7 @@ namespace MWClass
|
|||
{
|
||||
MWWorld::LiveCellRef<ESM::Creature> *ref =
|
||||
ptr.get<ESM::Creature>();
|
||||
assert (ref->mBase != NULL);
|
||||
assert (ref->mBase != nullptr);
|
||||
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
|
@ -280,7 +280,7 @@ namespace MWClass
|
|||
bool healthdmg = true;
|
||||
if (!weapon.isEmpty())
|
||||
{
|
||||
const unsigned char *attack = NULL;
|
||||
const unsigned char *attack = nullptr;
|
||||
if(type == ESM::Weapon::AT_Chop)
|
||||
attack = weapon.get<ESM::Weapon>()->mBase->mData.mChop;
|
||||
else if(type == ESM::Weapon::AT_Slash)
|
||||
|
@ -450,7 +450,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())
|
||||
|
@ -458,17 +458,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
|
||||
|
@ -512,7 +512,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);
|
||||
}
|
||||
|
@ -803,7 +803,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);
|
||||
|
||||
MWWorld::LiveCellRef<ESM::Creature> *ref = ptr.get<ESM::Creature>();
|
||||
|
||||
|
@ -862,7 +862,7 @@ namespace MWClass
|
|||
// Reset to original position
|
||||
ptr.getRefData().setPosition(ptr.getCellRef().getPosition());
|
||||
|
||||
ptr.getRefData().setCustomData(NULL);
|
||||
ptr.getRefData().setCustomData(nullptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ namespace MWClass
|
|||
|
||||
virtual void setActorHealth(const MWWorld::Ptr& ptr, float health, const MWWorld::Ptr& attacker) 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
|
||||
|
||||
|
|
|
@ -47,7 +47,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);
|
||||
}
|
||||
|
@ -91,7 +91,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;
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ namespace MWClass
|
|||
{
|
||||
MWWorld::LiveCellRef<ESM::Door> *ref =
|
||||
ptr.get<ESM::Door>();
|
||||
assert(ref->mBase != NULL);
|
||||
assert(ref->mBase != nullptr);
|
||||
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
|
@ -95,7 +95,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>();
|
||||
|
@ -139,14 +139,14 @@ namespace MWClass
|
|||
if(!ptr.getCellRef().getTrap().empty())
|
||||
{
|
||||
// Trap activation
|
||||
boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionTrap(actor, ptr.getCellRef().getTrap(), ptr));
|
||||
std::shared_ptr<MWWorld::Action> action(new MWWorld::ActionTrap(actor, ptr.getCellRef().getTrap(), ptr));
|
||||
action->setSound(trapActivationSound);
|
||||
return action;
|
||||
}
|
||||
|
||||
if (ptr.getCellRef().getTeleport())
|
||||
{
|
||||
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);
|
||||
|
||||
|
@ -155,7 +155,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;
|
||||
if (doorstate == 1)
|
||||
|
@ -188,7 +188,7 @@ namespace MWClass
|
|||
else
|
||||
{
|
||||
// locked, and we can't open.
|
||||
boost::shared_ptr<MWWorld::Action> action(new MWWorld::FailedAction);
|
||||
std::shared_ptr<MWWorld::Action> action(new MWWorld::FailedAction);
|
||||
action->setSound(lockedSound);
|
||||
return action;
|
||||
}
|
||||
|
@ -217,7 +217,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);
|
||||
}
|
||||
|
@ -307,7 +307,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());
|
||||
|
|
|
@ -28,7 +28,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
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ namespace MWClass
|
|||
{
|
||||
MWWorld::LiveCellRef<ESM::Ingredient> *ref =
|
||||
ptr.get<ESM::Ingredient>();
|
||||
assert(ref->mBase != NULL);
|
||||
assert(ref->mBase != nullptr);
|
||||
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
|
@ -65,7 +65,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);
|
||||
|
@ -88,9 +88,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");
|
||||
|
||||
|
@ -99,7 +99,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);
|
||||
}
|
||||
|
|
|
@ -24,7 +24,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
|
||||
|
||||
|
@ -40,7 +40,7 @@ namespace MWClass
|
|||
virtual int getValue (const MWWorld::Ptr& 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
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ namespace MWClass
|
|||
|
||||
void ItemLevList::registerSelf()
|
||||
{
|
||||
boost::shared_ptr<Class> instance (new ItemLevList);
|
||||
std::shared_ptr<Class> instance (new ItemLevList);
|
||||
|
||||
registerClass (typeid (ESM::ItemLevList).name(), instance);
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ namespace MWClass
|
|||
{
|
||||
MWWorld::LiveCellRef<ESM::Light> *ref =
|
||||
ptr.get<ESM::Light>();
|
||||
assert (ref->mBase != NULL);
|
||||
assert (ref->mBase != nullptr);
|
||||
|
||||
// TODO: add option somewhere to enable collision for placeable objects
|
||||
if (!model.empty() && (ref->mBase->mData.mFlags & ESM::Light::Carry) == 0)
|
||||
|
@ -63,7 +63,7 @@ namespace MWClass
|
|||
{
|
||||
MWWorld::LiveCellRef<ESM::Light> *ref =
|
||||
ptr.get<ESM::Light>();
|
||||
assert (ref->mBase != NULL);
|
||||
assert (ref->mBase != nullptr);
|
||||
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
|
@ -83,15 +83,15 @@ namespace MWClass
|
|||
return ref->mBase->mName;
|
||||
}
|
||||
|
||||
boost::shared_ptr<MWWorld::Action> Light::activate (const MWWorld::Ptr& ptr,
|
||||
std::shared_ptr<MWWorld::Action> Light::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());
|
||||
|
||||
MWWorld::LiveCellRef<ESM::Light> *ref = ptr.get<ESM::Light>();
|
||||
if(!(ref->mBase->mData.mFlags&ESM::Light::Carry))
|
||||
return boost::shared_ptr<MWWorld::Action>(new MWWorld::FailedAction());
|
||||
return std::shared_ptr<MWWorld::Action>(new MWWorld::FailedAction());
|
||||
|
||||
return defaultItemActivate(ptr, actor);
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ namespace MWClass
|
|||
|
||||
void Light::registerSelf()
|
||||
{
|
||||
boost::shared_ptr<Class> instance (new Light);
|
||||
std::shared_ptr<Class> instance (new Light);
|
||||
|
||||
registerClass (typeid (ESM::Light).name(), instance);
|
||||
}
|
||||
|
@ -186,9 +186,9 @@ namespace MWClass
|
|||
return info;
|
||||
}
|
||||
|
||||
boost::shared_ptr<MWWorld::Action> Light::use (const MWWorld::Ptr& ptr) const
|
||||
std::shared_ptr<MWWorld::Action> Light::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));
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace MWClass
|
|||
virtual MWGui::ToolTipInfo getToolTipInfo (const MWWorld::Ptr& ptr) const;
|
||||
///< @return the content of the tool tip to be displayed. raises exception if the object has no tooltip.
|
||||
|
||||
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
|
||||
|
||||
|
@ -55,7 +55,7 @@ namespace MWClass
|
|||
virtual std::string getInventoryIcon (const MWWorld::Ptr& 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
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue