mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-27 03:35:27 +00:00
c0f128bcb3
Signed-off-by: Bret Curtis <psi29a@gmail.com>
53 lines
1.4 KiB
C++
53 lines
1.4 KiB
C++
#ifndef OPENMW_COMPONENTS_ESMPAGING_CHUNKMANAGER_H
|
|
#define OPENMW_COMPONENTS_ESMPAGING_CHUNKMANAGER_H
|
|
|
|
#include <components/terrain/quadtreeworld.hpp>
|
|
#include <components/resource/resourcemanager.hpp>
|
|
#include <components/esm/loadcell.hpp>
|
|
|
|
#include <OpenThreads/Mutex>
|
|
|
|
namespace Resource
|
|
{
|
|
class SceneManager;
|
|
}
|
|
namespace MWWorld
|
|
{
|
|
class ESMStore;
|
|
}
|
|
|
|
namespace MWRender
|
|
{
|
|
|
|
typedef std::tuple<osg::Vec2f, float> ChunkId; // Center, Size
|
|
|
|
class ObjectPaging : public Resource::GenericResourceManager<ChunkId>, public Terrain::QuadTreeWorld::ChunkManager
|
|
{
|
|
public:
|
|
ObjectPaging(Resource::SceneManager* sceneManager);
|
|
~ObjectPaging() = default;
|
|
|
|
osg::ref_ptr<osg::Node> getChunk(float size, const osg::Vec2f& center, unsigned char lod, unsigned int lodFlags, bool far, const osg::Vec3f& viewPoint) override;
|
|
|
|
osg::ref_ptr<osg::Node> createChunk(float size, const osg::Vec2f& center, const osg::Vec3f& viewPoint);
|
|
|
|
virtual void setExpiryDelay(double expiryDelay) override { mExpiryDelay = 0.5f; }
|
|
|
|
virtual unsigned int getNodeMask() override;
|
|
|
|
void enableObject(const ESM::RefNum & refnum, bool enabled);
|
|
void clear();
|
|
|
|
private:
|
|
Resource::SceneManager* mSceneManager;
|
|
bool mMergeGeometry;
|
|
float mMinSize;
|
|
|
|
OpenThreads::Mutex mDisabledMutex;
|
|
std::set<ESM::RefNum> mDisabled;
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|