2023-08-12 13:45:44 +00:00
|
|
|
#ifndef OPENMW_COMPONENTS_ESM3_LANDRECORDDATA_H
|
|
|
|
#define OPENMW_COMPONENTS_ESM3_LANDRECORDDATA_H
|
|
|
|
|
2024-03-23 11:15:09 +00:00
|
|
|
#include <array>
|
2023-08-12 13:45:44 +00:00
|
|
|
#include <cstdint>
|
|
|
|
|
|
|
|
namespace ESM
|
|
|
|
{
|
|
|
|
struct LandRecordData
|
|
|
|
{
|
|
|
|
// number of vertices per side
|
|
|
|
static constexpr unsigned sLandSize = 65;
|
|
|
|
|
|
|
|
// total number of vertices
|
|
|
|
static constexpr unsigned sLandNumVerts = sLandSize * sLandSize;
|
|
|
|
|
|
|
|
// number of textures per side of land
|
|
|
|
static constexpr unsigned sLandTextureSize = 16;
|
|
|
|
|
|
|
|
// total number of textures per land
|
|
|
|
static constexpr unsigned sLandNumTextures = sLandTextureSize * sLandTextureSize;
|
|
|
|
|
|
|
|
// Height in world space for each vertex
|
2024-03-23 11:15:09 +00:00
|
|
|
std::array<float, sLandNumVerts> mHeights;
|
2023-08-12 13:45:44 +00:00
|
|
|
float mMinHeight = 0;
|
|
|
|
float mMaxHeight = 0;
|
|
|
|
|
|
|
|
// 24-bit normals, these aren't always correct though. Edge and corner normals may be garbage.
|
2024-03-23 11:15:09 +00:00
|
|
|
std::array<std::int8_t, 3 * sLandNumVerts> mNormals;
|
2023-08-12 13:45:44 +00:00
|
|
|
|
|
|
|
// 2D array of texture indices. An index can be used to look up an LandTexture,
|
|
|
|
// but to do so you must subtract 1 from the index first!
|
|
|
|
// An index of 0 indicates the default texture.
|
2024-03-23 11:15:09 +00:00
|
|
|
std::array<std::uint16_t, sLandNumTextures> mTextures;
|
2023-08-12 13:45:44 +00:00
|
|
|
|
|
|
|
// 24-bit RGB color for each vertex
|
2024-03-23 11:15:09 +00:00
|
|
|
std::array<std::uint8_t, 3 * sLandNumVerts> mColours;
|
2023-08-12 13:45:44 +00:00
|
|
|
|
|
|
|
int mDataLoaded = 0;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|