summaryrefslogtreecommitdiff
path: root/src/graphics/Renderer.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-07-25 13:08:14 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-07-25 13:08:14 (GMT)
commit860fc0d4c9e2761e9047534fa87e8c3f6bbe62e9 (patch)
treea9780bb7d2da7a21a935f0da8d3942d3fcc7d2fb /src/graphics/Renderer.cpp
parent9b1fb64e1640eb36c485102b499653ce48830e1b (diff)
downloadpowder-860fc0d4c9e2761e9047534fa87e8c3f6bbe62e9.zip
powder-860fc0d4c9e2761e9047534fa87e8c3f6bbe62e9.tar.gz
Streamlines
Diffstat (limited to 'src/graphics/Renderer.cpp')
-rw-r--r--src/graphics/Renderer.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/graphics/Renderer.cpp b/src/graphics/Renderer.cpp
index c1328d3..5577468 100644
--- a/src/graphics/Renderer.cpp
+++ b/src/graphics/Renderer.cpp
@@ -621,6 +621,27 @@ void Renderer::DrawWalls()
vid[(y*CELL+j)*(VIDXRES)+(x*CELL+i)] = PIXPACK(0x242424);
}
}
+ else if (wt==WL_STREAM)
+ {
+ float lx, ly, nx, ny;
+ lx = x*CELL + CELL*0.5f;
+ ly = y*CELL + CELL*0.5f;
+ for (int t = 0; t < 1024; t++)
+ {
+ nx = (int)(lx+0.5f);
+ ny = (int)(ly+0.5f);
+ if (nx<0 || nx>=XRES || ny<0 || ny>=YRES)
+ break;
+ addpixel(nx, ny, 255, 255, 255, 64);
+ i = nx/CELL;
+ j = ny/CELL;
+ lx += sim->vx[j][i]*0.125f;
+ ly += sim->vy[j][i]*0.125f;
+ if (bmap[j][i]==WL_STREAM && i!=x && j!=y)
+ break;
+ }
+ drawtext(x*CELL, y*CELL-2, "\x8D", 255, 255, 255, 128);
+ }
if (wtypes[wt].eglow && emap[y][x])
{
// glow if electrified