--- ray/src/hd/rhdobj.c 2003/05/13 17:58:33 3.12 +++ ray/src/hd/rhdobj.c 2003/07/21 22:30:18 3.15 @@ -1,15 +1,18 @@ #ifndef lint -static const char RCSid[] = "$Id: rhdobj.c,v 3.12 2003/05/13 17:58:33 greg Exp $"; +static const char RCSid[] = "$Id: rhdobj.c,v 3.15 2003/07/21 22:30:18 schorsch Exp $"; #endif /* * Routines for loading and displaying Radiance objects in rholo with GLX. */ +#include + #include "radogl.h" #include "tonemap.h" #include "rhdisp.h" #include "rhdriver.h" #include "rhdobj.h" +#include "rtprocess.h" extern FILE *sstdout; /* user standard output */ @@ -50,10 +53,10 @@ typedef struct dobject { struct dobject *next; /* next object in list */ char name[64]; /* object name */ FVECT center; /* orig. object center */ - FLOAT radius; /* orig. object radius */ + RREAL radius; /* orig. object radius */ int listid; /* GL display list identifier */ int nlists; /* number of lists allocated */ - int rtp[3]; /* associated rtrace process */ + SUBPROC rtp; /* associated rtrace process */ DLIGHTS *ol; /* object lights */ FULLXF xfb; /* coordinate transform */ short drawcode; /* drawing code */ @@ -118,7 +121,7 @@ register DOBJECT *op; dobjects = ohead.next; if (!foundlink) { glDeleteLists(op->listid, op->nlists); - close_process(op->rtp); + close_process(&(op->rtp)); } while (op->xfac) freestr(op->xfav[--op->xfac]); @@ -337,7 +340,7 @@ ssph_compute() /* compute source set from sphere sam d = 1.0/ncells; scalecolor(dlightsets->lamb, d); done: /* clear sphere sample array */ - bzero((void *)ssamp, sizeof(ssamp)); + memset((void *)ssamp, '\0', sizeof(ssamp)); return(ncells); } @@ -370,7 +373,7 @@ int force; if (!force) return(0); /* need to compute new light set */ - copystruct(&cvw, &stdview); + cvw = stdview; cvw.type = VT_PER; VCOPY(cvw.vp, ocent); cvw.vup[0] = 1.; cvw.vup[1] = cvw.vup[2] = 0.; @@ -578,7 +581,7 @@ char *oct, *nam; /* start rtrace */ rtargv[RTARGC-1] = fpath; rtargv[RTARGC] = NULL; - open_process(op->rtp, rtargv); + open_process(&(op->rtp), rtargv); /* insert into main list */ op->next = dobjects; curobj = dobjects = op; @@ -730,13 +733,13 @@ dobj_unmove() /* undo last transform change */ return(0); } /* hold last transform */ - bcopy((void *)lastxfav, (void *)txfav, + memcpy((void *)txfav, (void *)lastxfav, (txfac=lastxfac)*sizeof(char *)); /* save this transform */ - bcopy((void *)curobj->xfav, (void *)lastxfav, + memcpy((void *)lastxfav, (void *)curobj->xfav, (lastxfac=curobj->xfac)*sizeof(char *)); /* copy back last transform */ - bcopy((void *)txfav, (void *)curobj->xfav, + memcpy((void *)curobj->xfav, (void *)txfav, (curobj->xfac=txfac)*sizeof(char *)); /* set matrices */ fullxf(&curobj->xfb, curobj->xfac, curobj->xfav); @@ -771,7 +774,7 @@ char *oldnm, *nam; opdup = (DOBJECT *)malloc(sizeof(DOBJECT)); if (opdup == NULL) error(SYSTEM, "out of memory in dobj_dup"); - copystruct(opdup, op); + *opdup = *op; /* rename */ strcpy(opdup->name, nam); /* get our own copy of transform */ @@ -859,7 +862,7 @@ FVECT rorg, rdir; VCOPY(darr, rorg); VCOPY(darr+3, rdir); } /* trace it */ - if (process(op->rtp, (char *)darr, (char *)darr, sizeof(double), + if (process(&(op->rtp), (char *)darr, (char *)darr, sizeof(double), 6*sizeof(double)) != sizeof(double)) error(SYSTEM, "rtrace communication error"); /* return distance */