diff --git a/apps/openmw/mwclass/activator.cpp b/apps/openmw/mwclass/activator.cpp index 3a0f1b951..fdbff026f 100644 --- a/apps/openmw/mwclass/activator.cpp +++ b/apps/openmw/mwclass/activator.cpp @@ -130,6 +130,7 @@ namespace MWClass MWWorld::LiveCellRef *ref = ptr.get(); - return MWWorld::Ptr(&cell.get().insert(*ref), &cell); + return MWWorld::Ptr(); + //return MWWorld::Ptr(&cell.get().insert(*ref), &cell); } } diff --git a/apps/openmw/mwclass/apparatus.cpp b/apps/openmw/mwclass/apparatus.cpp index f93556ef9..06eea2c24 100644 --- a/apps/openmw/mwclass/apparatus.cpp +++ b/apps/openmw/mwclass/apparatus.cpp @@ -147,8 +147,9 @@ namespace MWClass { MWWorld::LiveCellRef *ref = ptr.get(); + return MWWorld::Ptr(); - return MWWorld::Ptr(&cell.get().insert(*ref), &cell); + //return MWWorld::Ptr(&cell.get().insert(*ref), &cell); } bool Apparatus::canSell (const MWWorld::Ptr& item, int npcServices) const diff --git a/apps/openmw/mwclass/armor.cpp b/apps/openmw/mwclass/armor.cpp index 324dd32ee..9ad28a537 100644 --- a/apps/openmw/mwclass/armor.cpp +++ b/apps/openmw/mwclass/armor.cpp @@ -381,8 +381,9 @@ namespace MWClass { MWWorld::LiveCellRef *ref = ptr.get(); + return MWWorld::Ptr(); - return MWWorld::Ptr(&cell.get().insert(*ref), &cell); + //return MWWorld::Ptr(&cell.get().insert(*ref), &cell); } int Armor::getEnchantmentPoints (const MWWorld::Ptr& ptr) const diff --git a/apps/openmw/mwclass/book.cpp b/apps/openmw/mwclass/book.cpp index 2c20435b2..cfa2508c4 100644 --- a/apps/openmw/mwclass/book.cpp +++ b/apps/openmw/mwclass/book.cpp @@ -186,8 +186,9 @@ namespace MWClass { MWWorld::LiveCellRef *ref = ptr.get(); + return MWWorld::Ptr(); - return MWWorld::Ptr(&cell.get().insert(*ref), &cell); + //return MWWorld::Ptr(&cell.get().insert(*ref), &cell); } int Book::getEnchantmentPoints (const MWWorld::Ptr& ptr) const diff --git a/apps/openmw/mwclass/clothing.cpp b/apps/openmw/mwclass/clothing.cpp index cea30d561..8bd3fd2e6 100644 --- a/apps/openmw/mwclass/clothing.cpp +++ b/apps/openmw/mwclass/clothing.cpp @@ -275,8 +275,9 @@ namespace MWClass { MWWorld::LiveCellRef *ref = ptr.get(); + return MWWorld::Ptr(); - return MWWorld::Ptr(&cell.get().insert(*ref), &cell); + //return MWWorld::Ptr(&cell.get().insert(*ref), &cell); } int Clothing::getEnchantmentPoints (const MWWorld::Ptr& ptr) const diff --git a/apps/openmw/mwclass/container.cpp b/apps/openmw/mwclass/container.cpp index 6c44c97e2..b82dff706 100644 --- a/apps/openmw/mwclass/container.cpp +++ b/apps/openmw/mwclass/container.cpp @@ -292,8 +292,9 @@ namespace MWClass { MWWorld::LiveCellRef *ref = ptr.get(); + return MWWorld::Ptr(); - return MWWorld::Ptr(&cell.get().insert(*ref), &cell); + //return MWWorld::Ptr(&cell.get().insert(*ref), &cell); } void Container::readAdditionalState (const MWWorld::Ptr& ptr, const ESM::ObjectState& state) const diff --git a/apps/openmw/mwclass/creature.cpp b/apps/openmw/mwclass/creature.cpp index 2cd11d113..7f43f8677 100644 --- a/apps/openmw/mwclass/creature.cpp +++ b/apps/openmw/mwclass/creature.cpp @@ -599,8 +599,9 @@ namespace MWClass { MWWorld::LiveCellRef *ref = ptr.get(); + return MWWorld::Ptr(); - return MWWorld::Ptr(&cell.get().insert(*ref), &cell); + //return MWWorld::Ptr(&cell.get().insert(*ref), &cell); } bool Creature::isBipedal(const MWWorld::Ptr &ptr) const diff --git a/apps/openmw/mwclass/door.cpp b/apps/openmw/mwclass/door.cpp index 6fee79ddf..cb9f59e96 100644 --- a/apps/openmw/mwclass/door.cpp +++ b/apps/openmw/mwclass/door.cpp @@ -309,8 +309,9 @@ namespace MWClass { MWWorld::LiveCellRef *ref = ptr.get(); + return MWWorld::Ptr(); - return MWWorld::Ptr(&cell.get().insert(*ref), &cell); + //return MWWorld::Ptr(&cell.get().insert(*ref), &cell); } void Door::ensureCustomData(const MWWorld::Ptr &ptr) const diff --git a/apps/openmw/mwclass/ingredient.cpp b/apps/openmw/mwclass/ingredient.cpp index c9e6e70f2..0b6724c6c 100644 --- a/apps/openmw/mwclass/ingredient.cpp +++ b/apps/openmw/mwclass/ingredient.cpp @@ -184,8 +184,9 @@ namespace MWClass { MWWorld::LiveCellRef *ref = ptr.get(); + return MWWorld::Ptr(); - return MWWorld::Ptr(&cell.get().insert(*ref), &cell); + //return MWWorld::Ptr(&cell.get().insert(*ref), &cell); } bool Ingredient::canSell (const MWWorld::Ptr& item, int npcServices) const diff --git a/apps/openmw/mwclass/light.cpp b/apps/openmw/mwclass/light.cpp index 34d93da67..0442fd2e0 100644 --- a/apps/openmw/mwclass/light.cpp +++ b/apps/openmw/mwclass/light.cpp @@ -216,8 +216,9 @@ namespace MWClass { MWWorld::LiveCellRef *ref = ptr.get(); + return MWWorld::Ptr(); - return MWWorld::Ptr(&cell.get().insert(*ref), &cell); + //return MWWorld::Ptr(&cell.get().insert(*ref), &cell); } bool Light::canSell (const MWWorld::Ptr& item, int npcServices) const diff --git a/apps/openmw/mwclass/lockpick.cpp b/apps/openmw/mwclass/lockpick.cpp index 5cffdf13a..bd17a527b 100644 --- a/apps/openmw/mwclass/lockpick.cpp +++ b/apps/openmw/mwclass/lockpick.cpp @@ -165,8 +165,9 @@ namespace MWClass { MWWorld::LiveCellRef *ref = ptr.get(); + return MWWorld::Ptr(); - return MWWorld::Ptr(&cell.get().insert(*ref), &cell); + //return MWWorld::Ptr(&cell.get().insert(*ref), &cell); } bool Lockpick::canSell (const MWWorld::Ptr& item, int npcServices) const diff --git a/apps/openmw/mwclass/misc.cpp b/apps/openmw/mwclass/misc.cpp index 98b4faab9..16d926f5e 100644 --- a/apps/openmw/mwclass/misc.cpp +++ b/apps/openmw/mwclass/misc.cpp @@ -194,6 +194,7 @@ namespace MWClass { MWWorld::Ptr newPtr; + /* const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); @@ -223,6 +224,7 @@ namespace MWClass ptr.get(); newPtr = MWWorld::Ptr(&cell.get().insert(*ref), &cell); } + */ return newPtr; } diff --git a/apps/openmw/mwclass/npc.cpp b/apps/openmw/mwclass/npc.cpp index 6633b3490..b5f2b52f3 100644 --- a/apps/openmw/mwclass/npc.cpp +++ b/apps/openmw/mwclass/npc.cpp @@ -1129,8 +1129,9 @@ namespace MWClass { MWWorld::LiveCellRef *ref = ptr.get(); + return MWWorld::Ptr(); - return MWWorld::Ptr(&cell.get().insert(*ref), &cell); + //return MWWorld::Ptr(&cell.get().insert(*ref), &cell); } int Npc::getSkill(const MWWorld::Ptr& ptr, int skill) const diff --git a/apps/openmw/mwclass/potion.cpp b/apps/openmw/mwclass/potion.cpp index cf6b0919b..0f449fa92 100644 --- a/apps/openmw/mwclass/potion.cpp +++ b/apps/openmw/mwclass/potion.cpp @@ -177,8 +177,9 @@ namespace MWClass { MWWorld::LiveCellRef *ref = ptr.get(); + return MWWorld::Ptr(); - return MWWorld::Ptr(&cell.get().insert(*ref), &cell); + //return MWWorld::Ptr(&cell.get().insert(*ref), &cell); } bool Potion::canSell (const MWWorld::Ptr& item, int npcServices) const diff --git a/apps/openmw/mwclass/probe.cpp b/apps/openmw/mwclass/probe.cpp index ff717c506..80825466a 100644 --- a/apps/openmw/mwclass/probe.cpp +++ b/apps/openmw/mwclass/probe.cpp @@ -164,8 +164,9 @@ namespace MWClass { MWWorld::LiveCellRef *ref = ptr.get(); + return MWWorld::Ptr(); - return MWWorld::Ptr(&cell.get().insert(*ref), &cell); + //return MWWorld::Ptr(&cell.get().insert(*ref), &cell); } bool Probe::canSell (const MWWorld::Ptr& item, int npcServices) const diff --git a/apps/openmw/mwclass/repair.cpp b/apps/openmw/mwclass/repair.cpp index e6baea2e0..993c39aa2 100644 --- a/apps/openmw/mwclass/repair.cpp +++ b/apps/openmw/mwclass/repair.cpp @@ -159,8 +159,9 @@ namespace MWClass { MWWorld::LiveCellRef *ref = ptr.get(); + return MWWorld::Ptr(); - return MWWorld::Ptr(&cell.get().insert(*ref), &cell); + //return MWWorld::Ptr(&cell.get().insert(*ref), &cell); } boost::shared_ptr Repair::use (const MWWorld::Ptr& ptr) const diff --git a/apps/openmw/mwclass/static.cpp b/apps/openmw/mwclass/static.cpp index 9755df28e..ae0b5d3dd 100644 --- a/apps/openmw/mwclass/static.cpp +++ b/apps/openmw/mwclass/static.cpp @@ -59,7 +59,8 @@ namespace MWClass { MWWorld::LiveCellRef *ref = ptr.get(); + return MWWorld::Ptr(); - return MWWorld::Ptr(&cell.get().insert(*ref), &cell); + //return MWWorld::Ptr(&cell.get().insert(*ref), &cell); } } diff --git a/apps/openmw/mwclass/weapon.cpp b/apps/openmw/mwclass/weapon.cpp index da4c7deb2..15c0039a4 100644 --- a/apps/openmw/mwclass/weapon.cpp +++ b/apps/openmw/mwclass/weapon.cpp @@ -417,7 +417,8 @@ namespace MWClass MWWorld::LiveCellRef *ref = ptr.get(); - return MWWorld::Ptr(&cell.get().insert(*ref), &cell); + return MWWorld::Ptr(); + //return MWWorld::Ptr(&cell.get().insert(*ref), &cell); } int Weapon::getEnchantmentPoints (const MWWorld::Ptr& ptr) const diff --git a/apps/openmw/mwmechanics/obstacle.cpp b/apps/openmw/mwmechanics/obstacle.cpp index dae5f8496..a2cbae2a0 100644 --- a/apps/openmw/mwmechanics/obstacle.cpp +++ b/apps/openmw/mwmechanics/obstacle.cpp @@ -44,6 +44,7 @@ namespace MWMechanics return MWWorld::Ptr(); // check interior cells only // Check all the doors in this cell + /* MWWorld::CellRefList& doors = cell->get(); MWWorld::CellRefList::List& refList = doors.mList; MWWorld::CellRefList::List::iterator it = refList.begin(); @@ -66,6 +67,7 @@ namespace MWMechanics return MWWorld::Ptr(&ref, actor.getCell()); // found, stop searching } } + */ return MWWorld::Ptr(); // none found } diff --git a/apps/openmw/mwworld/cellstore.hpp b/apps/openmw/mwworld/cellstore.hpp index f88bf0958..89b200262 100644 --- a/apps/openmw/mwworld/cellstore.hpp +++ b/apps/openmw/mwworld/cellstore.hpp @@ -73,6 +73,7 @@ namespace MWWorld MWWorld::TimeStamp mLastRespawn; + // List of refs owned by this cell CellRefList mActivators; CellRefList mPotions; CellRefList mAppas; @@ -179,6 +180,8 @@ namespace MWWorld forEachImp (functor, mNpcs); } + /// \todo add const version of forEach + bool isExterior() const; Ptr searchInContainer (const std::string& id); @@ -198,16 +201,6 @@ namespace MWWorld void respawn (); ///< Check mLastRespawn and respawn references if necessary. This is a no-op if the cell is not loaded. - template - CellRefList& get() { - throw std::runtime_error ("Storage for type " + std::string(typeid(T).name())+ " does not exist in cells"); - } - - template - const CellRefList& getReadOnly() { - throw std::runtime_error ("Read Only CellRefList access not available for type " + std::string(typeid(T).name()) ); - } - bool isPointConnected(const int start, const int end) const; std::list aStarSearch(const int start, const int end) const; @@ -241,152 +234,6 @@ namespace MWWorld MWMechanics::PathgridGraph mPathgridGraph; }; - template<> - inline CellRefList& CellStore::get() - { - mHasState = true; - return mActivators; - } - - template<> - inline CellRefList& CellStore::get() - { - mHasState = true; - return mPotions; - } - - template<> - inline CellRefList& CellStore::get() - { - mHasState = true; - return mAppas; - } - - template<> - inline CellRefList& CellStore::get() - { - mHasState = true; - return mArmors; - } - - template<> - inline CellRefList& CellStore::get() - { - mHasState = true; - return mBooks; - } - - template<> - inline CellRefList& CellStore::get() - { - mHasState = true; - return mClothes; - } - - template<> - inline CellRefList& CellStore::get() - { - mHasState = true; - return mContainers; - } - - template<> - inline CellRefList& CellStore::get() - { - mHasState = true; - return mCreatures; - } - - template<> - inline CellRefList& CellStore::get() - { - mHasState = true; - return mDoors; - } - - template<> - inline CellRefList& CellStore::get() - { - mHasState = true; - return mIngreds; - } - - template<> - inline CellRefList& CellStore::get() - { - mHasState = true; - return mCreatureLists; - } - - template<> - inline CellRefList& CellStore::get() - { - mHasState = true; - return mItemLists; - } - - template<> - inline CellRefList& CellStore::get() - { - mHasState = true; - return mLights; - } - - template<> - inline CellRefList& CellStore::get() - { - mHasState = true; - return mLockpicks; - } - - template<> - inline CellRefList& CellStore::get() - { - mHasState = true; - return mMiscItems; - } - - template<> - inline CellRefList& CellStore::get() - { - mHasState = true; - return mNpcs; - } - - template<> - inline CellRefList& CellStore::get() - { - mHasState = true; - return mProbes; - } - - template<> - inline CellRefList& CellStore::get() - { - mHasState = true; - return mRepairs; - } - - template<> - inline CellRefList& CellStore::get() - { - mHasState = true; - return mStatics; - } - - template<> - inline CellRefList& CellStore::get() - { - mHasState = true; - return mWeapons; - } - - template<> - inline const CellRefList& CellStore::getReadOnly() - { - return mDoors; - } - bool operator== (const CellStore& left, const CellStore& right); bool operator!= (const CellStore& left, const CellStore& right); } diff --git a/apps/openmw/mwworld/localscripts.cpp b/apps/openmw/mwworld/localscripts.cpp index e30246f7c..aa5abc076 100644 --- a/apps/openmw/mwworld/localscripts.cpp +++ b/apps/openmw/mwworld/localscripts.cpp @@ -116,6 +116,7 @@ void MWWorld::LocalScripts::add (const std::string& scriptName, const Ptr& ptr) void MWWorld::LocalScripts::addCell (CellStore *cell) { + /* listCellScripts (*this, cell->get(), cell); listCellScripts (*this, cell->get(), cell); listCellScripts (*this, cell->get(), cell); @@ -136,6 +137,7 @@ void MWWorld::LocalScripts::addCell (CellStore *cell) listCellScripts (*this, cell->get(), cell); listCellScripts (*this, cell->get(), cell); listCellScripts (*this, cell->get(), cell); + */ } void MWWorld::LocalScripts::clear() diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 22485ed92..950c38e76 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -1693,6 +1693,7 @@ namespace MWWorld osg::Vec2f World::getNorthVector (CellStore* cell) { + /* MWWorld::CellRefList& statics = cell->get(); MWWorld::LiveCellRef* ref = statics.find("northmarker"); if (!ref) @@ -1702,10 +1703,13 @@ namespace MWWorld osg::Vec3f dir = orient * osg::Vec3f(0,1,0); osg::Vec2f d (dir.x(), dir.y()); return d; + */ + return osg::Vec2f(); } void World::getDoorMarkers (CellStore* cell, std::vector& out) { + /* MWWorld::CellRefList& doors = cell->get(); CellRefList::List& refList = doors.mList; for (CellRefList::List::iterator it = refList.begin(); it != refList.end(); ++it) @@ -1744,6 +1748,7 @@ namespace MWWorld out.push_back(newMarker); } } + */ } void World::setWaterHeight(const float height) @@ -2240,6 +2245,7 @@ namespace MWWorld void World::getContainersOwnedBy (const MWWorld::Ptr& npc, std::vector& out) { + /* const Scene::CellStoreCollection& collection = mWorldScene->getActiveCells(); for (Scene::CellStoreCollection::const_iterator cellIt = collection.begin(); cellIt != collection.end(); ++cellIt) { @@ -2254,6 +2260,7 @@ namespace MWWorld out.push_back(ptr); } } + */ } struct ListObjectsFunctor @@ -2316,6 +2323,8 @@ namespace MWWorld bool World::findInteriorPosition(const std::string &name, ESM::Position &pos) { + return false; + /* typedef MWWorld::CellRefList::List DoorList; typedef MWWorld::CellRefList::List StaticList; @@ -2368,6 +2377,7 @@ namespace MWWorld pos = statics.begin()->mRef.getPosition(); return true; } + */ return false; } @@ -2715,6 +2725,8 @@ namespace MWWorld bool World::findInteriorPositionInWorldSpace(MWWorld::CellStore* cell, osg::Vec3f& result) { + return false; + /* if (cell->isExterior()) return false; @@ -2732,7 +2744,7 @@ namespace MWWorld MWWorld::CellStore *next = getInterior( *i ); if ( !next ) continue; - const MWWorld::CellRefList& doors = next->getReadOnly(); + const MWWorld::CellRefList& doors = next->getReadOnlyDoors(); const CellRefList::List& refList = doors.mList; // Check if any door in the cell leads to an exterior directly @@ -2761,10 +2773,12 @@ namespace MWWorld // No luck :( return false; + */ } MWWorld::Ptr World::getClosestMarker( const MWWorld::Ptr &ptr, const std::string &id ) { + /* if ( ptr.getCell()->isExterior() ) { return getClosestMarkerFromExteriorPosition(mPlayer->getLastKnownExteriorPosition(), id); } @@ -2792,7 +2806,7 @@ namespace MWWorld return closestMarker; } - const MWWorld::CellRefList& doors = next->getReadOnly(); + const MWWorld::CellRefList& doors = next->getReadOnlyDoors(); const CellRefList::List& doorList = doors.mList; // Check if any door in the cell leads to an exterior directly @@ -2816,7 +2830,7 @@ namespace MWWorld } } } - + */ return MWWorld::Ptr(); }