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>
|
|
|
|
|
2022-01-22 22:52:08 +00:00
|
|
|
#include <components/esm3terrain/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:
|
2020-09-13 15:46:27 +00:00
|
|
|
TerrainStorage(Resource::ResourceSystem* resourceSystem, const std::string& normalMapPattern = "",
|
|
|
|
const std::string& normalHeightMapPattern = "", bool autoUseNormalMaps = false,
|
|
|
|
const std::string& specularMapPattern = "", bool autoUseSpecularMaps = false);
|
2017-03-06 18:04:17 +00:00
|
|
|
~TerrainStorage();
|
|
|
|
|
2020-10-16 18:18:54 +00:00
|
|
|
osg::ref_ptr<const ESMTerrain::LandObject> getLand(int cellX, int cellY) override;
|
|
|
|
const ESM::LandTexture* getLandTexture(int index, short plugin) override;
|
2015-01-29 02:30:07 +00:00
|
|
|
|
2020-10-16 18:18:54 +00:00
|
|
|
bool hasData(int cellX, int cellY) 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
|
2020-10-16 18:18:54 +00:00
|
|
|
void getBounds(float& minX, float& maxX, float& minY, float& maxY) 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
|