Fix gravity lensing applying uniformly to all of RGB

Broken in 7e9d9686dda4, where I accidentally applied the offset calculated for the red channel to all channels, oops.
This commit is contained in:
Tamás Bálint Misius 2024-10-02 20:05:21 +02:00
parent 7c578b7f13
commit 2a7a6a40fd
No known key found for this signature in database
GPG Key ID: 5B472A12F6ECA9F2

View File

@ -65,11 +65,10 @@ void Renderer::render_gravlensing(const RendererFrame &source)
RES.OriginRect().Contains(bp))
{
auto v = RGB<uint8_t>::Unpack(video[p]);
auto s = RGB<uint8_t>::Unpack(source[rp]);
video[p] = RGB<uint8_t>(
std::min(0xFF, s.Red + v.Red ),
std::min(0xFF, s.Green + v.Green),
std::min(0xFF, s.Blue + v.Blue )
std::min(0xFF, RGB<uint8_t>::Unpack(source[rp]).Red + v.Red ),
std::min(0xFF, RGB<uint8_t>::Unpack(source[gp]).Green + v.Green),
std::min(0xFF, RGB<uint8_t>::Unpack(source[bp]).Blue + v.Blue )
).Pack();
}
}