--- ray/src/hd/rhdobj.c 1999/01/29 15:33:36 3.10 +++ ray/src/hd/rhdobj.c 2003/06/26 00:58:10 3.13 @@ -1,9 +1,6 @@ -/* Copyright (c) 1998 Silicon Graphics, Inc. */ - #ifndef lint -static char SCCSid[] = "$SunId$ SGI"; +static const char RCSid[] = "$Id: rhdobj.c,v 3.13 2003/06/26 00:58:10 schorsch Exp $"; #endif - /* * Routines for loading and displaying Radiance objects in rholo with GLX. */ @@ -13,6 +10,7 @@ static char SCCSid[] = "$SunId$ SGI"; #include "rhdisp.h" #include "rhdriver.h" #include "rhdobj.h" +#include "rtprocess.h" extern FILE *sstdout; /* user standard output */ @@ -53,10 +51,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 */ @@ -121,11 +119,11 @@ 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]); - free((char *)op); + free((void *)op); return(1); } @@ -300,7 +298,7 @@ ssph_compute() /* compute source set from sphere sam /* avg. reflected brightness */ d = AVGREFL / (double)ncells; scalecolor(csum, d); - if (tmCvColors(&dlightsets->larb, TM_NOCHROM, csum, 1) != TM_E_OK) + if (tmCvColors(&dlightsets->larb, TM_NOCHROM, &csum, 1) != TM_E_OK) error(CONSISTENCY, "tone mapping problem in ssph_compute"); /* greedy light source clustering */ while (dlightsets->nl < MAXLIGHTS) { @@ -340,7 +338,7 @@ ssph_compute() /* compute source set from sphere sam d = 1.0/ncells; scalecolor(dlightsets->lamb, d); done: /* clear sphere sample array */ - bzero((char *)ssamp, sizeof(ssamp)); + bzero((void *)ssamp, sizeof(ssamp)); return(ncells); } @@ -407,7 +405,7 @@ int force; quit(0); if (!ssph_compute()) { /* compute light sources from sphere */ dlightsets = dl->next; - free((char *)dl); + free((void *)dl); return(0); } op->ol = dl; @@ -538,7 +536,6 @@ toomany: dobj_load(oct, nam) /* create/load an octree object */ char *oct, *nam; { - extern char *getlibpath(), *getpath(); char *fpp, fpath[128]; register DOBJECT *op; /* check arguments */ @@ -559,7 +556,7 @@ char *oct, *nam; return(0); } /* get octree path */ - if ((fpp = getpath(oct, getlibpath(), R_OK)) == NULL) { + if ((fpp = getpath(oct, getrlibpath(), R_OK)) == NULL) { sprintf(errmsg, "cannot find octree \"%s\"", oct); error(COMMAND, errmsg); return(0); @@ -582,7 +579,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; @@ -615,7 +612,7 @@ dobj_cleanup() /* free all resources */ savedxf(curobj = NULL); while ((lp = dlightsets) != NULL) { dlightsets = lp->next; - free((char *)lp); + free((void *)lp); } return(1); } @@ -734,13 +731,13 @@ dobj_unmove() /* undo last transform change */ return(0); } /* hold last transform */ - bcopy((char *)lastxfav, (char *)txfav, + bcopy((void *)lastxfav, (void *)txfav, (txfac=lastxfac)*sizeof(char *)); /* save this transform */ - bcopy((char *)curobj->xfav, (char *)lastxfav, + bcopy((void *)curobj->xfav, (void *)lastxfav, (lastxfac=curobj->xfac)*sizeof(char *)); /* copy back last transform */ - bcopy((char *)txfav, (char *)curobj->xfav, + bcopy((void *)txfav, (void *)curobj->xfav, (curobj->xfac=txfac)*sizeof(char *)); /* set matrices */ fullxf(&curobj->xfb, curobj->xfac, curobj->xfav); @@ -863,7 +860,7 @@ FVECT rorg, rdir; VCOPY(darr, rorg); VCOPY(darr+3, rdir); } /* trace it */ - if (process(op->rtp, darr, 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 */