changed display default values
[physik/morpheus.git] / main.c
diff --git a/main.c b/main.c
index 07f34c9..2b88640 100644 (file)
--- a/main.c
+++ b/main.c
@@ -33,9 +33,9 @@ int usage()
  puts("-y <value> \t # y cells (default 50)");
  puts("-z <value> \t # z cells (default 100)");
  puts("-s <value> \t # steps to calculate (default 5000)");
- puts("-X <value> \t display area intercept point x (default 25)");
- puts("-Y <value> \t display area intercept point y (default 25)");
- puts("-Z <value> \t display area intercept point z (default 50)");
+ puts("-X <value> \t display area intercept point x (default # x celss / 2)");
+ puts("-Y <value> \t display area intercept point y (default # y cells / 2)");
+ puts("-Z <value> \t display area intercept point z (default # z cells / 2)");
  puts("-d <value> \t refresh every <value> loops (default 100)");
  return -23;
 }
@@ -57,7 +57,7 @@ int process_cell(u32 *cell)
 {
  /* tag it ... testing! */
  make_amorph(cell);
+
  return 23;
 }
 
@@ -80,9 +80,9 @@ int main(int argc,char **argv)
  slope_nel=DEFAULT_SLOPE_NEL;
  start_nel=DEFAULT_START_NEL;
  steps=DEFAULT_STEPS;
- display_x=DEFAULT_DISPLAY_X-1;
- display_y=DEFAULT_DISPLAY_Y-1;
- display_z=DEFAULT_DISPLAY_Z-1;
+ display_x=x_cell/2;
+ display_y=y_cell/2;
+ display_z=z_cell/2;
  display_refresh_rate=DEFAULT_DISPLAY_REF_RATE;
  
  /* parse command args */
@@ -149,6 +149,7 @@ int main(int argc,char **argv)
  /* testing ... */
 
  /* allocate cells */
+ printf("malloc will free %d bytes now ...\n",x_cell*y_cell*z_cell*sizeof(u32));
  if((cell_p=malloc(x_cell*y_cell*z_cell*sizeof(u32)))==NULL)
  {
   puts("failed allocating memory for cells\n");
@@ -171,17 +172,16 @@ int main(int argc,char **argv)
   process_cell((u32 *)(cell_p+x+y*(x_cell-1)+z*(x_cell-1)*(y_cell-1)));
 
   /* display stuff */
-  if((i%display_refresh_rate)==0)
-  {
-   puts("refreshing diplay ...");
-   // display_draw(&display,display_x,display_y,display_z);
-  }
-  /* */
+  if((i%display_refresh_rate)==0) 
+   display_draw(&display,display_x,display_y,display_z);
  }
   
  /* display again and quit when button hit */
+ display_draw(&display,display_x,display_y,display_z);
  puts("hit button to quit ...");
  getchar();
 
+ display_release(&display);
+
  return 23;
 }