summaryrefslogtreecommitdiff
path: root/src/simulation/Simulation.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-04-21 21:46:37 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-04-21 21:46:37 (GMT)
commit96506610b276be1b4bc1cbc462d991237750fc62 (patch)
treec05e6d55d2a0aa2ad178cfa30f00041a104d6fed /src/simulation/Simulation.cpp
parent75a9460c835f4ebea501a89d23e0c5f46da985cc (diff)
downloadpowder-96506610b276be1b4bc1cbc462d991237750fc62.zip
powder-96506610b276be1b4bc1cbc462d991237750fc62.tar.gz
Clean out graphics, add openGL graphics in seperate file, change brush to use unsigned char rather than boolean for bitmap/outline
Diffstat (limited to 'src/simulation/Simulation.cpp')
-rw-r--r--src/simulation/Simulation.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp
index eabdcfd..9f435f0 100644
--- a/src/simulation/Simulation.cpp
+++ b/src/simulation/Simulation.cpp
@@ -434,7 +434,7 @@ void Simulation::ApplyDecorationPoint(int x, int y, int rx, int ry, int colR, in
return;
}
- bool *bitmap = cBrush->GetBitmap();
+ unsigned char *bitmap = cBrush->GetBitmap();
for (j=-ry; j<=ry; j++)
for (i=-rx; i<=rx; i++)
if(bitmap[(j+ry)*(rx*2)+(i+rx)])
@@ -624,10 +624,10 @@ int Simulation::create_parts(int x, int y, int rx, int ry, int c, int flags, Bru
}
else if(cBrush)
{
- bool *bitmap = cBrush->GetBitmap();
+ unsigned char *bitmap = cBrush->GetBitmap();
for (j=-ry; j<=ry; j++)
for (i=-rx; i<=rx; i++)
- if(bitmap[(j+ry)*(rx*2)+(i+rx)])
+ if(bitmap[(j+ry)*((rx*2)+1)+(i+rx+1)])
delete_part(x+i, y+j, 0);
}
else
@@ -647,10 +647,10 @@ int Simulation::create_parts(int x, int y, int rx, int ry, int c, int flags, Bru
}
else if(cBrush)
{
- bool *bitmap = cBrush->GetBitmap();
+ unsigned char *bitmap = cBrush->GetBitmap();
for (j=-ry; j<=ry; j++)
for (i=-rx; i<=rx; i++)
- if(bitmap[(j+ry)*(rx*2)+(i+rx)])
+ if(bitmap[(j+ry)*((rx*2)+1)+(i+rx+1)])
{
if ( x+i<0 || y+j<0 || x+i>=XRES || y+j>=YRES)
continue;
@@ -678,10 +678,10 @@ int Simulation::create_parts(int x, int y, int rx, int ry, int c, int flags, Bru
}
else if(cBrush)
{
- bool *bitmap = cBrush->GetBitmap();
+ unsigned char *bitmap = cBrush->GetBitmap();
for (j=-ry; j<=ry; j++)
for (i=-rx; i<=rx; i++)
- if(bitmap[(j+ry)*(rx*2)+(i+rx)])
+ if(bitmap[(j+ry)*((rx*2)+1)+(i+rx+1)])
if (create_part_add_props(-2, x+i, y+j, c, rx, ry)==-1)
f = 1;
}