un peu de clarifications
This commit is contained in:
parent
86515d49d5
commit
d0a520ea56
10
bubulles.c
10
bubulles.c
@ -112,14 +112,14 @@ return ( &where->bbs[idx] );
|
|||||||
}
|
}
|
||||||
/* --------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------- */
|
||||||
|
|
||||||
int print_bublist_desc(BBList *bbl, int flags)
|
int print_bublist_desc(BBList *bbl, int opts)
|
||||||
{
|
{
|
||||||
|
|
||||||
printf("------- bblist at %p\n", bbl);
|
printf("------- bblist at %p\n", bbl);
|
||||||
printf("\tname \t'%s'\n", bbl->name);
|
printf("\tname \t'%s'\n", bbl->name);
|
||||||
|
|
||||||
printf("\tsize\t%6d\n\tfidx\t%6d\n", bbl->size, bbl->fidx);
|
printf("\tsize\t%6d\n\tfidx\t%6d\n", bbl->size, bbl->fidx);
|
||||||
if (flags & 0x01) {
|
if (opts & 0x01) {
|
||||||
printf("\txyz\t%f %f %f\n",
|
printf("\txyz\t%f %f %f\n",
|
||||||
bbl->position.x, bbl->position.y, bbl->position.z);
|
bbl->position.x, bbl->position.y, bbl->position.z);
|
||||||
}
|
}
|
||||||
@ -207,7 +207,7 @@ return 0;
|
|||||||
* 0x0001 print diameter
|
* 0x0001 print diameter
|
||||||
* 0x0002 print graylevel
|
* 0x0002 print graylevel
|
||||||
*/
|
*/
|
||||||
int fprint_bubulles(FILE *fp, char *title, BBList *bbl, int flags)
|
int fprint_bubulles(FILE *fp, char *title, BBList *bbl, int opts)
|
||||||
{
|
{
|
||||||
int idx;
|
int idx;
|
||||||
Bubulle *ar;
|
Bubulle *ar;
|
||||||
@ -230,8 +230,8 @@ for (idx=0; idx<bbl->fidx; idx++) {
|
|||||||
fprintf(fp, "%12.6f %12.6f %12.6f",
|
fprintf(fp, "%12.6f %12.6f %12.6f",
|
||||||
ar[idx].p.x, ar[idx].p.y, ar[idx].p.z);
|
ar[idx].p.x, ar[idx].p.y, ar[idx].p.z);
|
||||||
|
|
||||||
if (flags & 0x01) fprintf(fp, " %12.6f", ar[idx].d);
|
if (opts & 0x01) fprintf(fp, " %12.6f", ar[idx].d);
|
||||||
if (flags & 0x02) fprintf(fp, " %6d", ar[idx].gray);
|
if (opts & 0x02) fprintf(fp, " %6d", ar[idx].gray);
|
||||||
|
|
||||||
fputs("\n", fp);
|
fputs("\n", fp);
|
||||||
}
|
}
|
||||||
|
12
bubulles.h
12
bubulles.h
@ -20,6 +20,10 @@ typedef struct {
|
|||||||
unsigned long reserved;
|
unsigned long reserved;
|
||||||
} RGBA;
|
} RGBA;
|
||||||
|
|
||||||
|
/*
|
||||||
|
this is our main entity : the bubulle.
|
||||||
|
'bubulle' is a slang french word for 'friendly bubble'.
|
||||||
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
XYZ p; /* position */
|
XYZ p; /* position */
|
||||||
double d; /* diameter */
|
double d; /* diameter */
|
||||||
@ -29,15 +33,19 @@ typedef struct {
|
|||||||
double kvalue; /* wtf ? */
|
double kvalue; /* wtf ? */
|
||||||
} Bubulle;
|
} Bubulle;
|
||||||
|
|
||||||
|
/*
|
||||||
|
this is the bubulles list descriptor.
|
||||||
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char name[SZ_BUBULLE_TEXT+1];
|
char name[SZ_BUBULLE_TEXT+1];
|
||||||
int size; /* max number of bubulles */
|
int size; /* max number of bubulles */
|
||||||
int fidx; /* next free slot */
|
int fidx; /* next free slot */
|
||||||
XYZ position;
|
XYZ position; /* global position */
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
Bubulle *bbs;
|
Bubulle *bbs; /* ptr to a movable array */
|
||||||
} BBList;
|
} BBList;
|
||||||
|
|
||||||
|
|
||||||
BBList * alloc_bubulles(char *name, int nbre, int k);
|
BBList * alloc_bubulles(char *name, int nbre, int k);
|
||||||
int free_bubulles(BBList *bbl, int k);
|
int free_bubulles(BBList *bbl, int k);
|
||||||
int print_bublist_desc(BBList *bbl, int k);
|
int print_bublist_desc(BBList *bbl, int k);
|
||||||
|
3
tbb.c
3
tbb.c
@ -119,10 +119,9 @@ int foo;
|
|||||||
printf("*** Bubulles Testing -- %s %s\n\n", __DATE__, __TIME__);
|
printf("*** Bubulles Testing -- %s %s\n\n", __DATE__, __TIME__);
|
||||||
|
|
||||||
bubulles_version(1);
|
bubulles_version(1);
|
||||||
print_sizeof();
|
|
||||||
|
|
||||||
test_alloc_free(5);
|
test_alloc_free(5);
|
||||||
test_push_pop(2000);
|
test_push_pop(20000);
|
||||||
test_cleanfill_my_bublist(999);
|
test_cleanfill_my_bublist(999);
|
||||||
|
|
||||||
foo = test_peek_poke(5000);
|
foo = test_peek_poke(5000);
|
||||||
|
Loading…
Reference in New Issue
Block a user