|
|
|
@ -2,6 +2,9 @@
|
|
|
|
|
|
|
|
|
|
#include <cassert>
|
|
|
|
|
|
|
|
|
|
#include "../mwworld/class.hpp"
|
|
|
|
|
#include "../mwworld/ptr.hpp"
|
|
|
|
|
|
|
|
|
|
using namespace MWRender;
|
|
|
|
|
|
|
|
|
|
template<typename T>
|
|
|
|
@ -59,37 +62,45 @@ void insertObj(CellRenderImp& cellRender, ESMS::LiveCellRef<ESM::NPC, MWWorld::R
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<typename T>
|
|
|
|
|
void insertCellRefList (CellRenderImp& cellRender, const ESMS::ESMStore& store, T& cellRefList)
|
|
|
|
|
void insertCellRefList (CellRenderImp& cellRender, MWWorld::Environment& environment,
|
|
|
|
|
T& cellRefList, ESMS::CellStore<MWWorld::RefData> &cell)
|
|
|
|
|
{
|
|
|
|
|
for(typename T::List::iterator it = cellRefList.list.begin();
|
|
|
|
|
it != cellRefList.list.end(); it++)
|
|
|
|
|
if (!cellRefList.list.empty())
|
|
|
|
|
{
|
|
|
|
|
if (it->mData.getCount())
|
|
|
|
|
insertObj (cellRender, *it, store);
|
|
|
|
|
const MWWorld::Class& class_ =
|
|
|
|
|
MWWorld::Class::get (MWWorld::Ptr (&*cellRefList.list.begin(), &cell));
|
|
|
|
|
|
|
|
|
|
for (typename T::List::iterator it = cellRefList.list.begin();
|
|
|
|
|
it != cellRefList.list.end(); it++)
|
|
|
|
|
{
|
|
|
|
|
if (it->mData.getCount())
|
|
|
|
|
class_.insertObj (MWWorld::Ptr (&*it, &cell), cellRender, environment);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CellRenderImp::insertCell(ESMS::CellStore<MWWorld::RefData> &cell, const ESMS::ESMStore& store)
|
|
|
|
|
void CellRenderImp::insertCell(ESMS::CellStore<MWWorld::RefData> &cell,
|
|
|
|
|
MWWorld::Environment& environment)
|
|
|
|
|
{
|
|
|
|
|
// Loop through all references in the cell
|
|
|
|
|
insertCellRefList (*this, store, cell.activators);
|
|
|
|
|
insertCellRefList (*this, store, cell.potions);
|
|
|
|
|
insertCellRefList (*this, store, cell.appas);
|
|
|
|
|
insertCellRefList (*this, store, cell.armors);
|
|
|
|
|
insertCellRefList (*this, store, cell.books);
|
|
|
|
|
insertCellRefList (*this, store, cell.clothes);
|
|
|
|
|
insertCellRefList (*this, store, cell.containers);
|
|
|
|
|
insertCellRefList (*this, store, cell.creatures);
|
|
|
|
|
insertCellRefList (*this, store, cell.doors);
|
|
|
|
|
insertCellRefList (*this, store, cell.ingreds);
|
|
|
|
|
// insertCellRefList (*this, store, cell.creatureLists);
|
|
|
|
|
// insertCellRefList (*this, store, cell.itemLists);
|
|
|
|
|
insertCellRefList (*this, store, cell.lights);
|
|
|
|
|
insertCellRefList (*this, store, cell.lockpicks);
|
|
|
|
|
insertCellRefList (*this, store, cell.miscItems);
|
|
|
|
|
insertCellRefList (*this, store, cell.npcs);
|
|
|
|
|
insertCellRefList (*this, store, cell.probes);
|
|
|
|
|
insertCellRefList (*this, store, cell.repairs);
|
|
|
|
|
insertCellRefList (*this, store, cell.statics);
|
|
|
|
|
insertCellRefList (*this, store, cell.weapons);
|
|
|
|
|
insertCellRefList (*this, environment, cell.activators, cell);
|
|
|
|
|
insertCellRefList (*this, environment, cell.potions, cell);
|
|
|
|
|
insertCellRefList (*this, environment, cell.appas, cell);
|
|
|
|
|
insertCellRefList (*this, environment, cell.armors, cell);
|
|
|
|
|
insertCellRefList (*this, environment, cell.books, cell);
|
|
|
|
|
insertCellRefList (*this, environment, cell.clothes, cell);
|
|
|
|
|
insertCellRefList (*this, environment, cell.containers, cell);
|
|
|
|
|
insertCellRefList (*this, environment, cell.creatures, cell);
|
|
|
|
|
insertCellRefList (*this, environment, cell.doors, cell);
|
|
|
|
|
insertCellRefList (*this, environment, cell.ingreds, cell);
|
|
|
|
|
// insertCellRefList (*this, environment, cell.creatureLists, cell);
|
|
|
|
|
// insertCellRefList (*this, environment, cell.itemLists, cell);
|
|
|
|
|
insertCellRefList (*this, environment, cell.lights, cell);
|
|
|
|
|
insertCellRefList (*this, environment, cell.lockpicks, cell);
|
|
|
|
|
insertCellRefList (*this, environment, cell.miscItems, cell);
|
|
|
|
|
insertCellRefList (*this, environment, cell.npcs, cell);
|
|
|
|
|
insertCellRefList (*this, environment, cell.probes, cell);
|
|
|
|
|
insertCellRefList (*this, environment, cell.repairs, cell);
|
|
|
|
|
insertCellRefList (*this, environment, cell.statics, cell);
|
|
|
|
|
insertCellRefList (*this, environment, cell.weapons, cell);
|
|
|
|
|
}
|
|
|
|
|