summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Schinagl <oliver@schinagl.nl>2008-01-10 13:14:59 (GMT)
committerOliver Schinagl <oliver@schinagl.nl>2008-01-10 13:14:59 (GMT)
commit7f0f58b951975bc99f8e2555710893520f56d5bc (patch)
tree0d49a3ab41f7f49a898ef5754449f47561f0c355
parentb83fcd9e5721b107a15ce51e74984ce38623e44b (diff)
download2iv35-7f0f58b951975bc99f8e2555710893520f56d5bc.zip
2iv35-7f0f58b951975bc99f8e2555710893520f56d5bc.tar.gz
2iv35-7f0f58b951975bc99f8e2555710893520f56d5bc.tar.bz2
added getter for hisdex
-rw-r--r--Smoke/fluids.c15
-rw-r--r--Smoke/fluids.h2
2 files changed, 10 insertions, 7 deletions
diff --git a/Smoke/fluids.c b/Smoke/fluids.c
index 83764ac..a0bcb89 100644
--- a/Smoke/fluids.c
+++ b/Smoke/fluids.c
@@ -36,8 +36,6 @@ fftw_real *fx, *fy; //(fx,fy) = user-controlled simulation forces,
fftw_real *rho, *rho0; //smoke density at the current (rho) and previous (rho0) moment
fftw_real *height_array; //used for height plot
struct point *normal_array; //used for normal vectors
-int *frame_hist;
-int frame_index = 0;
rfftwnd_plan plan_rc, plan_cr; //simulation domain discretization
int winWidth, winHeight; //size of the graphics window, in pixels
@@ -47,10 +45,10 @@ int vis_dataset = DATASET_RHO;
int active_slider = 0;
int glyph_scalar = SCALAR_RHO;
int glyph_vector = VECTOR_VEL;
-GLuint startList;
static int fluids_calculate = TRUE;
static int DIM; //size of simulation grid
+static int fluids_hisdex = 0;
//------ SIMULATION CODE STARTS HERE -----------------------------------------------------------------
@@ -83,7 +81,6 @@ void fluids_init_simulation(int n, struct vis_data_arrays *vis_data)
{
vis_data->history[i] = (fftw_real *)malloc(dim1);
}
- printf("frame 0: %p\n", vis_data->history[0]);
fluids_reset_simulation();
@@ -409,15 +406,14 @@ fftw_real *get_frame(struct vis_data_arrays *vis_data, int dataset)
void add_history_frame(int dataset, struct vis_data_arrays *vis_data)
{
- static int hisdex = 0;
fftw_real *frame;
if (dataset != DATASET_HIST) {
frame = get_frame(vis_data, dataset);
- memcpy(vis_data->history[hisdex], frame, DIM * 2 * (DIM / 2 + 1) * sizeof(fftw_real));
- hisdex = (hisdex >= HISTORY_SIZE -1) ? 0 : hisdex +1;
+ memcpy(vis_data->history[fluids_hisdex], frame, DIM * 2 * (DIM / 2 + 1) * sizeof(fftw_real));
+ fluids_hisdex = (fluids_hisdex >= HISTORY_SIZE -1) ? 0 : fluids_hisdex +1;
}
}
@@ -597,3 +593,8 @@ int fluids_get_dim(void)
{
return DIM;
}
+
+int fluids_get_hisdex(void)
+{
+ return fluids_hisdex;
+}
diff --git a/Smoke/fluids.h b/Smoke/fluids.h
index e495222..2e79fd5 100644
--- a/Smoke/fluids.h
+++ b/Smoke/fluids.h
@@ -84,6 +84,8 @@ void fluids_reset_simulation(void);
void fluids_calculate_one_simulation_step(struct vis_data_arrays *vis_data);
+int fluids_get_hisdex(void);
+
float get_dataset(int index);
void set_autoscaling(void);
#endif