1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-05 15:55:45 +00:00
OpenMW/apps/openmw/mwworld/cellfunctors.hpp

34 lines
633 B
C++

#ifndef GAME_MWWORLD_CELLFUNCTORS_H
#define GAME_MWWORLD_CELLFUNCTORS_H
#include <vector>
#include <string>
#include "ptr.hpp"
namespace ESM
{
class CellRef;
}
namespace MWWorld
{
/// List all (Ogre-)handles, then reset RefData::mBaseNode to 0.
struct ListAndResetHandles
{
std::vector<Ogre::SceneNode*> mHandles;
bool operator() (MWWorld::Ptr ptr)
{
Ogre::SceneNode* handle = ptr.getRefData().getBaseNode();
if (handle)
mHandles.push_back (handle);
ptr.getRefData().setBaseNode(0);
return true;
}
};
}
#endif