X-Git-Url: https://www.hackdaworld.org/gitweb/?a=blobdiff_plain;f=main.c;h=2b8864062f406dfe75bed461139b1ce18c5a5e8a;hb=9d299f65c528e62247efb3b7f2b70468f43a255c;hp=07f34c9bf85fcc25afff90c1a67a331e8f3c3e4b;hpb=0ba7850819572931f67d28ebca0cc7d73d7c6dea;p=physik%2Fmorpheus.git diff --git a/main.c b/main.c index 07f34c9..2b88640 100644 --- a/main.c +++ b/main.c @@ -33,9 +33,9 @@ int usage() puts("-y \t # y cells (default 50)"); puts("-z \t # z cells (default 100)"); puts("-s \t # steps to calculate (default 5000)"); - puts("-X \t display area intercept point x (default 25)"); - puts("-Y \t display area intercept point y (default 25)"); - puts("-Z \t display area intercept point z (default 50)"); + puts("-X \t display area intercept point x (default # x celss / 2)"); + puts("-Y \t display area intercept point y (default # y cells / 2)"); + puts("-Z \t display area intercept point z (default # z cells / 2)"); puts("-d \t refresh every 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; }