Change mWnam type to std::array

macos_ci_fix
elsid 1 year ago
parent 0cb37742cb
commit 6f3b7072ac
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625

@ -94,7 +94,7 @@ namespace ESM
mDataTypes |= DATA_VHGT; mDataTypes |= DATA_VHGT;
break; break;
case fourCC("WNAM"): case fourCC("WNAM"):
esm.getHExact(mWnam, sizeof(mWnam)); esm.getHExact(mWnam.data(), mWnam.size());
mDataTypes |= DATA_WNAM; mDataTypes |= DATA_WNAM;
break; break;
case fourCC("VCLR"): case fourCC("VCLR"):
@ -325,9 +325,9 @@ namespace ESM
, mY(land.mY) , mY(land.mY)
, mContext(land.mContext) , mContext(land.mContext)
, mDataTypes(land.mDataTypes) , mDataTypes(land.mDataTypes)
, mWnam(land.mWnam)
, mLandData(land.mLandData != nullptr ? std::make_unique<LandData>(*land.mLandData) : nullptr) , mLandData(land.mLandData != nullptr ? std::make_unique<LandData>(*land.mLandData) : nullptr)
{ {
std::copy(land.mWnam, land.mWnam + LAND_GLOBAL_MAP_LOD_SIZE, mWnam);
} }
Land& Land::operator=(const Land& land) Land& Land::operator=(const Land& land)

@ -1,6 +1,7 @@
#ifndef OPENMW_ESM_LAND_H #ifndef OPENMW_ESM_LAND_H
#define OPENMW_ESM_LAND_H #define OPENMW_ESM_LAND_H
#include <array>
#include <cstdint> #include <cstdint>
#include <memory> #include <memory>
@ -125,7 +126,7 @@ namespace ESM
}; };
// low-LOD heightmap (used for rendering the global map) // low-LOD heightmap (used for rendering the global map)
std::int8_t mWnam[LAND_GLOBAL_MAP_LOD_SIZE]; std::array<std::int8_t, LAND_GLOBAL_MAP_LOD_SIZE> mWnam;
void load(ESMReader& esm, bool& isDeleted); void load(ESMReader& esm, bool& isDeleted);
void save(ESMWriter& esm, bool isDeleted = false) const; void save(ESMWriter& esm, bool isDeleted = false) const;

Loading…
Cancel
Save