forked from teamnwah/openmw-tes3coop
Issue #107: Detemplateised CellStore; some include cleanup
This commit is contained in:
parent
76174098c7
commit
7fcd41c69d
39 changed files with 461 additions and 442 deletions
|
@ -16,7 +16,7 @@ namespace MWClass
|
|||
{
|
||||
void Activator::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Activator, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Activator> *ref =
|
||||
ptr.get<ESM::Activator>();
|
||||
|
||||
assert (ref->base != NULL);
|
||||
|
@ -32,7 +32,7 @@ namespace MWClass
|
|||
|
||||
void Activator::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Activator, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Activator> *ref =
|
||||
ptr.get<ESM::Activator>();
|
||||
|
||||
|
||||
|
@ -46,7 +46,7 @@ namespace MWClass
|
|||
|
||||
std::string Activator::getName (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Activator, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Activator> *ref =
|
||||
ptr.get<ESM::Activator>();
|
||||
|
||||
return ref->base->name;
|
||||
|
@ -54,7 +54,7 @@ namespace MWClass
|
|||
|
||||
std::string Activator::getScript (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Activator, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Activator> *ref =
|
||||
ptr.get<ESM::Activator>();
|
||||
|
||||
return ref->base->script;
|
||||
|
@ -69,7 +69,7 @@ namespace MWClass
|
|||
|
||||
bool Activator::hasToolTip (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Activator, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Activator> *ref =
|
||||
ptr.get<ESM::Activator>();
|
||||
|
||||
return (ref->base->name != "");
|
||||
|
@ -77,7 +77,7 @@ namespace MWClass
|
|||
|
||||
MWGui::ToolTipInfo Activator::getToolTipInfo (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Activator, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Activator> *ref =
|
||||
ptr.get<ESM::Activator>();
|
||||
|
||||
MWGui::ToolTipInfo info;
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace MWClass
|
|||
{
|
||||
void Apparatus::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Apparatus, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Apparatus> *ref =
|
||||
ptr.get<ESM::Apparatus>();
|
||||
|
||||
assert (ref->base != NULL);
|
||||
|
@ -38,7 +38,7 @@ namespace MWClass
|
|||
|
||||
void Apparatus::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Apparatus, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Apparatus> *ref =
|
||||
ptr.get<ESM::Apparatus>();
|
||||
|
||||
|
||||
|
@ -52,7 +52,7 @@ namespace MWClass
|
|||
|
||||
std::string Apparatus::getName (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Apparatus, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Apparatus> *ref =
|
||||
ptr.get<ESM::Apparatus>();
|
||||
|
||||
return ref->base->name;
|
||||
|
@ -69,7 +69,7 @@ namespace MWClass
|
|||
|
||||
std::string Apparatus::getScript (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Apparatus, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Apparatus> *ref =
|
||||
ptr.get<ESM::Apparatus>();
|
||||
|
||||
return ref->base->script;
|
||||
|
@ -77,7 +77,7 @@ namespace MWClass
|
|||
|
||||
int Apparatus::getValue (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Apparatus, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Apparatus> *ref =
|
||||
ptr.get<ESM::Apparatus>();
|
||||
|
||||
return ref->base->data.value;
|
||||
|
@ -102,7 +102,7 @@ namespace MWClass
|
|||
|
||||
std::string Apparatus::getInventoryIcon (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Apparatus, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Apparatus> *ref =
|
||||
ptr.get<ESM::Apparatus>();
|
||||
|
||||
return ref->base->icon;
|
||||
|
@ -110,7 +110,7 @@ namespace MWClass
|
|||
|
||||
bool Apparatus::hasToolTip (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Apparatus, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Apparatus> *ref =
|
||||
ptr.get<ESM::Apparatus>();
|
||||
|
||||
return (ref->base->name != "");
|
||||
|
@ -118,7 +118,7 @@ namespace MWClass
|
|||
|
||||
MWGui::ToolTipInfo Apparatus::getToolTipInfo (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Apparatus, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Apparatus> *ref =
|
||||
ptr.get<ESM::Apparatus>();
|
||||
|
||||
MWGui::ToolTipInfo info;
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace MWClass
|
|||
{
|
||||
void Armor::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Armor, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Armor> *ref =
|
||||
ptr.get<ESM::Armor>();
|
||||
|
||||
assert (ref->base != NULL);
|
||||
|
@ -40,7 +40,7 @@ namespace MWClass
|
|||
|
||||
void Armor::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Armor, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Armor> *ref =
|
||||
ptr.get<ESM::Armor>();
|
||||
|
||||
const std::string &model = ref->base->model;
|
||||
|
@ -53,7 +53,7 @@ namespace MWClass
|
|||
|
||||
std::string Armor::getName (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Armor, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Armor> *ref =
|
||||
ptr.get<ESM::Armor>();
|
||||
|
||||
return ref->base->name;
|
||||
|
@ -75,7 +75,7 @@ namespace MWClass
|
|||
|
||||
int Armor::getItemMaxHealth (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Armor, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Armor> *ref =
|
||||
ptr.get<ESM::Armor>();
|
||||
|
||||
return ref->base->data.health;
|
||||
|
@ -83,7 +83,7 @@ namespace MWClass
|
|||
|
||||
std::string Armor::getScript (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Armor, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Armor> *ref =
|
||||
ptr.get<ESM::Armor>();
|
||||
|
||||
return ref->base->script;
|
||||
|
@ -91,7 +91,7 @@ namespace MWClass
|
|||
|
||||
std::pair<std::vector<int>, bool> Armor::getEquipmentSlots (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Armor, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Armor> *ref =
|
||||
ptr.get<ESM::Armor>();
|
||||
|
||||
std::vector<int> slots;
|
||||
|
@ -125,7 +125,7 @@ namespace MWClass
|
|||
|
||||
int Armor::getEquipmentSkill (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Armor, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Armor> *ref =
|
||||
ptr.get<ESM::Armor>();
|
||||
|
||||
std::string typeGmst;
|
||||
|
@ -163,7 +163,7 @@ namespace MWClass
|
|||
|
||||
int Armor::getValue (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Armor, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Armor> *ref =
|
||||
ptr.get<ESM::Armor>();
|
||||
|
||||
return ref->base->data.value;
|
||||
|
@ -200,7 +200,7 @@ namespace MWClass
|
|||
|
||||
std::string Armor::getInventoryIcon (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Armor, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Armor> *ref =
|
||||
ptr.get<ESM::Armor>();
|
||||
|
||||
return ref->base->icon;
|
||||
|
@ -208,7 +208,7 @@ namespace MWClass
|
|||
|
||||
bool Armor::hasToolTip (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Armor, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Armor> *ref =
|
||||
ptr.get<ESM::Armor>();
|
||||
|
||||
return (ref->base->name != "");
|
||||
|
@ -216,7 +216,7 @@ namespace MWClass
|
|||
|
||||
MWGui::ToolTipInfo Armor::getToolTipInfo (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Armor, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Armor> *ref =
|
||||
ptr.get<ESM::Armor>();
|
||||
|
||||
MWGui::ToolTipInfo info;
|
||||
|
@ -259,7 +259,7 @@ namespace MWClass
|
|||
|
||||
std::string Armor::getEnchantment (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Armor, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Armor> *ref =
|
||||
ptr.get<ESM::Armor>();
|
||||
|
||||
return ref->base->enchant;
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace MWClass
|
|||
{
|
||||
void Book::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Book, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Book> *ref =
|
||||
ptr.get<ESM::Book>();
|
||||
|
||||
assert (ref->base != NULL);
|
||||
|
@ -36,7 +36,7 @@ namespace MWClass
|
|||
|
||||
void Book::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Book, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Book> *ref =
|
||||
ptr.get<ESM::Book>();
|
||||
|
||||
|
||||
|
@ -50,7 +50,7 @@ namespace MWClass
|
|||
|
||||
std::string Book::getName (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Book, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Book> *ref =
|
||||
ptr.get<ESM::Book>();
|
||||
|
||||
return ref->base->name;
|
||||
|
@ -65,7 +65,7 @@ namespace MWClass
|
|||
|
||||
std::string Book::getScript (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Book, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Book> *ref =
|
||||
ptr.get<ESM::Book>();
|
||||
|
||||
return ref->base->script;
|
||||
|
@ -73,7 +73,7 @@ namespace MWClass
|
|||
|
||||
int Book::getValue (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Book, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Book> *ref =
|
||||
ptr.get<ESM::Book>();
|
||||
|
||||
return ref->base->data.value;
|
||||
|
@ -98,7 +98,7 @@ namespace MWClass
|
|||
|
||||
std::string Book::getInventoryIcon (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Book, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Book> *ref =
|
||||
ptr.get<ESM::Book>();
|
||||
|
||||
return ref->base->icon;
|
||||
|
@ -106,7 +106,7 @@ namespace MWClass
|
|||
|
||||
bool Book::hasToolTip (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Book, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Book> *ref =
|
||||
ptr.get<ESM::Book>();
|
||||
|
||||
return (ref->base->name != "");
|
||||
|
@ -114,7 +114,7 @@ namespace MWClass
|
|||
|
||||
MWGui::ToolTipInfo Book::getToolTipInfo (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Book, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Book> *ref =
|
||||
ptr.get<ESM::Book>();
|
||||
|
||||
MWGui::ToolTipInfo info;
|
||||
|
@ -142,7 +142,7 @@ namespace MWClass
|
|||
|
||||
std::string Book::getEnchantment (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Book, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Book> *ref =
|
||||
ptr.get<ESM::Book>();
|
||||
|
||||
return ref->base->enchant;
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace MWClass
|
|||
{
|
||||
void Clothing::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Clothing, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Clothing> *ref =
|
||||
ptr.get<ESM::Clothing>();
|
||||
|
||||
assert (ref->base != NULL);
|
||||
|
@ -39,7 +39,7 @@ namespace MWClass
|
|||
|
||||
void Clothing::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Clothing, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Clothing> *ref =
|
||||
ptr.get<ESM::Clothing>();
|
||||
|
||||
|
||||
|
@ -53,7 +53,7 @@ namespace MWClass
|
|||
|
||||
std::string Clothing::getName (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Clothing, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Clothing> *ref =
|
||||
ptr.get<ESM::Clothing>();
|
||||
|
||||
return ref->base->name;
|
||||
|
@ -70,7 +70,7 @@ namespace MWClass
|
|||
|
||||
std::string Clothing::getScript (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Clothing, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Clothing> *ref =
|
||||
ptr.get<ESM::Clothing>();
|
||||
|
||||
return ref->base->script;
|
||||
|
@ -78,7 +78,7 @@ namespace MWClass
|
|||
|
||||
std::pair<std::vector<int>, bool> Clothing::getEquipmentSlots (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Clothing, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Clothing> *ref =
|
||||
ptr.get<ESM::Clothing>();
|
||||
|
||||
std::vector<int> slots;
|
||||
|
@ -118,7 +118,7 @@ namespace MWClass
|
|||
|
||||
int Clothing::getEquipmentSkill (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Clothing, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Clothing> *ref =
|
||||
ptr.get<ESM::Clothing>();
|
||||
|
||||
if (ref->base->data.type==ESM::Clothing::Shoes)
|
||||
|
@ -129,7 +129,7 @@ namespace MWClass
|
|||
|
||||
int Clothing::getValue (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Clothing, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Clothing> *ref =
|
||||
ptr.get<ESM::Clothing>();
|
||||
|
||||
return ref->base->data.value;
|
||||
|
@ -144,7 +144,7 @@ namespace MWClass
|
|||
|
||||
std::string Clothing::getUpSoundId (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Clothing, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Clothing> *ref =
|
||||
ptr.get<ESM::Clothing>();
|
||||
|
||||
if (ref->base->data.type == 8)
|
||||
|
@ -156,7 +156,7 @@ namespace MWClass
|
|||
|
||||
std::string Clothing::getDownSoundId (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Clothing, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Clothing> *ref =
|
||||
ptr.get<ESM::Clothing>();
|
||||
|
||||
if (ref->base->data.type == 8)
|
||||
|
@ -168,7 +168,7 @@ namespace MWClass
|
|||
|
||||
std::string Clothing::getInventoryIcon (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Clothing, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Clothing> *ref =
|
||||
ptr.get<ESM::Clothing>();
|
||||
|
||||
return ref->base->icon;
|
||||
|
@ -176,7 +176,7 @@ namespace MWClass
|
|||
|
||||
bool Clothing::hasToolTip (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Clothing, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Clothing> *ref =
|
||||
ptr.get<ESM::Clothing>();
|
||||
|
||||
return (ref->base->name != "");
|
||||
|
@ -184,7 +184,7 @@ namespace MWClass
|
|||
|
||||
MWGui::ToolTipInfo Clothing::getToolTipInfo (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Clothing, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Clothing> *ref =
|
||||
ptr.get<ESM::Clothing>();
|
||||
|
||||
MWGui::ToolTipInfo info;
|
||||
|
@ -212,7 +212,7 @@ namespace MWClass
|
|||
|
||||
std::string Clothing::getEnchantment (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Clothing, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Clothing> *ref =
|
||||
ptr.get<ESM::Clothing>();
|
||||
|
||||
return ref->base->enchant;
|
||||
|
|
|
@ -52,7 +52,7 @@ namespace MWClass
|
|||
|
||||
void Container::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Container, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Container> *ref =
|
||||
ptr.get<ESM::Container>();
|
||||
|
||||
assert (ref->base != NULL);
|
||||
|
@ -68,7 +68,7 @@ namespace MWClass
|
|||
|
||||
void Container::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Container, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Container> *ref =
|
||||
ptr.get<ESM::Container>();
|
||||
|
||||
|
||||
|
@ -116,7 +116,7 @@ namespace MWClass
|
|||
|
||||
std::string Container::getName (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Container, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Container> *ref =
|
||||
ptr.get<ESM::Container>();
|
||||
|
||||
return ref->base->name;
|
||||
|
@ -132,7 +132,7 @@ namespace MWClass
|
|||
|
||||
std::string Container::getScript (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Container, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Container> *ref =
|
||||
ptr.get<ESM::Container>();
|
||||
|
||||
return ref->base->script;
|
||||
|
@ -147,7 +147,7 @@ namespace MWClass
|
|||
|
||||
bool Container::hasToolTip (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Container, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Container> *ref =
|
||||
ptr.get<ESM::Container>();
|
||||
|
||||
return (ref->base->name != "");
|
||||
|
@ -155,7 +155,7 @@ namespace MWClass
|
|||
|
||||
MWGui::ToolTipInfo Container::getToolTipInfo (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Container, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Container> *ref =
|
||||
ptr.get<ESM::Container>();
|
||||
|
||||
MWGui::ToolTipInfo info;
|
||||
|
@ -181,7 +181,7 @@ namespace MWClass
|
|||
|
||||
float Container::getCapacity (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Container, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Container> *ref =
|
||||
ptr.get<ESM::Container>();
|
||||
|
||||
return ref->base->weight;
|
||||
|
|
|
@ -40,7 +40,7 @@ namespace MWClass
|
|||
{
|
||||
std::auto_ptr<CustomData> data (new CustomData);
|
||||
|
||||
MWWorld::LiveCellRef<ESM::Creature, MWWorld::RefData> *ref = ptr.get<ESM::Creature>();
|
||||
MWWorld::LiveCellRef<ESM::Creature> *ref = ptr.get<ESM::Creature>();
|
||||
|
||||
// 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
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Creature, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Creature> *ref =
|
||||
ptr.get<ESM::Creature>();
|
||||
|
||||
return ref->base->mId;
|
||||
|
@ -83,7 +83,7 @@ namespace MWClass
|
|||
|
||||
void Creature::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Creature, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Creature> *ref =
|
||||
ptr.get<ESM::Creature>();
|
||||
|
||||
const std::string &model = ref->base->model;
|
||||
|
@ -97,7 +97,7 @@ namespace MWClass
|
|||
|
||||
std::string Creature::getName (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Creature, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Creature> *ref =
|
||||
ptr.get<ESM::Creature>();
|
||||
|
||||
return ref->base->name;
|
||||
|
@ -126,7 +126,7 @@ namespace MWClass
|
|||
|
||||
std::string Creature::getScript (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Creature, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Creature> *ref =
|
||||
ptr.get<ESM::Creature>();
|
||||
|
||||
return ref->base->script;
|
||||
|
@ -148,7 +148,7 @@ namespace MWClass
|
|||
|
||||
MWGui::ToolTipInfo Creature::getToolTipInfo (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Creature, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Creature> *ref =
|
||||
ptr.get<ESM::Creature>();
|
||||
|
||||
MWGui::ToolTipInfo info;
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace MWClass
|
|||
{
|
||||
void Door::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Door, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Door> *ref =
|
||||
ptr.get<ESM::Door>();
|
||||
|
||||
assert (ref->base != NULL);
|
||||
|
@ -39,7 +39,7 @@ namespace MWClass
|
|||
|
||||
void Door::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Door, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Door> *ref =
|
||||
ptr.get<ESM::Door>();
|
||||
|
||||
const std::string &model = ref->base->model;
|
||||
|
@ -51,7 +51,7 @@ namespace MWClass
|
|||
|
||||
std::string Door::getName (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Door, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Door> *ref =
|
||||
ptr.get<ESM::Door>();
|
||||
|
||||
if (ref->ref.teleport && !ref->ref.destCell.empty()) // TODO doors that lead to exteriors
|
||||
|
@ -63,7 +63,7 @@ namespace MWClass
|
|||
boost::shared_ptr<MWWorld::Action> Door::activate (const MWWorld::Ptr& ptr,
|
||||
const MWWorld::Ptr& actor) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Door, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Door> *ref =
|
||||
ptr.get<ESM::Door>();
|
||||
|
||||
const std::string &openSound = ref->base->openSound;
|
||||
|
@ -133,7 +133,7 @@ namespace MWClass
|
|||
|
||||
std::string Door::getScript (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Door, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Door> *ref =
|
||||
ptr.get<ESM::Door>();
|
||||
|
||||
return ref->base->script;
|
||||
|
@ -148,7 +148,7 @@ namespace MWClass
|
|||
|
||||
bool Door::hasToolTip (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Door, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Door> *ref =
|
||||
ptr.get<ESM::Door>();
|
||||
|
||||
return (ref->base->name != "");
|
||||
|
@ -156,7 +156,7 @@ namespace MWClass
|
|||
|
||||
MWGui::ToolTipInfo Door::getToolTipInfo (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Door, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Door> *ref =
|
||||
ptr.get<ESM::Door>();
|
||||
|
||||
MWGui::ToolTipInfo info;
|
||||
|
|
|
@ -21,7 +21,7 @@ namespace MWClass
|
|||
{
|
||||
void Ingredient::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Ingredient, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Ingredient> *ref =
|
||||
ptr.get<ESM::Ingredient>();
|
||||
|
||||
assert (ref->base != NULL);
|
||||
|
@ -37,7 +37,7 @@ namespace MWClass
|
|||
|
||||
void Ingredient::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Ingredient, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Ingredient> *ref =
|
||||
ptr.get<ESM::Ingredient>();
|
||||
|
||||
const std::string &model = ref->base->model;
|
||||
|
@ -49,7 +49,7 @@ namespace MWClass
|
|||
|
||||
std::string Ingredient::getName (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Ingredient, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Ingredient> *ref =
|
||||
ptr.get<ESM::Ingredient>();
|
||||
|
||||
return ref->base->name;
|
||||
|
@ -66,7 +66,7 @@ namespace MWClass
|
|||
|
||||
std::string Ingredient::getScript (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Ingredient, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Ingredient> *ref =
|
||||
ptr.get<ESM::Ingredient>();
|
||||
|
||||
return ref->base->script;
|
||||
|
@ -74,7 +74,7 @@ namespace MWClass
|
|||
|
||||
int Ingredient::getValue (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Ingredient, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Ingredient> *ref =
|
||||
ptr.get<ESM::Ingredient>();
|
||||
|
||||
return ref->base->data.value;
|
||||
|
@ -99,7 +99,7 @@ namespace MWClass
|
|||
|
||||
std::string Ingredient::getInventoryIcon (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Ingredient, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Ingredient> *ref =
|
||||
ptr.get<ESM::Ingredient>();
|
||||
|
||||
return ref->base->icon;
|
||||
|
@ -107,7 +107,7 @@ namespace MWClass
|
|||
|
||||
bool Ingredient::hasToolTip (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Ingredient, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Ingredient> *ref =
|
||||
ptr.get<ESM::Ingredient>();
|
||||
|
||||
return (ref->base->name != "");
|
||||
|
@ -115,7 +115,7 @@ namespace MWClass
|
|||
|
||||
MWGui::ToolTipInfo Ingredient::getToolTipInfo (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Ingredient, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Ingredient> *ref =
|
||||
ptr.get<ESM::Ingredient>();
|
||||
|
||||
MWGui::ToolTipInfo info;
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace MWClass
|
|||
{
|
||||
void Light::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Light, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Light> *ref =
|
||||
ptr.get<ESM::Light>();
|
||||
|
||||
assert (ref->base != NULL);
|
||||
|
@ -46,7 +46,7 @@ namespace MWClass
|
|||
|
||||
void Light::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Light, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Light> *ref =
|
||||
ptr.get<ESM::Light>();
|
||||
|
||||
assert (ref->base != NULL);
|
||||
|
@ -64,7 +64,7 @@ namespace MWClass
|
|||
|
||||
std::string Light::getName (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Light, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Light> *ref =
|
||||
ptr.get<ESM::Light>();
|
||||
|
||||
if (ref->base->model.empty())
|
||||
|
@ -76,7 +76,7 @@ namespace MWClass
|
|||
boost::shared_ptr<MWWorld::Action> Light::activate (const MWWorld::Ptr& ptr,
|
||||
const MWWorld::Ptr& actor) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Light, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Light> *ref =
|
||||
ptr.get<ESM::Light>();
|
||||
|
||||
if (!(ref->base->data.flags & ESM::Light::Carry))
|
||||
|
@ -90,7 +90,7 @@ namespace MWClass
|
|||
|
||||
std::string Light::getScript (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Light, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Light> *ref =
|
||||
ptr.get<ESM::Light>();
|
||||
|
||||
return ref->base->script;
|
||||
|
@ -98,7 +98,7 @@ namespace MWClass
|
|||
|
||||
std::pair<std::vector<int>, bool> Light::getEquipmentSlots (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Light, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Light> *ref =
|
||||
ptr.get<ESM::Light>();
|
||||
|
||||
std::vector<int> slots;
|
||||
|
@ -111,7 +111,7 @@ namespace MWClass
|
|||
|
||||
int Light::getValue (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Light, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Light> *ref =
|
||||
ptr.get<ESM::Light>();
|
||||
|
||||
return ref->base->data.value;
|
||||
|
@ -137,7 +137,7 @@ namespace MWClass
|
|||
|
||||
std::string Light::getInventoryIcon (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Light, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Light> *ref =
|
||||
ptr.get<ESM::Light>();
|
||||
|
||||
return ref->base->icon;
|
||||
|
@ -145,7 +145,7 @@ namespace MWClass
|
|||
|
||||
bool Light::hasToolTip (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Light, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Light> *ref =
|
||||
ptr.get<ESM::Light>();
|
||||
|
||||
return (ref->base->name != "");
|
||||
|
@ -153,7 +153,7 @@ namespace MWClass
|
|||
|
||||
MWGui::ToolTipInfo Light::getToolTipInfo (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Light, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Light> *ref =
|
||||
ptr.get<ESM::Light>();
|
||||
|
||||
MWGui::ToolTipInfo info;
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace MWClass
|
|||
{
|
||||
void Lockpick::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Tool, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Tool> *ref =
|
||||
ptr.get<ESM::Tool>();
|
||||
|
||||
assert (ref->base != NULL);
|
||||
|
@ -39,7 +39,7 @@ namespace MWClass
|
|||
|
||||
void Lockpick::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Tool, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Tool> *ref =
|
||||
ptr.get<ESM::Tool>();
|
||||
|
||||
|
||||
|
@ -54,7 +54,7 @@ namespace MWClass
|
|||
|
||||
std::string Lockpick::getName (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Tool, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Tool> *ref =
|
||||
ptr.get<ESM::Tool>();
|
||||
|
||||
return ref->base->name;
|
||||
|
@ -71,7 +71,7 @@ namespace MWClass
|
|||
|
||||
std::string Lockpick::getScript (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Tool, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Tool> *ref =
|
||||
ptr.get<ESM::Tool>();
|
||||
|
||||
return ref->base->script;
|
||||
|
@ -88,7 +88,7 @@ namespace MWClass
|
|||
|
||||
int Lockpick::getValue (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Tool, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Tool> *ref =
|
||||
ptr.get<ESM::Tool>();
|
||||
|
||||
return ref->base->data.value;
|
||||
|
@ -113,7 +113,7 @@ namespace MWClass
|
|||
|
||||
std::string Lockpick::getInventoryIcon (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Tool, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Tool> *ref =
|
||||
ptr.get<ESM::Tool>();
|
||||
|
||||
return ref->base->icon;
|
||||
|
@ -121,7 +121,7 @@ namespace MWClass
|
|||
|
||||
bool Lockpick::hasToolTip (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Tool, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Tool> *ref =
|
||||
ptr.get<ESM::Tool>();
|
||||
|
||||
return (ref->base->name != "");
|
||||
|
@ -129,7 +129,7 @@ namespace MWClass
|
|||
|
||||
MWGui::ToolTipInfo Lockpick::getToolTipInfo (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Tool, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Tool> *ref =
|
||||
ptr.get<ESM::Tool>();
|
||||
|
||||
MWGui::ToolTipInfo info;
|
||||
|
|
|
@ -25,7 +25,7 @@ namespace MWClass
|
|||
{
|
||||
void Miscellaneous::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Miscellaneous, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Miscellaneous> *ref =
|
||||
ptr.get<ESM::Miscellaneous>();
|
||||
|
||||
assert (ref->base != NULL);
|
||||
|
@ -41,7 +41,7 @@ namespace MWClass
|
|||
|
||||
void Miscellaneous::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Miscellaneous, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Miscellaneous> *ref =
|
||||
ptr.get<ESM::Miscellaneous>();
|
||||
|
||||
|
||||
|
@ -55,7 +55,7 @@ namespace MWClass
|
|||
|
||||
std::string Miscellaneous::getName (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Miscellaneous, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Miscellaneous> *ref =
|
||||
ptr.get<ESM::Miscellaneous>();
|
||||
|
||||
return ref->base->name;
|
||||
|
@ -72,7 +72,7 @@ namespace MWClass
|
|||
|
||||
std::string Miscellaneous::getScript (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Miscellaneous, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Miscellaneous> *ref =
|
||||
ptr.get<ESM::Miscellaneous>();
|
||||
|
||||
return ref->base->script;
|
||||
|
@ -80,7 +80,7 @@ namespace MWClass
|
|||
|
||||
int Miscellaneous::getValue (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Miscellaneous, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Miscellaneous> *ref =
|
||||
ptr.get<ESM::Miscellaneous>();
|
||||
|
||||
return ref->base->data.value;
|
||||
|
@ -95,7 +95,7 @@ namespace MWClass
|
|||
|
||||
std::string Miscellaneous::getUpSoundId (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Miscellaneous, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Miscellaneous> *ref =
|
||||
ptr.get<ESM::Miscellaneous>();
|
||||
|
||||
if (ref->base->name == MWBase::Environment::get().getWorld()->getStore().gameSettings.search("sGold")->str)
|
||||
|
@ -107,7 +107,7 @@ namespace MWClass
|
|||
|
||||
std::string Miscellaneous::getDownSoundId (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Miscellaneous, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Miscellaneous> *ref =
|
||||
ptr.get<ESM::Miscellaneous>();
|
||||
|
||||
if (ref->base->name == MWBase::Environment::get().getWorld()->getStore().gameSettings.search("sGold")->str)
|
||||
|
@ -119,7 +119,7 @@ namespace MWClass
|
|||
|
||||
std::string Miscellaneous::getInventoryIcon (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Miscellaneous, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Miscellaneous> *ref =
|
||||
ptr.get<ESM::Miscellaneous>();
|
||||
|
||||
return ref->base->icon;
|
||||
|
@ -127,7 +127,7 @@ namespace MWClass
|
|||
|
||||
bool Miscellaneous::hasToolTip (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Miscellaneous, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Miscellaneous> *ref =
|
||||
ptr.get<ESM::Miscellaneous>();
|
||||
|
||||
return (ref->base->name != "");
|
||||
|
@ -135,7 +135,7 @@ namespace MWClass
|
|||
|
||||
MWGui::ToolTipInfo Miscellaneous::getToolTipInfo (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Miscellaneous, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Miscellaneous> *ref =
|
||||
ptr.get<ESM::Miscellaneous>();
|
||||
|
||||
MWGui::ToolTipInfo info;
|
||||
|
|
|
@ -53,7 +53,7 @@ namespace MWClass
|
|||
{
|
||||
std::auto_ptr<CustomData> data (new CustomData);
|
||||
|
||||
MWWorld::LiveCellRef<ESM::NPC, MWWorld::RefData> *ref = ptr.get<ESM::NPC>();
|
||||
MWWorld::LiveCellRef<ESM::NPC> *ref = ptr.get<ESM::NPC>();
|
||||
|
||||
// NPC stats
|
||||
if (!ref->base->faction.empty())
|
||||
|
@ -107,7 +107,7 @@ namespace MWClass
|
|||
|
||||
std::string Npc::getId (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::NPC, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::NPC> *ref =
|
||||
ptr.get<ESM::NPC>();
|
||||
|
||||
return ref->base->mId;
|
||||
|
@ -120,7 +120,7 @@ namespace MWClass
|
|||
|
||||
void Npc::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::NPC, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::NPC> *ref =
|
||||
ptr.get<ESM::NPC>();
|
||||
|
||||
assert (ref->base != NULL);
|
||||
|
@ -138,7 +138,7 @@ namespace MWClass
|
|||
|
||||
std::string Npc::getName (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::NPC, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::NPC> *ref =
|
||||
ptr.get<ESM::NPC>();
|
||||
|
||||
return ref->base->name;
|
||||
|
@ -182,7 +182,7 @@ namespace MWClass
|
|||
|
||||
std::string Npc::getScript (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::NPC, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::NPC> *ref =
|
||||
ptr.get<ESM::NPC>();
|
||||
|
||||
return ref->base->script;
|
||||
|
@ -302,7 +302,7 @@ namespace MWClass
|
|||
|
||||
MWGui::ToolTipInfo Npc::getToolTipInfo (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::NPC, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::NPC> *ref =
|
||||
ptr.get<ESM::NPC>();
|
||||
|
||||
MWGui::ToolTipInfo info;
|
||||
|
|
|
@ -21,7 +21,7 @@ namespace MWClass
|
|||
{
|
||||
void Potion::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Potion, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Potion> *ref =
|
||||
ptr.get<ESM::Potion>();
|
||||
|
||||
assert (ref->base != NULL);
|
||||
|
@ -37,7 +37,7 @@ namespace MWClass
|
|||
|
||||
void Potion::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Potion, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Potion> *ref =
|
||||
ptr.get<ESM::Potion>();
|
||||
|
||||
|
||||
|
@ -51,7 +51,7 @@ namespace MWClass
|
|||
|
||||
std::string Potion::getName (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Potion, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Potion> *ref =
|
||||
ptr.get<ESM::Potion>();
|
||||
|
||||
return ref->base->name;
|
||||
|
@ -68,7 +68,7 @@ namespace MWClass
|
|||
|
||||
std::string Potion::getScript (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Potion, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Potion> *ref =
|
||||
ptr.get<ESM::Potion>();
|
||||
|
||||
return ref->base->script;
|
||||
|
@ -76,7 +76,7 @@ namespace MWClass
|
|||
|
||||
int Potion::getValue (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Potion, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Potion> *ref =
|
||||
ptr.get<ESM::Potion>();
|
||||
|
||||
return ref->base->data.value;
|
||||
|
@ -101,7 +101,7 @@ namespace MWClass
|
|||
|
||||
std::string Potion::getInventoryIcon (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Potion, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Potion> *ref =
|
||||
ptr.get<ESM::Potion>();
|
||||
|
||||
return ref->base->icon;
|
||||
|
@ -109,7 +109,7 @@ namespace MWClass
|
|||
|
||||
bool Potion::hasToolTip (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Potion, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Potion> *ref =
|
||||
ptr.get<ESM::Potion>();
|
||||
|
||||
return (ref->base->name != "");
|
||||
|
@ -117,7 +117,7 @@ namespace MWClass
|
|||
|
||||
MWGui::ToolTipInfo Potion::getToolTipInfo (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Potion, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Potion> *ref =
|
||||
ptr.get<ESM::Potion>();
|
||||
|
||||
MWGui::ToolTipInfo info;
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace MWClass
|
|||
{
|
||||
void Probe::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Probe, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Probe> *ref =
|
||||
ptr.get<ESM::Probe>();
|
||||
|
||||
assert (ref->base != NULL);
|
||||
|
@ -39,7 +39,7 @@ namespace MWClass
|
|||
|
||||
void Probe::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Probe, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Probe> *ref =
|
||||
ptr.get<ESM::Probe>();
|
||||
|
||||
|
||||
|
@ -54,7 +54,7 @@ namespace MWClass
|
|||
|
||||
std::string Probe::getName (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Probe, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Probe> *ref =
|
||||
ptr.get<ESM::Probe>();
|
||||
|
||||
return ref->base->name;
|
||||
|
@ -70,7 +70,7 @@ namespace MWClass
|
|||
|
||||
std::string Probe::getScript (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Probe, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Probe> *ref =
|
||||
ptr.get<ESM::Probe>();
|
||||
|
||||
return ref->base->script;
|
||||
|
@ -87,7 +87,7 @@ namespace MWClass
|
|||
|
||||
int Probe::getValue (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Probe, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Probe> *ref =
|
||||
ptr.get<ESM::Probe>();
|
||||
|
||||
return ref->base->data.value;
|
||||
|
@ -112,7 +112,7 @@ namespace MWClass
|
|||
|
||||
std::string Probe::getInventoryIcon (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Probe, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Probe> *ref =
|
||||
ptr.get<ESM::Probe>();
|
||||
|
||||
return ref->base->icon;
|
||||
|
@ -120,7 +120,7 @@ namespace MWClass
|
|||
|
||||
bool Probe::hasToolTip (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Probe, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Probe> *ref =
|
||||
ptr.get<ESM::Probe>();
|
||||
|
||||
return (ref->base->name != "");
|
||||
|
@ -128,7 +128,7 @@ namespace MWClass
|
|||
|
||||
MWGui::ToolTipInfo Probe::getToolTipInfo (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Probe, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Probe> *ref =
|
||||
ptr.get<ESM::Probe>();
|
||||
|
||||
MWGui::ToolTipInfo info;
|
||||
|
|
|
@ -21,7 +21,7 @@ namespace MWClass
|
|||
{
|
||||
void Repair::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Repair, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Repair> *ref =
|
||||
ptr.get<ESM::Repair>();
|
||||
|
||||
assert (ref->base != NULL);
|
||||
|
@ -37,7 +37,7 @@ namespace MWClass
|
|||
|
||||
void Repair::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Repair, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Repair> *ref =
|
||||
ptr.get<ESM::Repair>();
|
||||
|
||||
|
||||
|
@ -51,7 +51,7 @@ namespace MWClass
|
|||
|
||||
std::string Repair::getName (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Repair, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Repair> *ref =
|
||||
ptr.get<ESM::Repair>();
|
||||
|
||||
return ref->base->name;
|
||||
|
@ -68,7 +68,7 @@ namespace MWClass
|
|||
|
||||
std::string Repair::getScript (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Repair, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Repair> *ref =
|
||||
ptr.get<ESM::Repair>();
|
||||
|
||||
return ref->base->script;
|
||||
|
@ -76,7 +76,7 @@ namespace MWClass
|
|||
|
||||
int Repair::getValue (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Repair, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Repair> *ref =
|
||||
ptr.get<ESM::Repair>();
|
||||
|
||||
return ref->base->data.value;
|
||||
|
@ -101,7 +101,7 @@ namespace MWClass
|
|||
|
||||
std::string Repair::getInventoryIcon (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Repair, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Repair> *ref =
|
||||
ptr.get<ESM::Repair>();
|
||||
|
||||
return ref->base->icon;
|
||||
|
@ -109,7 +109,7 @@ namespace MWClass
|
|||
|
||||
bool Repair::hasToolTip (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Repair, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Repair> *ref =
|
||||
ptr.get<ESM::Repair>();
|
||||
|
||||
return (ref->base->name != "");
|
||||
|
@ -117,7 +117,7 @@ namespace MWClass
|
|||
|
||||
MWGui::ToolTipInfo Repair::getToolTipInfo (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Repair, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Repair> *ref =
|
||||
ptr.get<ESM::Repair>();
|
||||
|
||||
MWGui::ToolTipInfo info;
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace MWClass
|
|||
{
|
||||
void Static::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Static, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Static> *ref =
|
||||
ptr.get<ESM::Static>();
|
||||
|
||||
assert (ref->base != NULL);
|
||||
|
@ -27,7 +27,7 @@ namespace MWClass
|
|||
|
||||
void Static::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Static, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Static> *ref =
|
||||
ptr.get<ESM::Static>();
|
||||
|
||||
assert (ref->base != NULL);
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace MWClass
|
|||
{
|
||||
void Weapon::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Weapon, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Weapon> *ref =
|
||||
ptr.get<ESM::Weapon>();
|
||||
|
||||
assert (ref->base != NULL);
|
||||
|
@ -39,7 +39,7 @@ namespace MWClass
|
|||
|
||||
void Weapon::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Weapon, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Weapon> *ref =
|
||||
ptr.get<ESM::Weapon>();
|
||||
|
||||
|
||||
|
@ -53,7 +53,7 @@ namespace MWClass
|
|||
|
||||
std::string Weapon::getName (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Weapon, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Weapon> *ref =
|
||||
ptr.get<ESM::Weapon>();
|
||||
|
||||
return ref->base->name;
|
||||
|
@ -75,7 +75,7 @@ namespace MWClass
|
|||
|
||||
int Weapon::getItemMaxHealth (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Weapon, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Weapon> *ref =
|
||||
ptr.get<ESM::Weapon>();
|
||||
|
||||
return ref->base->data.health;
|
||||
|
@ -83,7 +83,7 @@ namespace MWClass
|
|||
|
||||
std::string Weapon::getScript (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Weapon, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Weapon> *ref =
|
||||
ptr.get<ESM::Weapon>();
|
||||
|
||||
return ref->base->script;
|
||||
|
@ -91,7 +91,7 @@ namespace MWClass
|
|||
|
||||
std::pair<std::vector<int>, bool> Weapon::getEquipmentSlots (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Weapon, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Weapon> *ref =
|
||||
ptr.get<ESM::Weapon>();
|
||||
|
||||
std::vector<int> slots;
|
||||
|
@ -115,7 +115,7 @@ namespace MWClass
|
|||
|
||||
int Weapon::getEquipmentSkill (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Weapon, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Weapon> *ref =
|
||||
ptr.get<ESM::Weapon>();
|
||||
|
||||
const int size = 12;
|
||||
|
@ -145,7 +145,7 @@ namespace MWClass
|
|||
|
||||
int Weapon::getValue (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Weapon, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Weapon> *ref =
|
||||
ptr.get<ESM::Weapon>();
|
||||
|
||||
return ref->base->data.value;
|
||||
|
@ -160,7 +160,7 @@ namespace MWClass
|
|||
|
||||
std::string Weapon::getUpSoundId (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Weapon, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Weapon> *ref =
|
||||
ptr.get<ESM::Weapon>();
|
||||
|
||||
int type = ref->base->data.type;
|
||||
|
@ -206,7 +206,7 @@ namespace MWClass
|
|||
|
||||
std::string Weapon::getDownSoundId (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Weapon, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Weapon> *ref =
|
||||
ptr.get<ESM::Weapon>();
|
||||
|
||||
int type = ref->base->data.type;
|
||||
|
@ -252,7 +252,7 @@ namespace MWClass
|
|||
|
||||
std::string Weapon::getInventoryIcon (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Weapon, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Weapon> *ref =
|
||||
ptr.get<ESM::Weapon>();
|
||||
|
||||
return ref->base->icon;
|
||||
|
@ -260,7 +260,7 @@ namespace MWClass
|
|||
|
||||
bool Weapon::hasToolTip (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Weapon, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Weapon> *ref =
|
||||
ptr.get<ESM::Weapon>();
|
||||
|
||||
return (ref->base->name != "");
|
||||
|
@ -268,7 +268,7 @@ namespace MWClass
|
|||
|
||||
MWGui::ToolTipInfo Weapon::getToolTipInfo (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Weapon, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Weapon> *ref =
|
||||
ptr.get<ESM::Weapon>();
|
||||
|
||||
MWGui::ToolTipInfo info;
|
||||
|
@ -350,7 +350,7 @@ namespace MWClass
|
|||
|
||||
std::string Weapon::getEnchantment (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Weapon, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Weapon> *ref =
|
||||
ptr.get<ESM::Weapon>();
|
||||
|
||||
return ref->base->enchant;
|
||||
|
|
|
@ -392,7 +392,7 @@ namespace MWDialogue
|
|||
|
||||
if(select.type==ESM::VT_Int)
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::NPC, MWWorld::RefData>* npc = actor.get<ESM::NPC>();
|
||||
MWWorld::LiveCellRef<ESM::NPC>* npc = actor.get<ESM::NPC>();
|
||||
int isFaction = int(toLower(npc->base->faction) == toLower(name));
|
||||
if(selectCompare<int,int>(comp,!isFaction,select.i))
|
||||
return false;
|
||||
|
@ -409,7 +409,7 @@ namespace MWDialogue
|
|||
|
||||
if(select.type==ESM::VT_Int)
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::NPC, MWWorld::RefData>* npc = actor.get<ESM::NPC>();
|
||||
MWWorld::LiveCellRef<ESM::NPC>* npc = actor.get<ESM::NPC>();
|
||||
int isClass = int(toLower(npc->base->cls) == toLower(name));
|
||||
if(selectCompare<int,int>(comp,!isClass,select.i))
|
||||
return false;
|
||||
|
@ -426,7 +426,7 @@ namespace MWDialogue
|
|||
|
||||
if(select.type==ESM::VT_Int)
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::NPC, MWWorld::RefData>* npc = actor.get<ESM::NPC>();
|
||||
MWWorld::LiveCellRef<ESM::NPC>* npc = actor.get<ESM::NPC>();
|
||||
int isRace = int(toLower(npc->base->race) == toLower(name));
|
||||
if(selectCompare<int,int>(comp,!isRace,select.i))
|
||||
return false;
|
||||
|
@ -493,7 +493,7 @@ namespace MWDialogue
|
|||
if (isCreature)
|
||||
return false;
|
||||
|
||||
MWWorld::LiveCellRef<ESM::NPC, MWWorld::RefData> *cellRef = actor.get<ESM::NPC>();
|
||||
MWWorld::LiveCellRef<ESM::NPC> *cellRef = actor.get<ESM::NPC>();
|
||||
|
||||
if (!cellRef)
|
||||
return false;
|
||||
|
@ -508,7 +508,7 @@ namespace MWDialogue
|
|||
if (isCreature)
|
||||
return false;
|
||||
|
||||
MWWorld::LiveCellRef<ESM::NPC, MWWorld::RefData> *cellRef = actor.get<ESM::NPC>();
|
||||
MWWorld::LiveCellRef<ESM::NPC> *cellRef = actor.get<ESM::NPC>();
|
||||
|
||||
if (!cellRef)
|
||||
return false;
|
||||
|
@ -558,7 +558,7 @@ namespace MWDialogue
|
|||
//check gender
|
||||
if (!isCreature)
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::NPC, MWWorld::RefData>* npc = actor.get<ESM::NPC>();
|
||||
MWWorld::LiveCellRef<ESM::NPC>* npc = actor.get<ESM::NPC>();
|
||||
if(npc->base->flags&npc->base->Female)
|
||||
{
|
||||
if(static_cast<int> (info.data.gender)==0) return false;
|
||||
|
@ -771,13 +771,13 @@ namespace MWDialogue
|
|||
int services = 0;
|
||||
if (mActor.getTypeName() == typeid(ESM::NPC).name())
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::NPC, MWWorld::RefData>* ref = mActor.get<ESM::NPC>();
|
||||
MWWorld::LiveCellRef<ESM::NPC>* ref = mActor.get<ESM::NPC>();
|
||||
if (ref->base->hasAI)
|
||||
services = ref->base->AI.services;
|
||||
}
|
||||
else if (mActor.getTypeName() == typeid(ESM::Creature).name())
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Creature, MWWorld::RefData>* ref = mActor.get<ESM::Creature>();
|
||||
MWWorld::LiveCellRef<ESM::Creature>* ref = mActor.get<ESM::Creature>();
|
||||
if (ref->base->hasAI)
|
||||
services = ref->base->AI.services;
|
||||
}
|
||||
|
|
|
@ -275,7 +275,7 @@ namespace MWGui
|
|||
for (MWWorld::ContainerStoreIterator it(store.begin(MWWorld::ContainerStore::Type_Apparatus));
|
||||
it != store.end(); ++it)
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Apparatus, MWWorld::RefData>* ref = it->get<ESM::Apparatus>();
|
||||
MWWorld::LiveCellRef<ESM::Apparatus>* ref = it->get<ESM::Apparatus>();
|
||||
if (ref->base->data.type == ESM::Apparatus::Albemic
|
||||
&& (bestAlbemic.isEmpty() || ref->base->data.quality > bestAlbemic.get<ESM::Apparatus>()->base->data.quality))
|
||||
bestAlbemic = *it;
|
||||
|
@ -420,7 +420,7 @@ namespace MWGui
|
|||
continue;
|
||||
|
||||
// add the effects of this ingredient to list of effects
|
||||
MWWorld::LiveCellRef<ESM::Ingredient, MWWorld::RefData>* ref = ingredient->getUserData<MWWorld::Ptr>()->get<ESM::Ingredient>();
|
||||
MWWorld::LiveCellRef<ESM::Ingredient>* ref = ingredient->getUserData<MWWorld::Ptr>()->get<ESM::Ingredient>();
|
||||
for (int i=0; i<4; ++i)
|
||||
{
|
||||
if (ref->base->data.effectID[i] < 0)
|
||||
|
|
|
@ -55,8 +55,7 @@ void BookWindow::open (MWWorld::Ptr book)
|
|||
|
||||
MWBase::Environment::get().getSoundManager()->playSound ("book open", 1.0, 1.0);
|
||||
|
||||
MWWorld::LiveCellRef<ESM::Book, MWWorld::RefData> *ref =
|
||||
mBook.get<ESM::Book>();
|
||||
MWWorld::LiveCellRef<ESM::Book> *ref = mBook.get<ESM::Book>();
|
||||
|
||||
BookTextParser parser;
|
||||
std::vector<std::string> results = parser.split(ref->base->text, mLeftPage->getSize().width, mLeftPage->getSize().height);
|
||||
|
|
|
@ -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())
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Container, MWWorld::RefData>* ref = mPtr.get<ESM::Container>();
|
||||
MWWorld::LiveCellRef<ESM::Container>* ref = mPtr.get<ESM::Container>();
|
||||
if (ref->base->flags & ESM::Container::Organic)
|
||||
{
|
||||
// user notification
|
||||
|
|
|
@ -31,8 +31,7 @@ void ScrollWindow::open (MWWorld::Ptr scroll)
|
|||
|
||||
mScroll = scroll;
|
||||
|
||||
MWWorld::LiveCellRef<ESM::Book, MWWorld::RefData> *ref =
|
||||
mScroll.get<ESM::Book>();
|
||||
MWWorld::LiveCellRef<ESM::Book> *ref = mScroll.get<ESM::Book>();
|
||||
|
||||
BookTextParser parser;
|
||||
MyGUI::IntSize size = parser.parse(ref->base->text, mTextView, 390);
|
||||
|
|
|
@ -161,7 +161,7 @@ namespace MWGui
|
|||
int merchantgold;
|
||||
if (mPtr.getTypeName() == typeid(ESM::NPC).name())
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::NPC, MWWorld::RefData>* ref = mPtr.get<ESM::NPC>();
|
||||
MWWorld::LiveCellRef<ESM::NPC>* ref = mPtr.get<ESM::NPC>();
|
||||
if (ref->base->npdt52.gold == -10)
|
||||
merchantgold = ref->base->npdt12.gold;
|
||||
else
|
||||
|
@ -169,7 +169,7 @@ namespace MWGui
|
|||
}
|
||||
else // ESM::Creature
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Creature, MWWorld::RefData>* ref = mPtr.get<ESM::Creature>();
|
||||
MWWorld::LiveCellRef<ESM::Creature>* ref = mPtr.get<ESM::Creature>();
|
||||
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())
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::NPC, MWWorld::RefData>* ref = mPtr.get<ESM::NPC>();
|
||||
MWWorld::LiveCellRef<ESM::NPC>* ref = mPtr.get<ESM::NPC>();
|
||||
if (ref->base->npdt52.gold == -10)
|
||||
merchantgold = ref->base->npdt12.gold;
|
||||
else
|
||||
|
@ -252,7 +252,7 @@ namespace MWGui
|
|||
}
|
||||
else // ESM::Creature
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Creature, MWWorld::RefData>* ref = mPtr.get<ESM::Creature>();
|
||||
MWWorld::LiveCellRef<ESM::Creature>* ref = mPtr.get<ESM::Creature>();
|
||||
merchantgold = ref->base->data.gold;
|
||||
}
|
||||
|
||||
|
@ -289,13 +289,13 @@ namespace MWGui
|
|||
int services = 0;
|
||||
if (mPtr.getTypeName() == typeid(ESM::NPC).name())
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::NPC, MWWorld::RefData>* ref = mPtr.get<ESM::NPC>();
|
||||
MWWorld::LiveCellRef<ESM::NPC>* ref = mPtr.get<ESM::NPC>();
|
||||
if (ref->base->hasAI)
|
||||
services = ref->base->AI.services;
|
||||
}
|
||||
else if (mPtr.getTypeName() == typeid(ESM::Creature).name())
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Creature, MWWorld::RefData>* ref = mPtr.get<ESM::Creature>();
|
||||
MWWorld::LiveCellRef<ESM::Creature>* ref = mPtr.get<ESM::Creature>();
|
||||
if (ref->base->hasAI)
|
||||
services = ref->base->AI.services;
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ CreatureAnimation::~CreatureAnimation(){
|
|||
}
|
||||
CreatureAnimation::CreatureAnimation(const MWWorld::Ptr& ptr, OEngine::Render::OgreRenderer& _rend): Animation(_rend){
|
||||
insert = ptr.getRefData().getBaseNode();
|
||||
MWWorld::LiveCellRef<ESM::Creature, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::Creature> *ref =
|
||||
ptr.get<ESM::Creature>();
|
||||
|
||||
assert (ref->base != NULL);
|
||||
|
|
|
@ -38,7 +38,7 @@ NpcAnimation::NpcAnimation(const MWWorld::Ptr& ptr, OEngine::Render::OgreRendere
|
|||
lfoot(0),
|
||||
rfoot(0)
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::NPC, MWWorld::RefData> *ref =
|
||||
MWWorld::LiveCellRef<ESM::NPC> *ref =
|
||||
ptr.get<ESM::NPC>();
|
||||
Ogre::Entity* blank = 0;
|
||||
std::vector<Nif::NiTriShapeCopy>* blankshape = 0;
|
||||
|
|
|
@ -194,8 +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);
|
||||
|
||||
MWWorld::LiveCellRef<ESM::Light, MWWorld::RefData> *ref =
|
||||
ptr.get<ESM::Light>();
|
||||
MWWorld::LiveCellRef<ESM::Light> *ref = ptr.get<ESM::Light>();
|
||||
|
||||
LightInfo info;
|
||||
info.name = light->getName();
|
||||
|
|
|
@ -13,8 +13,7 @@ namespace MWWorld
|
|||
|
||||
void ActionRead::execute ()
|
||||
{
|
||||
LiveCellRef<ESM::Book, MWWorld::RefData> *ref =
|
||||
mObject.get<ESM::Book>();
|
||||
LiveCellRef<ESM::Book> *ref = mObject.get<ESM::Book>();
|
||||
|
||||
if (ref->base->data.isScroll)
|
||||
{
|
||||
|
|
|
@ -39,7 +39,7 @@ MWWorld::Ptr::CellStore *MWWorld::Cells::getCellStore (const ESM::Cell *cell)
|
|||
|
||||
void MWWorld::Cells::fillContainers (Ptr::CellStore& cellStore)
|
||||
{
|
||||
for (CellRefList<ESM::Container, RefData>::List::iterator iter (
|
||||
for (CellRefList<ESM::Container>::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 (CellRefList<ESM::Creature, RefData>::List::iterator iter (
|
||||
for (CellRefList<ESM::Creature>::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 (CellRefList<ESM::NPC, RefData>::List::iterator iter (
|
||||
for (CellRefList<ESM::NPC>::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 (MWWorld::LiveCellRef<ESM::Activator, RefData> *ref = cell.activators.find (name))
|
||||
if (MWWorld::LiveCellRef<ESM::Activator> *ref = cell.activators.find (name))
|
||||
return Ptr (ref, &cell);
|
||||
|
||||
if (MWWorld::LiveCellRef<ESM::Potion, RefData> *ref = cell.potions.find (name))
|
||||
if (MWWorld::LiveCellRef<ESM::Potion> *ref = cell.potions.find (name))
|
||||
return Ptr (ref, &cell);
|
||||
|
||||
if (MWWorld::LiveCellRef<ESM::Apparatus, RefData> *ref = cell.appas.find (name))
|
||||
if (MWWorld::LiveCellRef<ESM::Apparatus> *ref = cell.appas.find (name))
|
||||
return Ptr (ref, &cell);
|
||||
|
||||
if (MWWorld::LiveCellRef<ESM::Armor, RefData> *ref = cell.armors.find (name))
|
||||
if (MWWorld::LiveCellRef<ESM::Armor> *ref = cell.armors.find (name))
|
||||
return Ptr (ref, &cell);
|
||||
|
||||
if (MWWorld::LiveCellRef<ESM::Book, RefData> *ref = cell.books.find (name))
|
||||
if (MWWorld::LiveCellRef<ESM::Book> *ref = cell.books.find (name))
|
||||
return Ptr (ref, &cell);
|
||||
|
||||
if (MWWorld::LiveCellRef<ESM::Clothing, RefData> *ref = cell.clothes.find (name))
|
||||
if (MWWorld::LiveCellRef<ESM::Clothing> *ref = cell.clothes.find (name))
|
||||
return Ptr (ref, &cell);
|
||||
|
||||
if (MWWorld::LiveCellRef<ESM::Container, RefData> *ref = cell.containers.find (name))
|
||||
if (MWWorld::LiveCellRef<ESM::Container> *ref = cell.containers.find (name))
|
||||
return Ptr (ref, &cell);
|
||||
|
||||
if (MWWorld::LiveCellRef<ESM::Creature, RefData> *ref = cell.creatures.find (name))
|
||||
if (MWWorld::LiveCellRef<ESM::Creature> *ref = cell.creatures.find (name))
|
||||
return Ptr (ref, &cell);
|
||||
|
||||
if (MWWorld::LiveCellRef<ESM::Door, RefData> *ref = cell.doors.find (name))
|
||||
if (MWWorld::LiveCellRef<ESM::Door> *ref = cell.doors.find (name))
|
||||
return Ptr (ref, &cell);
|
||||
|
||||
if (MWWorld::LiveCellRef<ESM::Ingredient, RefData> *ref = cell.ingreds.find (name))
|
||||
if (MWWorld::LiveCellRef<ESM::Ingredient> *ref = cell.ingreds.find (name))
|
||||
return Ptr (ref, &cell);
|
||||
|
||||
if (MWWorld::LiveCellRef<ESM::CreatureLevList, RefData> *ref = cell.creatureLists.find (name))
|
||||
if (MWWorld::LiveCellRef<ESM::CreatureLevList> *ref = cell.creatureLists.find (name))
|
||||
return Ptr (ref, &cell);
|
||||
|
||||
if (MWWorld::LiveCellRef<ESM::ItemLevList, RefData> *ref = cell.itemLists.find (name))
|
||||
if (MWWorld::LiveCellRef<ESM::ItemLevList> *ref = cell.itemLists.find (name))
|
||||
return Ptr (ref, &cell);
|
||||
|
||||
if (MWWorld::LiveCellRef<ESM::Light, RefData> *ref = cell.lights.find (name))
|
||||
if (MWWorld::LiveCellRef<ESM::Light> *ref = cell.lights.find (name))
|
||||
return Ptr (ref, &cell);
|
||||
|
||||
if (MWWorld::LiveCellRef<ESM::Tool, RefData> *ref = cell.lockpicks.find (name))
|
||||
if (MWWorld::LiveCellRef<ESM::Tool> *ref = cell.lockpicks.find (name))
|
||||
return Ptr (ref, &cell);
|
||||
|
||||
if (MWWorld::LiveCellRef<ESM::Miscellaneous, RefData> *ref = cell.miscItems.find (name))
|
||||
if (MWWorld::LiveCellRef<ESM::Miscellaneous> *ref = cell.miscItems.find (name))
|
||||
return Ptr (ref, &cell);
|
||||
|
||||
if (MWWorld::LiveCellRef<ESM::NPC, RefData> *ref = cell.npcs.find (name))
|
||||
if (MWWorld::LiveCellRef<ESM::NPC> *ref = cell.npcs.find (name))
|
||||
return Ptr (ref, &cell);
|
||||
|
||||
if (MWWorld::LiveCellRef<ESM::Probe, RefData> *ref = cell.probes.find (name))
|
||||
if (MWWorld::LiveCellRef<ESM::Probe> *ref = cell.probes.find (name))
|
||||
return Ptr (ref, &cell);
|
||||
|
||||
if (MWWorld::LiveCellRef<ESM::Repair, RefData> *ref = cell.repairs.find (name))
|
||||
if (MWWorld::LiveCellRef<ESM::Repair> *ref = cell.repairs.find (name))
|
||||
return Ptr (ref, &cell);
|
||||
|
||||
if (MWWorld::LiveCellRef<ESM::Static, RefData> *ref = cell.statics.find (name))
|
||||
if (MWWorld::LiveCellRef<ESM::Static> *ref = cell.statics.find (name))
|
||||
return Ptr (ref, &cell);
|
||||
|
||||
if (MWWorld::LiveCellRef<ESM::Weapon, RefData> *ref = cell.weapons.find (name))
|
||||
if (MWWorld::LiveCellRef<ESM::Weapon> *ref = cell.weapons.find (name))
|
||||
return Ptr (ref, &cell);
|
||||
|
||||
return Ptr();
|
||||
|
|
124
apps/openmw/mwworld/cellstore.cpp
Normal file
124
apps/openmw/mwworld/cellstore.cpp
Normal file
|
@ -0,0 +1,124 @@
|
|||
|
||||
#include "cellstore.hpp"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
|
||||
namespace MWWorld
|
||||
{
|
||||
CellStore::CellStore (const ESM::Cell *cell_) : cell (cell_), mState (State_Unloaded)
|
||||
{
|
||||
mWaterLevel = cell->water;
|
||||
}
|
||||
|
||||
void CellStore::load (const ESMS::ESMStore &store, ESM::ESMReader &esm)
|
||||
{
|
||||
if (mState!=State_Loaded)
|
||||
{
|
||||
if (mState==State_Preloaded)
|
||||
mIds.clear();
|
||||
|
||||
std::cout << "loading cell " << cell->getDescription() << std::endl;
|
||||
|
||||
loadRefs (store, esm);
|
||||
|
||||
mState = State_Loaded;
|
||||
}
|
||||
}
|
||||
|
||||
void CellStore::preload (const ESMS::ESMStore &store, ESM::ESMReader &esm)
|
||||
{
|
||||
if (mState==State_Unloaded)
|
||||
{
|
||||
listRefs (store, esm);
|
||||
|
||||
mState = State_Preloaded;
|
||||
}
|
||||
}
|
||||
|
||||
void CellStore::listRefs(const ESMS::ESMStore &store, ESM::ESMReader &esm)
|
||||
{
|
||||
assert (cell);
|
||||
|
||||
if (cell->context.filename.empty())
|
||||
return; // this is a dynamically generated cell -> skipping.
|
||||
|
||||
// Reopen the ESM reader and seek to the right position.
|
||||
cell->restore (esm);
|
||||
|
||||
ESM::CellRef ref;
|
||||
|
||||
// Get each reference in turn
|
||||
while (cell->getNextRef (esm, ref))
|
||||
{
|
||||
std::string lowerCase;
|
||||
|
||||
std::transform (ref.refID.begin(), ref.refID.end(), std::back_inserter (lowerCase),
|
||||
(int(*)(int)) std::tolower);
|
||||
|
||||
mIds.push_back (lowerCase);
|
||||
}
|
||||
|
||||
std::sort (mIds.begin(), mIds.end());
|
||||
}
|
||||
|
||||
void CellStore::loadRefs(const ESMS::ESMStore &store, ESM::ESMReader &esm)
|
||||
{
|
||||
assert (cell);
|
||||
|
||||
if (cell->context.filename.empty())
|
||||
return; // this is a dynamically generated cell -> skipping.
|
||||
|
||||
// Reopen the ESM reader and seek to the right position.
|
||||
cell->restore(esm);
|
||||
|
||||
ESM::CellRef ref;
|
||||
|
||||
// Get each reference in turn
|
||||
while(cell->getNextRef(esm, ref))
|
||||
{
|
||||
std::string lowerCase;
|
||||
|
||||
std::transform (ref.refID.begin(), ref.refID.end(), std::back_inserter (lowerCase),
|
||||
(int(*)(int)) std::tolower);
|
||||
|
||||
int rec = store.find(ref.refID);
|
||||
|
||||
ref.refID = lowerCase;
|
||||
|
||||
/* We can optimize this further by storing the pointer to the
|
||||
record itself in store.all, so that we don't need to look it
|
||||
up again here. However, never optimize. There are infinite
|
||||
opportunities to do that later.
|
||||
*/
|
||||
switch(rec)
|
||||
{
|
||||
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:
|
||||
std::cout << "WARNING: Ignoring reference '" << ref.refID << "' of unhandled type\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -3,15 +3,19 @@
|
|||
|
||||
#include <components/esm/records.hpp>
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
|
||||
#include <list>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#include <stdexcept>
|
||||
#include <algorithm>
|
||||
|
||||
#include "refdata.hpp"
|
||||
|
||||
namespace ESMS
|
||||
{
|
||||
struct ESMStore;
|
||||
}
|
||||
|
||||
namespace MWWorld
|
||||
{
|
||||
/// A reference to one object (of any type) in a cell.
|
||||
|
@ -20,7 +24,7 @@ namespace MWWorld
|
|||
/// in practice (where D is RefData) the possibly mutable data is copied
|
||||
/// across to mData. If later adding data (such as position) to CellRef
|
||||
/// this would have to be manually copied across.
|
||||
template <typename X, typename D>
|
||||
template <typename X>
|
||||
struct LiveCellRef
|
||||
{
|
||||
LiveCellRef(const ESM::CellRef& cref, const X* b = NULL) : base(b), ref(cref),
|
||||
|
@ -38,14 +42,14 @@ namespace MWWorld
|
|||
ESM::CellRef ref;
|
||||
|
||||
/// runtime-data
|
||||
D mData;
|
||||
RefData mData;
|
||||
};
|
||||
|
||||
/// A list of cell references
|
||||
template <typename X, typename D>
|
||||
template <typename X>
|
||||
struct CellRefList
|
||||
{
|
||||
typedef LiveCellRef<X, D> LiveRef;
|
||||
typedef LiveCellRef<X> LiveRef;
|
||||
typedef std::list<LiveRef> List;
|
||||
List list;
|
||||
|
||||
|
@ -75,7 +79,6 @@ namespace MWWorld
|
|||
};
|
||||
|
||||
/// A storage struct for one single cell reference.
|
||||
template <typename D>
|
||||
class CellStore
|
||||
{
|
||||
public:
|
||||
|
@ -85,10 +88,7 @@ namespace MWWorld
|
|||
State_Unloaded, State_Preloaded, State_Loaded
|
||||
};
|
||||
|
||||
CellStore (const ESM::Cell *cell_) : cell (cell_), mState (State_Unloaded)
|
||||
{
|
||||
mWaterLevel = cell->water;
|
||||
}
|
||||
CellStore (const ESM::Cell *cell_);
|
||||
|
||||
const ESM::Cell *cell;
|
||||
State mState;
|
||||
|
@ -97,51 +97,30 @@ namespace MWWorld
|
|||
float mWaterLevel;
|
||||
|
||||
// Lists for each individual object type
|
||||
CellRefList<ESM::Activator, D> activators;
|
||||
CellRefList<ESM::Potion, D> potions;
|
||||
CellRefList<ESM::Apparatus, D> appas;
|
||||
CellRefList<ESM::Armor, D> armors;
|
||||
CellRefList<ESM::Book, D> books;
|
||||
CellRefList<ESM::Clothing, D> clothes;
|
||||
CellRefList<ESM::Container, D> containers;
|
||||
CellRefList<ESM::Creature, D> creatures;
|
||||
CellRefList<ESM::Door, D> doors;
|
||||
CellRefList<ESM::Ingredient, D> ingreds;
|
||||
CellRefList<ESM::CreatureLevList, D> creatureLists;
|
||||
CellRefList<ESM::ItemLevList, D> itemLists;
|
||||
CellRefList<ESM::Light, D> lights;
|
||||
CellRefList<ESM::Tool, D> lockpicks;
|
||||
CellRefList<ESM::Miscellaneous, D> miscItems;
|
||||
CellRefList<ESM::NPC, D> npcs;
|
||||
CellRefList<ESM::Probe, D> probes;
|
||||
CellRefList<ESM::Repair, D> repairs;
|
||||
CellRefList<ESM::Static, D> statics;
|
||||
CellRefList<ESM::Weapon, D> weapons;
|
||||
CellRefList<ESM::Activator> activators;
|
||||
CellRefList<ESM::Potion> potions;
|
||||
CellRefList<ESM::Apparatus> appas;
|
||||
CellRefList<ESM::Armor> armors;
|
||||
CellRefList<ESM::Book> books;
|
||||
CellRefList<ESM::Clothing> clothes;
|
||||
CellRefList<ESM::Container> containers;
|
||||
CellRefList<ESM::Creature> creatures;
|
||||
CellRefList<ESM::Door> doors;
|
||||
CellRefList<ESM::Ingredient> ingreds;
|
||||
CellRefList<ESM::CreatureLevList> creatureLists;
|
||||
CellRefList<ESM::ItemLevList> itemLists;
|
||||
CellRefList<ESM::Light> lights;
|
||||
CellRefList<ESM::Tool> lockpicks;
|
||||
CellRefList<ESM::Miscellaneous> miscItems;
|
||||
CellRefList<ESM::NPC> npcs;
|
||||
CellRefList<ESM::Probe> probes;
|
||||
CellRefList<ESM::Repair> repairs;
|
||||
CellRefList<ESM::Static> statics;
|
||||
CellRefList<ESM::Weapon> weapons;
|
||||
|
||||
void load (const ESMS::ESMStore &store, ESM::ESMReader &esm)
|
||||
{
|
||||
if (mState!=State_Loaded)
|
||||
{
|
||||
if (mState==State_Preloaded)
|
||||
mIds.clear();
|
||||
void load (const ESMS::ESMStore &store, ESM::ESMReader &esm);
|
||||
|
||||
std::cout << "loading cell " << cell->getDescription() << std::endl;
|
||||
|
||||
loadRefs (store, esm);
|
||||
|
||||
mState = State_Loaded;
|
||||
}
|
||||
}
|
||||
|
||||
void preload (const ESMS::ESMStore &store, ESM::ESMReader &esm)
|
||||
{
|
||||
if (mState==State_Unloaded)
|
||||
{
|
||||
listRefs (store, esm);
|
||||
|
||||
mState = State_Preloaded;
|
||||
}
|
||||
}
|
||||
void preload (const ESMS::ESMStore &store, ESM::ESMReader &esm);
|
||||
|
||||
/// Call functor (ref) for each reference. functor must return a bool. Returning
|
||||
/// false will abort the iteration.
|
||||
|
@ -186,91 +165,9 @@ namespace MWWorld
|
|||
}
|
||||
|
||||
/// Run through references and store IDs
|
||||
void listRefs(const ESMS::ESMStore &store, ESM::ESMReader &esm)
|
||||
{
|
||||
assert (cell);
|
||||
|
||||
if (cell->context.filename.empty())
|
||||
return; // this is a dynamically generated cell -> skipping.
|
||||
|
||||
// Reopen the ESM reader and seek to the right position.
|
||||
cell->restore (esm);
|
||||
|
||||
ESM::CellRef ref;
|
||||
|
||||
// Get each reference in turn
|
||||
while (cell->getNextRef (esm, ref))
|
||||
{
|
||||
std::string lowerCase;
|
||||
|
||||
std::transform (ref.refID.begin(), ref.refID.end(), std::back_inserter (lowerCase),
|
||||
(int(*)(int)) std::tolower);
|
||||
|
||||
mIds.push_back (lowerCase);
|
||||
}
|
||||
|
||||
std::sort (mIds.begin(), mIds.end());
|
||||
}
|
||||
|
||||
void loadRefs(const ESMS::ESMStore &store, ESM::ESMReader &esm)
|
||||
{
|
||||
assert (cell);
|
||||
|
||||
if (cell->context.filename.empty())
|
||||
return; // this is a dynamically generated cell -> skipping.
|
||||
|
||||
// Reopen the ESM reader and seek to the right position.
|
||||
cell->restore(esm);
|
||||
|
||||
ESM::CellRef ref;
|
||||
|
||||
// Get each reference in turn
|
||||
while(cell->getNextRef(esm, ref))
|
||||
{
|
||||
std::string lowerCase;
|
||||
|
||||
std::transform (ref.refID.begin(), ref.refID.end(), std::back_inserter (lowerCase),
|
||||
(int(*)(int)) std::tolower);
|
||||
|
||||
int rec = store.find(ref.refID);
|
||||
|
||||
ref.refID = lowerCase;
|
||||
|
||||
/* We can optimize this further by storing the pointer to the
|
||||
record itself in store.all, so that we don't need to look it
|
||||
up again here. However, never optimize. There are infinite
|
||||
opportunities to do that later.
|
||||
*/
|
||||
switch(rec)
|
||||
{
|
||||
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:
|
||||
std::cout << "WARNING: Ignoring reference '" << ref.refID << "' of unhandled type\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
void listRefs(const ESMS::ESMStore &store, ESM::ESMReader &esm);
|
||||
|
||||
void loadRefs(const ESMS::ESMStore &store, ESM::ESMReader &esm);
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -19,11 +19,11 @@
|
|||
namespace
|
||||
{
|
||||
template<typename T>
|
||||
float getTotalWeight (const MWWorld::CellRefList<T, MWWorld::RefData>& cellRefList)
|
||||
float getTotalWeight (const MWWorld::CellRefList<T>& cellRefList)
|
||||
{
|
||||
float sum = 0;
|
||||
|
||||
for (typename MWWorld::CellRefList<T, MWWorld::RefData>::List::const_iterator iter (
|
||||
for (typename MWWorld::CellRefList<T>::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)
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Miscellaneous, MWWorld::RefData> *gold =
|
||||
MWWorld::LiveCellRef<ESM::Miscellaneous> *gold =
|
||||
ptr.get<ESM::Miscellaneous>();
|
||||
|
||||
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, MWWorld::CellRefList<ESM::Potion, RefData>::List::iterator iterator)
|
||||
MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Potion>::List::iterator iterator)
|
||||
: mType(MWWorld::ContainerStore::Type_Potion), mMask(MWWorld::ContainerStore::Type_All), mContainer(container), mPotion(iterator){}
|
||||
MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Apparatus, RefData>::List::iterator iterator)
|
||||
MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Apparatus>::List::iterator iterator)
|
||||
: mType(MWWorld::ContainerStore::Type_Apparatus), mMask(MWWorld::ContainerStore::Type_All), mContainer(container), mApparatus(iterator){}
|
||||
MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Armor, RefData>::List::iterator iterator)
|
||||
MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Armor>::List::iterator iterator)
|
||||
: mType(MWWorld::ContainerStore::Type_Armor), mMask(MWWorld::ContainerStore::Type_All), mContainer(container), mArmor(iterator){}
|
||||
MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Book, RefData>::List::iterator iterator)
|
||||
MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Book>::List::iterator iterator)
|
||||
: mType(MWWorld::ContainerStore::Type_Book), mMask(MWWorld::ContainerStore::Type_All), mContainer(container), mBook(iterator){}
|
||||
MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Clothing, RefData>::List::iterator iterator)
|
||||
MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Clothing>::List::iterator iterator)
|
||||
: mType(MWWorld::ContainerStore::Type_Clothing), mMask(MWWorld::ContainerStore::Type_All), mContainer(container), mClothing(iterator){}
|
||||
MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Ingredient, RefData>::List::iterator iterator)
|
||||
MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Ingredient>::List::iterator iterator)
|
||||
: mType(MWWorld::ContainerStore::Type_Ingredient), mMask(MWWorld::ContainerStore::Type_All), mContainer(container), mIngredient(iterator){}
|
||||
MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Light, RefData>::List::iterator iterator)
|
||||
MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Light>::List::iterator iterator)
|
||||
: mType(MWWorld::ContainerStore::Type_Light), mMask(MWWorld::ContainerStore::Type_All), mContainer(container), mLight(iterator){}
|
||||
MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Tool, RefData>::List::iterator iterator)
|
||||
MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Tool>::List::iterator iterator)
|
||||
: mType(MWWorld::ContainerStore::Type_Lockpick), mMask(MWWorld::ContainerStore::Type_All), mContainer(container), mLockpick(iterator){}
|
||||
MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Miscellaneous, RefData>::List::iterator iterator)
|
||||
MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Miscellaneous>::List::iterator iterator)
|
||||
: mType(MWWorld::ContainerStore::Type_Miscellaneous), mMask(MWWorld::ContainerStore::Type_All), mContainer(container), mMiscellaneous(iterator){}
|
||||
MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Probe, RefData>::List::iterator iterator)
|
||||
MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Probe>::List::iterator iterator)
|
||||
: mType(MWWorld::ContainerStore::Type_Probe), mMask(MWWorld::ContainerStore::Type_All), mContainer(container), mProbe(iterator){}
|
||||
MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Repair, RefData>::List::iterator iterator)
|
||||
MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Repair>::List::iterator iterator)
|
||||
: mType(MWWorld::ContainerStore::Type_Repair), mMask(MWWorld::ContainerStore::Type_All), mContainer(container), mRepair(iterator){}
|
||||
MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Weapon, RefData>::List::iterator iterator)
|
||||
MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Weapon>::List::iterator iterator)
|
||||
: mType(MWWorld::ContainerStore::Type_Weapon), mMask(MWWorld::ContainerStore::Type_All), mContainer(container), mWeapon(iterator){}
|
||||
|
||||
void MWWorld::ContainerStoreIterator::incType()
|
||||
|
|
|
@ -39,18 +39,18 @@ namespace MWWorld
|
|||
|
||||
private:
|
||||
|
||||
MWWorld::CellRefList<ESM::Potion, RefData> potions;
|
||||
MWWorld::CellRefList<ESM::Apparatus, RefData> appas;
|
||||
MWWorld::CellRefList<ESM::Armor, RefData> armors;
|
||||
MWWorld::CellRefList<ESM::Book, RefData> books;
|
||||
MWWorld::CellRefList<ESM::Clothing, RefData> clothes;
|
||||
MWWorld::CellRefList<ESM::Ingredient, RefData> ingreds;
|
||||
MWWorld::CellRefList<ESM::Light, RefData> lights;
|
||||
MWWorld::CellRefList<ESM::Tool, RefData> lockpicks;
|
||||
MWWorld::CellRefList<ESM::Miscellaneous, RefData> miscItems;
|
||||
MWWorld::CellRefList<ESM::Probe, RefData> probes;
|
||||
MWWorld::CellRefList<ESM::Repair, RefData> repairs;
|
||||
MWWorld::CellRefList<ESM::Weapon, RefData> weapons;
|
||||
MWWorld::CellRefList<ESM::Potion> potions;
|
||||
MWWorld::CellRefList<ESM::Apparatus> appas;
|
||||
MWWorld::CellRefList<ESM::Armor> armors;
|
||||
MWWorld::CellRefList<ESM::Book> books;
|
||||
MWWorld::CellRefList<ESM::Clothing> clothes;
|
||||
MWWorld::CellRefList<ESM::Ingredient> ingreds;
|
||||
MWWorld::CellRefList<ESM::Light> lights;
|
||||
MWWorld::CellRefList<ESM::Tool> lockpicks;
|
||||
MWWorld::CellRefList<ESM::Miscellaneous> miscItems;
|
||||
MWWorld::CellRefList<ESM::Probe> probes;
|
||||
MWWorld::CellRefList<ESM::Repair> repairs;
|
||||
MWWorld::CellRefList<ESM::Weapon> weapons;
|
||||
int mStateId;
|
||||
mutable float mCachedWeight;
|
||||
mutable bool mWeightUpToDate;
|
||||
|
@ -121,18 +121,18 @@ namespace MWWorld
|
|||
ContainerStore *mContainer;
|
||||
mutable Ptr mPtr;
|
||||
|
||||
MWWorld::CellRefList<ESM::Potion, RefData>::List::iterator mPotion;
|
||||
MWWorld::CellRefList<ESM::Apparatus, RefData>::List::iterator mApparatus;
|
||||
MWWorld::CellRefList<ESM::Armor, RefData>::List::iterator mArmor;
|
||||
MWWorld::CellRefList<ESM::Book, RefData>::List::iterator mBook;
|
||||
MWWorld::CellRefList<ESM::Clothing, RefData>::List::iterator mClothing;
|
||||
MWWorld::CellRefList<ESM::Ingredient, RefData>::List::iterator mIngredient;
|
||||
MWWorld::CellRefList<ESM::Light, RefData>::List::iterator mLight;
|
||||
MWWorld::CellRefList<ESM::Tool, RefData>::List::iterator mLockpick;
|
||||
MWWorld::CellRefList<ESM::Miscellaneous, RefData>::List::iterator mMiscellaneous;
|
||||
MWWorld::CellRefList<ESM::Probe, RefData>::List::iterator mProbe;
|
||||
MWWorld::CellRefList<ESM::Repair, RefData>::List::iterator mRepair;
|
||||
MWWorld::CellRefList<ESM::Weapon, RefData>::List::iterator mWeapon;
|
||||
MWWorld::CellRefList<ESM::Potion>::List::iterator mPotion;
|
||||
MWWorld::CellRefList<ESM::Apparatus>::List::iterator mApparatus;
|
||||
MWWorld::CellRefList<ESM::Armor>::List::iterator mArmor;
|
||||
MWWorld::CellRefList<ESM::Book>::List::iterator mBook;
|
||||
MWWorld::CellRefList<ESM::Clothing>::List::iterator mClothing;
|
||||
MWWorld::CellRefList<ESM::Ingredient>::List::iterator mIngredient;
|
||||
MWWorld::CellRefList<ESM::Light>::List::iterator mLight;
|
||||
MWWorld::CellRefList<ESM::Tool>::List::iterator mLockpick;
|
||||
MWWorld::CellRefList<ESM::Miscellaneous>::List::iterator mMiscellaneous;
|
||||
MWWorld::CellRefList<ESM::Probe>::List::iterator mProbe;
|
||||
MWWorld::CellRefList<ESM::Repair>::List::iterator mRepair;
|
||||
MWWorld::CellRefList<ESM::Weapon>::List::iterator mWeapon;
|
||||
|
||||
private:
|
||||
|
||||
|
@ -143,18 +143,18 @@ namespace MWWorld
|
|||
///< Begin-iterator
|
||||
|
||||
// construct iterator using a CellRefList iterator
|
||||
ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Potion, RefData>::List::iterator);
|
||||
ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Apparatus, RefData>::List::iterator);
|
||||
ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Armor, RefData>::List::iterator);
|
||||
ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Book, RefData>::List::iterator);
|
||||
ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Clothing, RefData>::List::iterator);
|
||||
ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Ingredient, RefData>::List::iterator);
|
||||
ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Light, RefData>::List::iterator);
|
||||
ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Tool, RefData>::List::iterator);
|
||||
ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Miscellaneous, RefData>::List::iterator);
|
||||
ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Probe, RefData>::List::iterator);
|
||||
ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Repair, RefData>::List::iterator);
|
||||
ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Weapon, RefData>::List::iterator);
|
||||
ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Potion>::List::iterator);
|
||||
ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Apparatus>::List::iterator);
|
||||
ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Armor>::List::iterator);
|
||||
ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Book>::List::iterator);
|
||||
ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Clothing>::List::iterator);
|
||||
ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Ingredient>::List::iterator);
|
||||
ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Light>::List::iterator);
|
||||
ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Tool>::List::iterator);
|
||||
ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Miscellaneous>::List::iterator);
|
||||
ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Probe>::List::iterator);
|
||||
ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Repair>::List::iterator);
|
||||
ContainerStoreIterator (ContainerStore *container, MWWorld::CellRefList<ESM::Weapon>::List::iterator);
|
||||
|
||||
void incType();
|
||||
|
||||
|
|
|
@ -1,15 +1,17 @@
|
|||
|
||||
#include "localscripts.hpp"
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
|
||||
#include "cellstore.hpp"
|
||||
|
||||
namespace
|
||||
{
|
||||
template<typename T>
|
||||
void listCellScripts (MWWorld::LocalScripts& localScripts,
|
||||
MWWorld::CellRefList<T, MWWorld::RefData>& cellRefList, MWWorld::Ptr::CellStore *cell)
|
||||
MWWorld::CellRefList<T>& cellRefList, MWWorld::Ptr::CellStore *cell)
|
||||
{
|
||||
for (typename MWWorld::CellRefList<T, MWWorld::RefData>::List::iterator iter (
|
||||
for (typename MWWorld::CellRefList<T>::List::iterator iter (
|
||||
cellRefList.list.begin());
|
||||
iter!=cellRefList.list.end(); ++iter)
|
||||
{
|
||||
|
|
|
@ -24,11 +24,11 @@ namespace MWWorld
|
|||
{
|
||||
if (const T *instance = list.search (name))
|
||||
{
|
||||
LiveCellRef<T, RefData> ref;
|
||||
LiveCellRef<T> ref;
|
||||
ref.base = instance;
|
||||
|
||||
mRef = ref;
|
||||
mPtr = Ptr (&boost::any_cast<LiveCellRef<T, RefData>&> (mRef), 0);
|
||||
mPtr = Ptr (&boost::any_cast<LiveCellRef<T>&> (mRef), 0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -41,11 +41,11 @@ namespace MWWorld
|
|||
{
|
||||
if (const T *instance = list.search (name))
|
||||
{
|
||||
LiveCellRef<T, RefData> ref;
|
||||
LiveCellRef<T> ref;
|
||||
ref.base = instance;
|
||||
|
||||
mRef = ref;
|
||||
mPtr = Ptr (&boost::any_cast<LiveCellRef<T, RefData>&> (mRef), 0);
|
||||
mPtr = Ptr (&boost::any_cast<LiveCellRef<T>&> (mRef), 0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ namespace MWWorld
|
|||
/// \brief NPC object representing the player and additional player data
|
||||
class Player
|
||||
{
|
||||
LiveCellRef<ESM::NPC, MWWorld::RefData> mPlayer;
|
||||
LiveCellRef<ESM::NPC> mPlayer;
|
||||
MWWorld::Ptr::CellStore *mCellStore;
|
||||
MWRender::Player *mRenderer;
|
||||
MWWorld::World& mWorld;
|
||||
|
@ -118,7 +118,7 @@ namespace MWWorld
|
|||
void setLeftRight (int value);
|
||||
|
||||
void setForwardBackward (int value);
|
||||
void setUpDown(int value);
|
||||
void setUpDown(int value);
|
||||
|
||||
void toggleRunning();
|
||||
};
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
#include <components/esm/loadcell.hpp>
|
||||
|
||||
#include "cellstore.hpp"
|
||||
#include "refdata.hpp"
|
||||
|
||||
namespace MWWorld
|
||||
{
|
||||
|
@ -20,7 +19,8 @@ namespace MWWorld
|
|||
{
|
||||
public:
|
||||
|
||||
typedef MWWorld::CellStore<RefData> CellStore;
|
||||
typedef MWWorld::CellStore CellStore;
|
||||
///< \deprecated
|
||||
|
||||
boost::any mPtr;
|
||||
ESM::CellRef *mCellRef;
|
||||
|
@ -50,7 +50,7 @@ namespace MWWorld
|
|||
}
|
||||
|
||||
template<typename T>
|
||||
Ptr (MWWorld::LiveCellRef<T, RefData> *liveCellRef, CellStore *cell)
|
||||
Ptr (MWWorld::LiveCellRef<T> *liveCellRef, CellStore *cell)
|
||||
: mContainerStore (0)
|
||||
{
|
||||
mPtr = liveCellRef;
|
||||
|
@ -61,9 +61,9 @@ namespace MWWorld
|
|||
}
|
||||
|
||||
template<typename T>
|
||||
MWWorld::LiveCellRef<T, RefData> *get() const
|
||||
MWWorld::LiveCellRef<T> *get() const
|
||||
{
|
||||
return boost::any_cast<MWWorld::LiveCellRef<T, RefData>*> (mPtr);
|
||||
return boost::any_cast<MWWorld::LiveCellRef<T>*> (mPtr);
|
||||
}
|
||||
|
||||
ESM::CellRef& getCellRef() const;
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace
|
|||
|
||||
template<typename T>
|
||||
void insertCellRefList(MWRender::RenderingManager& rendering,
|
||||
T& cellRefList, MWWorld::CellStore<MWWorld::RefData> &cell, MWWorld::PhysicsSystem& physics)
|
||||
T& cellRefList, MWWorld::CellStore &cell, MWWorld::PhysicsSystem& physics)
|
||||
{
|
||||
if (!cellRefList.list.empty())
|
||||
{
|
||||
|
@ -348,67 +348,67 @@ namespace MWWorld
|
|||
// insert into the correct CellRefList
|
||||
if (type == typeid(ESM::Potion).name())
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Potion, MWWorld::RefData>* ref = ptr.get<ESM::Potion>();
|
||||
MWWorld::LiveCellRef<ESM::Potion>* ref = ptr.get<ESM::Potion>();
|
||||
cell->potions.list.push_back( *ref );
|
||||
newPtr = MWWorld::Ptr(&cell->potions.list.back(), cell);
|
||||
}
|
||||
else if (type == typeid(ESM::Apparatus).name())
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Apparatus, MWWorld::RefData>* ref = ptr.get<ESM::Apparatus>();
|
||||
MWWorld::LiveCellRef<ESM::Apparatus>* ref = ptr.get<ESM::Apparatus>();
|
||||
cell->appas.list.push_back( *ref );
|
||||
newPtr = MWWorld::Ptr(&cell->appas.list.back(), cell);
|
||||
}
|
||||
else if (type == typeid(ESM::Armor).name())
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Armor, MWWorld::RefData>* ref = ptr.get<ESM::Armor>();
|
||||
MWWorld::LiveCellRef<ESM::Armor>* ref = ptr.get<ESM::Armor>();
|
||||
cell->armors.list.push_back( *ref );
|
||||
newPtr = MWWorld::Ptr(&cell->armors.list.back(), cell);
|
||||
}
|
||||
else if (type == typeid(ESM::Book).name())
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Book, MWWorld::RefData>* ref = ptr.get<ESM::Book>();
|
||||
MWWorld::LiveCellRef<ESM::Book>* ref = ptr.get<ESM::Book>();
|
||||
cell->books.list.push_back( *ref );
|
||||
newPtr = MWWorld::Ptr(&cell->books.list.back(), cell);
|
||||
}
|
||||
else if (type == typeid(ESM::Clothing).name())
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Clothing, MWWorld::RefData>* ref = ptr.get<ESM::Clothing>();
|
||||
MWWorld::LiveCellRef<ESM::Clothing>* ref = ptr.get<ESM::Clothing>();
|
||||
cell->clothes.list.push_back( *ref );
|
||||
newPtr = MWWorld::Ptr(&cell->clothes.list.back(), cell);
|
||||
}
|
||||
else if (type == typeid(ESM::Ingredient).name())
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Ingredient, MWWorld::RefData>* ref = ptr.get<ESM::Ingredient>();
|
||||
MWWorld::LiveCellRef<ESM::Ingredient>* ref = ptr.get<ESM::Ingredient>();
|
||||
cell->ingreds.list.push_back( *ref );
|
||||
newPtr = MWWorld::Ptr(&cell->ingreds.list.back(), cell);
|
||||
}
|
||||
else if (type == typeid(ESM::Light).name())
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Light, MWWorld::RefData>* ref = ptr.get<ESM::Light>();
|
||||
MWWorld::LiveCellRef<ESM::Light>* ref = ptr.get<ESM::Light>();
|
||||
cell->lights.list.push_back( *ref );
|
||||
newPtr = MWWorld::Ptr(&cell->lights.list.back(), cell);
|
||||
}
|
||||
else if (type == typeid(ESM::Tool).name())
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Tool, MWWorld::RefData>* ref = ptr.get<ESM::Tool>();
|
||||
MWWorld::LiveCellRef<ESM::Tool>* ref = ptr.get<ESM::Tool>();
|
||||
cell->lockpicks.list.push_back( *ref );
|
||||
newPtr = MWWorld::Ptr(&cell->lockpicks.list.back(), cell);
|
||||
}
|
||||
else if (type == typeid(ESM::Repair).name())
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Repair, MWWorld::RefData>* ref = ptr.get<ESM::Repair>();
|
||||
MWWorld::LiveCellRef<ESM::Repair>* ref = ptr.get<ESM::Repair>();
|
||||
cell->repairs.list.push_back( *ref );
|
||||
newPtr = MWWorld::Ptr(&cell->repairs.list.back(), cell);
|
||||
}
|
||||
else if (type == typeid(ESM::Probe).name())
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Probe, MWWorld::RefData>* ref = ptr.get<ESM::Probe>();
|
||||
MWWorld::LiveCellRef<ESM::Probe>* ref = ptr.get<ESM::Probe>();
|
||||
cell->probes.list.push_back( *ref );
|
||||
newPtr = MWWorld::Ptr(&cell->probes.list.back(), cell);
|
||||
}
|
||||
else if (type == typeid(ESM::Weapon).name())
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Weapon, MWWorld::RefData>* ref = ptr.get<ESM::Weapon>();
|
||||
MWWorld::LiveCellRef<ESM::Weapon>* ref = ptr.get<ESM::Weapon>();
|
||||
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);
|
||||
|
||||
MWWorld::LiveCellRef<ESM::Miscellaneous, MWWorld::RefData>* ref = newRef.getPtr().get<ESM::Miscellaneous>();
|
||||
MWWorld::LiveCellRef<ESM::Miscellaneous>* ref = newRef.getPtr().get<ESM::Miscellaneous>();
|
||||
|
||||
cell->miscItems.list.push_back( *ref );
|
||||
newPtr = MWWorld::Ptr(&cell->miscItems.list.back(), cell);
|
||||
|
@ -444,7 +444,7 @@ namespace MWWorld
|
|||
}
|
||||
else
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Miscellaneous, MWWorld::RefData>* ref = ptr.get<ESM::Miscellaneous>();
|
||||
MWWorld::LiveCellRef<ESM::Miscellaneous>* ref = ptr.get<ESM::Miscellaneous>();
|
||||
|
||||
cell->miscItems.list.push_back( *ref );
|
||||
newPtr = MWWorld::Ptr(&cell->miscItems.list.back(), cell);
|
||||
|
|
|
@ -33,10 +33,10 @@ namespace
|
|||
{
|
||||
template<typename T>
|
||||
void listCellScripts (const ESMS::ESMStore& store,
|
||||
MWWorld::CellRefList<T, MWWorld::RefData>& cellRefList, MWWorld::LocalScripts& localScripts,
|
||||
MWWorld::CellRefList<T>& cellRefList, MWWorld::LocalScripts& localScripts,
|
||||
MWWorld::Ptr::CellStore *cell)
|
||||
{
|
||||
for (typename MWWorld::CellRefList<T, MWWorld::RefData>::List::iterator iter (
|
||||
for (typename MWWorld::CellRefList<T>::List::iterator iter (
|
||||
cellRefList.list.begin());
|
||||
iter!=cellRefList.list.end(); ++iter)
|
||||
{
|
||||
|
@ -53,10 +53,10 @@ namespace
|
|||
}
|
||||
|
||||
template<typename T>
|
||||
MWWorld::LiveCellRef<T, MWWorld::RefData> *searchViaHandle (const std::string& handle,
|
||||
MWWorld::CellRefList<T, MWWorld::RefData>& refList)
|
||||
MWWorld::LiveCellRef<T> *searchViaHandle (const std::string& handle,
|
||||
MWWorld::CellRefList<T>& refList)
|
||||
{
|
||||
typedef typename MWWorld::CellRefList<T, MWWorld::RefData>::List::iterator iterator;
|
||||
typedef typename MWWorld::CellRefList<T>::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 (MWWorld::LiveCellRef<ESM::Activator, RefData> *ref =
|
||||
if (MWWorld::LiveCellRef<ESM::Activator> *ref =
|
||||
searchViaHandle (handle, cell.activators))
|
||||
return Ptr (ref, &cell);
|
||||
if (MWWorld::LiveCellRef<ESM::Potion, RefData> *ref = searchViaHandle (handle, cell.potions))
|
||||
if (MWWorld::LiveCellRef<ESM::Potion> *ref = searchViaHandle (handle, cell.potions))
|
||||
return Ptr (ref, &cell);
|
||||
if (MWWorld::LiveCellRef<ESM::Apparatus, RefData> *ref = searchViaHandle (handle, cell.appas))
|
||||
if (MWWorld::LiveCellRef<ESM::Apparatus> *ref = searchViaHandle (handle, cell.appas))
|
||||
return Ptr (ref, &cell);
|
||||
if (MWWorld::LiveCellRef<ESM::Armor, RefData> *ref = searchViaHandle (handle, cell.armors))
|
||||
if (MWWorld::LiveCellRef<ESM::Armor> *ref = searchViaHandle (handle, cell.armors))
|
||||
return Ptr (ref, &cell);
|
||||
if (MWWorld::LiveCellRef<ESM::Book, RefData> *ref = searchViaHandle (handle, cell.books))
|
||||
if (MWWorld::LiveCellRef<ESM::Book> *ref = searchViaHandle (handle, cell.books))
|
||||
return Ptr (ref, &cell);
|
||||
if (MWWorld::LiveCellRef<ESM::Clothing, RefData> *ref = searchViaHandle (handle, cell.clothes))
|
||||
if (MWWorld::LiveCellRef<ESM::Clothing> *ref = searchViaHandle (handle, cell.clothes))
|
||||
return Ptr (ref, &cell);
|
||||
if (MWWorld::LiveCellRef<ESM::Container, RefData> *ref =
|
||||
if (MWWorld::LiveCellRef<ESM::Container> *ref =
|
||||
searchViaHandle (handle, cell.containers))
|
||||
return Ptr (ref, &cell);
|
||||
if (MWWorld::LiveCellRef<ESM::Creature, RefData> *ref =
|
||||
if (MWWorld::LiveCellRef<ESM::Creature> *ref =
|
||||
searchViaHandle (handle, cell.creatures))
|
||||
return Ptr (ref, &cell);
|
||||
if (MWWorld::LiveCellRef<ESM::Door, RefData> *ref = searchViaHandle (handle, cell.doors))
|
||||
if (MWWorld::LiveCellRef<ESM::Door> *ref = searchViaHandle (handle, cell.doors))
|
||||
return Ptr (ref, &cell);
|
||||
if (MWWorld::LiveCellRef<ESM::Ingredient, RefData> *ref =
|
||||
if (MWWorld::LiveCellRef<ESM::Ingredient> *ref =
|
||||
searchViaHandle (handle, cell.ingreds))
|
||||
return Ptr (ref, &cell);
|
||||
if (MWWorld::LiveCellRef<ESM::Light, RefData> *ref = searchViaHandle (handle, cell.lights))
|
||||
if (MWWorld::LiveCellRef<ESM::Light> *ref = searchViaHandle (handle, cell.lights))
|
||||
return Ptr (ref, &cell);
|
||||
if (MWWorld::LiveCellRef<ESM::Tool, RefData> *ref = searchViaHandle (handle, cell.lockpicks))
|
||||
if (MWWorld::LiveCellRef<ESM::Tool> *ref = searchViaHandle (handle, cell.lockpicks))
|
||||
return Ptr (ref, &cell);
|
||||
if (MWWorld::LiveCellRef<ESM::Miscellaneous, RefData> *ref = searchViaHandle (handle, cell.miscItems))
|
||||
if (MWWorld::LiveCellRef<ESM::Miscellaneous> *ref = searchViaHandle (handle, cell.miscItems))
|
||||
return Ptr (ref, &cell);
|
||||
if (MWWorld::LiveCellRef<ESM::NPC, RefData> *ref = searchViaHandle (handle, cell.npcs))
|
||||
if (MWWorld::LiveCellRef<ESM::NPC> *ref = searchViaHandle (handle, cell.npcs))
|
||||
return Ptr (ref, &cell);
|
||||
if (MWWorld::LiveCellRef<ESM::Probe, RefData> *ref = searchViaHandle (handle, cell.probes))
|
||||
if (MWWorld::LiveCellRef<ESM::Probe> *ref = searchViaHandle (handle, cell.probes))
|
||||
return Ptr (ref, &cell);
|
||||
if (MWWorld::LiveCellRef<ESM::Repair, RefData> *ref = searchViaHandle (handle, cell.repairs))
|
||||
if (MWWorld::LiveCellRef<ESM::Repair> *ref = searchViaHandle (handle, cell.repairs))
|
||||
return Ptr (ref, &cell);
|
||||
if (MWWorld::LiveCellRef<ESM::Static, RefData> *ref = searchViaHandle (handle, cell.statics))
|
||||
if (MWWorld::LiveCellRef<ESM::Static> *ref = searchViaHandle (handle, cell.statics))
|
||||
return Ptr (ref, &cell);
|
||||
if (MWWorld::LiveCellRef<ESM::Weapon, RefData> *ref = searchViaHandle (handle, cell.weapons))
|
||||
if (MWWorld::LiveCellRef<ESM::Weapon> *ref = searchViaHandle (handle, cell.weapons))
|
||||
return Ptr (ref, &cell);
|
||||
return Ptr();
|
||||
}
|
||||
|
@ -961,8 +961,8 @@ namespace MWWorld
|
|||
|
||||
Ogre::Vector2 World::getNorthVector(Ptr::CellStore* cell)
|
||||
{
|
||||
MWWorld::CellRefList<ESM::Static, MWWorld::RefData> statics = cell->statics;
|
||||
MWWorld::LiveCellRef<ESM::Static, MWWorld::RefData>* ref = statics.find("northmarker");
|
||||
MWWorld::CellRefList<ESM::Static> statics = cell->statics;
|
||||
MWWorld::LiveCellRef<ESM::Static>* ref = statics.find("northmarker");
|
||||
if (!ref)
|
||||
return Vector2(0, 1);
|
||||
Ogre::SceneNode* node = ref->mData.getBaseNode();
|
||||
|
|
Loading…
Reference in a new issue