summaryrefslogtreecommitdiff
path: root/src/graphics.c
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2011-08-11 12:02:00 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-08-11 12:02:00 (GMT)
commit9e634b95cca748b67d63a496b719a0b5c9746dc3 (patch)
treed2e5b90c634e148a735dcde600ea58e07746d98b /src/graphics.c
parent806e1933a2f1a80feeeb10e7923ae58461640225 (diff)
downloadpowder-9e634b95cca748b67d63a496b719a0b5c9746dc3.zip
powder-9e634b95cca748b67d63a496b719a0b5c9746dc3.tar.gz
Fire intensity from Lua
Diffstat (limited to 'src/graphics.c')
-rw-r--r--src/graphics.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/graphics.c b/src/graphics.c
index 4be05a6..055a867 100644
--- a/src/graphics.c
+++ b/src/graphics.c
@@ -3869,9 +3869,11 @@ void render_fire(pixel *vid)
}
}
-void prepare_alpha(void)
+void prepare_alpha(int size, float intensity)
{
+ //TODO: implement size
int x,y,i,j;
+ float multiplier = 255.0f*intensity;
float temp[CELL*3][CELL*3];
memset(temp, 0, sizeof(temp));
for (x=0; x<CELL; x++)
@@ -3881,7 +3883,7 @@ void prepare_alpha(void)
temp[y+CELL+j][x+CELL+i] += expf(-0.1f*(i*i+j*j));
for (x=0; x<CELL*3; x++)
for (y=0; y<CELL*3; y++)
- fire_alpha[y][x] = (int)(255.0f*temp[y][x]/(CELL*CELL));
+ fire_alpha[y][x] = (int)(multiplier*temp[y][x]/(CELL*CELL));
}
pixel *render_packed_rgb(void *image, int width, int height, int cmp_size)