summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorCate <cate@cate-6sh2.(none)>2011-07-12 15:28:33 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-07-12 17:46:33 (GMT)
commitd3452b01c8aad35e6d55523323247eeb114dc7d1 (patch)
tree82eae01ee6e63d47b944ad0eb53937100d5a73af /src/main.c
parent7480442c67682c40672dd862a921972e816ce59e (diff)
downloadpowder-d3452b01c8aad35e6d55523323247eeb114dc7d1.zip
powder-d3452b01c8aad35e6d55523323247eeb114dc7d1.tar.gz
OMG FIXES. Lots of fixes for triangle brush to make sure it works, from Cracker. Edited CLST to prevent "popcorning" when its float hits weird numbers. Also fixed it so it freezes nicely when cooled. Fingers are back! :DDD
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 9d68465..075cab0 100644
--- a/src/main.c
+++ b/src/main.c
@@ -3055,7 +3055,7 @@ int main(int argc, char *argv[])
{
for (j=-bsy; j<=bsy; j++)
for (i=-bsx; i<=bsx; i++)
- if (lx+i>=0 && ly+j>=0 && lx+i<XRES && ly+j<YRES && ((CURRENT_BRUSH==CIRCLE_BRUSH && pow(i,2)*pow(bsy,2)+pow(j,2)*pow(bsx,2)<=pow(bsx,2)*pow(bsy,2))||(CURRENT_BRUSH==SQUARE_BRUSH&&i*j<=bsy*bsx)))
+ if (x+i>0 && y+j>0 && x+i<XRES && y+j<YRES && InCurrentBrush(i,j,bsx,bsy))
{
vx[(ly+j)/CELL][(lx+i)/CELL] += (line_x-lx)*0.002f;
vy[(ly+j)/CELL][(lx+i)/CELL] += (line_y-ly)*0.002f;
@@ -3075,7 +3075,7 @@ int main(int argc, char *argv[])
{
for (j=-bsy; j<=bsy; j++)
for (i=-bsx; i<=bsx; i++)
- 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)))
+ if (x+i>0 && y+j>0 && x+i<XRES && y+j<YRES && InCurrentBrush(i,j,bsx,bsy))
{
vx[(y+j)/CELL][(x+i)/CELL] += (x-lx)*0.01f;
vy[(y+j)/CELL][(x+i)/CELL] += (y-ly)*0.01f;