purge all instances of <boost/shared_ptr.hpp>, clean up unused headers

pull/228/head
Bret Curtis 7 years ago
parent 07f75e1104
commit d785344fad

@ -1,9 +1,9 @@
#ifndef GAME_MWBASE_SOUNDMANAGER_H #ifndef GAME_MWBASE_SOUNDMANAGER_H
#define GAME_MWBASE_SOUNDMANAGER_H #define GAME_MWBASE_SOUNDMANAGER_H
#include <memory>
#include <string> #include <string>
#include <set> #include <set>
#include <boost/shared_ptr.hpp>
#include "../mwworld/ptr.hpp" #include "../mwworld/ptr.hpp"

@ -73,7 +73,7 @@ namespace MWClass
void Activator::registerSelf() void Activator::registerSelf()
{ {
boost::shared_ptr<Class> instance (new Activator); std::shared_ptr<Class> instance (new Activator);
registerClass (typeid (ESM::Activator).name(), instance); registerClass (typeid (ESM::Activator).name(), instance);
} }
@ -107,19 +107,19 @@ namespace MWClass
return info; 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()) if(actor.getClass().isNpc() && actor.getClass().getNpcStats(actor).isWerewolf())
{ {
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
const ESM::Sound *sound = store.get<ESM::Sound>().searchRandom("WolfActivator"); 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); if(sound) action->setSound(sound->mId);
return action; return action;
} }
return boost::shared_ptr<MWWorld::Action>(new MWWorld::NullAction); return std::shared_ptr<MWWorld::Action>(new MWWorld::NullAction);
} }

@ -33,7 +33,7 @@ namespace MWClass
virtual std::string getScript (const MWWorld::ConstPtr& ptr) const; virtual std::string getScript (const MWWorld::ConstPtr& ptr) const;
///< Return name of the script attached to ptr ///< 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 ///< Generate action for activation
static void registerSelf(); static void registerSelf();

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

@ -23,7 +23,7 @@ namespace MWClass
///< \return name (the one that is to be presented to the user; not the internal one); ///< \return name (the one that is to be presented to the user; not the internal one);
/// can return an empty string. /// 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; const MWWorld::Ptr& actor) const;
///< Generate action for activation ///< Generate action for activation
@ -50,7 +50,7 @@ namespace MWClass
virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const; virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;
///< Return name of inventory icon. ///< 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; const;
///< Generate action for using via inventory menu ///< Generate action for using via inventory menu

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

@ -22,7 +22,7 @@ namespace MWClass
///< \return name (the one that is to be presented to the user; not the internal one); ///< \return name (the one that is to be presented to the user; not the internal one);
/// can return an empty string. /// 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; const MWWorld::Ptr& actor) const;
///< Generate action for activation ///< Generate action for activation
@ -73,7 +73,7 @@ namespace MWClass
///< Return 0 if player cannot equip item. 1 if can equip. 2 if it's twohanded weapon. 3 if twohanded weapon conflicts with that. \n ///< 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 /// 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; const;
///< Generate action for using via inventory menu ///< Generate action for using via inventory menu

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

@ -54,7 +54,7 @@ namespace MWClass
return ref->mBase->mName; 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 const MWWorld::Ptr& actor) const
{ {
if(actor.getClass().isNpc() && actor.getClass().getNpcStats(actor).isWerewolf()) if(actor.getClass().isNpc() && actor.getClass().getNpcStats(actor).isWerewolf())
@ -62,13 +62,13 @@ namespace MWClass
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
const ESM::Sound *sound = store.get<ESM::Sound>().searchRandom("WolfItem"); 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); if(sound) action->setSound(sound->mId);
return action; return action;
} }
return boost::shared_ptr<MWWorld::Action>(new MWWorld::ActionRead(ptr)); return std::shared_ptr<MWWorld::Action>(new MWWorld::ActionRead(ptr));
} }
std::string Book::getScript (const MWWorld::ConstPtr& ptr) const std::string Book::getScript (const MWWorld::ConstPtr& ptr) const
@ -87,7 +87,7 @@ namespace MWClass
void Book::registerSelf() void Book::registerSelf()
{ {
boost::shared_ptr<Class> instance (new Book); std::shared_ptr<Class> instance (new Book);
registerClass (typeid (ESM::Book).name(), instance); registerClass (typeid (ESM::Book).name(), instance);
} }
@ -162,9 +162,9 @@ namespace MWClass
return record->mId; return record->mId;
} }
boost::shared_ptr<MWWorld::Action> Book::use (const MWWorld::Ptr& ptr) const std::shared_ptr<MWWorld::Action> Book::use (const MWWorld::Ptr& ptr) const
{ {
return boost::shared_ptr<MWWorld::Action>(new MWWorld::ActionRead(ptr)); return std::shared_ptr<MWWorld::Action>(new MWWorld::ActionRead(ptr));
} }
MWWorld::Ptr Book::copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const MWWorld::Ptr Book::copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const

@ -20,7 +20,7 @@ namespace MWClass
///< \return name (the one that is to be presented to the user; not the internal one); ///< \return name (the one that is to be presented to the user; not the internal one);
/// can return an empty string. /// 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; const MWWorld::Ptr& actor) const;
///< Generate action for activation ///< Generate action for activation
@ -53,7 +53,7 @@ namespace MWClass
virtual std::string applyEnchantment(const MWWorld::ConstPtr &ptr, const std::string& enchId, int enchCharge, const std::string& newName) const; virtual std::string applyEnchantment(const MWWorld::ConstPtr &ptr, const std::string& enchId, int enchCharge, const std::string& newName) const;
///< Creates a new record using \a ptr as template, with the given name and the given enchantment applied to it. ///< 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 ///< Generate action for using via inventory menu
virtual std::string getModel(const MWWorld::ConstPtr &ptr) const; virtual std::string getModel(const MWWorld::ConstPtr &ptr) const;

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

@ -20,7 +20,7 @@ namespace MWClass
///< \return name (the one that is to be presented to the user; not the internal one); ///< \return name (the one that is to be presented to the user; not the internal one);
/// can return an empty string. /// 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; const MWWorld::Ptr& actor) const;
///< Generate action for activation ///< Generate action for activation
@ -65,7 +65,7 @@ namespace MWClass
///< Return 0 if player cannot equip item. 1 if can equip. 2 if it's twohanded weapon. 3 if twohanded weapon conflicts with that. ///< 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 /// 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; const;
///< Generate action for using via inventory menu ///< Generate action for using via inventory menu

@ -118,18 +118,18 @@ namespace MWClass
return true; return true;
} }
boost::shared_ptr<MWWorld::Action> Container::activate (const MWWorld::Ptr& ptr, std::shared_ptr<MWWorld::Action> Container::activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor) const const MWWorld::Ptr& actor) const
{ {
if (!MWBase::Environment::get().getWindowManager()->isAllowed(MWGui::GW_Inventory)) 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()) if(actor.getClass().isNpc() && actor.getClass().getNpcStats(actor).isWerewolf())
{ {
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
const ESM::Sound *sound = store.get<ESM::Sound>().searchRandom("WolfContainer"); 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); if(sound) action->setSound(sound->mId);
return action; return action;
@ -181,20 +181,20 @@ namespace MWClass
{ {
if(!isTrapped) if(!isTrapped)
{ {
boost::shared_ptr<MWWorld::Action> action (new MWWorld::ActionOpen(ptr)); std::shared_ptr<MWWorld::Action> action (new MWWorld::ActionOpen(ptr));
return action; return action;
} }
else else
{ {
// Activate trap // Activate trap
boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionTrap(ptr.getCellRef().getTrap(), ptr)); std::shared_ptr<MWWorld::Action> action(new MWWorld::ActionTrap(ptr.getCellRef().getTrap(), ptr));
action->setSound(trapActivationSound); action->setSound(trapActivationSound);
return action; return action;
} }
} }
else else
{ {
boost::shared_ptr<MWWorld::Action> action(new MWWorld::FailedAction(std::string(), ptr)); std::shared_ptr<MWWorld::Action> action(new MWWorld::FailedAction(std::string(), ptr));
action->setSound(lockedSound); action->setSound(lockedSound);
return action; return action;
} }
@ -224,7 +224,7 @@ namespace MWClass
void Container::registerSelf() void Container::registerSelf()
{ {
boost::shared_ptr<Class> instance (new Container); std::shared_ptr<Class> instance (new Container);
registerClass (typeid (ESM::Container).name(), instance); registerClass (typeid (ESM::Container).name(), instance);
} }

@ -23,7 +23,7 @@ namespace MWClass
///< \return name (the one that is to be presented to the user; not the internal one); ///< \return name (the one that is to be presented to the user; not the internal one);
/// can return an empty string. /// 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; const MWWorld::Ptr& actor) const;
///< Generate action for activation ///< Generate action for activation

@ -434,7 +434,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 const MWWorld::Ptr& actor) const
{ {
if(actor.getClass().isNpc() && actor.getClass().getNpcStats(actor).isWerewolf()) if(actor.getClass().isNpc() && actor.getClass().getNpcStats(actor).isWerewolf())
@ -442,17 +442,17 @@ namespace MWClass
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
const ESM::Sound *sound = store.get<ESM::Sound>().searchRandom("WolfCreature"); 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); if(sound) action->setSound(sound->mId);
return action; return action;
} }
if(getCreatureStats(ptr).isDead()) 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()) if(ptr.getClass().getCreatureStats(ptr).getAiSequence().isInCombat())
return boost::shared_ptr<MWWorld::Action>(new MWWorld::FailedAction("")); return std::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::ActionTalk(ptr));
} }
MWWorld::ContainerStore& Creature::getContainerStore (const MWWorld::Ptr& ptr) const MWWorld::ContainerStore& Creature::getContainerStore (const MWWorld::Ptr& ptr) const
@ -489,7 +489,7 @@ namespace MWClass
void Creature::registerSelf() void Creature::registerSelf()
{ {
boost::shared_ptr<Class> instance (new Creature); std::shared_ptr<Class> instance (new Creature);
registerClass (typeid (ESM::Creature).name(), instance); registerClass (typeid (ESM::Creature).name(), instance);
} }

@ -60,7 +60,7 @@ namespace MWClass
virtual void onHit(const MWWorld::Ptr &ptr, float damage, bool ishealth, const MWWorld::Ptr &object, const MWWorld::Ptr &attacker, const osg::Vec3f &hitPosition, bool successful) const; virtual void onHit(const MWWorld::Ptr &ptr, float damage, bool ishealth, const MWWorld::Ptr &object, const MWWorld::Ptr &attacker, const osg::Vec3f &hitPosition, bool successful) const;
virtual boost::shared_ptr<MWWorld::Action> activate (const MWWorld::Ptr& ptr, virtual std::shared_ptr<MWWorld::Action> activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor) const; const MWWorld::Ptr& actor) const;
///< Generate action for activation ///< Generate action for activation

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

@ -99,7 +99,7 @@ namespace MWClass
return ref->mBase->mName; 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 const MWWorld::Ptr& actor) const
{ {
MWWorld::LiveCellRef<ESM::Door> *ref = ptr.get<ESM::Door>(); MWWorld::LiveCellRef<ESM::Door> *ref = ptr.get<ESM::Door>();
@ -166,7 +166,7 @@ namespace MWClass
if(isTrapped) if(isTrapped)
{ {
// Trap activation // Trap activation
boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionTrap(ptr.getCellRef().getTrap(), ptr)); std::shared_ptr<MWWorld::Action> action(new MWWorld::ActionTrap(ptr.getCellRef().getTrap(), ptr));
action->setSound(trapActivationSound); action->setSound(trapActivationSound);
return action; return action;
} }
@ -176,12 +176,12 @@ namespace MWClass
if (actor == MWMechanics::getPlayer() && MWBase::Environment::get().getWorld()->getDistanceToFacedObject() > MWBase::Environment::get().getWorld()->getMaxActivationDistance()) if (actor == MWMechanics::getPlayer() && MWBase::Environment::get().getWorld()->getDistanceToFacedObject() > MWBase::Environment::get().getWorld()->getMaxActivationDistance())
{ {
// player activated teleport door with telekinesis // player activated teleport door with telekinesis
boost::shared_ptr<MWWorld::Action> action(new MWWorld::FailedAction); std::shared_ptr<MWWorld::Action> action(new MWWorld::FailedAction);
return action; return action;
} }
else else
{ {
boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionTeleport (ptr.getCellRef().getDestCell(), ptr.getCellRef().getDoorDest(), true)); std::shared_ptr<MWWorld::Action> action(new MWWorld::ActionTeleport (ptr.getCellRef().getDestCell(), ptr.getCellRef().getDoorDest(), true));
action->setSound(openSound); action->setSound(openSound);
return action; return action;
} }
@ -189,7 +189,7 @@ namespace MWClass
else else
{ {
// animated door // 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); int doorstate = getDoorState(ptr);
bool opening = true; bool opening = true;
float doorRot = ptr.getRefData().getPosition().rot[2] - ptr.getCellRef().getPosition().rot[2]; float doorRot = ptr.getRefData().getPosition().rot[2] - ptr.getCellRef().getPosition().rot[2];
@ -223,7 +223,7 @@ namespace MWClass
else else
{ {
// locked, and we can't open. // locked, and we can't open.
boost::shared_ptr<MWWorld::Action> action(new MWWorld::FailedAction(std::string(), ptr)); std::shared_ptr<MWWorld::Action> action(new MWWorld::FailedAction(std::string(), ptr));
action->setSound(lockedSound); action->setSound(lockedSound);
return action; return action;
} }
@ -264,7 +264,7 @@ namespace MWClass
void Door::registerSelf() void Door::registerSelf()
{ {
boost::shared_ptr<Class> instance (new Door); std::shared_ptr<Class> instance (new Door);
registerClass (typeid (ESM::Door).name(), instance); registerClass (typeid (ESM::Door).name(), instance);
} }

@ -26,7 +26,7 @@ namespace MWClass
///< \return name (the one that is to be presented to the user; not the internal one); ///< \return name (the one that is to be presented to the user; not the internal one);
/// can return an empty string. /// 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; const MWWorld::Ptr& actor) const;
///< Generate action for activation ///< Generate action for activation

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

@ -20,7 +20,7 @@ namespace MWClass
///< \return name (the one that is to be presented to the user; not the internal one); ///< \return name (the one that is to be presented to the user; not the internal one);
/// can return an empty string. /// 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; const MWWorld::Ptr& actor) const;
///< Generate action for activation ///< Generate action for activation
@ -36,7 +36,7 @@ namespace MWClass
virtual int getValue (const MWWorld::ConstPtr& ptr) const; virtual int getValue (const MWWorld::ConstPtr& ptr) const;
///< Return trade value of the object. Throws an exception, if the object can't be traded. ///< 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; const;
///< Generate action for using via inventory menu ///< Generate action for using via inventory menu

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

@ -79,15 +79,15 @@ namespace MWClass
return ref->mBase->mName; 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 const MWWorld::Ptr& actor) const
{ {
if(!MWBase::Environment::get().getWindowManager()->isAllowed(MWGui::GW_Inventory)) 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>(); MWWorld::LiveCellRef<ESM::Light> *ref = ptr.get<ESM::Light>();
if(!(ref->mBase->mData.mFlags&ESM::Light::Carry)) 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); return defaultItemActivate(ptr, actor);
} }
@ -120,7 +120,7 @@ namespace MWClass
void Light::registerSelf() void Light::registerSelf()
{ {
boost::shared_ptr<Class> instance (new Light); std::shared_ptr<Class> instance (new Light);
registerClass (typeid (ESM::Light).name(), instance); registerClass (typeid (ESM::Light).name(), instance);
} }
@ -186,9 +186,9 @@ namespace MWClass
return Class::showsInInventory(ptr); return Class::showsInInventory(ptr);
} }
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)); action->setSound(getUpSoundId(ptr));

@ -30,7 +30,7 @@ namespace MWClass
virtual bool showsInInventory (const MWWorld::ConstPtr& ptr) const; virtual bool showsInInventory (const MWWorld::ConstPtr& ptr) 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; const MWWorld::Ptr& actor) const;
///< Generate action for activation ///< Generate action for activation
@ -55,7 +55,7 @@ namespace MWClass
virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const; virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;
///< Return name of inventory icon. ///< 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; const;
///< Generate action for using via inventory menu ///< Generate action for using via inventory menu

@ -52,7 +52,7 @@ namespace MWClass
return ref->mBase->mName; return ref->mBase->mName;
} }
boost::shared_ptr<MWWorld::Action> Lockpick::activate (const MWWorld::Ptr& ptr, std::shared_ptr<MWWorld::Action> Lockpick::activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor) const const MWWorld::Ptr& actor) const
{ {
return defaultItemActivate(ptr, actor); return defaultItemActivate(ptr, actor);
@ -83,7 +83,7 @@ namespace MWClass
void Lockpick::registerSelf() void Lockpick::registerSelf()
{ {
boost::shared_ptr<Class> instance (new Lockpick); std::shared_ptr<Class> instance (new Lockpick);
registerClass (typeid (ESM::Lockpick).name(), instance); registerClass (typeid (ESM::Lockpick).name(), instance);
} }
@ -139,9 +139,9 @@ namespace MWClass
return info; return info;
} }
boost::shared_ptr<MWWorld::Action> Lockpick::use (const MWWorld::Ptr& ptr) const std::shared_ptr<MWWorld::Action> Lockpick::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)); action->setSound(getUpSoundId(ptr));

@ -20,7 +20,7 @@ namespace MWClass
///< \return name (the one that is to be presented to the user; not the internal one); ///< \return name (the one that is to be presented to the user; not the internal one);
/// can return an empty string. /// 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; const MWWorld::Ptr& actor) const;
///< Generate action for activation ///< Generate action for activation
@ -51,7 +51,7 @@ namespace MWClass
virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const; virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;
///< Return name of inventory icon. ///< 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; const;
///< Generate action for using via inventory menu ///< Generate action for using via inventory menu

@ -65,7 +65,7 @@ namespace MWClass
return ref->mBase->mName; return ref->mBase->mName;
} }
boost::shared_ptr<MWWorld::Action> Miscellaneous::activate (const MWWorld::Ptr& ptr, std::shared_ptr<MWWorld::Action> Miscellaneous::activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor) const const MWWorld::Ptr& actor) const
{ {
return defaultItemActivate(ptr, actor); return defaultItemActivate(ptr, actor);
@ -97,7 +97,7 @@ namespace MWClass
void Miscellaneous::registerSelf() void Miscellaneous::registerSelf()
{ {
boost::shared_ptr<Class> instance (new Miscellaneous); std::shared_ptr<Class> instance (new Miscellaneous);
registerClass (typeid (ESM::Miscellaneous).name(), instance); registerClass (typeid (ESM::Miscellaneous).name(), instance);
} }
@ -213,12 +213,12 @@ namespace MWClass
return newPtr; return newPtr;
} }
boost::shared_ptr<MWWorld::Action> Miscellaneous::use (const MWWorld::Ptr& ptr) const std::shared_ptr<MWWorld::Action> Miscellaneous::use (const MWWorld::Ptr& ptr) const
{ {
if (ptr.getCellRef().getSoul().empty()) if (ptr.getCellRef().getSoul().empty())
return boost::shared_ptr<MWWorld::Action>(new MWWorld::NullAction()); return std::shared_ptr<MWWorld::Action>(new MWWorld::NullAction());
else else
return boost::shared_ptr<MWWorld::Action>(new MWWorld::ActionSoulgem(ptr)); return std::shared_ptr<MWWorld::Action>(new MWWorld::ActionSoulgem(ptr));
} }
bool Miscellaneous::canSell (const MWWorld::ConstPtr& item, int npcServices) const bool Miscellaneous::canSell (const MWWorld::ConstPtr& item, int npcServices) const

@ -20,7 +20,7 @@ namespace MWClass
///< \return name (the one that is to be presented to the user; not the internal one); ///< \return name (the one that is to be presented to the user; not the internal one);
/// can return an empty string. /// 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; const MWWorld::Ptr& actor) const;
///< Generate action for activation ///< Generate action for activation
@ -49,7 +49,7 @@ namespace MWClass
virtual std::string getModel(const MWWorld::ConstPtr &ptr) const; virtual std::string getModel(const MWWorld::ConstPtr &ptr) const;
virtual boost::shared_ptr<MWWorld::Action> use (const MWWorld::Ptr& ptr) virtual std::shared_ptr<MWWorld::Action> use (const MWWorld::Ptr& ptr)
const; const;
///< Generate action for using via inventory menu ///< Generate action for using via inventory menu

@ -844,12 +844,12 @@ namespace MWClass
} }
} }
boost::shared_ptr<MWWorld::Action> Npc::activate (const MWWorld::Ptr& ptr, std::shared_ptr<MWWorld::Action> Npc::activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor) const const MWWorld::Ptr& actor) const
{ {
// player got activated by another NPC // player got activated by another NPC
if(ptr == MWMechanics::getPlayer()) if(ptr == MWMechanics::getPlayer())
return boost::shared_ptr<MWWorld::Action>(new MWWorld::ActionTalk(actor)); return std::shared_ptr<MWWorld::Action>(new MWWorld::ActionTalk(actor));
// Werewolfs can't activate NPCs // Werewolfs can't activate NPCs
if(actor.getClass().isNpc() && actor.getClass().getNpcStats(actor).isWerewolf()) if(actor.getClass().isNpc() && actor.getClass().getNpcStats(actor).isWerewolf())
@ -857,23 +857,23 @@ namespace MWClass
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
const ESM::Sound *sound = store.get<ESM::Sound>().searchRandom("WolfNPC"); const ESM::Sound *sound = store.get<ESM::Sound>().searchRandom("WolfNPC");
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); if(sound) action->setSound(sound->mId);
return action; return action;
} }
if(getCreatureStats(ptr).isDead()) 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()) if(ptr.getClass().getCreatureStats(ptr).getAiSequence().isInCombat())
return boost::shared_ptr<MWWorld::Action>(new MWWorld::FailedAction("#{sActorInCombat}")); return std::shared_ptr<MWWorld::Action>(new MWWorld::FailedAction("#{sActorInCombat}"));
if(getCreatureStats(actor).getStance(MWMechanics::CreatureStats::Stance_Sneak) if(getCreatureStats(actor).getStance(MWMechanics::CreatureStats::Stance_Sneak)
|| ptr.getClass().getCreatureStats(ptr).getKnockedDown()) || ptr.getClass().getCreatureStats(ptr).getKnockedDown())
return boost::shared_ptr<MWWorld::Action>(new MWWorld::ActionOpen(ptr)); // stealing return std::shared_ptr<MWWorld::Action>(new MWWorld::ActionOpen(ptr)); // stealing
// Can't talk to werewolfs // Can't talk to werewolfs
if(ptr.getClass().isNpc() && ptr.getClass().getNpcStats(ptr).isWerewolf()) if(ptr.getClass().isNpc() && ptr.getClass().getNpcStats(ptr).isWerewolf())
return boost::shared_ptr<MWWorld::Action> (new MWWorld::FailedAction("")); return std::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::ActionTalk(ptr));
} }
MWWorld::ContainerStore& Npc::getContainerStore (const MWWorld::Ptr& ptr) MWWorld::ContainerStore& Npc::getContainerStore (const MWWorld::Ptr& ptr)
@ -1009,7 +1009,7 @@ namespace MWClass
void Npc::registerSelf() void Npc::registerSelf()
{ {
boost::shared_ptr<Class> instance (new Npc); std::shared_ptr<Class> instance (new Npc);
registerClass (typeid (ESM::NPC).name(), instance); registerClass (typeid (ESM::NPC).name(), instance);
} }

@ -78,7 +78,7 @@ namespace MWClass
virtual void getModelsToPreload(const MWWorld::Ptr& ptr, std::vector<std::string>& models) const; virtual void getModelsToPreload(const MWWorld::Ptr& ptr, std::vector<std::string>& models) const;
///< Get a list of models to preload that this object may use (directly or indirectly). default implementation: list getModel(). ///< Get a list of models to preload that this object may use (directly or indirectly). default implementation: list getModel().
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; const MWWorld::Ptr& actor) const;
///< Generate action for activation ///< Generate action for activation

@ -55,7 +55,7 @@ namespace MWClass
return ref->mBase->mName; return ref->mBase->mName;
} }
boost::shared_ptr<MWWorld::Action> Potion::activate (const MWWorld::Ptr& ptr, std::shared_ptr<MWWorld::Action> Potion::activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor) const const MWWorld::Ptr& actor) const
{ {
return defaultItemActivate(ptr, actor); return defaultItemActivate(ptr, actor);
@ -78,7 +78,7 @@ namespace MWClass
void Potion::registerSelf() void Potion::registerSelf()
{ {
boost::shared_ptr<Class> instance (new Potion); std::shared_ptr<Class> instance (new Potion);
registerClass (typeid (ESM::Potion).name(), instance); registerClass (typeid (ESM::Potion).name(), instance);
} }
@ -139,12 +139,12 @@ namespace MWClass
return info; return info;
} }
boost::shared_ptr<MWWorld::Action> Potion::use (const MWWorld::Ptr& ptr) const std::shared_ptr<MWWorld::Action> Potion::use (const MWWorld::Ptr& ptr) const
{ {
MWWorld::LiveCellRef<ESM::Potion> *ref = MWWorld::LiveCellRef<ESM::Potion> *ref =
ptr.get<ESM::Potion>(); ptr.get<ESM::Potion>();
boost::shared_ptr<MWWorld::Action> action ( std::shared_ptr<MWWorld::Action> action (
new MWWorld::ActionApply (ptr, ref->mBase->mId)); new MWWorld::ActionApply (ptr, ref->mBase->mId));
action->setSound ("Drink"); action->setSound ("Drink");

@ -20,7 +20,7 @@ namespace MWClass
///< \return name (the one that is to be presented to the user; not the internal one); ///< \return name (the one that is to be presented to the user; not the internal one);
/// can return an empty string. /// 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; const MWWorld::Ptr& actor) const;
///< Generate action for activation ///< Generate action for activation
@ -36,7 +36,7 @@ namespace MWClass
virtual int getValue (const MWWorld::ConstPtr& ptr) const; virtual int getValue (const MWWorld::ConstPtr& ptr) const;
///< Return trade value of the object. Throws an exception, if the object can't be traded. ///< 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) const; virtual std::shared_ptr<MWWorld::Action> use (const MWWorld::Ptr& ptr) const;
///< Generate action for using via inventory menu ///< Generate action for using via inventory menu
static void registerSelf(); static void registerSelf();

@ -51,7 +51,7 @@ namespace MWClass
return ref->mBase->mName; return ref->mBase->mName;
} }
boost::shared_ptr<MWWorld::Action> Probe::activate (const MWWorld::Ptr& ptr, std::shared_ptr<MWWorld::Action> Probe::activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor) const const MWWorld::Ptr& actor) const
{ {
return defaultItemActivate(ptr, actor); return defaultItemActivate(ptr, actor);
@ -83,7 +83,7 @@ namespace MWClass
void Probe::registerSelf() void Probe::registerSelf()
{ {
boost::shared_ptr<Class> instance (new Probe); std::shared_ptr<Class> instance (new Probe);
registerClass (typeid (ESM::Probe).name(), instance); registerClass (typeid (ESM::Probe).name(), instance);
} }
@ -139,9 +139,9 @@ namespace MWClass
return info; return info;
} }
boost::shared_ptr<MWWorld::Action> Probe::use (const MWWorld::Ptr& ptr) const std::shared_ptr<MWWorld::Action> Probe::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)); action->setSound(getUpSoundId(ptr));

@ -20,7 +20,7 @@ namespace MWClass
///< \return name (the one that is to be presented to the user; not the internal one); ///< \return name (the one that is to be presented to the user; not the internal one);
/// can return an empty string. /// 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; const MWWorld::Ptr& actor) const;
///< Generate action for activation ///< Generate action for activation
@ -51,7 +51,7 @@ namespace MWClass
virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const; virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;
///< Return name of inventory icon. ///< 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; const;
///< Generate action for using via inventory menu ///< Generate action for using via inventory menu

@ -51,7 +51,7 @@ namespace MWClass
return ref->mBase->mName; return ref->mBase->mName;
} }
boost::shared_ptr<MWWorld::Action> Repair::activate (const MWWorld::Ptr& ptr, std::shared_ptr<MWWorld::Action> Repair::activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor) const const MWWorld::Ptr& actor) const
{ {
return defaultItemActivate(ptr, actor); return defaultItemActivate(ptr, actor);
@ -74,7 +74,7 @@ namespace MWClass
void Repair::registerSelf() void Repair::registerSelf()
{ {
boost::shared_ptr<Class> instance (new Repair); std::shared_ptr<Class> instance (new Repair);
registerClass (typeid (ESM::Repair).name(), instance); registerClass (typeid (ESM::Repair).name(), instance);
} }
@ -149,9 +149,9 @@ namespace MWClass
return MWWorld::Ptr(cell.insert(ref), &cell); return MWWorld::Ptr(cell.insert(ref), &cell);
} }
boost::shared_ptr<MWWorld::Action> Repair::use (const MWWorld::Ptr& ptr) const std::shared_ptr<MWWorld::Action> Repair::use (const MWWorld::Ptr& ptr) const
{ {
return boost::shared_ptr<MWWorld::Action>(new MWWorld::ActionRepair(ptr)); return std::shared_ptr<MWWorld::Action>(new MWWorld::ActionRepair(ptr));
} }
bool Repair::canSell (const MWWorld::ConstPtr& item, int npcServices) const bool Repair::canSell (const MWWorld::ConstPtr& item, int npcServices) const

@ -20,7 +20,7 @@ namespace MWClass
///< \return name (the one that is to be presented to the user; not the internal one); ///< \return name (the one that is to be presented to the user; not the internal one);
/// can return an empty string. /// 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; const MWWorld::Ptr& actor) const;
///< Generate action for activation ///< Generate action for activation
@ -49,7 +49,7 @@ namespace MWClass
virtual std::string getModel(const MWWorld::ConstPtr &ptr) const; virtual std::string getModel(const MWWorld::ConstPtr &ptr) const;
virtual boost::shared_ptr<MWWorld::Action> use (const MWWorld::Ptr& ptr) virtual std::shared_ptr<MWWorld::Action> use (const MWWorld::Ptr& ptr)
const; const;
///< Generate action for using via inventory menu (default implementation: return a ///< Generate action for using via inventory menu (default implementation: return a
/// null action). /// null action).

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

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

@ -21,7 +21,7 @@ namespace MWClass
///< \return name (the one that is to be presented to the user; not the internal one); ///< \return name (the one that is to be presented to the user; not the internal one);
/// can return an empty string. /// 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; const MWWorld::Ptr& actor) const;
///< Generate action for activation ///< Generate action for activation
@ -72,7 +72,7 @@ namespace MWClass
///< Return 0 if player cannot equip item. 1 if can equip. 2 if it's twohanded weapon. 3 if twohanded weapon conflicts with that. ///< 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 /// 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; const;
///< Generate action for using via inventory menu ///< Generate action for using via inventory menu

@ -8,7 +8,6 @@
#include <stdint.h> #include <stdint.h>
#include <boost/function.hpp> #include <boost/function.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/make_shared.hpp> #include <boost/make_shared.hpp>
#include <components/misc/utf8stream.hpp> #include <components/misc/utf8stream.hpp>
@ -235,7 +234,7 @@ struct TypesetBookImpl::Typesetter : BookTypesetter
}; };
typedef TypesetBookImpl Book; typedef TypesetBookImpl Book;
typedef boost::shared_ptr <Book> BookPtr; typedef std::shared_ptr <Book> BookPtr;
typedef std::vector<PartialText>::const_iterator PartialTextConstIterator; typedef std::vector<PartialText>::const_iterator PartialTextConstIterator;
int mPageWidth; int mPageWidth;
@ -259,7 +258,7 @@ struct TypesetBookImpl::Typesetter : BookTypesetter
mCurrentContent (NULL), mCurrentContent (NULL),
mCurrentAlignment (AlignLeft) mCurrentAlignment (AlignLeft)
{ {
mBook = boost::make_shared <Book> (); mBook = std::make_shared <Book> ();
} }
virtual ~Typesetter () virtual ~Typesetter ()
@ -628,7 +627,7 @@ struct TypesetBookImpl::Typesetter : BookTypesetter
BookTypesetter::Ptr BookTypesetter::create (int pageWidth, int pageHeight) BookTypesetter::Ptr BookTypesetter::create (int pageWidth, int pageHeight)
{ {
return boost::make_shared <TypesetBookImpl::Typesetter> (pageWidth, pageHeight); return std::make_shared <TypesetBookImpl::Typesetter> (pageWidth, pageHeight);
} }
namespace namespace
@ -900,7 +899,7 @@ public:
boost::function <void (intptr_t)> mLinkClicked; boost::function <void (intptr_t)> mLinkClicked;
boost::shared_ptr <TypesetBookImpl> mBook; std::shared_ptr <TypesetBookImpl> mBook;
MyGUI::ILayerNode* mNode; MyGUI::ILayerNode* mNode;
ActiveTextFormats mActiveTextFormats; ActiveTextFormats mActiveTextFormats;
@ -1034,7 +1033,7 @@ public:
void showPage (TypesetBook::Ptr book, size_t newPage) void showPage (TypesetBook::Ptr book, size_t newPage)
{ {
boost::shared_ptr <TypesetBookImpl> newBook = boost::dynamic_pointer_cast <TypesetBookImpl> (book); std::shared_ptr <TypesetBookImpl> newBook = std::dynamic_pointer_cast <TypesetBookImpl> (book);
if (mBook != newBook) if (mBook != newBook)
{ {
@ -1123,7 +1122,7 @@ public:
} }
}; };
void createActiveFormats (boost::shared_ptr <TypesetBookImpl> newBook) void createActiveFormats (std::shared_ptr <TypesetBookImpl> newBook)
{ {
newBook->visitRuns (0, 0x7FFFFFFF, CreateActiveFormat (this)); newBook->visitRuns (0, 0x7FFFFFFF, CreateActiveFormat (this));

@ -7,7 +7,6 @@
#include <functional> #include <functional>
#include <stdint.h> #include <stdint.h>
#include <boost/function.hpp> #include <boost/function.hpp>
#include <boost/shared_ptr.hpp>
namespace MWGui namespace MWGui
{ {
@ -15,7 +14,7 @@ namespace MWGui
/// the book page widget. /// the book page widget.
struct TypesetBook struct TypesetBook
{ {
typedef boost::shared_ptr <TypesetBook> Ptr; typedef std::shared_ptr <TypesetBook> Ptr;
typedef intptr_t InteractiveId; typedef intptr_t InteractiveId;
/// Returns the number of pages in the document. /// Returns the number of pages in the document.
@ -33,7 +32,7 @@ namespace MWGui
/// A factory class for creating a typeset book instance. /// A factory class for creating a typeset book instance.
struct BookTypesetter struct BookTypesetter
{ {
typedef boost::shared_ptr <BookTypesetter> Ptr; typedef std::shared_ptr <BookTypesetter> Ptr;
typedef TypesetBook::InteractiveId InteractiveId; typedef TypesetBook::InteractiveId InteractiveId;
typedef MyGUI::Colour Colour; typedef MyGUI::Colour Colour;
typedef uint8_t const * Utf8Point; typedef uint8_t const * Utf8Point;

@ -493,7 +493,7 @@ namespace MWGui
{ {
if (script.empty() || ptr.getRefData().getLocals().getIntVar(script, "pcskipequip") == 0) if (script.empty() || ptr.getRefData().getLocals().getIntVar(script, "pcskipequip") == 0)
{ {
boost::shared_ptr<MWWorld::Action> action = ptr.getClass().use(ptr); std::shared_ptr<MWWorld::Action> action = ptr.getClass().use(ptr);
action->execute (player); action->execute (player);
} }

@ -356,7 +356,7 @@ struct JournalViewModelImpl : JournalViewModel
JournalViewModel::Ptr JournalViewModel::create () JournalViewModel::Ptr JournalViewModel::create ()
{ {
return boost::make_shared <JournalViewModelImpl> (); return std::make_shared <JournalViewModelImpl> ();
} }
} }

@ -6,7 +6,6 @@
#include <functional> #include <functional>
#include <stdint.h> #include <stdint.h>
#include <boost/function.hpp> #include <boost/function.hpp>
#include <boost/shared_ptr.hpp>
namespace MWGui namespace MWGui
{ {
@ -18,7 +17,7 @@ namespace MWGui
/// game data store. /// game data store.
struct JournalViewModel struct JournalViewModel
{ {
typedef boost::shared_ptr <JournalViewModel> Ptr; typedef std::shared_ptr <JournalViewModel> Ptr;
typedef intptr_t QuestId; typedef intptr_t QuestId;
typedef intptr_t TopicId; typedef intptr_t TopicId;

@ -1,7 +1,7 @@
#ifndef MWGUI_JOURNAL_H #ifndef MWGUI_JOURNAL_H
#define MWGUI_JOURNAL_H #define MWGUI_JOURNAL_H
#include <boost/shared_ptr.hpp> #include <memory>
namespace MWBase { class WindowManager; } namespace MWBase { class WindowManager; }
@ -12,7 +12,7 @@ namespace MWGui
struct JournalWindow struct JournalWindow
{ {
/// construct a new instance of the one JournalWindow implementation /// construct a new instance of the one JournalWindow implementation
static JournalWindow * create (boost::shared_ptr <JournalViewModel> Model, bool questList); static JournalWindow * create (std::shared_ptr <JournalViewModel> Model, bool questList);
/// destroy this instance of the JournalWindow implementation /// destroy this instance of the JournalWindow implementation
virtual ~JournalWindow () {}; virtual ~JournalWindow () {};

@ -252,7 +252,7 @@ namespace MWGui
osg::ref_ptr<osg::Texture2D> tex = mLocalMapRender->getFogOfWarTexture(x, y); osg::ref_ptr<osg::Texture2D> tex = mLocalMapRender->getFogOfWarTexture(x, y);
if (tex) if (tex)
{ {
boost::shared_ptr<MyGUI::ITexture> myguitex (new osgMyGUI::OSGTexture(tex)); std::shared_ptr<MyGUI::ITexture> myguitex (new osgMyGUI::OSGTexture(tex));
fog->setRenderItemTexture(myguitex.get()); fog->setRenderItemTexture(myguitex.get());
fog->getSubWidgetMain()->_setUVSet(MyGUI::FloatRect(0.f, 1.f, 1.f, 0.f)); fog->getSubWidgetMain()->_setUVSet(MyGUI::FloatRect(0.f, 1.f, 1.f, 0.f));
fogTextures.push_back(myguitex); fogTextures.push_back(myguitex);
@ -382,7 +382,7 @@ namespace MWGui
osg::ref_ptr<osg::Texture2D> texture = mLocalMapRender->getMapTexture(mapX, mapY); osg::ref_ptr<osg::Texture2D> texture = mLocalMapRender->getMapTexture(mapX, mapY);
if (texture) if (texture)
{ {
boost::shared_ptr<MyGUI::ITexture> guiTex (new osgMyGUI::OSGTexture(texture)); std::shared_ptr<MyGUI::ITexture> guiTex (new osgMyGUI::OSGTexture(texture));
textures.push_back(guiTex); textures.push_back(guiTex);
box->setRenderItemTexture(guiTex.get()); box->setRenderItemTexture(guiTex.get());
box->getSubWidgetMain()->_setUVSet(MyGUI::FloatRect(0.f, 0.f, 1.f, 1.f)); box->getSubWidgetMain()->_setUVSet(MyGUI::FloatRect(0.f, 0.f, 1.f, 1.f));

@ -3,8 +3,6 @@
#include <stdint.h> #include <stdint.h>
#include <boost/shared_ptr.hpp>
#include "windowpinnablebase.hpp" #include "windowpinnablebase.hpp"
#include <components/esm/cellid.hpp> #include <components/esm/cellid.hpp>
@ -130,7 +128,7 @@ namespace MWGui
std::vector<MyGUI::ImageBox*> mMapWidgets; std::vector<MyGUI::ImageBox*> mMapWidgets;
std::vector<MyGUI::ImageBox*> mFogWidgets; std::vector<MyGUI::ImageBox*> mFogWidgets;
typedef std::vector<boost::shared_ptr<MyGUI::ITexture> > TextureVector; typedef std::vector<std::shared_ptr<MyGUI::ITexture> > TextureVector;
TextureVector mMapTextures; TextureVector mMapTextures;
TextureVector mFogTextures; TextureVector mFogTextures;

@ -3,8 +3,6 @@
#include <deque> #include <deque>
#include <boost/shared_ptr.hpp>
#include "windowbase.hpp" #include "windowbase.hpp"
namespace MWGui namespace MWGui
@ -14,7 +12,7 @@ namespace MWGui
class FadeOp class FadeOp
{ {
public: public:
typedef boost::shared_ptr<FadeOp> Ptr; typedef std::shared_ptr<FadeOp> Ptr;
FadeOp(ScreenFader * fader, float time, float targetAlpha); FadeOp(ScreenFader * fader, float time, float targetAlpha);

@ -143,7 +143,7 @@ namespace MWGui
if ((mFilter & Filter_OnlyUsableItems) && base.getClass().getScript(base).empty()) if ((mFilter & Filter_OnlyUsableItems) && base.getClass().getScript(base).empty())
{ {
boost::shared_ptr<MWWorld::Action> actionOnUse = base.getClass().use(base); std::shared_ptr<MWWorld::Action> actionOnUse = base.getClass().use(base);
if (!actionOnUse || actionOnUse->isNullAction()) if (!actionOnUse || actionOnUse->isNullAction())
return false; return false;
} }

@ -47,7 +47,7 @@ namespace MWMechanics
bool mCombatMove; bool mCombatMove;
osg::Vec3f mLastTargetPos; osg::Vec3f mLastTargetPos;
const MWWorld::CellStore* mCell; const MWWorld::CellStore* mCell;
boost::shared_ptr<Action> mCurrentAction; std::shared_ptr<Action> mCurrentAction;
float mActionCooldown; float mActionCooldown;
float mStrength; float mStrength;
bool mForceNoShortcut; bool mForceNoShortcut;
@ -249,7 +249,7 @@ namespace MWMechanics
actorClass.getCreatureStats(actor).setMovementFlag(CreatureStats::Flag_Run, true); actorClass.getCreatureStats(actor).setMovementFlag(CreatureStats::Flag_Run, true);
float& actionCooldown = storage.mActionCooldown; float& actionCooldown = storage.mActionCooldown;
boost::shared_ptr<Action>& currentAction = storage.mCurrentAction; std::shared_ptr<Action>& currentAction = storage.mCurrentAction;
if (!forceFlee) if (!forceFlee)
{ {
@ -512,7 +512,7 @@ namespace MWMechanics
targetWeapon = *weaponSlot; targetWeapon = *weaponSlot;
} }
boost::shared_ptr<Action> targetWeaponAction (new ActionWeapon(targetWeapon)); std::shared_ptr<Action> targetWeaponAction (new ActionWeapon(targetWeapon));
if (targetWeaponAction.get()) if (targetWeaponAction.get())
{ {

@ -3,8 +3,6 @@
#include "aipackage.hpp" #include "aipackage.hpp"
#include <boost/shared_ptr.hpp>
#include "../mwworld/cellstore.hpp" // for Doors #include "../mwworld/cellstore.hpp" // for Doors
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"

@ -709,14 +709,14 @@ namespace MWMechanics
return mWeapon.get<ESM::Weapon>()->mBase; return mWeapon.get<ESM::Weapon>()->mBase;
} }
boost::shared_ptr<Action> prepareNextAction(const MWWorld::Ptr &actor, const MWWorld::Ptr &enemy) std::shared_ptr<Action> prepareNextAction(const MWWorld::Ptr &actor, const MWWorld::Ptr &enemy)
{ {
Spells& spells = actor.getClass().getCreatureStats(actor).getSpells(); Spells& spells = actor.getClass().getCreatureStats(actor).getSpells();
float bestActionRating = 0.f; float bestActionRating = 0.f;
float antiFleeRating = 0.f; float antiFleeRating = 0.f;
// Default to hand-to-hand combat // Default to hand-to-hand combat
boost::shared_ptr<Action> bestAction (new ActionWeapon(MWWorld::Ptr())); std::shared_ptr<Action> bestAction (new ActionWeapon(MWWorld::Ptr()));
if (actor.getClass().isNpc() && actor.getClass().getNpcStats(actor).isWerewolf()) if (actor.getClass().isNpc() && actor.getClass().getNpcStats(actor).isWerewolf())
{ {
bestAction->prepare(actor); bestAction->prepare(actor);

@ -1,7 +1,7 @@
#ifndef OPENMW_AICOMBAT_ACTION_H #ifndef OPENMW_AICOMBAT_ACTION_H
#define OPENMW_AICOMBAT_ACTION_H #define OPENMW_AICOMBAT_ACTION_H
#include <boost/shared_ptr.hpp> #include <memory>
#include <components/esm/loadspel.hpp> #include <components/esm/loadspel.hpp>
@ -100,7 +100,7 @@ namespace MWMechanics
/// @note target may be empty /// @note target may be empty
float rateEffects (const ESM::EffectList& list, const MWWorld::Ptr& actor, const MWWorld::Ptr& enemy); float rateEffects (const ESM::EffectList& list, const MWWorld::Ptr& actor, const MWWorld::Ptr& enemy);
boost::shared_ptr<Action> prepareNextAction (const MWWorld::Ptr& actor, const MWWorld::Ptr& enemy); std::shared_ptr<Action> prepareNextAction (const MWWorld::Ptr& actor, const MWWorld::Ptr& enemy);
float getDistanceMinusHalfExtents(const MWWorld::Ptr& actor, const MWWorld::Ptr& enemy, bool minusZDist=false); float getDistanceMinusHalfExtents(const MWWorld::Ptr& actor, const MWWorld::Ptr& enemy, bool minusZDist=false);
float getMaxAttackDistance(const MWWorld::Ptr& actor); float getMaxAttackDistance(const MWWorld::Ptr& actor);

@ -199,7 +199,7 @@ namespace MWScript
MWBase::Environment::get().getWindowManager()->useItem(*it); MWBase::Environment::get().getWindowManager()->useItem(*it);
else else
{ {
boost::shared_ptr<MWWorld::Action> action = it->getClass().use(*it); std::shared_ptr<MWWorld::Action> action = it->getClass().use(*it);
// No equip sound for actors other than the player // No equip sound for actors other than the player
action->execute(ptr, true); action->execute(ptr, true);
} }

@ -478,7 +478,7 @@ namespace MWScript
void InterpreterContext::executeActivation(MWWorld::Ptr ptr, MWWorld::Ptr actor) void InterpreterContext::executeActivation(MWWorld::Ptr ptr, MWWorld::Ptr actor)
{ {
boost::shared_ptr<MWWorld::Action> action = (ptr.getClass().activate(ptr, actor)); std::shared_ptr<MWWorld::Action> action = (ptr.getClass().activate(ptr, actor));
action->execute (actor); action->execute (actor);
if (action->getTarget() != MWWorld::Ptr() && action->getTarget() != ptr) if (action->getTarget() != MWWorld::Ptr() && action->getTarget() != ptr)
{ {

@ -1,8 +1,6 @@
#ifndef GAME_SCRIPT_INTERPRETERCONTEXT_H #ifndef GAME_SCRIPT_INTERPRETERCONTEXT_H
#define GAME_SCRIPT_INTERPRETERCONTEXT_H #define GAME_SCRIPT_INTERPRETERCONTEXT_H
#include <boost/shared_ptr.hpp>
#include <components/interpreter/context.hpp> #include <components/interpreter/context.hpp>
#include "../mwworld/ptr.hpp" #include "../mwworld/ptr.hpp"

@ -7,8 +7,6 @@
#include <deque> #include <deque>
#include <map> #include <map>
#include <boost/shared_ptr.hpp>
#include <components/settings/settings.hpp> #include <components/settings/settings.hpp>
#include <components/fallback/fallback.hpp> #include <components/fallback/fallback.hpp>

@ -6,8 +6,7 @@
#include <string> #include <string>
#include <typeinfo> #include <typeinfo>
#include <map> #include <map>
#include <memory>
#include <boost/shared_ptr.hpp>
#include "livecellref.hpp" #include "livecellref.hpp"
#include "cellreflist.hpp" #include "cellreflist.hpp"
@ -67,7 +66,7 @@ namespace MWWorld
// Even though fog actually belongs to the player and not cells, // Even though fog actually belongs to the player and not cells,
// it makes sense to store it here since we need it once for each cell. // it makes sense to store it here since we need it once for each cell.
// Note this is NULL until the cell is explored to save some memory // Note this is NULL until the cell is explored to save some memory
boost::shared_ptr<ESM::FogState> mFogState; std::shared_ptr<ESM::FogState> mFogState;
const ESM::Cell *mCell; const ESM::Cell *mCell;
State mState; State mState;

@ -24,7 +24,7 @@
namespace MWWorld namespace MWWorld
{ {
std::map<std::string, boost::shared_ptr<Class> > Class::sClasses; std::map<std::string, std::shared_ptr<Class> > Class::sClasses;
Class::Class() {} Class::Class() {}
@ -108,14 +108,14 @@ namespace MWWorld
throw std::runtime_error("class cannot be hit"); throw std::runtime_error("class cannot be hit");
} }
boost::shared_ptr<Action> Class::activate (const Ptr& ptr, const Ptr& actor) const std::shared_ptr<Action> Class::activate (const Ptr& ptr, const Ptr& actor) const
{ {
return boost::shared_ptr<Action> (new NullAction); return std::shared_ptr<Action> (new NullAction);
} }
boost::shared_ptr<Action> Class::use (const Ptr& ptr) const std::shared_ptr<Action> Class::use (const Ptr& ptr) const
{ {
return boost::shared_ptr<Action> (new NullAction); return std::shared_ptr<Action> (new NullAction);
} }
ContainerStore& Class::getContainerStore (const Ptr& ptr) const ContainerStore& Class::getContainerStore (const Ptr& ptr) const
@ -233,7 +233,7 @@ namespace MWWorld
if (key.empty()) if (key.empty())
throw std::logic_error ("Class::get(): attempting to get an empty key"); throw std::logic_error ("Class::get(): attempting to get an empty key");
std::map<std::string, boost::shared_ptr<Class> >::const_iterator iter = sClasses.find (key); std::map<std::string, std::shared_ptr<Class> >::const_iterator iter = sClasses.find (key);
if (iter==sClasses.end()) if (iter==sClasses.end())
throw std::logic_error ("Class::get(): unknown class key: " + key); throw std::logic_error ("Class::get(): unknown class key: " + key);
@ -246,7 +246,7 @@ namespace MWWorld
throw std::runtime_error ("class does not support persistence"); throw std::runtime_error ("class does not support persistence");
} }
void Class::registerClass(const std::string& key, boost::shared_ptr<Class> instance) void Class::registerClass(const std::string& key, std::shared_ptr<Class> instance)
{ {
instance->mTypeName = key; instance->mTypeName = key;
sClasses.insert(std::make_pair(key, instance)); sClasses.insert(std::make_pair(key, instance));
@ -330,23 +330,23 @@ namespace MWWorld
{ {
} }
boost::shared_ptr<Action> Class::defaultItemActivate(const Ptr &ptr, const Ptr &actor) const std::shared_ptr<Action> Class::defaultItemActivate(const Ptr &ptr, const Ptr &actor) const
{ {
if(!MWBase::Environment::get().getWindowManager()->isAllowed(MWGui::GW_Inventory)) if(!MWBase::Environment::get().getWindowManager()->isAllowed(MWGui::GW_Inventory))
return boost::shared_ptr<Action>(new NullAction()); return std::shared_ptr<Action>(new NullAction());
if(actor.getClass().isNpc() && actor.getClass().getNpcStats(actor).isWerewolf()) if(actor.getClass().isNpc() && actor.getClass().getNpcStats(actor).isWerewolf())
{ {
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
const ESM::Sound *sound = store.get<ESM::Sound>().searchRandom("WolfItem"); 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); if(sound) action->setSound(sound->mId);
return action; return action;
} }
boost::shared_ptr<MWWorld::Action> action(new ActionTake(ptr)); std::shared_ptr<MWWorld::Action> action(new ActionTake(ptr));
action->setSound(getUpSoundId(ptr)); action->setSound(getUpSoundId(ptr));
return action; return action;

@ -2,11 +2,10 @@
#define GAME_MWWORLD_CLASS_H #define GAME_MWWORLD_CLASS_H
#include <map> #include <map>
#include <memory>
#include <string> #include <string>
#include <vector> #include <vector>
#include <boost/shared_ptr.hpp>
#include "ptr.hpp" #include "ptr.hpp"
namespace ESM namespace ESM
@ -51,7 +50,7 @@ namespace MWWorld
/// \brief Base class for referenceable esm records /// \brief Base class for referenceable esm records
class Class class Class
{ {
static std::map<std::string, boost::shared_ptr<Class> > sClasses; static std::map<std::string, std::shared_ptr<Class> > sClasses;
std::string mTypeName; std::string mTypeName;
@ -63,7 +62,7 @@ namespace MWWorld
Class(); Class();
boost::shared_ptr<Action> defaultItemActivate(const Ptr &ptr, const Ptr &actor) const; std::shared_ptr<Action> defaultItemActivate(const Ptr &ptr, const Ptr &actor) const;
///< Generate default action for activating inventory items ///< Generate default action for activating inventory items
virtual Ptr copyToCellImpl(const ConstPtr &ptr, CellStore &cell) const; virtual Ptr copyToCellImpl(const ConstPtr &ptr, CellStore &cell) const;
@ -139,10 +138,10 @@ namespace MWWorld
///< \return Can the player activate this object? ///< \return Can the player activate this object?
/// (default implementation: true if object's user-readable name is not empty, false otherwise) /// (default implementation: true if object's user-readable name is not empty, false otherwise)
virtual boost::shared_ptr<Action> activate (const Ptr& ptr, const Ptr& actor) const; virtual std::shared_ptr<Action> activate (const Ptr& ptr, const Ptr& actor) const;
///< Generate action for activation (default implementation: return a null action). ///< Generate action for activation (default implementation: return a null action).
virtual boost::shared_ptr<Action> use (const Ptr& ptr) virtual std::shared_ptr<Action> use (const Ptr& ptr)
const; const;
///< Generate action for using via inventory menu (default implementation: return a ///< Generate action for using via inventory menu (default implementation: return a
/// null action). /// null action).
@ -332,7 +331,7 @@ namespace MWWorld
static const Class& get (const std::string& key); static const Class& get (const std::string& key);
///< If there is no class for this \a key, an exception is thrown. ///< If there is no class for this \a key, an exception is thrown.
static void registerClass (const std::string& key, boost::shared_ptr<Class> instance); static void registerClass (const std::string& key, std::shared_ptr<Class> instance);
virtual int getBaseGold(const MWWorld::ConstPtr& ptr) const; virtual int getBaseGold(const MWWorld::ConstPtr& ptr) const;

@ -3359,7 +3359,7 @@ namespace MWWorld
if (object.getRefData().activate()) if (object.getRefData().activate())
{ {
boost::shared_ptr<MWWorld::Action> action = (object.getClass().activate(object, actor)); std::shared_ptr<MWWorld::Action> action = (object.getClass().activate(object, actor));
action->execute (actor); action->execute (actor);
} }
} }

@ -1,8 +1,6 @@
#ifndef GAME_MWWORLD_WORLDIMP_H #ifndef GAME_MWWORLD_WORLDIMP_H
#define GAME_MWWORLD_WORLDIMP_H #define GAME_MWWORLD_WORLDIMP_H
#include <boost/shared_ptr.hpp>
#include <osg/ref_ptr> #include <osg/ref_ptr>
#include <components/settings/settings.hpp> #include <components/settings/settings.hpp>
@ -100,7 +98,7 @@ namespace MWWorld
std::string mCurrentWorldSpace; std::string mCurrentWorldSpace;
boost::shared_ptr<ProjectileManager> mProjectileManager; std::shared_ptr<ProjectileManager> mProjectileManager;
bool mGodMode; bool mGodMode;
bool mScriptsEnabled; bool mScriptsEnabled;

@ -24,6 +24,7 @@
#include "bsa_file.hpp" #include "bsa_file.hpp"
#include <stdexcept> #include <stdexcept>
#include <cassert>
#include <boost/filesystem/path.hpp> #include <boost/filesystem/path.hpp>
#include <boost/filesystem/fstream.hpp> #include <boost/filesystem/fstream.hpp>

@ -1,5 +1,5 @@
#include "loadordererror.hpp" #include "loadordererror.hpp"
#include <assert.h> #include <cassert>
QString ContentSelectorModel::LoadOrderError::sErrorToolTips[ErrorCode_LoadOrder] = QString ContentSelectorModel::LoadOrderError::sErrorToolTips[ErrorCode_LoadOrder] =
{ {

@ -6,12 +6,9 @@
#include <QMenu> #include <QMenu>
#include <QContextMenuEvent> #include <QContextMenuEvent>
#include <QGridLayout> #include <QGridLayout>
#include <QMessageBox>
#include <QModelIndex>
#include <QDir> #include <QDir>
#include <assert.h> #include <QtGui/QAbstractItemView>
ContentSelectorView::ContentSelector::ContentSelector(QWidget *parent) : ContentSelectorView::ContentSelector::ContentSelector(QWidget *parent) :
QObject(parent) QObject(parent)

@ -1,3 +1,5 @@
#include <cassert>
#include "npcstats.hpp" #include "npcstats.hpp"
#include "esmreader.hpp" #include "esmreader.hpp"

@ -2,8 +2,7 @@
#define OPENMW_CONSTRAINEDFILESTREAM_H #define OPENMW_CONSTRAINEDFILESTREAM_H
#include <istream> #include <istream>
#include <memory>
#include <boost/shared_ptr.hpp>
namespace Files namespace Files
{ {

@ -8,8 +8,6 @@
#include <sstream> #include <sstream>
#include <map> #include <map>
#include <boost/shared_ptr.hpp>
#include "niffile.hpp" #include "niffile.hpp"
namespace Nif namespace Nif

@ -3,6 +3,7 @@
#ifndef OPENMW_COMPONENTS_NIF_NIFSTREAM_HPP #ifndef OPENMW_COMPONENTS_NIF_NIFSTREAM_HPP
#define OPENMW_COMPONENTS_NIF_NIFSTREAM_HPP #define OPENMW_COMPONENTS_NIF_NIFSTREAM_HPP
#include <cassert>
#include <stdint.h> #include <stdint.h>
#include <stdexcept> #include <stdexcept>
#include <vector> #include <vector>

@ -9,8 +9,6 @@
#include <components/sceneutil/controller.hpp> #include <components/sceneutil/controller.hpp>
#include <components/sceneutil/statesetupdater.hpp> #include <components/sceneutil/statesetupdater.hpp>
#include <boost/shared_ptr.hpp>
#include <set> //UVController #include <set> //UVController
// FlipController // FlipController
@ -101,8 +99,6 @@ namespace NifOsg
// cache for next time // cache for next time
mLastHighKey = it; mLastHighKey = it;
assert (it != keys.begin()); // Shouldn't happen, was checked at beginning of this function
typename MapT::MapType::const_iterator last = --it; typename MapT::MapType::const_iterator last = --it;
mLastLowKey = last; mLastLowKey = last;
float aLastTime = last->first; float aLastTime = last->first;

@ -1,7 +1,7 @@
#include "imagemanager.hpp" #include "imagemanager.hpp"
#include <cassert>
#include <osgDB/Registry> #include <osgDB/Registry>
#include <osg/GLExtensions>
#include <components/vfs/manager.hpp> #include <components/vfs/manager.hpp>

@ -1,5 +1,7 @@
#include "resourcesystem.hpp" #include "resourcesystem.hpp"
#include <algorithm>
#include "scenemanager.hpp" #include "scenemanager.hpp"
#include "imagemanager.hpp" #include "imagemanager.hpp"
#include "niffilemanager.hpp" #include "niffilemanager.hpp"

@ -10,8 +10,6 @@
#include <osg/Texture2D> #include <osg/Texture2D>
#include <boost/shared_ptr.hpp>
namespace osg namespace osg
{ {
class Texture2D; class Texture2D;

@ -1,7 +1,7 @@
#include "videostate.hpp" #include "videostate.hpp"
#include <cassert>
#include <iostream> #include <iostream>
#include <stdexcept>
#include <osg/Texture2D> #include <osg/Texture2D>
@ -19,8 +19,6 @@ extern "C"
#include <libavutil/time.h> #include <libavutil/time.h>
#endif #endif
#include <libavutil/mathematics.h>
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(55,28,1) #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(55,28,1)
#define av_frame_alloc avcodec_alloc_frame #define av_frame_alloc avcodec_alloc_frame
#endif #endif

@ -5,8 +5,6 @@
#include <vector> #include <vector>
#include <memory> #include <memory>
#include <boost/shared_ptr.hpp>
#include <OpenThreads/Thread> #include <OpenThreads/Thread>
#include <OpenThreads/Mutex> #include <OpenThreads/Mutex>
#include <OpenThreads/Condition> #include <OpenThreads/Condition>

Loading…
Cancel
Save