mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-28 15:02:39 +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++)
|
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;
|
pos += step;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -401,7 +401,7 @@ static void WriteVaryingColor(float pos, float step, int x0, int x1, const float
|
||||||
pos += ssecount * step;
|
pos += ssecount * step;
|
||||||
for (int x = sseend; x < x1; x++)
|
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;
|
pos += step;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue