summaryrefslogtreecommitdiffstats
path: root/Smoke/renderer_gl.c
diff options
context:
space:
mode:
Diffstat (limited to 'Smoke/renderer_gl.c')
-rw-r--r--Smoke/renderer_gl.c37
1 files changed, 23 insertions, 14 deletions
diff --git a/Smoke/renderer_gl.c b/Smoke/renderer_gl.c
index 3fc3a75..5a33093 100644
--- a/Smoke/renderer_gl.c
+++ b/Smoke/renderer_gl.c
@@ -45,7 +45,7 @@
#define LEGEND_Y_POS -295.0f
#define LEGEND_Z_POS -735.0f
-#define BITMAP_SOURCE "arrow.bmp"
+#define BITMAP_SOURCE "quake.bmp"
#define BITMAP_FILESIZE 0x02
#define BITMAP_OFFSET 0x0a
#define BITMAP_HEADERSIZE 0x0e
@@ -67,7 +67,7 @@ static GLuint texture;
static void render_legend(void)
{
- int i;
+ int i, s, c;
struct color4f color;
glDisable(GL_LIGHTING);
@@ -83,8 +83,16 @@ static void render_legend(void)
value = (float)((float)i/winWidth);
+ s = colormap_get_scaling();
+ c = colormap_get_clamping();
+
+ colormap_set_scaling(0);
+ colormap_set_clamping(0);
+
color = colormap_get_color(value);
+ colormap_set_scaling(s);
+ colormap_set_clamping(c);
clamp_scaled_min = colormap_get_clamp_min() *winWidth;
clamp_scaled_max = colormap_get_clamp_max() *winWidth;
@@ -367,11 +375,11 @@ static void render_glyph(GLUquadricObj *qobj, float x_value, float y_value, floa
int DIM;
DIM = fluids_get_dim();
- scale = (float)((float)DIM / (float)get_var_dims()) / 6;
+ scale = (float)((float)DIM / (float)fluids_get_var_dim()) / 6;
size = quake_root((x_value * x_value * 20) + (y_value * y_value * 20)) * 5 * scale;
- wn = (fftw_real)winWidth / (fftw_real)(get_var_dims() + 1); // Grid cell width
- hn = (fftw_real)winHeight / (fftw_real)(get_var_dims() + 1); // Grid cell heigh
+ wn = (fftw_real)winWidth / (fftw_real)(fluids_get_var_dim() + 1); // Grid cell width
+ hn = (fftw_real)winHeight / (fftw_real)(fluids_get_var_dim() + 1); // Grid cell heigh
x0 = wn + (fftw_real)i * wn;
y0 = hn + (fftw_real)j * hn;
@@ -393,7 +401,7 @@ static void render_glyph(GLUquadricObj *qobj, float x_value, float y_value, floa
theta = acos(in_prod) * (180/3.141592654);
if (x1 > x0) { theta *= -1; }
- switch(get_glyph_sort())
+ switch(glyphs_get_sort())
{
default:
case GLYPH_LINES:
@@ -403,7 +411,7 @@ static void render_glyph(GLUquadricObj *qobj, float x_value, float y_value, floa
glEnd();
break;
- case GLYPH_ARROWS:
+ case GLYPH_TRIANGLES:
if (size < 0.08f) return;
glPushMatrix();
@@ -441,7 +449,8 @@ static void render_glyph(GLUquadricObj *qobj, float x_value, float y_value, floa
glPopMatrix();
break;
- case GLYPH_BITMAPS:
+ case GLYPH_ARROWS:
+ case GLYPH_QUAKE:
if (size < 0.08f) return;
glPushMatrix();
@@ -480,10 +489,10 @@ static void render_glyphs(void)
DIM = fluids_get_dim();
- scale = (float)((float)DIM / (float)get_var_dims());
- for (i = 0; i < get_var_dims(); i++)
+ scale = (float)((float)DIM / (float)fluids_get_var_dim());
+ for (i = 0; i < fluids_get_var_dim(); i++)
{
- for (j = 0; j < get_var_dims(); j++)
+ for (j = 0; j < fluids_get_var_dim(); j++)
{
idxcf = round(j * scale) * DIM;
idxrf = round(i * scale);
@@ -520,7 +529,7 @@ static void render_glyphs(void)
}
}
}
-
+
gluDeleteQuadric(qobj);
}
@@ -586,8 +595,8 @@ static void render_isolines(void)
state = 0;
idx = (j * DIM) + i;
color = isolines_get_color(get_dataset(idx));
- //glColor4f(color.r, color.g, color.b, color.a);
- glColor3f(1.0f, 0.0f, 0.0f);
+ glColor4f(color.r, color.g, color.b, color.a);
+ //glColor3f(1.0f, 0.0f, 0.0f);
v0 = get_dataset(idx + DIM);
v1 = get_dataset(idx + 1 + DIM);