mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-26 05:51:20 +00:00
- fixed calculation of glow color
Width and pitch were mixed up for RGB format texture, pixel data were read outside of designated buffer https://forum.zdoom.org/viewtopic.php?t=60538
This commit is contained in:
parent
46e2e0b57c
commit
a7e7db1fe9
1 changed files with 2 additions and 2 deletions
|
@ -1136,10 +1136,10 @@ void FTexture::GetGlowColor(float *data)
|
|||
if (bGlowing && GlowColor == 0)
|
||||
{
|
||||
int w = Width, h = Height;
|
||||
auto buffer = new uint8_t[w * h];
|
||||
auto buffer = new uint8_t[w * h * 4];
|
||||
if (buffer)
|
||||
{
|
||||
FillBuffer(buffer, w, h, TEX_RGB);
|
||||
FillBuffer(buffer, w * 4, h, TEX_RGB);
|
||||
GlowColor = averageColor((uint32_t *)buffer, w*h, 153);
|
||||
delete[] buffer;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue