Fix gfx.drawPixel being unable to draw in event.AFTERSIMDRAW

It somehow never got the upgrade where a drawing primitive looks at the current event context and chooses a graphics backend based on it. All the others primitive got it in c5b72b213baa.
This commit is contained in:
Tamás Bálint Misius 2024-05-24 10:46:19 +02:00
parent 080f059da9
commit 118786e39b
No known key found for this signature in database
GPG Key ID: 5B472A12F6ECA9F2

View File

@ -71,8 +71,9 @@ static int drawPixel(lua_State *L)
else if (b > 255) b = 255;
if (a < 0 ) a = 0 ;
else if (a > 255) a = 255;
auto *lsi = GetLSI();
lsi->g->BlendPixel({ x, y }, RGBA<uint8_t>(r, g, b, a));
std::visit([x, y, r, g, b, a](auto p) {
p->BlendPixel({ x, y }, RGBA<uint8_t>(r, g, b, a));
}, currentGraphics());
return 0;
}