1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-07 12:54:00 +00:00
OpenMW/components/esm/esmterrain.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

50 lines
1.6 KiB
C++
Raw Normal View History

#ifndef COMPONENTS_ESM_ESMTERRAIN
#define COMPONENTS_ESM_ESMTERRAIN
#include <cstdint>
#include <memory>
#include <span>
#include <vector>
#include <components/esm3/loadland.hpp>
#include <components/esm4/loadland.hpp>
namespace ESM
{
class LandData
{
public:
~LandData() = default;
LandData() = default;
LandData(const ESM::Land& Land, int loadFlags);
LandData(const ESM4::Land& Land, int loadFlags);
std::span<const float> getHeights() const { return mHeights; }
std::span<const std::int8_t> getNormals() const { return mNormals; }
std::span<const std::uint8_t> getColors() const { return mColors; }
std::span<const std::uint16_t> getTextures() const { return mTextures; }
float getSize() const { return mSize; }
float getMinHeight() const { return mMinHeight; }
float getMaxHeight() const { return mMaxHeight; }
int getLandSize() const { return mLandSize; }
2023-08-12 13:14:34 +00:00
int getLoadFlags() const { return mLoadFlags; }
int getPlugin() const { return mPlugin; }
private:
std::unique_ptr<const ESM::Land::LandData> mData;
2023-08-12 13:14:34 +00:00
int mLoadFlags = 0;
std::vector<float> mHeightsData;
float mMinHeight = 0.f;
float mMaxHeight = 0.f;
float mSize = 0.f;
int mLandSize = 0;
int mPlugin = 0;
std::span<const float> mHeights;
std::span<const std::int8_t> mNormals;
std::span<const std::uint8_t> mColors;
std::span<const std::uint16_t> mTextures;
};
}
#endif // ! COMPNENTS_ESM_ESMTERRAIN