X-Git-Url: https://hackdaworld.org/gitweb/?p=physik%2Fmorpheus.git;a=blobdiff_plain;f=main.c;fp=main.c;h=d508e7db44a938dbe0ce0b275506a3accf8f4008;hp=2b8864062f406dfe75bed461139b1ce18c5a5e8a;hb=cdf203b95bccd0e7e01e83800ad8435f4a2da8c3;hpb=9d299f65c528e62247efb3b7f2b70468f43a255c diff --git a/main.c b/main.c index 2b88640..d508e7d 100644 --- a/main.c +++ b/main.c @@ -13,12 +13,18 @@ #include #include +#include #include #include #include +/* important defines */ #include "defines.h" +/* function prototypes */ +#include "random.h" +#include "display.h" + /* global variables */ u32 sum_z_cells; int random_fd; /* /dev/urandom file descriptor */ @@ -37,27 +43,57 @@ int usage() 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)"); + puts("-r \t pressure range from amorphous SiCx (default 2)"); + puts("-f \t faktor for pressure from amorphous SiCx (default 1)"); return -23; } int make_amorph(u32 *cell) { - *cell=*cell|AMORPH; + *cell|=AMORPH; return 23; } int make_cryst(u32 *cell) { - *cell=*cell&(~AMORPH); + *cell&=~AMORPH; return 23; } /* look at cell ... */ -int process_cell(u32 *cell) +int process_cell(void *cell_p,u32 x,u32 y,u32 z,u32 x_max,u32 y_max,u32 z_max,int range,int faktor) { - /* tag it ... testing! */ - make_amorph(cell); - + /* is amorph? */ + u32 *cell; + int i,j,k; + float count; + cell=(u32 *)(cell_p+x+y*(x_max-1)+z*(x_max-1)*(y_max-1)); + count=0; + for(i=-range;i<=range;i++) + for(j=-range;j<=range;j++) + for(k=-range;k<=range;k++) + if(!(i==0 && j==0 && k==0) && (x>=range && x=range && y=range && z