From: hackbard Date: Fri, 9 May 2003 00:16:04 +0000 (+0000) Subject: fixes in dfbapi, buggy ising.c added X-Git-Url: https://hackdaworld.org/gitweb/?a=commitdiff_plain;h=0646288c1f9b82c04ff6c74546600e5527c64b2f;p=physik%2Fising.git fixes in dfbapi, buggy ising.c added --- diff --git a/dfbapi.c b/dfbapi.c index 9a8519b..0b46a60 100644 --- a/dfbapi.c +++ b/dfbapi.c @@ -28,7 +28,8 @@ int d2_lattice_init(int *argc,char **argv,d2_lattice *d2_l,int x,int y) d2_l->p_surface->GetSize(d2_l->p_surface,&(d2_l->s_width),&(d2_l->s_height)); font_dsc.flags=DFDESC_HEIGHT; - font_dsc.height=d2_l->max_y*((d2_l->s_height)/(d2_l->max_y))/20; /* 20 ? */ + font_dsc.height=d2_l->max_y*((d2_l->s_height)/(d2_l->max_y))/40; /* 40 ? */ + d2_l->font_h=font_dsc.height; d2_l->dfb->CreateFont(d2_l->dfb,FONT,&font_dsc,&(d2_l->font)); d2_l->p_surface->SetFont(d2_l->p_surface,d2_l->font); @@ -113,9 +114,9 @@ int d2_lattice_draw(d2_lattice *d2_l,int x,int y,int arg_c,char **arg_v) d2_l->p_surface->SetColor(d2_l->p_surface,0x80,0x80,0xff,0xff); for(i=1;i<=arg_c;i++) { - d2_l->p_surface->DrawString(d2_l->p_surface,arg_v[1],-1, + d2_l->p_surface->DrawString(d2_l->p_surface,arg_v[i],-1, d2_l->info_x+d2_l->fakt_x, - d2_l->info_y+d2_l->fakt_x+(i-1)*d2_l->fakt_x, + d2_l->info_y+d2_l->fakt_y+d2_l->font_h+(i-1)*2*d2_l->font_h, DSTF_LEFT); } /* now we flip all to surface */ diff --git a/dfbapi.h b/dfbapi.h index 2403d80..8dfd215 100644 --- a/dfbapi.h +++ b/dfbapi.h @@ -20,6 +20,7 @@ typedef struct __d2_lattice int fakt_x,fakt_y; int info_x,info_y; int info_w,info_h; + int font_h; unsigned char *status; /* status&1 -> red, else blue */ IDirectFB *dfb; IDirectFBSurface *p_surface; diff --git a/ising.c b/ising.c index cb89d8a..dd538b3 100644 --- a/ising.c +++ b/ising.c @@ -13,17 +13,23 @@ #include #include "dfbapi.h" -#define X 50 -#define Y 50 +#define X 100 +#define Y 100 #define MAX_T 200 int main(int argc, char **argv) { unsigned char *atom; + char *arg_v[4]; + char m_text[30]; + char t_text[30]; + char b_text[30]; int max_x,x_c,max_y,y_c; - int i,j; + int i; + int count_p; unsigned int T; - double M; + double S; + int M; double beta; double delta_e; @@ -43,25 +49,44 @@ int main(int argc, char **argv) /* begin at T=0 M=1 situation */ memset(atom,0,max_x*max_y*sizeof(unsigned char)); + S=1; /* i have no idea! */ + for(T=1;T