diff options
| author | Simon 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) |
| commit | 8f91f948c1082b09eba53f01704e98abc6bd611e (patch) | |
| tree | 2c86c6d8963cc867752eb61bf0c319662b91f7f3 /includes/graphics.h | |
| parent | 66fd41673b5e1c3a2d86af1a6f0c7f565639a482 (diff) | |
| download | powder-8f91f948c1082b09eba53f01704e98abc6bd611e.zip powder-8f91f948c1082b09eba53f01704e98abc6bd611e.tar.gz | |
Generate fire/plasma gradients at runtime, makes editing easier
Diffstat (limited to 'includes/graphics.h')
| -rw-r--r-- | includes/graphics.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/includes/graphics.h b/includes/graphics.h index bbc0ea8..b62279d 100644 --- a/includes/graphics.h +++ b/includes/graphics.h @@ -2,7 +2,6 @@ #define GRAPHICS_H #include <SDL/SDL.h> #include "defines.h" -#include "hmap.h" #ifdef PIX16 #define PIXELSIZE 2 @@ -61,6 +60,16 @@ extern unsigned int fire_alpha[CELL*3][CELL*3]; extern pixel *fire_bg; extern pixel *pers_bg; +extern char * flm_data; +extern int flm_data_points;; +extern pixel flm_data_colours[]; +extern float flm_data_pos[]; + +extern char * plasma_data; +extern int plasma_data_points;; +extern pixel plasma_data_colours[]; +extern float plasma_data_pos[]; + struct gcache_item { int isready; @@ -76,6 +85,8 @@ int graphics_DEFAULT(GRAPHICS_FUNC_ARGS); void prepare_graphicscache(); +char * generate_gradient(pixel * colours, float * points, int pointcount, int size); + void draw_rgba_image(pixel *vid, unsigned char *data, int x, int y, float a); void *ptif_pack(pixel *src, int w, int h, int *result_size); @@ -208,6 +219,8 @@ void ogl_blit(int x, int y, int w, int h, pixel *src, int pitch, int scale); #endif #ifdef INCLUDE_SHADERS +#ifndef SHADERS_H +#define SHADERS_H const char * fireFragment = "uniform sampler2D fireAlpha;\ void main () {\ vec4 texColor = texture2D(fireAlpha, gl_PointCoord);\ @@ -257,5 +270,5 @@ const char * airVertex = "void main(void)\ gl_Position = ftransform();;\ gl_FrontColor = gl_Color;\ }"; - +#endif #endif |
