mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-09-10 16:00:40 +02:00
Fix crash with smudge tool around the edges
This commit is contained in:
@@ -782,6 +782,8 @@ void Simulation::ApplyDecoration(int x, int y, int colR_, int colG_, int colB_,
|
|||||||
tb /= 1.0f+(colB*strength)*colA;
|
tb /= 1.0f+(colB*strength)*colA;
|
||||||
}
|
}
|
||||||
else if (mode == DECO_SMUDGE)
|
else if (mode == DECO_SMUDGE)
|
||||||
|
{
|
||||||
|
if (x >= CELL && x < XRES-CELL && y >= CELL && y < YRES-CELL)
|
||||||
{
|
{
|
||||||
float tas = 0.0f, trs = 0.0f, tgs = 0.0f, tbs = 0.0f;
|
float tas = 0.0f, trs = 0.0f, tgs = 0.0f, tbs = 0.0f;
|
||||||
|
|
||||||
@@ -809,6 +811,7 @@ void Simulation::ApplyDecoration(int x, int y, int colR_, int colG_, int colB_,
|
|||||||
if (!parts[rp>>8].dcolour)
|
if (!parts[rp>>8].dcolour)
|
||||||
ta -= 3/255.0f;
|
ta -= 3/255.0f;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ta *= 255.0f; tr *= 255.0f; tg *= 255.0f; tb *= 255.0f;
|
ta *= 255.0f; tr *= 255.0f; tg *= 255.0f; tb *= 255.0f;
|
||||||
ta += .5f; tr += .5f; tg += .5f; tb += .5f;
|
ta += .5f; tr += .5f; tg += .5f; tb += .5f;
|
||||||
|
Reference in New Issue
Block a user