2013-08-16 11:01:52 +00:00
|
|
|
#ifndef MWRENDER_TERRAINSTORAGE_H
|
|
|
|
#define MWRENDER_TERRAINSTORAGE_H
|
|
|
|
|
2017-03-06 18:04:17 +00:00
|
|
|
#include <memory>
|
|
|
|
|
2023-08-06 10:53:29 +00:00
|
|
|
#include <components/esmterrain/storage.hpp>
|
2013-08-16 11:01:52 +00:00
|
|
|
|
2017-03-06 18:04:17 +00:00
|
|
|
#include <components/resource/resourcesystem.hpp>
|
|
|
|
|
2013-08-16 11:01:52 +00:00
|
|
|
namespace MWRender
|
|
|
|
{
|
|
|
|
|
2017-03-06 18:04:17 +00:00
|
|
|
class LandManager;
|
|
|
|
|
2014-08-07 18:31:07 +00:00
|
|
|
/// @brief Connects the ESM Store used in OpenMW with the ESMTerrain storage.
|
|
|
|
class TerrainStorage : public ESMTerrain::Storage
|
2013-08-16 11:01:52 +00:00
|
|
|
{
|
|
|
|
public:
|
2024-05-23 16:48:54 +00:00
|
|
|
TerrainStorage(Resource::ResourceSystem* resourceSystem, std::string_view normalMapPattern = {},
|
|
|
|
std::string_view normalHeightMapPattern = {}, bool autoUseNormalMaps = false,
|
|
|
|
std::string_view specularMapPattern = {}, bool autoUseSpecularMaps = false);
|
2017-03-06 18:04:17 +00:00
|
|
|
~TerrainStorage();
|
|
|
|
|
2023-05-14 18:00:02 +00:00
|
|
|
osg::ref_ptr<const ESMTerrain::LandObject> getLand(ESM::ExteriorCellLocation cellLocation) override;
|
2024-05-23 16:48:54 +00:00
|
|
|
const ESM::LandTexture* getLandTexture(std::uint16_t index, int plugin) override;
|
2015-01-29 02:30:07 +00:00
|
|
|
|
2023-05-14 18:00:02 +00:00
|
|
|
bool hasData(ESM::ExteriorCellLocation cellLocation) override;
|
2019-02-20 13:37:00 +00:00
|
|
|
|
2014-02-13 09:13:53 +00:00
|
|
|
/// Get bounds of the whole terrain in cell units
|
2023-05-18 23:07:34 +00:00
|
|
|
void getBounds(float& minX, float& maxX, float& minY, float& maxY, ESM::RefId worldspace) override;
|
2017-03-06 18:04:17 +00:00
|
|
|
|
|
|
|
LandManager* getLandManager() const;
|
|
|
|
|
|
|
|
private:
|
2017-04-28 15:30:26 +00:00
|
|
|
std::unique_ptr<LandManager> mLandManager;
|
2017-03-06 18:04:17 +00:00
|
|
|
|
|
|
|
Resource::ResourceSystem* mResourceSystem;
|
2013-08-16 11:01:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|