Skip to content

Commit

Permalink
Seems the clamp was required
Browse files Browse the repository at this point in the history
  • Loading branch information
dpjudas committed Jan 18, 2020
1 parent 9bbd09b commit 43562c9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/rendering/polyrenderer/drawers/screen_blend.cpp
Expand Up @@ -547,6 +547,10 @@ void BlendColorColormap(int y, int x0, int x1, PolyTriangleThreadData* thread)
g = (startG + ((gray * rangeG) >> 8)) << 1;
b = (startB + ((gray * rangeB) >> 8)) << 1;

r = MIN(r, (uint32_t)255);
g = MIN(g, (uint32_t)255);
b = MIN(b, (uint32_t)255);

line[x] = MAKEARGB(a, r, g, b);
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/rendering/polyrenderer/drawers/screen_shader.cpp
Expand Up @@ -561,6 +561,10 @@ static void MainFP(int x0, int x1, PolyTriangleThreadData* thread)
g = (startG + ((gray * rangeG) >> 8)) << 1;
b = (startB + ((gray * rangeB) >> 8)) << 1;

r = MIN(r, (uint32_t)255);
g = MIN(g, (uint32_t)255);
b = MIN(b, (uint32_t)255);

fragcolor[x] = MAKEARGB(a, r, g, b);
}
}
Expand Down

0 comments on commit 43562c9

Please sign in to comment.