summaryrefslogtreecommitdiff
path: root/src/graphics.c
diff options
context:
space:
mode:
authorjacksonmj <mj-pt@jacksonmj.co.uk>2011-02-26 19:32:51 (GMT)
committer jacksonmj <mj-pt@jacksonmj.co.uk>2011-02-26 19:32:51 (GMT)
commitded7bdf30d87601e125ce06fee0a6614cd424f73 (patch)
tree9b9004facb67d6276e9a2c8f6c79449834c5a229 /src/graphics.c
parenta972644c4ffda6774ecea2798ff6d76f09d8f04e (diff)
parent669a672b3d083af22c6aeb37a636903ce30bcf6c (diff)
downloadpowder-ded7bdf30d87601e125ce06fee0a6614cd424f73.zip
powder-ded7bdf30d87601e125ce06fee0a6614cd424f73.tar.gz
Merge branch 'upstream' into dev
Conflicts: src/main.c
Diffstat (limited to 'src/graphics.c')
-rw-r--r--src/graphics.c40
1 files changed, 18 insertions, 22 deletions
diff --git a/src/graphics.c b/src/graphics.c
index ea8d0d5..cea2ba7 100644
--- a/src/graphics.c
+++ b/src/graphics.c
@@ -2370,15 +2370,15 @@ void draw_parts(pixel *vid)
}
else if (t==PT_GLOW)
{
- fg = 0;
- fb = 0;
- fr = 0;
- if (pv[ny/CELL][nx/CELL]>0) {
- fg = 6 * pv[ny/CELL][nx/CELL];
- fb = 4 * pv[ny/CELL][nx/CELL];
- fr = 2 * pv[ny/CELL][nx/CELL];
- }
- vid[ny*(XRES+BARSIZE)+nx] = PIXRGB((int)restrict_flt(0x44 + fr*8, 0, 255), (int)restrict_flt(0x88 + fg*8, 0, 255), (int)restrict_flt(0x44 + fb*8, 0, 255));
+ fr = restrict_flt(parts[i].temp-(275.13f+32.0f), 0, 128)/50.0f;
+ fg = restrict_flt(parts[i].ctype, 0, 128)/50.0f;
+ fb = restrict_flt(parts[i].tmp, 0, 128)/50.0f;
+
+ cr = restrict_flt(64.0f+parts[i].temp-(275.13f+32.0f), 0, 255);
+ cg = restrict_flt(64.0f+parts[i].ctype, 0, 255);
+ cb = restrict_flt(64.0f+parts[i].tmp, 0, 255);
+
+ vid[ny*(XRES+BARSIZE)+nx] = PIXRGB(cr, cg, cb);
if (cmode == CM_FIRE||cmode==CM_BLOB || cmode==CM_FANCY)
{
x = nx/CELL;
@@ -2394,19 +2394,15 @@ void draw_parts(pixel *vid)
fire_r[y][x] = fr;
}
if (cmode == CM_BLOB) {
- uint8 R = (int)restrict_flt(0x44 + fr*8, 0, 255);
- uint8 G = (int)restrict_flt(0x88 + fg*8, 0, 255);
- uint8 B = (int)restrict_flt(0x44 + fb*8, 0, 255);
-
- blendpixel(vid, nx+1, ny, R, G, B, 223);
- blendpixel(vid, nx-1, ny, R, G, B, 223);
- blendpixel(vid, nx, ny+1, R, G, B, 223);
- blendpixel(vid, nx, ny-1, R, G, B, 223);
-
- blendpixel(vid, nx+1, ny-1, R, G, B, 112);
- blendpixel(vid, nx-1, ny-1, R, G, B, 112);
- blendpixel(vid, nx+1, ny+1, R, G, B, 112);
- blendpixel(vid, nx-1, ny+1, R, G, B, 112);
+ blendpixel(vid, nx+1, ny, cr, cg, cb, 223);
+ blendpixel(vid, nx-1, ny, cr, cg, cb, 223);
+ blendpixel(vid, nx, ny+1, cr, cg, cb, 223);
+ blendpixel(vid, nx, ny-1, cr, cg, cb, 223);
+
+ blendpixel(vid, nx+1, ny-1, cr, cg, cb, 112);
+ blendpixel(vid, nx-1, ny-1, cr, cg, cb, 112);
+ blendpixel(vid, nx+1, ny+1, cr, cg, cb, 112);
+ blendpixel(vid, nx-1, ny+1, cr, cg, cb, 112);
}
}
else if (t==PT_LCRY)