mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-19 12:40:49 +00:00
Remove unused functions
This commit is contained in:
parent
a0cddfda2b
commit
47b7c71c73
@ -199,8 +199,6 @@ namespace MWBase
|
||||
virtual MWWorld::Ptr searchPtrViaActorId(int actorId) = 0;
|
||||
///< Search is limited to the active cells.
|
||||
|
||||
virtual MWWorld::Ptr searchPtrViaRefNum(const ESM::RefId& id, const ESM::RefNum& refNum) = 0;
|
||||
|
||||
virtual MWWorld::Ptr findContainer(const MWWorld::ConstPtr& ptr) = 0;
|
||||
///< Return a pointer to a liveCellRef which contains \a ptr.
|
||||
/// \note Search is limited to the active cells.
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/scriptmanager.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
#include "../mwworld/worldmodel.hpp"
|
||||
|
||||
#include "interpretercontext.hpp"
|
||||
|
||||
@ -62,7 +63,7 @@ namespace
|
||||
if (pair.second.empty())
|
||||
return MWWorld::Ptr();
|
||||
else if (pair.first.hasContentFile())
|
||||
return MWBase::Environment::get().getWorld()->searchPtrViaRefNum(pair.second, pair.first);
|
||||
return MWBase::Environment::get().getWorldModel()->getPtr(pair.first);
|
||||
return MWBase::Environment::get().getWorld()->searchPtr(pair.second, false);
|
||||
}
|
||||
};
|
||||
|
@ -728,11 +728,6 @@ namespace MWWorld
|
||||
return mWorldScene->searchPtrViaActorId(actorId);
|
||||
}
|
||||
|
||||
Ptr World::searchPtrViaRefNum(const ESM::RefId& id, const ESM::RefNum& refNum)
|
||||
{
|
||||
return mWorldModel.getPtr(id, refNum);
|
||||
}
|
||||
|
||||
struct FindContainerVisitor
|
||||
{
|
||||
ConstPtr mContainedPtr;
|
||||
|
@ -286,8 +286,6 @@ namespace MWWorld
|
||||
Ptr searchPtrViaActorId(int actorId) override;
|
||||
///< Search is limited to the active cells.
|
||||
|
||||
Ptr searchPtrViaRefNum(const ESM::RefId& id, const ESM::RefNum& refNum) override;
|
||||
|
||||
MWWorld::Ptr findContainer(const MWWorld::ConstPtr& ptr) override;
|
||||
///< Return a pointer to a liveCellRef which contains \a ptr.
|
||||
/// \note Search is limited to the active cells.
|
||||
|
@ -377,37 +377,6 @@ MWWorld::Ptr MWWorld::WorldModel::getPtr(const ESM::RefId& name)
|
||||
return Ptr();
|
||||
}
|
||||
|
||||
MWWorld::Ptr MWWorld::WorldModel::getPtr(const ESM::RefId& id, const ESM::RefNum& refNum)
|
||||
{
|
||||
for (auto& pair : mInteriors)
|
||||
{
|
||||
Ptr ptr = getPtr(pair.second, id, refNum);
|
||||
if (!ptr.isEmpty())
|
||||
return ptr;
|
||||
}
|
||||
for (auto& pair : mExteriors)
|
||||
{
|
||||
Ptr ptr = getPtr(pair.second, id, refNum);
|
||||
if (!ptr.isEmpty())
|
||||
return ptr;
|
||||
}
|
||||
return Ptr();
|
||||
}
|
||||
|
||||
MWWorld::Ptr MWWorld::WorldModel::getPtr(CellStore& cellStore, const ESM::RefId& id, const ESM::RefNum& refNum)
|
||||
{
|
||||
if (cellStore.getState() == CellStore::State_Unloaded)
|
||||
cellStore.preload();
|
||||
if (cellStore.getState() == CellStore::State_Preloaded)
|
||||
{
|
||||
if (cellStore.hasId(id))
|
||||
cellStore.load();
|
||||
else
|
||||
return Ptr();
|
||||
}
|
||||
return cellStore.searchViaRefNum(refNum);
|
||||
}
|
||||
|
||||
void MWWorld::WorldModel::getExteriorPtrs(const ESM::RefId& name, std::vector<MWWorld::Ptr>& out)
|
||||
{
|
||||
const MWWorld::Store<ESM::Cell>& cells = mStore.get<ESM::Cell>();
|
||||
@ -422,20 +391,6 @@ void MWWorld::WorldModel::getExteriorPtrs(const ESM::RefId& name, std::vector<MW
|
||||
}
|
||||
}
|
||||
|
||||
void MWWorld::WorldModel::getInteriorPtrs(const ESM::RefId& name, std::vector<MWWorld::Ptr>& out)
|
||||
{
|
||||
const MWWorld::Store<ESM::Cell>& cells = mStore.get<ESM::Cell>();
|
||||
for (MWWorld::Store<ESM::Cell>::iterator iter = cells.intBegin(); iter != cells.intEnd(); ++iter)
|
||||
{
|
||||
CellStore* cellStore = getCellStore(&(*iter));
|
||||
|
||||
Ptr ptr = getPtrAndCache(name, *cellStore);
|
||||
|
||||
if (!ptr.isEmpty())
|
||||
out.push_back(ptr);
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<MWWorld::Ptr> MWWorld::WorldModel::getAll(const ESM::RefId& id)
|
||||
{
|
||||
PtrCollector visitor;
|
||||
|
@ -56,8 +56,6 @@ namespace MWWorld
|
||||
CellStore* getCellStore(const ESM::Cell* cell);
|
||||
Ptr getPtrAndCache(const ESM::RefId& name, CellStore& cellStore);
|
||||
|
||||
Ptr getPtr(CellStore& cellStore, const ESM::RefId& id, const ESM::RefNum& refNum);
|
||||
|
||||
void writeCell(ESM::ESMWriter& writer, CellStore& cell) const;
|
||||
|
||||
std::unordered_map<ESM::RefNum, Ptr> mPtrIndex;
|
||||
@ -95,8 +93,6 @@ namespace MWWorld
|
||||
/// @note name must be lower case
|
||||
Ptr getPtr(const ESM::RefId& name);
|
||||
|
||||
Ptr getPtr(const ESM::RefId& id, const ESM::RefNum& refNum);
|
||||
|
||||
template <typename Fn>
|
||||
void forEachLoadedCellStore(Fn&& fn)
|
||||
{
|
||||
@ -111,11 +107,6 @@ namespace MWWorld
|
||||
/// @note name must be lower case
|
||||
void getExteriorPtrs(const ESM::RefId& name, std::vector<MWWorld::Ptr>& out);
|
||||
|
||||
/// Get all Ptrs referencing \a name in interior cells
|
||||
/// @note Due to the current implementation of getPtr this only supports one Ptr per cell.
|
||||
/// @note name must be lower case
|
||||
void getInteriorPtrs(const ESM::RefId& name, std::vector<MWWorld::Ptr>& out);
|
||||
|
||||
std::vector<MWWorld::Ptr> getAll(const ESM::RefId& id);
|
||||
|
||||
int countSavedGameRecords() const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user