summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjacksonmj <mj-pt@jacksonmj.co.uk>2011-03-12 14:01:58 (GMT)
committer jacksonmj <mj-pt@jacksonmj.co.uk>2011-03-12 14:01:58 (GMT)
commit0a3b44ee146159575d49a0c14f379f27070dd841 (patch)
treec00879f3423b16df333d2199d403a1f0ec2ebd84 /src
parentfbae5fb16adead5e8af8799da4cfff9e0064afd9 (diff)
downloadpowder-0a3b44ee146159575d49a0c14f379f27070dd841.zip
powder-0a3b44ee146159575d49a0c14f379f27070dd841.tar.gz
Update fancy mode to use the new GLOW graphics
Diffstat (limited to 'src')
-rw-r--r--src/graphics.c34
1 files changed, 15 insertions, 19 deletions
diff --git a/src/graphics.c b/src/graphics.c
index bbfb32f..90e81b0 100644
--- a/src/graphics.c
+++ b/src/graphics.c
@@ -1573,31 +1573,27 @@ void draw_parts(pixel *vid)
}
else if (parts[i].type==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);
- /*x = nx/CELL;
+ vid[ny*(XRES+BARSIZE)+nx] = PIXRGB(cr, cg, cb);
+ x = nx/CELL;
y = ny/CELL;
fg += fire_g[y][x];
- if(fg > 255) fg = 255;
- fire_g[y][x] = fg;
+ if (fg > 255) fg = 255;
+ fire_g[y][x] = fg;
fb += fire_b[y][x];
- if(fb > 255) fb = 255;
- fire_b[y][x] = fb;
+ if (fb > 255) fb = 255;
+ fire_b[y][x] = fb;
fr += fire_r[y][x];
- if(fr > 255) fr = 255;
- fire_r[y][x] = fr;*/
+ if (fr > 255) fr = 255;
+ fire_r[y][x] = fr;
- cr = (int)restrict_flt(0x44 + fr*8, 0, 255);
- cg = (int)restrict_flt(0x88 + fg*8, 0, 255);
- cb = (int)restrict_flt(0x44 + fb*8, 0, 255);
for (x=-1; x<=1; x++)
{
for (y=-1; y<=1; y++)