mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-13 07:14:31 +00:00
Use static_cast
This commit is contained in:
parent
6f3b7072ac
commit
bd426bac5c
@ -145,7 +145,8 @@ namespace ESM
|
||||
for (int i = 0; i < LAND_SIZE; ++i)
|
||||
{
|
||||
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];
|
||||
++number;
|
||||
@ -153,7 +154,8 @@ namespace ESM
|
||||
for (int j = 1; j < LAND_SIZE; ++j)
|
||||
{
|
||||
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];
|
||||
++number;
|
||||
@ -172,7 +174,8 @@ namespace ESM
|
||||
{
|
||||
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 = std::clamp(height, min, max);
|
||||
wnam[row * LAND_GLOBAL_MAP_LOD_SIZE_SQRT + col] = static_cast<std::int8_t>(height);
|
||||
|
Loading…
x
Reference in New Issue
Block a user