From 76174098c723ea52e299a7cf62f062ded3c98823 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Fri, 29 Jun 2012 16:48:50 +0200 Subject: [PATCH] Issue #107: CellStore moved from ESMS to MWWorld --- apps/openmw/CMakeLists.txt | 2 +- apps/openmw/engine.cpp | 2 +- apps/openmw/mwclass/activator.cpp | 22 ++-- apps/openmw/mwclass/apparatus.cpp | 19 ++- apps/openmw/mwclass/armor.cpp | 27 ++-- apps/openmw/mwclass/book.cpp | 21 ++-- apps/openmw/mwclass/clothing.cpp | 29 +++-- apps/openmw/mwclass/container.cpp | 17 ++- apps/openmw/mwclass/creature.cpp | 12 +- apps/openmw/mwclass/door.cpp | 17 ++- apps/openmw/mwclass/ingredient.cpp | 19 ++- apps/openmw/mwclass/light.cpp | 23 ++-- apps/openmw/mwclass/lockpick.cpp | 20 +-- apps/openmw/mwclass/misc.cpp | 23 ++-- apps/openmw/mwclass/npc.cpp | 12 +- apps/openmw/mwclass/potion.cpp | 19 ++- apps/openmw/mwclass/probe.cpp | 20 +-- apps/openmw/mwclass/repair.cpp | 20 +-- apps/openmw/mwclass/static.cpp | 4 +- apps/openmw/mwclass/weapon.cpp | 31 +++-- apps/openmw/mwdialogue/dialoguemanager.cpp | 16 +-- apps/openmw/mwgui/alchemywindow.cpp | 4 +- apps/openmw/mwgui/bookwindow.cpp | 2 +- apps/openmw/mwgui/container.cpp | 4 +- apps/openmw/mwgui/scrollwindow.cpp | 2 +- apps/openmw/mwgui/tradewindow.cpp | 14 +-- apps/openmw/mwrender/actors.hpp | 3 - apps/openmw/mwrender/creatureanimation.cpp | 2 +- apps/openmw/mwrender/npcanimation.cpp | 2 +- apps/openmw/mwrender/objects.cpp | 6 +- apps/openmw/mwrender/objects.hpp | 4 +- apps/openmw/mwrender/renderingmanager.cpp | 4 +- apps/openmw/mwrender/renderingmanager.hpp | 4 +- apps/openmw/mwworld/actionread.cpp | 3 +- apps/openmw/mwworld/cells.cpp | 46 +++---- .../openmw/mwworld/cellstore.hpp | 116 ++++++++---------- apps/openmw/mwworld/containerstore.cpp | 32 ++--- apps/openmw/mwworld/containerstore.hpp | 75 ++++++----- apps/openmw/mwworld/localscripts.cpp | 6 +- apps/openmw/mwworld/manualref.hpp | 10 +- apps/openmw/mwworld/player.hpp | 7 +- apps/openmw/mwworld/ptr.hpp | 11 +- apps/openmw/mwworld/refdata.cpp | 3 +- apps/openmw/mwworld/scene.cpp | 30 ++--- apps/openmw/mwworld/scene.hpp | 4 +- apps/openmw/mwworld/world.cpp | 50 ++++---- apps/openmw/mwworld/world.hpp | 1 - components/CMakeLists.txt | 3 +- 48 files changed, 396 insertions(+), 427 deletions(-) rename components/esm_store/cell_store.hpp => apps/openmw/mwworld/cellstore.hpp (65%) diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index 045f504a74..a2ebc1191c 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -50,7 +50,7 @@ add_openmw_dir (mwworld refdata world physicssystem scene globals class action nullaction actionteleport containerstore actiontalk actiontake manualref player cellfunctors cells localscripts customdata weather inventorystore ptr actionopen actionread - actionequip timestamp actionalchemy + actionequip timestamp actionalchemy cellstore ) add_openmw_dir (mwclass diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp index 5c5a586afc..70e69b99cd 100644 --- a/apps/openmw/engine.cpp +++ b/apps/openmw/engine.cpp @@ -15,7 +15,6 @@ #include #include -#include #include #include #include @@ -42,6 +41,7 @@ #include "mwworld/world.hpp" #include "mwworld/class.hpp" #include "mwworld/player.hpp" +#include "mwworld/cellstore.hpp" #include "mwclass/classes.hpp" diff --git a/apps/openmw/mwclass/activator.cpp b/apps/openmw/mwclass/activator.cpp index 505f61f4ca..cbc73a68c4 100644 --- a/apps/openmw/mwclass/activator.cpp +++ b/apps/openmw/mwclass/activator.cpp @@ -3,18 +3,20 @@ #include -#include - -#include "../mwworld/ptr.hpp" -#include "../mwrender/objects.hpp" #include "../mwbase/environment.hpp" + +#include "../mwworld//cellstore.hpp" +#include "../mwworld/ptr.hpp" + +#include "../mwrender/objects.hpp" + #include "../mwgui/window_manager.hpp" namespace MWClass { void Activator::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); assert (ref->base != NULL); @@ -30,7 +32,7 @@ namespace MWClass void Activator::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); @@ -44,7 +46,7 @@ namespace MWClass std::string Activator::getName (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->name; @@ -52,7 +54,7 @@ namespace MWClass std::string Activator::getScript (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->script; @@ -67,7 +69,7 @@ namespace MWClass bool Activator::hasToolTip (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return (ref->base->name != ""); @@ -75,7 +77,7 @@ namespace MWClass MWGui::ToolTipInfo Activator::getToolTipInfo (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); MWGui::ToolTipInfo info; diff --git a/apps/openmw/mwclass/apparatus.cpp b/apps/openmw/mwclass/apparatus.cpp index 6945f3c271..84be29bd93 100644 --- a/apps/openmw/mwclass/apparatus.cpp +++ b/apps/openmw/mwclass/apparatus.cpp @@ -3,14 +3,13 @@ #include -#include - #include "../mwbase/environment.hpp" #include "../mwworld/ptr.hpp" #include "../mwworld/actiontake.hpp" #include "../mwworld/actionalchemy.hpp" #include "../mwworld/world.hpp" +#include "../mwworld/cellstore.hpp" #include "../mwrender/objects.hpp" @@ -23,7 +22,7 @@ namespace MWClass { void Apparatus::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); assert (ref->base != NULL); @@ -39,7 +38,7 @@ namespace MWClass void Apparatus::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); @@ -53,7 +52,7 @@ namespace MWClass std::string Apparatus::getName (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->name; @@ -70,7 +69,7 @@ namespace MWClass std::string Apparatus::getScript (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->script; @@ -78,7 +77,7 @@ namespace MWClass int Apparatus::getValue (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->data.value; @@ -103,7 +102,7 @@ namespace MWClass std::string Apparatus::getInventoryIcon (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->icon; @@ -111,7 +110,7 @@ namespace MWClass bool Apparatus::hasToolTip (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return (ref->base->name != ""); @@ -119,7 +118,7 @@ namespace MWClass MWGui::ToolTipInfo Apparatus::getToolTipInfo (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); MWGui::ToolTipInfo info; diff --git a/apps/openmw/mwclass/armor.cpp b/apps/openmw/mwclass/armor.cpp index 83c0120c78..eea780faa3 100644 --- a/apps/openmw/mwclass/armor.cpp +++ b/apps/openmw/mwclass/armor.cpp @@ -5,13 +5,12 @@ #include #include -#include - #include "../mwworld/ptr.hpp" #include "../mwworld/actiontake.hpp" #include "../mwworld/actionequip.hpp" #include "../mwworld/inventorystore.hpp" #include "../mwworld/world.hpp" +#include "../mwworld/cellstore.hpp" #include "../mwbase/environment.hpp" @@ -25,7 +24,7 @@ namespace MWClass { void Armor::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); assert (ref->base != NULL); @@ -41,7 +40,7 @@ namespace MWClass void Armor::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); const std::string &model = ref->base->model; @@ -54,7 +53,7 @@ namespace MWClass std::string Armor::getName (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->name; @@ -76,7 +75,7 @@ namespace MWClass int Armor::getItemMaxHealth (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->data.health; @@ -84,7 +83,7 @@ namespace MWClass std::string Armor::getScript (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->script; @@ -92,7 +91,7 @@ namespace MWClass std::pair, bool> Armor::getEquipmentSlots (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); std::vector slots; @@ -126,7 +125,7 @@ namespace MWClass int Armor::getEquipmentSkill (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); std::string typeGmst; @@ -164,7 +163,7 @@ namespace MWClass int Armor::getValue (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->data.value; @@ -201,7 +200,7 @@ namespace MWClass std::string Armor::getInventoryIcon (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->icon; @@ -209,7 +208,7 @@ namespace MWClass bool Armor::hasToolTip (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return (ref->base->name != ""); @@ -217,7 +216,7 @@ namespace MWClass MWGui::ToolTipInfo Armor::getToolTipInfo (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); MWGui::ToolTipInfo info; @@ -260,7 +259,7 @@ namespace MWClass std::string Armor::getEnchantment (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->enchant; diff --git a/apps/openmw/mwclass/book.cpp b/apps/openmw/mwclass/book.cpp index a107d9b210..515c76e36d 100644 --- a/apps/openmw/mwclass/book.cpp +++ b/apps/openmw/mwclass/book.cpp @@ -3,13 +3,12 @@ #include -#include - #include "../mwbase/environment.hpp" #include "../mwworld/ptr.hpp" #include "../mwworld/actionread.hpp" #include "../mwworld/world.hpp" +#include "../mwworld/cellstore.hpp" #include "../mwrender/objects.hpp" @@ -21,7 +20,7 @@ namespace MWClass { void Book::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); assert (ref->base != NULL); @@ -37,7 +36,7 @@ namespace MWClass void Book::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); @@ -51,7 +50,7 @@ namespace MWClass std::string Book::getName (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->name; @@ -66,7 +65,7 @@ namespace MWClass std::string Book::getScript (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->script; @@ -74,7 +73,7 @@ namespace MWClass int Book::getValue (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->data.value; @@ -99,7 +98,7 @@ namespace MWClass std::string Book::getInventoryIcon (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->icon; @@ -107,7 +106,7 @@ namespace MWClass bool Book::hasToolTip (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return (ref->base->name != ""); @@ -115,7 +114,7 @@ namespace MWClass MWGui::ToolTipInfo Book::getToolTipInfo (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); MWGui::ToolTipInfo info; @@ -143,7 +142,7 @@ namespace MWClass std::string Book::getEnchantment (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->enchant; diff --git a/apps/openmw/mwclass/clothing.cpp b/apps/openmw/mwclass/clothing.cpp index 11b515faf7..01c17b3f39 100644 --- a/apps/openmw/mwclass/clothing.cpp +++ b/apps/openmw/mwclass/clothing.cpp @@ -3,8 +3,6 @@ #include -#include - #include "../mwbase/environment.hpp" #include "../mwworld/ptr.hpp" @@ -12,6 +10,7 @@ #include "../mwworld/actionequip.hpp" #include "../mwworld/inventorystore.hpp" #include "../mwworld/world.hpp" +#include "../mwworld/cellstore.hpp" #include "../mwgui/tooltips.hpp" #include "../mwgui/window_manager.hpp" @@ -24,7 +23,7 @@ namespace MWClass { void Clothing::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); assert (ref->base != NULL); @@ -40,7 +39,7 @@ namespace MWClass void Clothing::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); @@ -54,7 +53,7 @@ namespace MWClass std::string Clothing::getName (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->name; @@ -71,7 +70,7 @@ namespace MWClass std::string Clothing::getScript (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->script; @@ -79,7 +78,7 @@ namespace MWClass std::pair, bool> Clothing::getEquipmentSlots (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); std::vector slots; @@ -119,7 +118,7 @@ namespace MWClass int Clothing::getEquipmentSkill (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); if (ref->base->data.type==ESM::Clothing::Shoes) @@ -130,7 +129,7 @@ namespace MWClass int Clothing::getValue (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->data.value; @@ -145,7 +144,7 @@ namespace MWClass std::string Clothing::getUpSoundId (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); if (ref->base->data.type == 8) @@ -157,7 +156,7 @@ namespace MWClass std::string Clothing::getDownSoundId (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); if (ref->base->data.type == 8) @@ -169,7 +168,7 @@ namespace MWClass std::string Clothing::getInventoryIcon (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->icon; @@ -177,7 +176,7 @@ namespace MWClass bool Clothing::hasToolTip (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return (ref->base->name != ""); @@ -185,7 +184,7 @@ namespace MWClass MWGui::ToolTipInfo Clothing::getToolTipInfo (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); MWGui::ToolTipInfo info; @@ -213,7 +212,7 @@ namespace MWClass std::string Clothing::getEnchantment (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->enchant; diff --git a/apps/openmw/mwclass/container.cpp b/apps/openmw/mwclass/container.cpp index 99a32fc327..3c938f4010 100644 --- a/apps/openmw/mwclass/container.cpp +++ b/apps/openmw/mwclass/container.cpp @@ -3,8 +3,6 @@ #include -#include - #include "../mwbase/environment.hpp" #include "../mwworld/ptr.hpp" @@ -12,6 +10,7 @@ #include "../mwworld/containerstore.hpp" #include "../mwworld/customdata.hpp" #include "../mwworld/world.hpp" +#include "../mwworld/cellstore.hpp" #include "../mwgui/window_manager.hpp" #include "../mwgui/tooltips.hpp" @@ -53,7 +52,7 @@ namespace MWClass void Container::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); assert (ref->base != NULL); @@ -69,7 +68,7 @@ namespace MWClass void Container::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); @@ -117,7 +116,7 @@ namespace MWClass std::string Container::getName (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->name; @@ -133,7 +132,7 @@ namespace MWClass std::string Container::getScript (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->script; @@ -148,7 +147,7 @@ namespace MWClass bool Container::hasToolTip (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return (ref->base->name != ""); @@ -156,7 +155,7 @@ namespace MWClass MWGui::ToolTipInfo Container::getToolTipInfo (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); MWGui::ToolTipInfo info; @@ -182,7 +181,7 @@ namespace MWClass float Container::getCapacity (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->weight; diff --git a/apps/openmw/mwclass/creature.cpp b/apps/openmw/mwclass/creature.cpp index c9b43896b2..41abda1b0a 100644 --- a/apps/openmw/mwclass/creature.cpp +++ b/apps/openmw/mwclass/creature.cpp @@ -40,7 +40,7 @@ namespace MWClass { std::auto_ptr data (new CustomData); - ESMS::LiveCellRef *ref = ptr.get(); + MWWorld::LiveCellRef *ref = ptr.get(); // creature stats data->mCreatureStats.mAttributes[0].set (ref->base->data.strength); @@ -69,7 +69,7 @@ namespace MWClass std::string Creature::getId (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->mId; @@ -83,7 +83,7 @@ namespace MWClass void Creature::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); const std::string &model = ref->base->model; @@ -97,7 +97,7 @@ namespace MWClass std::string Creature::getName (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->name; @@ -126,7 +126,7 @@ namespace MWClass std::string Creature::getScript (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->script; @@ -148,7 +148,7 @@ namespace MWClass MWGui::ToolTipInfo Creature::getToolTipInfo (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); MWGui::ToolTipInfo info; diff --git a/apps/openmw/mwclass/door.cpp b/apps/openmw/mwclass/door.cpp index 7041de1c68..ad245997fe 100644 --- a/apps/openmw/mwclass/door.cpp +++ b/apps/openmw/mwclass/door.cpp @@ -3,8 +3,6 @@ #include -#include - #include "../mwbase/environment.hpp" #include "../mwworld/player.hpp" @@ -12,6 +10,7 @@ #include "../mwworld/nullaction.hpp" #include "../mwworld/actionteleport.hpp" #include "../mwworld/world.hpp" +#include "../mwworld/cellstore.hpp" #include "../mwgui/window_manager.hpp" #include "../mwgui/tooltips.hpp" @@ -24,7 +23,7 @@ namespace MWClass { void Door::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); assert (ref->base != NULL); @@ -40,7 +39,7 @@ namespace MWClass void Door::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); const std::string &model = ref->base->model; @@ -52,7 +51,7 @@ namespace MWClass std::string Door::getName (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); if (ref->ref.teleport && !ref->ref.destCell.empty()) // TODO doors that lead to exteriors @@ -64,7 +63,7 @@ namespace MWClass boost::shared_ptr Door::activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); const std::string &openSound = ref->base->openSound; @@ -134,7 +133,7 @@ namespace MWClass std::string Door::getScript (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->script; @@ -149,7 +148,7 @@ namespace MWClass bool Door::hasToolTip (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return (ref->base->name != ""); @@ -157,7 +156,7 @@ namespace MWClass MWGui::ToolTipInfo Door::getToolTipInfo (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); MWGui::ToolTipInfo info; diff --git a/apps/openmw/mwclass/ingredient.cpp b/apps/openmw/mwclass/ingredient.cpp index 0c7fa7e698..c2a44e8bd9 100644 --- a/apps/openmw/mwclass/ingredient.cpp +++ b/apps/openmw/mwclass/ingredient.cpp @@ -3,13 +3,12 @@ #include -#include - #include "../mwbase/environment.hpp" #include "../mwworld/ptr.hpp" #include "../mwworld/actiontake.hpp" #include "../mwworld/world.hpp" +#include "../mwworld/cellstore.hpp" #include "../mwgui/window_manager.hpp" #include "../mwgui/tooltips.hpp" @@ -22,7 +21,7 @@ namespace MWClass { void Ingredient::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); assert (ref->base != NULL); @@ -38,7 +37,7 @@ namespace MWClass void Ingredient::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); const std::string &model = ref->base->model; @@ -50,7 +49,7 @@ namespace MWClass std::string Ingredient::getName (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->name; @@ -67,7 +66,7 @@ namespace MWClass std::string Ingredient::getScript (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->script; @@ -75,7 +74,7 @@ namespace MWClass int Ingredient::getValue (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->data.value; @@ -100,7 +99,7 @@ namespace MWClass std::string Ingredient::getInventoryIcon (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->icon; @@ -108,7 +107,7 @@ namespace MWClass bool Ingredient::hasToolTip (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return (ref->base->name != ""); @@ -116,7 +115,7 @@ namespace MWClass MWGui::ToolTipInfo Ingredient::getToolTipInfo (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); MWGui::ToolTipInfo info; diff --git a/apps/openmw/mwclass/light.cpp b/apps/openmw/mwclass/light.cpp index 1540334338..c38033f702 100644 --- a/apps/openmw/mwclass/light.cpp +++ b/apps/openmw/mwclass/light.cpp @@ -3,8 +3,6 @@ #include -#include - #include "../mwbase/environment.hpp" #include "../mwworld/ptr.hpp" @@ -13,6 +11,7 @@ #include "../mwworld/nullaction.hpp" #include "../mwworld/inventorystore.hpp" #include "../mwworld/world.hpp" +#include "../mwworld/cellstore.hpp" #include "../mwgui/window_manager.hpp" #include "../mwgui/tooltips.hpp" @@ -25,7 +24,7 @@ namespace MWClass { void Light::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); assert (ref->base != NULL); @@ -47,7 +46,7 @@ namespace MWClass void Light::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); assert (ref->base != NULL); @@ -65,7 +64,7 @@ namespace MWClass std::string Light::getName (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); if (ref->base->model.empty()) @@ -77,7 +76,7 @@ namespace MWClass boost::shared_ptr Light::activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); if (!(ref->base->data.flags & ESM::Light::Carry)) @@ -91,7 +90,7 @@ namespace MWClass std::string Light::getScript (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->script; @@ -99,7 +98,7 @@ namespace MWClass std::pair, bool> Light::getEquipmentSlots (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); std::vector slots; @@ -112,7 +111,7 @@ namespace MWClass int Light::getValue (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->data.value; @@ -138,7 +137,7 @@ namespace MWClass std::string Light::getInventoryIcon (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->icon; @@ -146,7 +145,7 @@ namespace MWClass bool Light::hasToolTip (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return (ref->base->name != ""); @@ -154,7 +153,7 @@ namespace MWClass MWGui::ToolTipInfo Light::getToolTipInfo (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); MWGui::ToolTipInfo info; diff --git a/apps/openmw/mwclass/lockpick.cpp b/apps/openmw/mwclass/lockpick.cpp index 27e292bc0e..81430fe17f 100644 --- a/apps/openmw/mwclass/lockpick.cpp +++ b/apps/openmw/mwclass/lockpick.cpp @@ -3,8 +3,6 @@ #include -#include - #include "../mwbase/environment.hpp" #include "../mwworld/ptr.hpp" @@ -12,6 +10,8 @@ #include "../mwworld/actionequip.hpp" #include "../mwworld/inventorystore.hpp" #include "../mwworld/world.hpp" +#include "../mwworld/cellstore.hpp" + #include "../mwgui/window_manager.hpp" #include "../mwgui/tooltips.hpp" @@ -23,7 +23,7 @@ namespace MWClass { void Lockpick::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); assert (ref->base != NULL); @@ -39,7 +39,7 @@ namespace MWClass void Lockpick::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); @@ -54,7 +54,7 @@ namespace MWClass std::string Lockpick::getName (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->name; @@ -71,7 +71,7 @@ namespace MWClass std::string Lockpick::getScript (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->script; @@ -88,7 +88,7 @@ namespace MWClass int Lockpick::getValue (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->data.value; @@ -113,7 +113,7 @@ namespace MWClass std::string Lockpick::getInventoryIcon (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->icon; @@ -121,7 +121,7 @@ namespace MWClass bool Lockpick::hasToolTip (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return (ref->base->name != ""); @@ -129,7 +129,7 @@ namespace MWClass MWGui::ToolTipInfo Lockpick::getToolTipInfo (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); MWGui::ToolTipInfo info; diff --git a/apps/openmw/mwclass/misc.cpp b/apps/openmw/mwclass/misc.cpp index d8e0553b9e..3a764ebe7c 100644 --- a/apps/openmw/mwclass/misc.cpp +++ b/apps/openmw/mwclass/misc.cpp @@ -5,13 +5,12 @@ #include -#include - #include "../mwbase/environment.hpp" #include "../mwworld/ptr.hpp" #include "../mwworld/actiontake.hpp" #include "../mwworld/world.hpp" +#include "../mwworld/cellstore.hpp" #include "../mwgui/window_manager.hpp" #include "../mwgui/tooltips.hpp" @@ -26,7 +25,7 @@ namespace MWClass { void Miscellaneous::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); assert (ref->base != NULL); @@ -42,7 +41,7 @@ namespace MWClass void Miscellaneous::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); @@ -56,7 +55,7 @@ namespace MWClass std::string Miscellaneous::getName (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->name; @@ -73,7 +72,7 @@ namespace MWClass std::string Miscellaneous::getScript (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->script; @@ -81,7 +80,7 @@ namespace MWClass int Miscellaneous::getValue (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->data.value; @@ -96,7 +95,7 @@ namespace MWClass std::string Miscellaneous::getUpSoundId (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); if (ref->base->name == MWBase::Environment::get().getWorld()->getStore().gameSettings.search("sGold")->str) @@ -108,7 +107,7 @@ namespace MWClass std::string Miscellaneous::getDownSoundId (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); if (ref->base->name == MWBase::Environment::get().getWorld()->getStore().gameSettings.search("sGold")->str) @@ -120,7 +119,7 @@ namespace MWClass std::string Miscellaneous::getInventoryIcon (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->icon; @@ -128,7 +127,7 @@ namespace MWClass bool Miscellaneous::hasToolTip (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return (ref->base->name != ""); @@ -136,7 +135,7 @@ namespace MWClass MWGui::ToolTipInfo Miscellaneous::getToolTipInfo (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); MWGui::ToolTipInfo info; diff --git a/apps/openmw/mwclass/npc.cpp b/apps/openmw/mwclass/npc.cpp index f30e164f96..9561ba7b65 100644 --- a/apps/openmw/mwclass/npc.cpp +++ b/apps/openmw/mwclass/npc.cpp @@ -53,7 +53,7 @@ namespace MWClass { std::auto_ptr data (new CustomData); - ESMS::LiveCellRef *ref = ptr.get(); + MWWorld::LiveCellRef *ref = ptr.get(); // NPC stats if (!ref->base->faction.empty()) @@ -107,7 +107,7 @@ namespace MWClass std::string Npc::getId (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->mId; @@ -120,7 +120,7 @@ namespace MWClass void Npc::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); assert (ref->base != NULL); @@ -138,7 +138,7 @@ namespace MWClass std::string Npc::getName (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->name; @@ -182,7 +182,7 @@ namespace MWClass std::string Npc::getScript (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->script; @@ -302,7 +302,7 @@ namespace MWClass MWGui::ToolTipInfo Npc::getToolTipInfo (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); MWGui::ToolTipInfo info; diff --git a/apps/openmw/mwclass/potion.cpp b/apps/openmw/mwclass/potion.cpp index 157af01f55..105703bd6d 100644 --- a/apps/openmw/mwclass/potion.cpp +++ b/apps/openmw/mwclass/potion.cpp @@ -3,13 +3,12 @@ #include -#include - #include "../mwbase/environment.hpp" #include "../mwworld/ptr.hpp" #include "../mwworld/actiontake.hpp" #include "../mwworld/world.hpp" +#include "../mwworld/cellstore.hpp" #include "../mwgui/window_manager.hpp" #include "../mwgui/tooltips.hpp" @@ -22,7 +21,7 @@ namespace MWClass { void Potion::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); assert (ref->base != NULL); @@ -38,7 +37,7 @@ namespace MWClass void Potion::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); @@ -52,7 +51,7 @@ namespace MWClass std::string Potion::getName (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->name; @@ -69,7 +68,7 @@ namespace MWClass std::string Potion::getScript (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->script; @@ -77,7 +76,7 @@ namespace MWClass int Potion::getValue (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->data.value; @@ -102,7 +101,7 @@ namespace MWClass std::string Potion::getInventoryIcon (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->icon; @@ -110,7 +109,7 @@ namespace MWClass bool Potion::hasToolTip (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return (ref->base->name != ""); @@ -118,7 +117,7 @@ namespace MWClass MWGui::ToolTipInfo Potion::getToolTipInfo (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); MWGui::ToolTipInfo info; diff --git a/apps/openmw/mwclass/probe.cpp b/apps/openmw/mwclass/probe.cpp index 0b256d7293..cb62b2c4d9 100644 --- a/apps/openmw/mwclass/probe.cpp +++ b/apps/openmw/mwclass/probe.cpp @@ -3,8 +3,6 @@ #include -#include - #include "../mwbase/environment.hpp" #include "../mwworld/ptr.hpp" @@ -12,6 +10,8 @@ #include "../mwworld/actionequip.hpp" #include "../mwworld/inventorystore.hpp" #include "../mwworld/world.hpp" +#include "../mwworld/cellstore.hpp" + #include "../mwgui/window_manager.hpp" #include "../mwgui/tooltips.hpp" @@ -23,7 +23,7 @@ namespace MWClass { void Probe::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); assert (ref->base != NULL); @@ -39,7 +39,7 @@ namespace MWClass void Probe::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); @@ -54,7 +54,7 @@ namespace MWClass std::string Probe::getName (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->name; @@ -70,7 +70,7 @@ namespace MWClass std::string Probe::getScript (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->script; @@ -87,7 +87,7 @@ namespace MWClass int Probe::getValue (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->data.value; @@ -112,7 +112,7 @@ namespace MWClass std::string Probe::getInventoryIcon (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->icon; @@ -120,7 +120,7 @@ namespace MWClass bool Probe::hasToolTip (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return (ref->base->name != ""); @@ -128,7 +128,7 @@ namespace MWClass MWGui::ToolTipInfo Probe::getToolTipInfo (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); MWGui::ToolTipInfo info; diff --git a/apps/openmw/mwclass/repair.cpp b/apps/openmw/mwclass/repair.cpp index 5666a95a50..4a66b177ef 100644 --- a/apps/openmw/mwclass/repair.cpp +++ b/apps/openmw/mwclass/repair.cpp @@ -3,13 +3,13 @@ #include -#include - #include "../mwbase/environment.hpp" #include "../mwworld/ptr.hpp" #include "../mwworld/actiontake.hpp" #include "../mwworld/world.hpp" +#include "../mwworld/cellstore.hpp" + #include "../mwgui/window_manager.hpp" #include "../mwgui/tooltips.hpp" @@ -21,7 +21,7 @@ namespace MWClass { void Repair::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); assert (ref->base != NULL); @@ -37,7 +37,7 @@ namespace MWClass void Repair::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); @@ -51,7 +51,7 @@ namespace MWClass std::string Repair::getName (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->name; @@ -68,7 +68,7 @@ namespace MWClass std::string Repair::getScript (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->script; @@ -76,7 +76,7 @@ namespace MWClass int Repair::getValue (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->data.value; @@ -101,7 +101,7 @@ namespace MWClass std::string Repair::getInventoryIcon (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->icon; @@ -109,7 +109,7 @@ namespace MWClass bool Repair::hasToolTip (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return (ref->base->name != ""); @@ -117,7 +117,7 @@ namespace MWClass MWGui::ToolTipInfo Repair::getToolTipInfo (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); MWGui::ToolTipInfo info; diff --git a/apps/openmw/mwclass/static.cpp b/apps/openmw/mwclass/static.cpp index 4a4136816e..b93d185967 100644 --- a/apps/openmw/mwclass/static.cpp +++ b/apps/openmw/mwclass/static.cpp @@ -11,7 +11,7 @@ namespace MWClass { void Static::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); assert (ref->base != NULL); @@ -27,7 +27,7 @@ namespace MWClass void Static::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); assert (ref->base != NULL); diff --git a/apps/openmw/mwclass/weapon.cpp b/apps/openmw/mwclass/weapon.cpp index 482d618b01..79c98dda2f 100644 --- a/apps/openmw/mwclass/weapon.cpp +++ b/apps/openmw/mwclass/weapon.cpp @@ -3,8 +3,6 @@ #include -#include - #include "../mwbase/environment.hpp" #include "../mwworld/ptr.hpp" @@ -12,6 +10,7 @@ #include "../mwworld/actionequip.hpp" #include "../mwworld/inventorystore.hpp" #include "../mwworld/world.hpp" +#include "../mwworld/cellstore.hpp" #include "../mwgui/window_manager.hpp" #include "../mwgui/tooltips.hpp" @@ -24,7 +23,7 @@ namespace MWClass { void Weapon::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); assert (ref->base != NULL); @@ -40,7 +39,7 @@ namespace MWClass void Weapon::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); @@ -54,7 +53,7 @@ namespace MWClass std::string Weapon::getName (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->name; @@ -76,7 +75,7 @@ namespace MWClass int Weapon::getItemMaxHealth (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->data.health; @@ -84,7 +83,7 @@ namespace MWClass std::string Weapon::getScript (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->script; @@ -92,7 +91,7 @@ namespace MWClass std::pair, bool> Weapon::getEquipmentSlots (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); std::vector slots; @@ -116,7 +115,7 @@ namespace MWClass int Weapon::getEquipmentSkill (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); const int size = 12; @@ -146,7 +145,7 @@ namespace MWClass int Weapon::getValue (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->data.value; @@ -161,7 +160,7 @@ namespace MWClass std::string Weapon::getUpSoundId (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); int type = ref->base->data.type; @@ -207,7 +206,7 @@ namespace MWClass std::string Weapon::getDownSoundId (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); int type = ref->base->data.type; @@ -253,7 +252,7 @@ namespace MWClass std::string Weapon::getInventoryIcon (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->icon; @@ -261,7 +260,7 @@ namespace MWClass bool Weapon::hasToolTip (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return (ref->base->name != ""); @@ -269,7 +268,7 @@ namespace MWClass MWGui::ToolTipInfo Weapon::getToolTipInfo (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); MWGui::ToolTipInfo info; @@ -351,7 +350,7 @@ namespace MWClass std::string Weapon::getEnchantment (const MWWorld::Ptr& ptr) const { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); return ref->base->enchant; diff --git a/apps/openmw/mwdialogue/dialoguemanager.cpp b/apps/openmw/mwdialogue/dialoguemanager.cpp index 45e2c8cb36..58670044a1 100644 --- a/apps/openmw/mwdialogue/dialoguemanager.cpp +++ b/apps/openmw/mwdialogue/dialoguemanager.cpp @@ -392,7 +392,7 @@ namespace MWDialogue if(select.type==ESM::VT_Int) { - ESMS::LiveCellRef* npc = actor.get(); + MWWorld::LiveCellRef* npc = actor.get(); int isFaction = int(toLower(npc->base->faction) == toLower(name)); if(selectCompare(comp,!isFaction,select.i)) return false; @@ -409,7 +409,7 @@ namespace MWDialogue if(select.type==ESM::VT_Int) { - ESMS::LiveCellRef* npc = actor.get(); + MWWorld::LiveCellRef* npc = actor.get(); int isClass = int(toLower(npc->base->cls) == toLower(name)); if(selectCompare(comp,!isClass,select.i)) return false; @@ -426,7 +426,7 @@ namespace MWDialogue if(select.type==ESM::VT_Int) { - ESMS::LiveCellRef* npc = actor.get(); + MWWorld::LiveCellRef* npc = actor.get(); int isRace = int(toLower(npc->base->race) == toLower(name)); if(selectCompare(comp,!isRace,select.i)) return false; @@ -493,7 +493,7 @@ namespace MWDialogue if (isCreature) return false; - ESMS::LiveCellRef *cellRef = actor.get(); + MWWorld::LiveCellRef *cellRef = actor.get(); if (!cellRef) return false; @@ -508,7 +508,7 @@ namespace MWDialogue if (isCreature) return false; - ESMS::LiveCellRef *cellRef = actor.get(); + MWWorld::LiveCellRef *cellRef = actor.get(); if (!cellRef) return false; @@ -558,7 +558,7 @@ namespace MWDialogue //check gender if (!isCreature) { - ESMS::LiveCellRef* npc = actor.get(); + MWWorld::LiveCellRef* npc = actor.get(); if(npc->base->flags&npc->base->Female) { if(static_cast (info.data.gender)==0) return false; @@ -771,13 +771,13 @@ namespace MWDialogue int services = 0; if (mActor.getTypeName() == typeid(ESM::NPC).name()) { - ESMS::LiveCellRef* ref = mActor.get(); + MWWorld::LiveCellRef* ref = mActor.get(); if (ref->base->hasAI) services = ref->base->AI.services; } else if (mActor.getTypeName() == typeid(ESM::Creature).name()) { - ESMS::LiveCellRef* ref = mActor.get(); + MWWorld::LiveCellRef* ref = mActor.get(); if (ref->base->hasAI) services = ref->base->AI.services; } diff --git a/apps/openmw/mwgui/alchemywindow.cpp b/apps/openmw/mwgui/alchemywindow.cpp index 423678eed0..1535f3a26e 100644 --- a/apps/openmw/mwgui/alchemywindow.cpp +++ b/apps/openmw/mwgui/alchemywindow.cpp @@ -275,7 +275,7 @@ namespace MWGui for (MWWorld::ContainerStoreIterator it(store.begin(MWWorld::ContainerStore::Type_Apparatus)); it != store.end(); ++it) { - ESMS::LiveCellRef* ref = it->get(); + MWWorld::LiveCellRef* ref = it->get(); if (ref->base->data.type == ESM::Apparatus::Albemic && (bestAlbemic.isEmpty() || ref->base->data.quality > bestAlbemic.get()->base->data.quality)) bestAlbemic = *it; @@ -420,7 +420,7 @@ namespace MWGui continue; // add the effects of this ingredient to list of effects - ESMS::LiveCellRef* ref = ingredient->getUserData()->get(); + MWWorld::LiveCellRef* ref = ingredient->getUserData()->get(); for (int i=0; i<4; ++i) { if (ref->base->data.effectID[i] < 0) diff --git a/apps/openmw/mwgui/bookwindow.cpp b/apps/openmw/mwgui/bookwindow.cpp index a9dcd4555e..74ba7d44e1 100644 --- a/apps/openmw/mwgui/bookwindow.cpp +++ b/apps/openmw/mwgui/bookwindow.cpp @@ -55,7 +55,7 @@ void BookWindow::open (MWWorld::Ptr book) MWBase::Environment::get().getSoundManager()->playSound ("book open", 1.0, 1.0); - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = mBook.get(); BookTextParser parser; diff --git a/apps/openmw/mwgui/container.cpp b/apps/openmw/mwgui/container.cpp index 36ed16b0ef..9d6fc3c6b4 100644 --- a/apps/openmw/mwgui/container.cpp +++ b/apps/openmw/mwgui/container.cpp @@ -273,7 +273,7 @@ void ContainerBase::onContainerClicked(MyGUI::Widget* _sender) // check the container's Organic flag (if this is a container). container with Organic flag doesn't allow putting items inside if (mPtr.getTypeName() == typeid(ESM::Container).name()) { - ESMS::LiveCellRef* ref = mPtr.get(); + MWWorld::LiveCellRef* ref = mPtr.get(); if (ref->base->flags & ESM::Container::Organic) { // user notification @@ -556,7 +556,7 @@ void ContainerBase::addItem(MWWorld::Ptr item, int count) { MWWorld::ContainerStore& containerStore = MWWorld::Class::get(mPtr).getContainerStore(mPtr); - int origCount = item.getRefData().getCount(); + int origCount = item.getRefData().getCount(); item.getRefData().setCount(count); MWWorld::ContainerStoreIterator it = containerStore.add(item); diff --git a/apps/openmw/mwgui/scrollwindow.cpp b/apps/openmw/mwgui/scrollwindow.cpp index 92b18d953d..5b527cf86f 100644 --- a/apps/openmw/mwgui/scrollwindow.cpp +++ b/apps/openmw/mwgui/scrollwindow.cpp @@ -31,7 +31,7 @@ void ScrollWindow::open (MWWorld::Ptr scroll) mScroll = scroll; - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = mScroll.get(); BookTextParser parser; diff --git a/apps/openmw/mwgui/tradewindow.cpp b/apps/openmw/mwgui/tradewindow.cpp index a42da60d19..487c5020a2 100644 --- a/apps/openmw/mwgui/tradewindow.cpp +++ b/apps/openmw/mwgui/tradewindow.cpp @@ -86,7 +86,7 @@ namespace MWGui offerButtonWidth, mOfferButton->getHeight()); - setCoord(400, 0, 400, 300); + setCoord(400, 0, 400, 300); static_cast(mMainWidget)->eventWindowChangeCoord += MyGUI::newDelegate(this, &TradeWindow::onWindowResize); } @@ -161,7 +161,7 @@ namespace MWGui int merchantgold; if (mPtr.getTypeName() == typeid(ESM::NPC).name()) { - ESMS::LiveCellRef* ref = mPtr.get(); + MWWorld::LiveCellRef* ref = mPtr.get(); if (ref->base->npdt52.gold == -10) merchantgold = ref->base->npdt12.gold; else @@ -169,7 +169,7 @@ namespace MWGui } else // ESM::Creature { - ESMS::LiveCellRef* ref = mPtr.get(); + MWWorld::LiveCellRef* ref = mPtr.get(); merchantgold = ref->base->data.gold; } if (mCurrentBalance > 0 && merchantgold < mCurrentBalance) @@ -244,7 +244,7 @@ namespace MWGui int merchantgold; if (mPtr.getTypeName() == typeid(ESM::NPC).name()) { - ESMS::LiveCellRef* ref = mPtr.get(); + MWWorld::LiveCellRef* ref = mPtr.get(); if (ref->base->npdt52.gold == -10) merchantgold = ref->base->npdt12.gold; else @@ -252,7 +252,7 @@ namespace MWGui } else // ESM::Creature { - ESMS::LiveCellRef* ref = mPtr.get(); + MWWorld::LiveCellRef* ref = mPtr.get(); merchantgold = ref->base->data.gold; } @@ -289,13 +289,13 @@ namespace MWGui int services = 0; if (mPtr.getTypeName() == typeid(ESM::NPC).name()) { - ESMS::LiveCellRef* ref = mPtr.get(); + MWWorld::LiveCellRef* ref = mPtr.get(); if (ref->base->hasAI) services = ref->base->AI.services; } else if (mPtr.getTypeName() == typeid(ESM::Creature).name()) { - ESMS::LiveCellRef* ref = mPtr.get(); + MWWorld::LiveCellRef* ref = mPtr.get(); if (ref->base->hasAI) services = ref->base->AI.services; } diff --git a/apps/openmw/mwrender/actors.hpp b/apps/openmw/mwrender/actors.hpp index 432bcc2972..c664927806 100644 --- a/apps/openmw/mwrender/actors.hpp +++ b/apps/openmw/mwrender/actors.hpp @@ -1,12 +1,9 @@ #ifndef _GAME_RENDER_ACTORS_H #define _GAME_RENDER_ACTORS_H -#include "components/esm_store/cell_store.hpp" #include #include - - #include #include "components/nifogre/ogre_nif_loader.hpp" diff --git a/apps/openmw/mwrender/creatureanimation.cpp b/apps/openmw/mwrender/creatureanimation.cpp index 9ca3ed7319..3303f3ddff 100644 --- a/apps/openmw/mwrender/creatureanimation.cpp +++ b/apps/openmw/mwrender/creatureanimation.cpp @@ -12,7 +12,7 @@ CreatureAnimation::~CreatureAnimation(){ } CreatureAnimation::CreatureAnimation(const MWWorld::Ptr& ptr, OEngine::Render::OgreRenderer& _rend): Animation(_rend){ insert = ptr.getRefData().getBaseNode(); - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); assert (ref->base != NULL); diff --git a/apps/openmw/mwrender/npcanimation.cpp b/apps/openmw/mwrender/npcanimation.cpp index 5ceafca365..ed1f591dd5 100644 --- a/apps/openmw/mwrender/npcanimation.cpp +++ b/apps/openmw/mwrender/npcanimation.cpp @@ -38,7 +38,7 @@ NpcAnimation::NpcAnimation(const MWWorld::Ptr& ptr, OEngine::Render::OgreRendere lfoot(0), rfoot(0) { - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); Ogre::Entity* blank = 0; std::vector* blankshape = 0; diff --git a/apps/openmw/mwrender/objects.cpp b/apps/openmw/mwrender/objects.cpp index b9efcd3f5d..985dcde7ed 100644 --- a/apps/openmw/mwrender/objects.cpp +++ b/apps/openmw/mwrender/objects.cpp @@ -56,7 +56,7 @@ void Objects::insertBegin (const MWWorld::Ptr& ptr, bool enabled, bool static_) insert->setPosition(f[0], f[1], f[2]); insert->setScale(ptr.getCellRef().scale, ptr.getCellRef().scale, ptr.getCellRef().scale); - + // Convert MW rotation to a quaternion: f = ptr.getCellRef().pos.rot; @@ -194,7 +194,7 @@ void Objects::insertLight (const MWWorld::Ptr& ptr, float r, float g, float b, f Ogre::Light *light = mRenderer.getScene()->createLight(); light->setDiffuseColour (r, g, b); - ESMS::LiveCellRef *ref = + MWWorld::LiveCellRef *ref = ptr.get(); LightInfo info; @@ -307,7 +307,7 @@ void Objects::removeCell(MWWorld::Ptr::CellStore* store) mBounds.erase(store); } -void Objects::buildStaticGeometry(ESMS::CellStore& cell) +void Objects::buildStaticGeometry(MWWorld::Ptr::CellStore& cell) { if(mStaticGeometry.find(&cell) != mStaticGeometry.end()) { diff --git a/apps/openmw/mwrender/objects.hpp b/apps/openmw/mwrender/objects.hpp index 6132879e69..05634e4b0b 100644 --- a/apps/openmw/mwrender/objects.hpp +++ b/apps/openmw/mwrender/objects.hpp @@ -3,8 +3,6 @@ #include -#include - #include "../mwworld/refdata.hpp" #include "../mwworld/ptr.hpp" @@ -88,7 +86,7 @@ public: ///< \return found? void removeCell(MWWorld::Ptr::CellStore* store); - void buildStaticGeometry(ESMS::CellStore &cell); + void buildStaticGeometry(MWWorld::Ptr::CellStore &cell); void setMwRoot(Ogre::SceneNode* root); }; } diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index 1029b5b60f..03bb246358 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -323,7 +323,7 @@ bool RenderingManager::toggleRenderMode(int mode) } } -void RenderingManager::configureFog(ESMS::CellStore &mCell) +void RenderingManager::configureFog(MWWorld::Ptr::CellStore &mCell) { Ogre::ColourValue color; color.setAsABGR (mCell.cell->ambi.fog); @@ -372,7 +372,7 @@ void RenderingManager::setAmbientMode() } } -void RenderingManager::configureAmbient(ESMS::CellStore &mCell) +void RenderingManager::configureAmbient(MWWorld::Ptr::CellStore &mCell) { mAmbientColor.setAsABGR (mCell.cell->ambi.ambient); setAmbientMode(); diff --git a/apps/openmw/mwrender/renderingmanager.hpp b/apps/openmw/mwrender/renderingmanager.hpp index 20f22fcca8..2c1b21dd56 100644 --- a/apps/openmw/mwrender/renderingmanager.hpp +++ b/apps/openmw/mwrender/renderingmanager.hpp @@ -136,13 +136,13 @@ class RenderingManager: private RenderingInterface, public Ogre::WindowEventList int skyGetMasserPhase() const; int skyGetSecundaPhase() const; void skySetMoonColour (bool red); - void configureAmbient(ESMS::CellStore &mCell); + void configureAmbient(MWWorld::Ptr::CellStore &mCell); void requestMap (MWWorld::Ptr::CellStore* cell); ///< request the local map for a cell /// configure fog according to cell - void configureFog(ESMS::CellStore &mCell); + void configureFog(MWWorld::Ptr::CellStore &mCell); /// configure fog manually void configureFog(const float density, const Ogre::ColourValue& colour); diff --git a/apps/openmw/mwworld/actionread.cpp b/apps/openmw/mwworld/actionread.cpp index 34e95cbd07..d84c8346ff 100644 --- a/apps/openmw/mwworld/actionread.cpp +++ b/apps/openmw/mwworld/actionread.cpp @@ -13,7 +13,7 @@ namespace MWWorld void ActionRead::execute () { - ESMS::LiveCellRef *ref = + LiveCellRef *ref = mObject.get(); if (ref->base->data.isScroll) @@ -28,4 +28,3 @@ namespace MWWorld } } } - diff --git a/apps/openmw/mwworld/cells.cpp b/apps/openmw/mwworld/cells.cpp index 3d6042e466..8e89d86d71 100644 --- a/apps/openmw/mwworld/cells.cpp +++ b/apps/openmw/mwworld/cells.cpp @@ -39,7 +39,7 @@ MWWorld::Ptr::CellStore *MWWorld::Cells::getCellStore (const ESM::Cell *cell) void MWWorld::Cells::fillContainers (Ptr::CellStore& cellStore) { - for (ESMS::CellRefList::List::iterator iter ( + for (CellRefList::List::iterator iter ( cellStore.containers.list.begin()); iter!=cellStore.containers.list.end(); ++iter) { @@ -49,7 +49,7 @@ void MWWorld::Cells::fillContainers (Ptr::CellStore& cellStore) iter->base->inventory, mStore); } - for (ESMS::CellRefList::List::iterator iter ( + for (CellRefList::List::iterator iter ( cellStore.creatures.list.begin()); iter!=cellStore.creatures.list.end(); ++iter) { @@ -59,7 +59,7 @@ void MWWorld::Cells::fillContainers (Ptr::CellStore& cellStore) iter->base->inventory, mStore); } - for (ESMS::CellRefList::List::iterator iter ( + for (CellRefList::List::iterator iter ( cellStore.npcs.list.begin()); iter!=cellStore.npcs.list.end(); ++iter) { @@ -168,64 +168,64 @@ MWWorld::Ptr MWWorld::Cells::getPtr (const std::string& name, Ptr::CellStore& ce return Ptr(); } - if (ESMS::LiveCellRef *ref = cell.activators.find (name)) + if (MWWorld::LiveCellRef *ref = cell.activators.find (name)) return Ptr (ref, &cell); - if (ESMS::LiveCellRef *ref = cell.potions.find (name)) + if (MWWorld::LiveCellRef *ref = cell.potions.find (name)) return Ptr (ref, &cell); - if (ESMS::LiveCellRef *ref = cell.appas.find (name)) + if (MWWorld::LiveCellRef *ref = cell.appas.find (name)) return Ptr (ref, &cell); - if (ESMS::LiveCellRef *ref = cell.armors.find (name)) + if (MWWorld::LiveCellRef *ref = cell.armors.find (name)) return Ptr (ref, &cell); - if (ESMS::LiveCellRef *ref = cell.books.find (name)) + if (MWWorld::LiveCellRef *ref = cell.books.find (name)) return Ptr (ref, &cell); - if (ESMS::LiveCellRef *ref = cell.clothes.find (name)) + if (MWWorld::LiveCellRef *ref = cell.clothes.find (name)) return Ptr (ref, &cell); - if (ESMS::LiveCellRef *ref = cell.containers.find (name)) + if (MWWorld::LiveCellRef *ref = cell.containers.find (name)) return Ptr (ref, &cell); - if (ESMS::LiveCellRef *ref = cell.creatures.find (name)) + if (MWWorld::LiveCellRef *ref = cell.creatures.find (name)) return Ptr (ref, &cell); - if (ESMS::LiveCellRef *ref = cell.doors.find (name)) + if (MWWorld::LiveCellRef *ref = cell.doors.find (name)) return Ptr (ref, &cell); - if (ESMS::LiveCellRef *ref = cell.ingreds.find (name)) + if (MWWorld::LiveCellRef *ref = cell.ingreds.find (name)) return Ptr (ref, &cell); - if (ESMS::LiveCellRef *ref = cell.creatureLists.find (name)) + if (MWWorld::LiveCellRef *ref = cell.creatureLists.find (name)) return Ptr (ref, &cell); - if (ESMS::LiveCellRef *ref = cell.itemLists.find (name)) + if (MWWorld::LiveCellRef *ref = cell.itemLists.find (name)) return Ptr (ref, &cell); - if (ESMS::LiveCellRef *ref = cell.lights.find (name)) + if (MWWorld::LiveCellRef *ref = cell.lights.find (name)) return Ptr (ref, &cell); - if (ESMS::LiveCellRef *ref = cell.lockpicks.find (name)) + if (MWWorld::LiveCellRef *ref = cell.lockpicks.find (name)) return Ptr (ref, &cell); - if (ESMS::LiveCellRef *ref = cell.miscItems.find (name)) + if (MWWorld::LiveCellRef *ref = cell.miscItems.find (name)) return Ptr (ref, &cell); - if (ESMS::LiveCellRef *ref = cell.npcs.find (name)) + if (MWWorld::LiveCellRef *ref = cell.npcs.find (name)) return Ptr (ref, &cell); - if (ESMS::LiveCellRef *ref = cell.probes.find (name)) + if (MWWorld::LiveCellRef *ref = cell.probes.find (name)) return Ptr (ref, &cell); - if (ESMS::LiveCellRef *ref = cell.repairs.find (name)) + if (MWWorld::LiveCellRef *ref = cell.repairs.find (name)) return Ptr (ref, &cell); - if (ESMS::LiveCellRef *ref = cell.statics.find (name)) + if (MWWorld::LiveCellRef *ref = cell.statics.find (name)) return Ptr (ref, &cell); - if (ESMS::LiveCellRef *ref = cell.weapons.find (name)) + if (MWWorld::LiveCellRef *ref = cell.weapons.find (name)) return Ptr (ref, &cell); return Ptr(); diff --git a/components/esm_store/cell_store.hpp b/apps/openmw/mwworld/cellstore.hpp similarity index 65% rename from components/esm_store/cell_store.hpp rename to apps/openmw/mwworld/cellstore.hpp index 0244122916..cac5eb6178 100644 --- a/components/esm_store/cell_store.hpp +++ b/apps/openmw/mwworld/cellstore.hpp @@ -1,17 +1,9 @@ -#ifndef _GAME_CELL_STORE_H -#define _GAME_CELL_STORE_H +#ifndef GAME_MWWORLD_CELLSTORE_H +#define GAME_MWWORLD_CELLSTORE_H -/* - Cell storage. +#include - Used to load, look up and store all references in a single cell. - - Depends on esm/loadcell.hpp (loading from ESM) and esm_store.hpp - (looking up references.) Neither of these modules depend on us. - */ - -#include "store.hpp" -#include "components/esm/records.hpp" +#include #include #include @@ -20,10 +12,8 @@ #include #include -namespace ESMS +namespace MWWorld { - using namespace ESM; - /// A reference to one object (of any type) in a cell. /// /// Constructing this with a CellRef instance in the constructor means that @@ -33,7 +23,7 @@ namespace ESMS template struct LiveCellRef { - LiveCellRef(const CellRef& cref, const X* b = NULL) : base(b), ref(cref), + LiveCellRef(const ESM::CellRef& cref, const X* b = NULL) : base(b), ref(cref), mData(ref) {} @@ -45,7 +35,7 @@ namespace ESMS /* Information about this instance, such as 3D location and rotation and individual type-dependent data. */ - CellRef ref; + ESM::CellRef ref; /// runtime-data D mData; @@ -63,7 +53,7 @@ namespace ESMS // ESMStore. Insert the reference into the list if a match is // found. If not, throw an exception. template - void find(CellRef &ref, const Y& recList) + void find(ESM::CellRef &ref, const Y& recList) { const X* obj = recList.find(ref.refID); if(obj == NULL) @@ -107,28 +97,28 @@ namespace ESMS float mWaterLevel; // Lists for each individual object type - CellRefList activators; - CellRefList potions; - CellRefList appas; - CellRefList armors; - CellRefList books; - CellRefList clothes; - CellRefList containers; - CellRefList creatures; - CellRefList doors; - CellRefList ingreds; - CellRefList creatureLists; - CellRefList itemLists; + CellRefList activators; + CellRefList potions; + CellRefList appas; + CellRefList armors; + CellRefList books; + CellRefList clothes; + CellRefList containers; + CellRefList creatures; + CellRefList doors; + CellRefList ingreds; + CellRefList creatureLists; + CellRefList itemLists; CellRefList lights; - CellRefList lockpicks; - CellRefList miscItems; - CellRefList npcs; - CellRefList probes; - CellRefList repairs; - CellRefList statics; - CellRefList weapons; + CellRefList lockpicks; + CellRefList miscItems; + CellRefList npcs; + CellRefList probes; + CellRefList repairs; + CellRefList statics; + CellRefList weapons; - void load (const ESMStore &store, ESMReader &esm) + void load (const ESMS::ESMStore &store, ESM::ESMReader &esm) { if (mState!=State_Loaded) { @@ -143,7 +133,7 @@ namespace ESMS } } - void preload (const ESMStore &store, ESMReader &esm) + void preload (const ESMS::ESMStore &store, ESM::ESMReader &esm) { if (mState==State_Unloaded) { @@ -196,7 +186,7 @@ namespace ESMS } /// Run through references and store IDs - void listRefs(const ESMStore &store, ESMReader &esm) + void listRefs(const ESMS::ESMStore &store, ESM::ESMReader &esm) { assert (cell); @@ -206,7 +196,7 @@ namespace ESMS // Reopen the ESM reader and seek to the right position. cell->restore (esm); - CellRef ref; + ESM::CellRef ref; // Get each reference in turn while (cell->getNextRef (esm, ref)) @@ -222,7 +212,7 @@ namespace ESMS std::sort (mIds.begin(), mIds.end()); } - void loadRefs(const ESMStore &store, ESMReader &esm) + void loadRefs(const ESMS::ESMStore &store, ESM::ESMReader &esm) { assert (cell); @@ -232,7 +222,7 @@ namespace ESMS // Reopen the ESM reader and seek to the right position. cell->restore(esm); - CellRef ref; + ESM::CellRef ref; // Get each reference in turn while(cell->getNextRef(esm, ref)) @@ -253,26 +243,26 @@ namespace ESMS */ switch(rec) { - case REC_ACTI: activators.find(ref, store.activators); break; - case REC_ALCH: potions.find(ref, store.potions); break; - case REC_APPA: appas.find(ref, store.appas); break; - case REC_ARMO: armors.find(ref, store.armors); break; - case REC_BOOK: books.find(ref, store.books); break; - case REC_CLOT: clothes.find(ref, store.clothes); break; - case REC_CONT: containers.find(ref, store.containers); break; - case REC_CREA: creatures.find(ref, store.creatures); break; - case REC_DOOR: doors.find(ref, store.doors); break; - case REC_INGR: ingreds.find(ref, store.ingreds); break; - case REC_LEVC: creatureLists.find(ref, store.creatureLists); break; - case REC_LEVI: itemLists.find(ref, store.itemLists); break; - case REC_LIGH: lights.find(ref, store.lights); break; - case REC_LOCK: lockpicks.find(ref, store.lockpicks); break; - case REC_MISC: miscItems.find(ref, store.miscItems); break; - case REC_NPC_: npcs.find(ref, store.npcs); break; - case REC_PROB: probes.find(ref, store.probes); break; - case REC_REPA: repairs.find(ref, store.repairs); break; - case REC_STAT: statics.find(ref, store.statics); break; - case REC_WEAP: weapons.find(ref, store.weapons); break; + case ESM::REC_ACTI: activators.find(ref, store.activators); break; + case ESM::REC_ALCH: potions.find(ref, store.potions); break; + case ESM::REC_APPA: appas.find(ref, store.appas); break; + case ESM::REC_ARMO: armors.find(ref, store.armors); break; + case ESM::REC_BOOK: books.find(ref, store.books); break; + case ESM::REC_CLOT: clothes.find(ref, store.clothes); break; + case ESM::REC_CONT: containers.find(ref, store.containers); break; + case ESM::REC_CREA: creatures.find(ref, store.creatures); break; + case ESM::REC_DOOR: doors.find(ref, store.doors); break; + case ESM::REC_INGR: ingreds.find(ref, store.ingreds); break; + case ESM::REC_LEVC: creatureLists.find(ref, store.creatureLists); break; + case ESM::REC_LEVI: itemLists.find(ref, store.itemLists); break; + case ESM::REC_LIGH: lights.find(ref, store.lights); break; + case ESM::REC_LOCK: lockpicks.find(ref, store.lockpicks); break; + case ESM::REC_MISC: miscItems.find(ref, store.miscItems); break; + case ESM::REC_NPC_: npcs.find(ref, store.npcs); break; + case ESM::REC_PROB: probes.find(ref, store.probes); break; + case ESM::REC_REPA: repairs.find(ref, store.repairs); break; + case ESM::REC_STAT: statics.find(ref, store.statics); break; + case ESM::REC_WEAP: weapons.find(ref, store.weapons); break; case 0: std::cout << "Cell reference " + ref.refID + " not found!\n"; break; default: diff --git a/apps/openmw/mwworld/containerstore.cpp b/apps/openmw/mwworld/containerstore.cpp index 3304d0e6d0..a071710b72 100644 --- a/apps/openmw/mwworld/containerstore.cpp +++ b/apps/openmw/mwworld/containerstore.cpp @@ -5,7 +5,7 @@ #include #include -#include +#include #include @@ -19,11 +19,11 @@ namespace { template - float getTotalWeight (const ESMS::CellRefList& cellRefList) + float getTotalWeight (const MWWorld::CellRefList& cellRefList) { float sum = 0; - for (typename ESMS::CellRefList::List::const_iterator iter ( + for (typename MWWorld::CellRefList::List::const_iterator iter ( cellRefList.list.begin()); iter!=cellRefList.list.end(); ++iter) @@ -78,7 +78,7 @@ MWWorld::ContainerStoreIterator MWWorld::ContainerStore::add (const Ptr& ptr) // this ensures that gold piles of different sizes stack with each other (also, several scripts rely on Gold_001 for detecting player gold) if (MWWorld::Class::get(ptr).getName(ptr) == MWBase::Environment::get().getWorld()->getStore().gameSettings.search("sGold")->str) { - ESMS::LiveCellRef *gold = + MWWorld::LiveCellRef *gold = ptr.get(); if (compare_string_ci(gold->ref.refID, "gold_001") @@ -281,29 +281,29 @@ MWWorld::ContainerStoreIterator::ContainerStoreIterator (int mask, ContainerStor ++*this; } -MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, ESMS::CellRefList::List::iterator iterator) +MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList::List::iterator iterator) : mType(MWWorld::ContainerStore::Type_Potion), mMask(MWWorld::ContainerStore::Type_All), mContainer(container), mPotion(iterator){} -MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, ESMS::CellRefList::List::iterator iterator) +MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList::List::iterator iterator) : mType(MWWorld::ContainerStore::Type_Apparatus), mMask(MWWorld::ContainerStore::Type_All), mContainer(container), mApparatus(iterator){} -MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, ESMS::CellRefList::List::iterator iterator) +MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList::List::iterator iterator) : mType(MWWorld::ContainerStore::Type_Armor), mMask(MWWorld::ContainerStore::Type_All), mContainer(container), mArmor(iterator){} -MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, ESMS::CellRefList::List::iterator iterator) +MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList::List::iterator iterator) : mType(MWWorld::ContainerStore::Type_Book), mMask(MWWorld::ContainerStore::Type_All), mContainer(container), mBook(iterator){} -MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, ESMS::CellRefList::List::iterator iterator) +MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList::List::iterator iterator) : mType(MWWorld::ContainerStore::Type_Clothing), mMask(MWWorld::ContainerStore::Type_All), mContainer(container), mClothing(iterator){} -MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, ESMS::CellRefList::List::iterator iterator) +MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList::List::iterator iterator) : mType(MWWorld::ContainerStore::Type_Ingredient), mMask(MWWorld::ContainerStore::Type_All), mContainer(container), mIngredient(iterator){} -MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, ESMS::CellRefList::List::iterator iterator) +MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList::List::iterator iterator) : mType(MWWorld::ContainerStore::Type_Light), mMask(MWWorld::ContainerStore::Type_All), mContainer(container), mLight(iterator){} -MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, ESMS::CellRefList::List::iterator iterator) +MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList::List::iterator iterator) : mType(MWWorld::ContainerStore::Type_Lockpick), mMask(MWWorld::ContainerStore::Type_All), mContainer(container), mLockpick(iterator){} -MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, ESMS::CellRefList::List::iterator iterator) +MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList::List::iterator iterator) : mType(MWWorld::ContainerStore::Type_Miscellaneous), mMask(MWWorld::ContainerStore::Type_All), mContainer(container), mMiscellaneous(iterator){} -MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, ESMS::CellRefList::List::iterator iterator) +MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList::List::iterator iterator) : mType(MWWorld::ContainerStore::Type_Probe), mMask(MWWorld::ContainerStore::Type_All), mContainer(container), mProbe(iterator){} -MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, ESMS::CellRefList::List::iterator iterator) +MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList::List::iterator iterator) : mType(MWWorld::ContainerStore::Type_Repair), mMask(MWWorld::ContainerStore::Type_All), mContainer(container), mRepair(iterator){} -MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, ESMS::CellRefList::List::iterator iterator) +MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList::List::iterator iterator) : mType(MWWorld::ContainerStore::Type_Weapon), mMask(MWWorld::ContainerStore::Type_All), mContainer(container), mWeapon(iterator){} void MWWorld::ContainerStoreIterator::incType() diff --git a/apps/openmw/mwworld/containerstore.hpp b/apps/openmw/mwworld/containerstore.hpp index 15b553f9dd..0a20bcc768 100644 --- a/apps/openmw/mwworld/containerstore.hpp +++ b/apps/openmw/mwworld/containerstore.hpp @@ -3,8 +3,7 @@ #include -#include - +#include "cellstore.hpp" #include "refdata.hpp" #include "ptr.hpp" @@ -40,18 +39,18 @@ namespace MWWorld private: - ESMS::CellRefList potions; - ESMS::CellRefList appas; - ESMS::CellRefList armors; - ESMS::CellRefList books; - ESMS::CellRefList clothes; - ESMS::CellRefList ingreds; - ESMS::CellRefList lights; - ESMS::CellRefList lockpicks; - ESMS::CellRefList miscItems; - ESMS::CellRefList probes; - ESMS::CellRefList repairs; - ESMS::CellRefList weapons; + MWWorld::CellRefList potions; + MWWorld::CellRefList appas; + MWWorld::CellRefList armors; + MWWorld::CellRefList books; + MWWorld::CellRefList clothes; + MWWorld::CellRefList ingreds; + MWWorld::CellRefList lights; + MWWorld::CellRefList lockpicks; + MWWorld::CellRefList miscItems; + MWWorld::CellRefList probes; + MWWorld::CellRefList repairs; + MWWorld::CellRefList weapons; int mStateId; mutable float mCachedWeight; mutable bool mWeightUpToDate; @@ -122,18 +121,18 @@ namespace MWWorld ContainerStore *mContainer; mutable Ptr mPtr; - ESMS::CellRefList::List::iterator mPotion; - ESMS::CellRefList::List::iterator mApparatus; - ESMS::CellRefList::List::iterator mArmor; - ESMS::CellRefList::List::iterator mBook; - ESMS::CellRefList::List::iterator mClothing; - ESMS::CellRefList::List::iterator mIngredient; - ESMS::CellRefList::List::iterator mLight; - ESMS::CellRefList::List::iterator mLockpick; - ESMS::CellRefList::List::iterator mMiscellaneous; - ESMS::CellRefList::List::iterator mProbe; - ESMS::CellRefList::List::iterator mRepair; - ESMS::CellRefList::List::iterator mWeapon; + MWWorld::CellRefList::List::iterator mPotion; + MWWorld::CellRefList::List::iterator mApparatus; + MWWorld::CellRefList::List::iterator mArmor; + MWWorld::CellRefList::List::iterator mBook; + MWWorld::CellRefList::List::iterator mClothing; + MWWorld::CellRefList::List::iterator mIngredient; + MWWorld::CellRefList::List::iterator mLight; + MWWorld::CellRefList::List::iterator mLockpick; + MWWorld::CellRefList::List::iterator mMiscellaneous; + MWWorld::CellRefList::List::iterator mProbe; + MWWorld::CellRefList::List::iterator mRepair; + MWWorld::CellRefList::List::iterator mWeapon; private: @@ -144,18 +143,18 @@ namespace MWWorld ///< Begin-iterator // construct iterator using a CellRefList iterator - ContainerStoreIterator (ContainerStore *container, ESMS::CellRefList::List::iterator); - ContainerStoreIterator (ContainerStore *container, ESMS::CellRefList::List::iterator); - ContainerStoreIterator (ContainerStore *container, ESMS::CellRefList::List::iterator); - ContainerStoreIterator (ContainerStore *container, ESMS::CellRefList::List::iterator); - ContainerStoreIterator (ContainerStore *container, ESMS::CellRefList::List::iterator); - ContainerStoreIterator (ContainerStore *container, ESMS::CellRefList::List::iterator); - ContainerStoreIterator (ContainerStore *container, ESMS::CellRefList::List::iterator); - ContainerStoreIterator (ContainerStore *container, ESMS::CellRefList::List::iterator); - ContainerStoreIterator (ContainerStore *container, ESMS::CellRefList::List::iterator); - ContainerStoreIterator (ContainerStore *container, ESMS::CellRefList::List::iterator); - ContainerStoreIterator (ContainerStore *container, ESMS::CellRefList::List::iterator); - ContainerStoreIterator (ContainerStore *container, ESMS::CellRefList::List::iterator); + ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList::List::iterator); + ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList::List::iterator); + ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList::List::iterator); + ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList::List::iterator); + ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList::List::iterator); + ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList::List::iterator); + ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList::List::iterator); + ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList::List::iterator); + ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList::List::iterator); + ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList::List::iterator); + ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList::List::iterator); + ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList::List::iterator); void incType(); diff --git a/apps/openmw/mwworld/localscripts.cpp b/apps/openmw/mwworld/localscripts.cpp index 2d90d90e01..246d959404 100644 --- a/apps/openmw/mwworld/localscripts.cpp +++ b/apps/openmw/mwworld/localscripts.cpp @@ -1,13 +1,15 @@ #include "localscripts.hpp" +#include "cellstore.hpp" + namespace { template void listCellScripts (MWWorld::LocalScripts& localScripts, - ESMS::CellRefList& cellRefList, MWWorld::Ptr::CellStore *cell) + MWWorld::CellRefList& cellRefList, MWWorld::Ptr::CellStore *cell) { - for (typename ESMS::CellRefList::List::iterator iter ( + for (typename MWWorld::CellRefList::List::iterator iter ( cellRefList.list.begin()); iter!=cellRefList.list.end(); ++iter) { diff --git a/apps/openmw/mwworld/manualref.hpp b/apps/openmw/mwworld/manualref.hpp index f8bc7d9832..9705fc7af6 100644 --- a/apps/openmw/mwworld/manualref.hpp +++ b/apps/openmw/mwworld/manualref.hpp @@ -3,10 +3,10 @@ #include -#include #include #include "ptr.hpp" +#include "cellstore.hpp" namespace MWWorld { @@ -24,11 +24,11 @@ namespace MWWorld { if (const T *instance = list.search (name)) { - ESMS::LiveCellRef ref; + LiveCellRef ref; ref.base = instance; mRef = ref; - mPtr = Ptr (&boost::any_cast&> (mRef), 0); + mPtr = Ptr (&boost::any_cast&> (mRef), 0); return true; } @@ -41,11 +41,11 @@ namespace MWWorld { if (const T *instance = list.search (name)) { - ESMS::LiveCellRef ref; + LiveCellRef ref; ref.base = instance; mRef = ref; - mPtr = Ptr (&boost::any_cast&> (mRef), 0); + mPtr = Ptr (&boost::any_cast&> (mRef), 0); return true; } diff --git a/apps/openmw/mwworld/player.hpp b/apps/openmw/mwworld/player.hpp index a5c5ff308b..09c4949d4f 100644 --- a/apps/openmw/mwworld/player.hpp +++ b/apps/openmw/mwworld/player.hpp @@ -3,8 +3,7 @@ #include "OgreCamera.h" -#include - +#include "../mwworld/cellstore.hpp" #include "../mwworld/refdata.hpp" #include "../mwworld/ptr.hpp" @@ -20,9 +19,9 @@ namespace MWWorld class World; /// \brief NPC object representing the player and additional player data - class Player + class Player { - ESMS::LiveCellRef mPlayer; + LiveCellRef mPlayer; MWWorld::Ptr::CellStore *mCellStore; MWRender::Player *mRenderer; MWWorld::World& mWorld; diff --git a/apps/openmw/mwworld/ptr.hpp b/apps/openmw/mwworld/ptr.hpp index 4cf3e98da4..c5461c4691 100644 --- a/apps/openmw/mwworld/ptr.hpp +++ b/apps/openmw/mwworld/ptr.hpp @@ -7,8 +7,7 @@ #include -#include - +#include "cellstore.hpp" #include "refdata.hpp" namespace MWWorld @@ -21,7 +20,7 @@ namespace MWWorld { public: - typedef ESMS::CellStore CellStore; + typedef MWWorld::CellStore CellStore; boost::any mPtr; ESM::CellRef *mCellRef; @@ -51,7 +50,7 @@ namespace MWWorld } template - Ptr (ESMS::LiveCellRef *liveCellRef, CellStore *cell) + Ptr (MWWorld::LiveCellRef *liveCellRef, CellStore *cell) : mContainerStore (0) { mPtr = liveCellRef; @@ -62,9 +61,9 @@ namespace MWWorld } template - ESMS::LiveCellRef *get() const + MWWorld::LiveCellRef *get() const { - return boost::any_cast*> (mPtr); + return boost::any_cast*> (mPtr); } ESM::CellRef& getCellRef() const; diff --git a/apps/openmw/mwworld/refdata.cpp b/apps/openmw/mwworld/refdata.cpp index e1c14b907e..a8aa058bc3 100644 --- a/apps/openmw/mwworld/refdata.cpp +++ b/apps/openmw/mwworld/refdata.cpp @@ -1,9 +1,8 @@ #include "refdata.hpp" -#include - #include "customdata.hpp" +#include "cellstore.hpp" namespace MWWorld { diff --git a/apps/openmw/mwworld/scene.cpp b/apps/openmw/mwworld/scene.cpp index a47137d257..8a4373b1e8 100644 --- a/apps/openmw/mwworld/scene.cpp +++ b/apps/openmw/mwworld/scene.cpp @@ -23,7 +23,7 @@ namespace template void insertCellRefList(MWRender::RenderingManager& rendering, - T& cellRefList, ESMS::CellStore &cell, MWWorld::PhysicsSystem& physics) + T& cellRefList, MWWorld::CellStore &cell, MWWorld::PhysicsSystem& physics) { if (!cellRefList.list.empty()) { @@ -312,7 +312,7 @@ namespace MWWorld mCellChanged = false; } - void Scene::insertCell(ESMS::CellStore &cell) + void Scene::insertCell (Ptr::CellStore &cell) { // Loop through all references in the cell insertCellRefList(mRendering, cell.activators, cell, *mPhysics); @@ -348,67 +348,67 @@ namespace MWWorld // insert into the correct CellRefList if (type == typeid(ESM::Potion).name()) { - ESMS::LiveCellRef* ref = ptr.get(); + MWWorld::LiveCellRef* ref = ptr.get(); cell->potions.list.push_back( *ref ); newPtr = MWWorld::Ptr(&cell->potions.list.back(), cell); } else if (type == typeid(ESM::Apparatus).name()) { - ESMS::LiveCellRef* ref = ptr.get(); + MWWorld::LiveCellRef* ref = ptr.get(); cell->appas.list.push_back( *ref ); newPtr = MWWorld::Ptr(&cell->appas.list.back(), cell); } else if (type == typeid(ESM::Armor).name()) { - ESMS::LiveCellRef* ref = ptr.get(); + MWWorld::LiveCellRef* ref = ptr.get(); cell->armors.list.push_back( *ref ); newPtr = MWWorld::Ptr(&cell->armors.list.back(), cell); } else if (type == typeid(ESM::Book).name()) { - ESMS::LiveCellRef* ref = ptr.get(); + MWWorld::LiveCellRef* ref = ptr.get(); cell->books.list.push_back( *ref ); newPtr = MWWorld::Ptr(&cell->books.list.back(), cell); } else if (type == typeid(ESM::Clothing).name()) { - ESMS::LiveCellRef* ref = ptr.get(); + MWWorld::LiveCellRef* ref = ptr.get(); cell->clothes.list.push_back( *ref ); newPtr = MWWorld::Ptr(&cell->clothes.list.back(), cell); } else if (type == typeid(ESM::Ingredient).name()) { - ESMS::LiveCellRef* ref = ptr.get(); + MWWorld::LiveCellRef* ref = ptr.get(); cell->ingreds.list.push_back( *ref ); newPtr = MWWorld::Ptr(&cell->ingreds.list.back(), cell); } else if (type == typeid(ESM::Light).name()) { - ESMS::LiveCellRef* ref = ptr.get(); + MWWorld::LiveCellRef* ref = ptr.get(); cell->lights.list.push_back( *ref ); newPtr = MWWorld::Ptr(&cell->lights.list.back(), cell); } else if (type == typeid(ESM::Tool).name()) { - ESMS::LiveCellRef* ref = ptr.get(); + MWWorld::LiveCellRef* ref = ptr.get(); cell->lockpicks.list.push_back( *ref ); newPtr = MWWorld::Ptr(&cell->lockpicks.list.back(), cell); } else if (type == typeid(ESM::Repair).name()) { - ESMS::LiveCellRef* ref = ptr.get(); + MWWorld::LiveCellRef* ref = ptr.get(); cell->repairs.list.push_back( *ref ); newPtr = MWWorld::Ptr(&cell->repairs.list.back(), cell); } else if (type == typeid(ESM::Probe).name()) { - ESMS::LiveCellRef* ref = ptr.get(); + MWWorld::LiveCellRef* ref = ptr.get(); cell->probes.list.push_back( *ref ); newPtr = MWWorld::Ptr(&cell->probes.list.back(), cell); } else if (type == typeid(ESM::Weapon).name()) { - ESMS::LiveCellRef* ref = ptr.get(); + MWWorld::LiveCellRef* ref = ptr.get(); cell->weapons.list.push_back( *ref ); newPtr = MWWorld::Ptr(&cell->weapons.list.back(), cell); } @@ -432,7 +432,7 @@ namespace MWWorld MWWorld::ManualRef newRef (MWBase::Environment::get().getWorld()->getStore(), base); - ESMS::LiveCellRef* ref = newRef.getPtr().get(); + MWWorld::LiveCellRef* ref = newRef.getPtr().get(); cell->miscItems.list.push_back( *ref ); newPtr = MWWorld::Ptr(&cell->miscItems.list.back(), cell); @@ -444,7 +444,7 @@ namespace MWWorld } else { - ESMS::LiveCellRef* ref = ptr.get(); + MWWorld::LiveCellRef* ref = ptr.get(); cell->miscItems.list.push_back( *ref ); newPtr = MWWorld::Ptr(&cell->miscItems.list.back(), cell); diff --git a/apps/openmw/mwworld/scene.hpp b/apps/openmw/mwworld/scene.hpp index 906580ff4f..373b20ed5e 100644 --- a/apps/openmw/mwworld/scene.hpp +++ b/apps/openmw/mwworld/scene.hpp @@ -8,8 +8,6 @@ #include -#include - #include "../mwrender/renderingmanager.hpp" #include "../mwrender/renderinginterface.hpp" @@ -98,7 +96,7 @@ namespace MWWorld void markCellAsUnchanged(); - void insertCell(ESMS::CellStore &cell); + void insertCell (Ptr::CellStore &cell); /// this method is only meant for dropping objects into the gameworld from a container /// and thus only handles object types that can be placed in a container diff --git a/apps/openmw/mwworld/world.cpp b/apps/openmw/mwworld/world.cpp index 79fd03e366..525ae33ce5 100644 --- a/apps/openmw/mwworld/world.cpp +++ b/apps/openmw/mwworld/world.cpp @@ -33,10 +33,10 @@ namespace { template void listCellScripts (const ESMS::ESMStore& store, - ESMS::CellRefList& cellRefList, MWWorld::LocalScripts& localScripts, + MWWorld::CellRefList& cellRefList, MWWorld::LocalScripts& localScripts, MWWorld::Ptr::CellStore *cell) { - for (typename ESMS::CellRefList::List::iterator iter ( + for (typename MWWorld::CellRefList::List::iterator iter ( cellRefList.list.begin()); iter!=cellRefList.list.end(); ++iter) { @@ -53,10 +53,10 @@ namespace } template - ESMS::LiveCellRef *searchViaHandle (const std::string& handle, - ESMS::CellRefList& refList) + MWWorld::LiveCellRef *searchViaHandle (const std::string& handle, + MWWorld::CellRefList& refList) { - typedef typename ESMS::CellRefList::List::iterator iterator; + typedef typename MWWorld::CellRefList::List::iterator iterator; for (iterator iter (refList.list.begin()); iter!=refList.list.end(); ++iter) { @@ -75,45 +75,45 @@ namespace MWWorld { Ptr World::getPtrViaHandle (const std::string& handle, Ptr::CellStore& cell) { - if (ESMS::LiveCellRef *ref = + if (MWWorld::LiveCellRef *ref = searchViaHandle (handle, cell.activators)) return Ptr (ref, &cell); - if (ESMS::LiveCellRef *ref = searchViaHandle (handle, cell.potions)) + if (MWWorld::LiveCellRef *ref = searchViaHandle (handle, cell.potions)) return Ptr (ref, &cell); - if (ESMS::LiveCellRef *ref = searchViaHandle (handle, cell.appas)) + if (MWWorld::LiveCellRef *ref = searchViaHandle (handle, cell.appas)) return Ptr (ref, &cell); - if (ESMS::LiveCellRef *ref = searchViaHandle (handle, cell.armors)) + if (MWWorld::LiveCellRef *ref = searchViaHandle (handle, cell.armors)) return Ptr (ref, &cell); - if (ESMS::LiveCellRef *ref = searchViaHandle (handle, cell.books)) + if (MWWorld::LiveCellRef *ref = searchViaHandle (handle, cell.books)) return Ptr (ref, &cell); - if (ESMS::LiveCellRef *ref = searchViaHandle (handle, cell.clothes)) + if (MWWorld::LiveCellRef *ref = searchViaHandle (handle, cell.clothes)) return Ptr (ref, &cell); - if (ESMS::LiveCellRef *ref = + if (MWWorld::LiveCellRef *ref = searchViaHandle (handle, cell.containers)) return Ptr (ref, &cell); - if (ESMS::LiveCellRef *ref = + if (MWWorld::LiveCellRef *ref = searchViaHandle (handle, cell.creatures)) return Ptr (ref, &cell); - if (ESMS::LiveCellRef *ref = searchViaHandle (handle, cell.doors)) + if (MWWorld::LiveCellRef *ref = searchViaHandle (handle, cell.doors)) return Ptr (ref, &cell); - if (ESMS::LiveCellRef *ref = + if (MWWorld::LiveCellRef *ref = searchViaHandle (handle, cell.ingreds)) return Ptr (ref, &cell); - if (ESMS::LiveCellRef *ref = searchViaHandle (handle, cell.lights)) + if (MWWorld::LiveCellRef *ref = searchViaHandle (handle, cell.lights)) return Ptr (ref, &cell); - if (ESMS::LiveCellRef *ref = searchViaHandle (handle, cell.lockpicks)) + if (MWWorld::LiveCellRef *ref = searchViaHandle (handle, cell.lockpicks)) return Ptr (ref, &cell); - if (ESMS::LiveCellRef *ref = searchViaHandle (handle, cell.miscItems)) + if (MWWorld::LiveCellRef *ref = searchViaHandle (handle, cell.miscItems)) return Ptr (ref, &cell); - if (ESMS::LiveCellRef *ref = searchViaHandle (handle, cell.npcs)) + if (MWWorld::LiveCellRef *ref = searchViaHandle (handle, cell.npcs)) return Ptr (ref, &cell); - if (ESMS::LiveCellRef *ref = searchViaHandle (handle, cell.probes)) + if (MWWorld::LiveCellRef *ref = searchViaHandle (handle, cell.probes)) return Ptr (ref, &cell); - if (ESMS::LiveCellRef *ref = searchViaHandle (handle, cell.repairs)) + if (MWWorld::LiveCellRef *ref = searchViaHandle (handle, cell.repairs)) return Ptr (ref, &cell); - if (ESMS::LiveCellRef *ref = searchViaHandle (handle, cell.statics)) + if (MWWorld::LiveCellRef *ref = searchViaHandle (handle, cell.statics)) return Ptr (ref, &cell); - if (ESMS::LiveCellRef *ref = searchViaHandle (handle, cell.weapons)) + if (MWWorld::LiveCellRef *ref = searchViaHandle (handle, cell.weapons)) return Ptr (ref, &cell); return Ptr(); } @@ -961,8 +961,8 @@ namespace MWWorld Ogre::Vector2 World::getNorthVector(Ptr::CellStore* cell) { - ESMS::CellRefList statics = cell->statics; - ESMS::LiveCellRef* ref = statics.find("northmarker"); + MWWorld::CellRefList statics = cell->statics; + MWWorld::LiveCellRef* ref = statics.find("northmarker"); if (!ref) return Vector2(0, 1); Ogre::SceneNode* node = ref->mData.getBaseNode(); diff --git a/apps/openmw/mwworld/world.hpp b/apps/openmw/mwworld/world.hpp index 34990574e9..f0da56b659 100644 --- a/apps/openmw/mwworld/world.hpp +++ b/apps/openmw/mwworld/world.hpp @@ -6,7 +6,6 @@ #include -#include #include #include "../mwrender/debugging.hpp" diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index 8a1875d0fb..284ca3cce4 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -35,7 +35,7 @@ add_component_dir (file_finder ) add_component_dir (esm_store - cell_store reclists store + reclists store ) add_component_dir (esm @@ -74,4 +74,3 @@ target_link_libraries(components ${Boost_LIBRARIES} ${OGRE_LIBRARIES}) # Make the variable accessible for other subdirectories set(COMPONENT_FILES ${COMPONENT_FILES} PARENT_SCOPE) -