check bounds for wind, causes some funny glitches though.
This commit is contained in:
parent
1802c160c4
commit
6ef9f0300e
@ -2417,7 +2417,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
for (j=-bsy; j<=bsy; j++)
|
for (j=-bsy; j<=bsy; j++)
|
||||||
for (i=-bsx; i<=bsx; i++)
|
for (i=-bsx; i<=bsx; i++)
|
||||||
if ((CURRENT_BRUSH==CIRCLE_BRUSH && (pow(i,2))/(pow(bsx,2))+(pow(j,2))/(pow(bsy,2))<=1)||(CURRENT_BRUSH==SQUARE_BRUSH&&i*j<=bsy*bsx))
|
if (x+i>0 && y+j>0 && x+i<XRES && y+j<YRES && ((CURRENT_BRUSH==CIRCLE_BRUSH && (pow(i,2))/(pow(bsx,2))+(pow(j,2))/(pow(bsy,2))<=1)||(CURRENT_BRUSH==SQUARE_BRUSH&&i*j<=bsy*bsx)))
|
||||||
{
|
{
|
||||||
vx[(y+j)/CELL][(x+i)/CELL] += (x-lx)*0.01f;
|
vx[(y+j)/CELL][(x+i)/CELL] += (x-lx)*0.01f;
|
||||||
vy[(y+j)/CELL][(x+i)/CELL] += (y-ly)*0.01f;
|
vy[(y+j)/CELL][(x+i)/CELL] += (y-ly)*0.01f;
|
||||||
|
Reference in New Issue
Block a user