summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Schinagl <oliver@schinagl.nl>2008-01-09 13:11:49 (GMT)
committerOliver Schinagl <oliver@schinagl.nl>2008-01-09 13:11:49 (GMT)
commit2f82b925a8d54fccc0ed78ce9c16f1079aed8588 (patch)
tree1b90101f9988fd6f6ee8926add15d4d6b2fdf5cc
parent54de5aa73a9effad7857f597fba3d6fa99e7f21f (diff)
download2iv35-2f82b925a8d54fccc0ed78ce9c16f1079aed8588.zip
2iv35-2f82b925a8d54fccc0ed78ce9c16f1079aed8588.tar.gz
2iv35-2f82b925a8d54fccc0ed78ce9c16f1079aed8588.tar.bz2
relocated rescale_to_winwith
-rw-r--r--Smoke/fluids.c9
-rw-r--r--Smoke/fluids.h2
-rw-r--r--Smoke/interact.c6
3 files changed, 8 insertions, 9 deletions
diff --git a/Smoke/fluids.c b/Smoke/fluids.c
index 51ee23e..eeada0e 100644
--- a/Smoke/fluids.c
+++ b/Smoke/fluids.c
@@ -82,9 +82,8 @@ void fluids_init_simulation(int n, struct vis_data_arrays *vis_data)
{
frame_hist[i] = (fftw_real*) malloc(dim1);
}
-
- for (i = 0; i < n * n; i++) //Initialize data structures to 0
- { vx[i] = vy[i] = vx0[i] = vy0[i] = fx[i] = fy[i] = rho[i] = rho0[i] = 0.0f; }
+
+ fluids_reset_simulation();
vis_data->rho = rho;
vis_data->force = (fftw_real *)malloc(dim2);
@@ -102,10 +101,6 @@ void fluids_reset_simulation(void) {
{ vx[i] = vy[i] = vx0[i] = vy0[i] = fx[i] = fy[i] = rho[i] = rho0[i] = 0.0f; }
}
-int rescale_to_winwidth(float value)
-{
- return round(value *winWidth);
-}
//FFT: Execute the Fast Fourier Transform on the dataset 'vx'.
// 'dirfection' indicates if we do the direct (1) or inverse (-1) Fourier Transform
diff --git a/Smoke/fluids.h b/Smoke/fluids.h
index 07e8c1b..c9ba8b1 100644
--- a/Smoke/fluids.h
+++ b/Smoke/fluids.h
@@ -74,8 +74,6 @@ extern float threshold1;
extern float threshold2;
extern int active_slider;
-int rescale_to_winwidth(float value);
-
void fluids_set_calculate(int calculate);
diff --git a/Smoke/interact.c b/Smoke/interact.c
index 64f6f36..c1a83cc 100644
--- a/Smoke/interact.c
+++ b/Smoke/interact.c
@@ -22,6 +22,12 @@ int prev_rot_my = 0;
int prev_rot_mz = 0;
+
+int rescale_to_winwidth(float value)
+{
+ return round(value *winWidth);
+}
+
void mouse_move(int mx, int my)
{
x_pos += (float)(mx - prev_mov_mx);