--- ray/src/hd/rhd_odraw.h 1998/12/21 13:17:01 3.3 +++ ray/src/hd/rhd_odraw.h 2011/05/20 02:06:39 3.14 @@ -1,24 +1,25 @@ -/* Copyright (c) 1998 Silicon Graphics, Inc. */ - -/* SCCSid "$SunId$ SGI" */ - +/* RCSid $Id: rhd_odraw.h,v 3.14 2011/05/20 02:06:39 greg Exp $ */ /* * Header for OpenGL cone drawing routines with depth buffer checks. + * + * Include after "standard.h" */ +#ifndef _RAD_RHD_ODRAW_H_ +#define _RAD_RHD_ODRAW_H_ -#undef NOPROTO -#define NOPROTO 1 #include "color.h" #include "tonemap.h" #include "rhdriver.h" -#ifndef int4 -#define int4 int +#ifdef __cplusplus +extern "C" { #endif extern struct ODview { + int sfirst, snext; /* first sample and first in next view */ short hhi, vhi; /* screen image resolution */ short hlow, vlow; /* block resolution */ + int n2redraw; /* approx. number of samples needing redraw */ struct ODblock { short nsamp; /* number of samples in block */ short nused; /* number actually allocated */ @@ -26,24 +27,26 @@ extern struct ODview { int free; /* index for block free list */ float pthresh; /* proximity threshold */ } *bmap; /* low resolution image map */ - int4 *emap; /* low resolution edge presence map */ - int4 *pmap; /* high resolution presence map */ + int32 *emap; /* low resolution edge presence map */ + int32 *pmap; /* high resolution presence map */ GLfloat *dmap; /* high resolution depth map */ } *odView; /* our view list */ extern int odNViews; /* number of views in our list */ +extern TMstruct *tmGlobal; /* global tone-mapping structure */ + extern struct ODsamp { union ODfunion { float prox; /* viewpoint proximity */ - int4 next; /* next in free list */ + int32 next; /* next in free list */ } *f; /* free list next or proximity */ short (*ip)[2]; /* image position array */ TMbright *brt; /* encoded brightness array */ - BYTE (*chr)[3]; /* encoded chrominance array */ - BYTE (*rgb)[3]; /* tone-mapped color array */ - int4 *redraw; /* redraw flags */ + uby8 (*chr)[3]; /* encoded chrominance array */ + uby8 (*rgb)[3]; /* tone-mapped color array */ + int32 *redraw; /* redraw flags */ int nsamp; /* total number of samples */ char *base; /* base of allocated memory */ } odS; /* sample values */ @@ -55,7 +58,7 @@ extern struct ODsamp { #define CLR4(f,i) FL4OP(f,i,&=~) #define TGL4(f,i) FL4OP(f,i,^=) #define FL4NELS(n) (((n)+0x1f)>>5) -#define CLR4ALL(f,n) bzero((char *)(f),FL4NELS(n)*sizeof(int4)) +#define CLR4ALL(f,n) memset((char *)(f),'\0',FL4NELS(n)*sizeof(int32)) #endif #define OMAXDEPTH 32000 /* maximum depth value */ @@ -113,6 +116,13 @@ needs to be redrawn in the next call to odUpdate(). void +odRedrawAll() : everything needs to be redrawn + +Redraw everything in all views on the next call to odUpdate(). +Unless odRemap() is called, no new tone mapping will be done. + + +void odUpdate(vn) : update the current view int vn; : view number @@ -128,3 +138,27 @@ and redraw them on the next call(s) to odUpdate(). If is non-zero, then clear the previous sample history. **********************************************************************/ + + /* rhd_geom.c */ +void gmNewGeom( char *file); +extern void gmEndGeom(void); +extern int gmDrawGeom(void); +extern void gmDrawPortals(int r, int g, int b, int a); +extern void gmDepthLimit( double dl[2], FVECT vorg, FVECT vdir); +extern void gmNewPortal(char *pflist); +extern int gmEndPortal(void); + /* rhd_odraw.c */ +extern int odInit(int n); +extern void odSample(COLR c, FVECT d, FVECT p); +extern void odRemap(int newhist); +extern void odRedrawAll(void); +extern void odRedraw(int vn, int hmin, int vmin, int hmax, int vmax); +extern void odDepthMap(int vn, GLfloat *dm); +extern void odUpdate(int vn); + + +#ifdef __cplusplus +} +#endif +#endif /* _RAD_RHD_ODRAW_H_ */ +