diff options
author | Oliver Schinagl <oliver@schinagl.nl> | 2007-12-19 20:59:56 (GMT) |
---|---|---|
committer | Oliver Schinagl <oliver@schinagl.nl> | 2007-12-19 20:59:56 (GMT) |
commit | 5f1fc7b0711f51dd05077303f854c658ccd9dcba (patch) | |
tree | 7d519f704a04a8f25d3e5f14ce809a7d985c4581 /Smoke/streamlines.c | |
parent | a60088999da4f44bf5885f431fe78eb87d643ae7 (diff) | |
download | 2iv35-5f1fc7b0711f51dd05077303f854c658ccd9dcba.zip 2iv35-5f1fc7b0711f51dd05077303f854c658ccd9dcba.tar.gz 2iv35-5f1fc7b0711f51dd05077303f854c658ccd9dcba.tar.bz2 |
Loads of splitting, gui templates added for other elements
Diffstat (limited to 'Smoke/streamlines.c')
-rw-r--r-- | Smoke/streamlines.c | 71 |
1 files changed, 41 insertions, 30 deletions
diff --git a/Smoke/streamlines.c b/Smoke/streamlines.c index 59f9b33..acfc016 100644 --- a/Smoke/streamlines.c +++ b/Smoke/streamlines.c @@ -1,47 +1,58 @@ -// Includes - #ifdef G_OS_WIN32 #define WIN32_LEAN_AND_MEAN 1 #include <windows.h> #endif -#include <rfftw.h> -#include <GL/gl.h> -#include <GL/glu.h> -#include "fluids.h" -#include "streamlines.h" -#include "seedpoint.h" #include "funcs.h" +#include "palette.h" + +#include "streamlines.h" + + +static int streamlines_render = FALSE; -void render_streamlines(void) +static int streamlines_num_colors = PALETTE_MAXCOLORS; + +static int streamlines_colormap = PALETTE_BLACKWHITE; + + +void streamlines_set_render(int render_streamlines) { - int i, j, k, l, idx; - float v; - struct point p; - int *frame_history; - fftw_real cell_x, cell_y; + streamlines_render = render_streamlines; +} - i = j = k = l = 0; +int streamlines_get_render(void) +{ + return streamlines_render; +} - for (i = 0; i < get_cur_seedpoint(); i++) - { - p = get_seedpoint(i); +void streamlines_set_num_colors(int num_colors) +{ + streamlines_num_colors = num_colors; +} - while (j < DIM) - { - frame_history = frame_hist[j]; +int streamlines_get_num_colors(void) +{ + return streamlines_num_colors; +} - cell_x = (fftw_real)winWidth / (fftw_real)(DIM + 1); // Grid cell width - cell_y = (fftw_real)winHeight / (fftw_real)(DIM + 1); // Grid cell heigh +void streamlines_set_colormap(int colormap) +{ + streamlines_colormap = colormap; +} - cell_x = round(p.x / cell_x); - cell_y = round(p.y / cell_y); +int streamlines_get_colormap(void) +{ + return streamlines_colormap; +} + + +struct color4f streamlines_get_color(float value) +{ + struct color4f return_value; - idx = cell_x + (cell_y * DIM) + (j * DIM * DIM); - //v = frame_history[idx]; + return_value = set_palette(streamlines_colormap, value, streamlines_num_colors); - j++; - } - } + return return_value; } |