Readded alpha clear to rlReadScreenPixels()
When capturing framebuffer, if some element with transparency has been drawn, it retrieves that data... it could be a bit annoying in some situations because we could expect color compositing with background color... It depends on the situation and our needs... but most of the time we don't want that transparency on screenshots.
This commit is contained in:
parent
c93bf336fe
commit
ced7321089
1 changed files with 5 additions and 2 deletions
|
@ -2630,8 +2630,11 @@ unsigned char *rlReadScreenPixels(int width, int height)
|
||||||
{
|
{
|
||||||
for (int x = 0; x < (width*4); x++)
|
for (int x = 0; x < (width*4); x++)
|
||||||
{
|
{
|
||||||
// Flip line
|
imgData[((height - 1) - y)*width*4 + x] = screenData[(y*width*4) + x]; // Flip line
|
||||||
imgData[((height - 1) - y)*width*4 + x] = screenData[(y*width*4) + x];
|
|
||||||
|
// Set alpha component value to 255 (no trasparent image retrieval)
|
||||||
|
// NOTE: Alpha value has already been applied to RGB in framebuffer, we don't need it!
|
||||||
|
if (((x + 1)%4) == 0) imgData[((height - 1) - y)*width*4 + x] = 255;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue