mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-10 18:34:21 +02:00
Fix gravity lensing applying uniformly to all of RGB
Broken in 7e9d9686dd
, where I accidentally applied the offset calculated for the red channel to all channels, oops.
This commit is contained in:
@@ -65,11 +65,10 @@ void Renderer::render_gravlensing(const RendererFrame &source)
|
|||||||
RES.OriginRect().Contains(bp))
|
RES.OriginRect().Contains(bp))
|
||||||
{
|
{
|
||||||
auto v = RGB<uint8_t>::Unpack(video[p]);
|
auto v = RGB<uint8_t>::Unpack(video[p]);
|
||||||
auto s = RGB<uint8_t>::Unpack(source[rp]);
|
|
||||||
video[p] = RGB<uint8_t>(
|
video[p] = RGB<uint8_t>(
|
||||||
std::min(0xFF, s.Red + v.Red ),
|
std::min(0xFF, RGB<uint8_t>::Unpack(source[rp]).Red + v.Red ),
|
||||||
std::min(0xFF, s.Green + v.Green),
|
std::min(0xFF, RGB<uint8_t>::Unpack(source[gp]).Green + v.Green),
|
||||||
std::min(0xFF, s.Blue + v.Blue )
|
std::min(0xFF, RGB<uint8_t>::Unpack(source[bp]).Blue + v.Blue )
|
||||||
).Pack();
|
).Pack();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user