summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorSimon <simon@hardwired.org.uk>2011-02-24 17:11:05 (GMT)
committer Simon <simon@hardwired.org.uk>2011-02-24 17:11:05 (GMT)
commitfd6f6c5406c3af9bcb679e5381800b8708ba3d8a (patch)
treecd8a0f2ccba368feb0040718f2b9f81f6f522b82 /src/main.c
parent879dd43e31c21e83fb61f640ee64eeeaa9b83b64 (diff)
downloadpowder-fd6f6c5406c3af9bcb679e5381800b8708ba3d8a.zip
powder-fd6f6c5406c3af9bcb679e5381800b8708ba3d8a.tar.gz
WIND from cracker!
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index bb99db6..6de200a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2432,7 +2432,20 @@ int main(int argc, char *argv[])
}
else
{
- create_line(lx, ly, x, y, bsx, bsy, c);
+ if (c == PT_WIND)
+ {
+ for (j=-bsy; j<=bsy; j++)
+ 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))
+ {
+ vx[(y+j)/CELL][(x+i)/CELL] += (x-lx)*0.01f;
+ vy[(y+j)/CELL][(x+i)/CELL] += (y-ly)*0.01f;
+ }
+ }
+ else
+ {
+ create_line(lx, ly, x, y, bsx, bsy, c);
+ }
lx = x;
ly = y;
}
@@ -2457,7 +2470,7 @@ int main(int argc, char *argv[])
{
if (sdl_mod & (KMOD_CAPS))
c = 0;
- if (c!=WL_STREAM+100&&c!=SPC_AIR&&c!=SPC_HEAT&&c!=SPC_COOL&&c!=SPC_VACUUM&&!REPLACE_MODE)
+ if (c!=WL_STREAM+100&&c!=SPC_AIR&&c!=SPC_HEAT&&c!=SPC_COOL&&c!=SPC_VACUUM&&c!=PT_WIND&&!REPLACE_MODE)
flood_parts(x, y, c, -1, -1);
if (c==SPC_HEAT || c==SPC_COOL)
create_parts(x, y, bsx, bsy, c);