summaryrefslogtreecommitdiff
path: root/src/simulation/Simulation.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-08-05 15:11:43 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-08-05 15:11:43 (GMT)
commit50103aa074917803479ea7957b54f3b982cb9887 (patch)
treeacd520349b30189fa6e0d62432417db217c63f16 /src/simulation/Simulation.cpp
parented270d8dbf685fdc00e01959e1aa63c2163f152b (diff)
downloadpowder-50103aa074917803479ea7957b54f3b982cb9887.zip
powder-50103aa074917803479ea7957b54f3b982cb9887.tar.gz
Fix some of the flood fill methods
Diffstat (limited to 'src/simulation/Simulation.cpp')
-rw-r--r--src/simulation/Simulation.cpp26
1 files changed, 3 insertions, 23 deletions
diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp
index 8717faa..6b78184 100644
--- a/src/simulation/Simulation.cpp
+++ b/src/simulation/Simulation.cpp
@@ -546,16 +546,7 @@ int Simulation::FloodParts(int x, int y, int fullc, int cm, int bm, int flags)
}
if (bm==-1)
{
- if (c-UI_WALLSTART+UI_ACTUALSTART==WL_ERASE)
- {
- bm = bmap[y/CELL][x/CELL];
- if (!bm)
- return 0;
- if (bm==WL_WALL)
- cm = 0xFF;
- }
- else
- bm = 0;
+ bm = bmap[y/CELL][x/CELL];
}
if (((pmap[y][x]&0xFF)!=cm || bmap[y/CELL][x/CELL]!=bm ))
@@ -635,16 +626,7 @@ int Simulation::FloodWalls(int x, int y, int c, int cm, int bm, int flags)
int co = c;
if (cm==-1)
{
- if (c==0)
- {
- cm = pmap[y][x]&0xFF;
- if (!cm)
- return 0;
- //if ((flags&BRUSH_REPLACEMODE) && cm!=SLALT)
- // return 0;
- }
- else
- cm = 0;
+ cm = pmap[y][x]&0xFF;
}
if (bm==-1)
{
@@ -653,8 +635,6 @@ int Simulation::FloodWalls(int x, int y, int c, int cm, int bm, int flags)
bm = bmap[y/CELL][x/CELL];
if (!bm)
return 0;
- if (bm==WL_WALL)
- cm = 0xFF;
}
else
bm = 0;
@@ -699,7 +679,7 @@ int Simulation::FloodWalls(int x, int y, int c, int cm, int bm, int flags)
if ((pmap[y+dy][x]&0xFF)==cm && bmap[(y+dy)/CELL][x/CELL]==bm)
if (!FloodWalls(x, y+dy, c, cm, bm, flags))
return 0;
- return 0;
+ return 1;
}
int Simulation::flood_water(int x, int y, int i, int originaly, int check)
{