mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 06:42:12 +00:00
Clamp vColor
This commit is contained in:
parent
f365f6f433
commit
cef3fd53ab
1 changed files with 2 additions and 2 deletions
|
@ -376,7 +376,7 @@ static void WriteVaryingColor(float pos, float step, int x0, int x1, const float
|
|||
{
|
||||
for (int x = x0; x < x1; x++)
|
||||
{
|
||||
varying[x] = (int)(pos * w[x] * 255.0f);
|
||||
varying[x] = clamp(static_cast<int>(pos * w[x] * 255.0f), 0, 255);
|
||||
pos += step;
|
||||
}
|
||||
}
|
||||
|
@ -401,7 +401,7 @@ static void WriteVaryingColor(float pos, float step, int x0, int x1, const float
|
|||
pos += ssecount * step;
|
||||
for (int x = sseend; x < x1; x++)
|
||||
{
|
||||
varying[x] = (int)(pos * w[x] * 255.0f);
|
||||
varying[x] = clamp(static_cast<int>(pos * w[x] * 255.0f), 0, 255);
|
||||
pos += step;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue