mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-17 02:42:45 +00:00
59 lines
1.9 KiB
C++
59 lines
1.9 KiB
C++
#ifndef MWRENDER_TERRAINSTORAGE_H
|
|
#define MWRENDER_TERRAINSTORAGE_H
|
|
|
|
#include <memory>
|
|
|
|
#include <components/esmterrain/storage.hpp>
|
|
|
|
#include <components/resource/resourcesystem.hpp>
|
|
|
|
namespace ESM4
|
|
{
|
|
struct Land;
|
|
struct LandTexture;
|
|
struct TextureSet;
|
|
}
|
|
|
|
namespace MWRender
|
|
{
|
|
|
|
class LandManager;
|
|
|
|
/// @brief Connects the ESM Store used in OpenMW with the ESMTerrain storage.
|
|
class TerrainStorage : public ESMTerrain::Storage
|
|
{
|
|
public:
|
|
TerrainStorage(Resource::ResourceSystem* resourceSystem, std::string_view normalMapPattern = {},
|
|
std::string_view normalHeightMapPattern = {}, bool autoUseNormalMaps = false,
|
|
std::string_view specularMapPattern = {}, bool autoUseSpecularMaps = false);
|
|
~TerrainStorage();
|
|
|
|
osg::ref_ptr<const ESMTerrain::LandObject> getLand(ESM::ExteriorCellLocation cellLocation) override;
|
|
const std::string* getLandTexture(std::uint16_t index, int plugin) override;
|
|
|
|
bool hasData(ESM::ExteriorCellLocation cellLocation) override;
|
|
|
|
/// Get bounds of the whole terrain in cell units
|
|
void getBounds(float& minX, float& maxX, float& minY, float& maxY, ESM::RefId worldspace) override;
|
|
|
|
LandManager* getLandManager() const;
|
|
|
|
const ESM4::Land *getEsm4Land(ESM::ExteriorCellLocation cellLocation) const override;
|
|
const ESM4::LandTexture *getEsm4LandTexture(ESM::RefId ltexId) const override;
|
|
const ESM4::TextureSet *getEsm4TextureSet(ESM::RefId txstId) const override;
|
|
|
|
// Intended to be set by RenderingManager. Ideally this should be part of the
|
|
// construction but this class is initialised in the constructor and we man end up with
|
|
// a different terrain during RenderingManager::enableTerrain().
|
|
void setIsEsm4Ext(bool state) { mIsEsm4Ext = state; }
|
|
|
|
private:
|
|
std::unique_ptr<LandManager> mLandManager;
|
|
|
|
Resource::ResourceSystem* mResourceSystem;
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|