summaryrefslogtreecommitdiff
path: root/src/elements
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2011-10-25 11:13:32 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-10-25 11:13:32 (GMT)
commitcb537351e7b61c84bbe77e25ee2c93be53d7c466 (patch)
tree03e7bd38eac1208d4096dff8fcfbfd580942f620 /src/elements
parentef3bab249a0ceb1d18dd4871b3a888098270cf8a (diff)
downloadpowder-cb537351e7b61c84bbe77e25ee2c93be53d7c466.zip
powder-cb537351e7b61c84bbe77e25ee2c93be53d7c466.tar.gz
Fixes to EMP and speed/zoom for FBO texture
Diffstat (limited to 'src/elements')
-rw-r--r--src/elements/emp.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/elements/emp.c b/src/elements/emp.c
index 201b8e4..a7978a3 100644
--- a/src/elements/emp.c
+++ b/src/elements/emp.c
@@ -110,16 +110,19 @@ int update_EMP(UPDATE_FUNC_ARGS) {
}
int graphics_EMP(GRAPHICS_FUNC_ARGS)
{
- *colr = cpart->life*1.5;
- *colg = cpart->life*1.5;
- *colb = 200-cpart->life;
- if (*colr>255)
- *colr = 255;
- if (*colg>255)
- *colg = 255;
- if (*colb>255)
- *colb = 255;
- if (*colb<=0)
- *colb = 0;
+ if(cpart->life)
+ {
+ *colr = cpart->life*1.5;
+ *colg = cpart->life*1.5;
+ *colb = 200-(cpart->life);
+ if (*colr>255)
+ *colr = 255;
+ if (*colg>255)
+ *colg = 255;
+ if (*colb>255)
+ *colb = 255;
+ if (*colb<=0)
+ *colb = 0;
+ }
return 0;
}