#ifndef OPENMW_COMPONENTS_TERRAIN_CHUNKMANAGER_H #define OPENMW_COMPONENTS_TERRAIN_CHUNKMANAGER_H #include #include "buffercache.hpp" namespace osg { class Group; class Texture2D; } namespace SceneUtil { class PositionAttitudeTransform; } namespace Resource { class SceneManager; } namespace Terrain { class TextureManager; class CompositeMapRenderer; class Storage; /// @brief Handles loading and caching of terrain chunks class ChunkManager : public Resource::ResourceManager { public: ChunkManager(Storage* storage, Resource::SceneManager* sceneMgr, TextureManager* textureManager, CompositeMapRenderer* renderer); osg::ref_ptr getChunk(float size, const osg::Vec2f& center); virtual void reportStats(unsigned int frameNumber, osg::Stats* stats) const; private: osg::ref_ptr createChunk(float size, const osg::Vec2f& center); osg::ref_ptr createCompositeMapRTT(osg::ref_ptr& texture); Terrain::Storage* mStorage; Resource::SceneManager* mSceneManager; TextureManager* mTextureManager; CompositeMapRenderer* mCompositeMapRenderer; BufferCache mBufferCache; unsigned int mCompositeMapSize; }; } #endif