summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjacksonmj <mj-pt@jacksonmj.co.uk>2011-03-10 23:34:22 (GMT)
committer jacksonmj <mj-pt@jacksonmj.co.uk>2011-03-10 23:50:20 (GMT)
commitfbae5fb16adead5e8af8799da4cfff9e0064afd9 (patch)
tree909b17953428652a5bce4cd479b51609fde719f0 /src
parent57630e561d025804be9acfeaca2b5aa816629d1b (diff)
downloadpowder-fbae5fb16adead5e8af8799da4cfff9e0064afd9.zip
powder-fbae5fb16adead5e8af8799da4cfff9e0064afd9.tar.gz
Flashing BRAY fix
We should just be thankful that negative life will not save correctly...
Diffstat (limited to 'src')
-rw-r--r--src/graphics.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/graphics.c b/src/graphics.c
index cea2ba7..bbfb32f 100644
--- a/src/graphics.c
+++ b/src/graphics.c
@@ -1893,10 +1893,16 @@ void draw_parts(pixel *vid)
}
if (cr>255)
cr=255;
+ if (cr<0)
+ cr=0;
if (cg>255)
cg=255;
+ if (cg<0)
+ cg=0;
if (cb>255)
cb=255;
+ if (cb<0)
+ cb=0;
blendpixel(vid, nx, ny, cr, cg, cb, 255);
}
else if (t==PT_WIFI)
@@ -2143,6 +2149,7 @@ void draw_parts(pixel *vid)
else if (t==PT_BRAY && parts[i].tmp==0)
{
int trans = parts[i].life * 7;
+ if (trans>255) trans = 255;
if (parts[i].ctype) {
cg = 0;
cb = 0;
@@ -2167,6 +2174,7 @@ void draw_parts(pixel *vid)
else if (t==PT_BRAY && parts[i].tmp==1)
{
int trans = parts[i].life/4;
+ if (trans>255) trans = 255;
if (parts[i].ctype) {
cg = 0;
cb = 0;
@@ -2191,6 +2199,7 @@ void draw_parts(pixel *vid)
else if (t==PT_BRAY && parts[i].tmp==2)
{
int trans = parts[i].life*100;
+ if (trans>255) trans = 255;
blendpixel(vid, nx, ny, 255, 150, 50, trans);
}
else if (t==PT_PHOT)