sw_engine fill: correct value loss by data conversion.

This commit is contained in:
Hermet Park 2021-03-11 20:10:11 +09:00
parent ecf47fcec8
commit 0984241954

View file

@ -248,8 +248,8 @@ void fillFetchLinear(const SwFill* fill, uint32_t* dst, uint32_t y, uint32_t x,
//we can use fixed point math //we can use fixed point math
if (v < vMax && v > vMin) { if (v < vMax && v > vMin) {
auto t2 = static_cast<uint32_t>(t * FIXPT_SIZE); auto t2 = static_cast<int32_t>(t * FIXPT_SIZE);
auto inc2 = static_cast<uint32_t>(inc * FIXPT_SIZE); auto inc2 = static_cast<int32_t>(inc * FIXPT_SIZE);
for (uint32_t j = 0; j < len; ++j) { for (uint32_t j = 0; j < len; ++j) {
*dst = _fixedPixel(fill, t2); *dst = _fixedPixel(fill, t2);
++dst; ++dst;