mirror of
https://github.com/OpenMW/openmw.git
synced 2025-05-08 13:41:26 +00:00
Avoid left shift of negative value
This commit is contained in:
parent
6a3ff5ed81
commit
df459199dd
1 changed files with 3 additions and 3 deletions
|
@ -135,9 +135,9 @@ namespace MWRender
|
|||
|
||||
float y2 = 0;
|
||||
if (land && (land->mDataTypes & ESM::Land::DATA_WNAM))
|
||||
y2 = (land->mWnam[vertexY * 9 + vertexX] << 4) / 2048.f;
|
||||
y2 = land->mWnam[vertexY * 9 + vertexX] / 128.f;
|
||||
else
|
||||
y2 = (SCHAR_MIN << 4) / 2048.f;
|
||||
y2 = SCHAR_MIN / 128.f;
|
||||
if (y2 < 0)
|
||||
{
|
||||
r = static_cast<unsigned char>(14 * y2 + 38);
|
||||
|
|
Loading…
Reference in a new issue