mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-20 07:53:51 +00:00
MWWorld::Scene::insertCell
This commit is contained in:
parent
b7dbfb849a
commit
a13b958600
2 changed files with 66 additions and 0 deletions
|
@ -11,11 +11,42 @@
|
||||||
#include "ptr.hpp"
|
#include "ptr.hpp"
|
||||||
#include "environment.hpp"
|
#include "environment.hpp"
|
||||||
#include "player.hpp"
|
#include "player.hpp"
|
||||||
|
#include "class.hpp"
|
||||||
|
|
||||||
#include "doingphysics.hpp"
|
#include "doingphysics.hpp"
|
||||||
#include "cellfunctors.hpp"
|
#include "cellfunctors.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
void insertCellRefList (T& cellRefList, ESMS::CellStore<MWWorld::RefData> &cell)
|
||||||
|
{
|
||||||
|
if (!cellRefList.list.empty())
|
||||||
|
{
|
||||||
|
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() || it->mData.isEnabled())
|
||||||
|
{
|
||||||
|
MWWorld::Ptr ptr (&*it, &cell);
|
||||||
|
/* TODO: call
|
||||||
|
* RenderingManager.insertObject
|
||||||
|
* class_.insertObjectPhysic
|
||||||
|
* class_.insertObjectMechanics
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
namespace MWWorld
|
namespace MWWorld
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -216,5 +247,38 @@ namespace MWWorld
|
||||||
{
|
{
|
||||||
mCellChanged = false;
|
mCellChanged = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*#include <cassert>
|
||||||
|
#include <iostream>
|
||||||
|
#include <exception>
|
||||||
|
|
||||||
|
#include "../mwworld/class.hpp"
|
||||||
|
#include "../mwworld/ptr.hpp"*/
|
||||||
|
|
||||||
|
void Scene::insertCell(ESMS::CellStore<MWWorld::RefData> &cell)
|
||||||
|
{
|
||||||
|
// Loop through all references in the cell
|
||||||
|
insertCellRefList (cell.activators, cell);
|
||||||
|
insertCellRefList (cell.potions, cell);
|
||||||
|
insertCellRefList (cell.appas, cell);
|
||||||
|
insertCellRefList (cell.armors, cell);
|
||||||
|
insertCellRefList (cell.books, cell);
|
||||||
|
insertCellRefList (cell.clothes, cell);
|
||||||
|
insertCellRefList (cell.containers, cell);
|
||||||
|
insertCellRefList (cell.creatures, cell);
|
||||||
|
insertCellRefList (cell.doors, cell);
|
||||||
|
insertCellRefList (cell.ingreds, cell);
|
||||||
|
insertCellRefList (cell.creatureLists, cell);
|
||||||
|
insertCellRefList (cell.itemLists, cell);
|
||||||
|
insertCellRefList (cell.lights, cell);
|
||||||
|
insertCellRefList (cell.lockpicks, cell);
|
||||||
|
insertCellRefList (cell.miscItems, cell);
|
||||||
|
insertCellRefList (cell.npcs, cell);
|
||||||
|
insertCellRefList (cell.probes, cell);
|
||||||
|
insertCellRefList (cell.repairs, cell);
|
||||||
|
insertCellRefList (cell.statics, cell);
|
||||||
|
insertCellRefList (cell.weapons, cell);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -98,6 +98,8 @@ namespace MWWorld
|
||||||
void markCellAsUnchanged();
|
void markCellAsUnchanged();
|
||||||
|
|
||||||
std::string getFacedHandle();
|
std::string getFacedHandle();
|
||||||
|
|
||||||
|
void insertCell(ESMS::CellStore<MWWorld::RefData> &cell);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue