summaryrefslogtreecommitdiff
path: root/src/elements
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2011-10-24 16:20:18 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-10-24 16:20:18 (GMT)
commit8f91f948c1082b09eba53f01704e98abc6bd611e (patch)
tree2c86c6d8963cc867752eb61bf0c319662b91f7f3 /src/elements
parent66fd41673b5e1c3a2d86af1a6f0c7f565639a482 (diff)
downloadpowder-8f91f948c1082b09eba53f01704e98abc6bd611e.zip
powder-8f91f948c1082b09eba53f01704e98abc6bd611e.tar.gz
Generate fire/plasma gradients at runtime, makes editing easier
Diffstat (limited to 'src/elements')
-rw-r--r--src/elements/fire.c2
-rw-r--r--src/elements/newgraphics.c2
-rw-r--r--src/elements/plsm.c3
3 files changed, 5 insertions, 2 deletions
diff --git a/src/elements/fire.c b/src/elements/fire.c
index b16b679..6dc620e 100644
--- a/src/elements/fire.c
+++ b/src/elements/fire.c
@@ -2,7 +2,7 @@
int graphics_FIRE(GRAPHICS_FUNC_ARGS)
{
- int caddress = restrict_flt(restrict_flt((float)((int)(cpart->life/2)), 0.0f, 200.0f)*3, 0.0f, (200.0f*3)-3);
+ int caddress = restrict_flt(restrict_flt((float)cpart->life, 0.0f, 200.0f)*3, 0.0f, (200.0f*3)-3);
*colr = (unsigned char)flm_data[caddress];
*colg = (unsigned char)flm_data[caddress+1];
*colb = (unsigned char)flm_data[caddress+2];
diff --git a/src/elements/newgraphics.c b/src/elements/newgraphics.c
index 2f7be03..7a8fc32 100644
--- a/src/elements/newgraphics.c
+++ b/src/elements/newgraphics.c
@@ -1,4 +1,6 @@
#include <element.h>
+#include "hmap.h"
+
int graphics_QRTZ(GRAPHICS_FUNC_ARGS) //QRTZ and PQRT
{
int t = cpart->type, z = cpart->tmp - 5;//speckles!
diff --git a/src/elements/plsm.c b/src/elements/plsm.c
index 6cd0275..7fa99bb 100644
--- a/src/elements/plsm.c
+++ b/src/elements/plsm.c
@@ -1,4 +1,5 @@
#include <element.h>
+#include "hmap.h"
int graphics_PLSM(GRAPHICS_FUNC_ARGS)
{
@@ -12,7 +13,7 @@ int graphics_PLSM(GRAPHICS_FUNC_ARGS)
*fireg = *colg;
*fireb = *colb;
- *pixel_mode = PMODE_NONE; //Clear default, don't draw pixel
+ *pixel_mode = PMODE_GLOW; //Clear default, don't draw pixel
*pixel_mode |= FIRE_ADD;
//Returning 0 means dynamic, do not cache
return 0;