Use static_cast

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

@ -145,7 +145,8 @@ namespace ESM
for (int i = 0; i < LAND_SIZE; ++i) for (int i = 0; i < LAND_SIZE; ++i)
{ {
float diff = (mLandData->mHeights[number] - prevY) / HEIGHT_SCALE; float diff = (mLandData->mHeights[number] - prevY) / HEIGHT_SCALE;
offsets.mHeightData[number] = (diff >= 0) ? (int8_t)(diff + 0.5) : (int8_t)(diff - 0.5); offsets.mHeightData[number]
= diff >= 0 ? static_cast<std::int8_t>(diff + 0.5) : static_cast<std::int8_t>(diff - 0.5);
float prevX = prevY = mLandData->mHeights[number]; float prevX = prevY = mLandData->mHeights[number];
++number; ++number;
@ -153,7 +154,8 @@ namespace ESM
for (int j = 1; j < LAND_SIZE; ++j) for (int j = 1; j < LAND_SIZE; ++j)
{ {
diff = (mLandData->mHeights[number] - prevX) / HEIGHT_SCALE; diff = (mLandData->mHeights[number] - prevX) / HEIGHT_SCALE;
offsets.mHeightData[number] = (diff >= 0) ? (int8_t)(diff + 0.5) : (int8_t)(diff - 0.5); offsets.mHeightData[number]
= diff >= 0 ? static_cast<std::int8_t>(diff + 0.5) : static_cast<std::int8_t>(diff - 0.5);
prevX = mLandData->mHeights[number]; prevX = mLandData->mHeights[number];
++number; ++number;
@ -172,7 +174,8 @@ namespace ESM
{ {
for (int col = 0; col < LAND_GLOBAL_MAP_LOD_SIZE_SQRT; ++col) for (int col = 0; col < LAND_GLOBAL_MAP_LOD_SIZE_SQRT; ++col)
{ {
float height = mLandData->mHeights[int(row * vertMult) * Land::LAND_SIZE + int(col * vertMult)]; float height = mLandData->mHeights[static_cast<int>(row * vertMult) * Land::LAND_SIZE
+ static_cast<int>(col * vertMult)];
height /= height > 0 ? 128.f : 16.f; height /= height > 0 ? 128.f : 16.f;
height = std::clamp(height, min, max); height = std::clamp(height, min, max);
wnam[row * LAND_GLOBAL_MAP_LOD_SIZE_SQRT + col] = static_cast<std::int8_t>(height); wnam[row * LAND_GLOBAL_MAP_LOD_SIZE_SQRT + col] = static_cast<std::int8_t>(height);

Loading…
Cancel
Save