q3d0.1/0040755000175200017560000000000007306140066012232 5ustar stephensstephengq3d0.1/src/0040755000175200017560000000000007306140063013016 5ustar stephensstephengq3d0.1/src/q3d/0040755000175200017560000000000007306140063013505 5ustar stephensstephengq3d0.1/src/q3d/CVS/0040755000175200017560000000000007306135676014156 5ustar stephensstephengq3d0.1/src/q3d/CVS/Root0100644000175200017560000000003407236675453015022 0ustar stephensstepheng:local://cvs/ioncvs/cvsroot q3d0.1/src/q3d/CVS/Repository0100644000175200017560000000002107236675453016252 0ustar stephensstephenghome/ion/src/q3d q3d0.1/src/q3d/CVS/Entries0100644000175200017560000000027407306135676015512 0ustar stephensstepheng/PKG/1.1.1.1/Wed Feb 17 06:33:20 1999// D/archive//// D/common//// D/device//// D/dispatch//// D/macro//// D/qr//// D/rcs//// D/ri//// D/tests//// /Makefile/1.4/Sat Jun 2 10:11:10 2001// q3d0.1/src/q3d/Makefile0100644000175200017560000000240207306135676015156 0ustar stephensstepheng# $Id: Makefile,v 1.4 2001/06/02 10:11:10 stephens Exp $ INCLS = -I.. -I. #DEFINES= -DDEBUG_PRINT=1 OPTIMIZE = -O -ffast-math CFLAGS = $(OPTIMIZE) -g $(INCLS) $(DEFINES) CFILES = \ common/error.c \ common/mem.c \ common/token.c \ common/image.c \ common/context.c \ common/util.c \ common/xform.c \ common/rixform.c \ common/common.c \ common/dispatch.c \ common/ndc.c \ dispatch/riv.c \ dispatch/dispatch.c \ dispatch/null.c \ dispatch/nocntx.c \ dispatch/notimpl.c \ qr/dispatch.c \ qr/context.c \ qr/polyscan.c \ qr/shader.c \ qr/shaders/texmap.c \ archive/dispatch.c \ archive/context.c OTHER_OFILES = \ device/x.o OFILES = $(CFILES:.c=.o) $(OTHER_OFILES) EARLY_TARGETS = qr/signbit.h TESTS = tests/test1 tests/test2 all : early-targets $(TESTS) .PHONY: all $(OFILES) : Makefile XLIBS = -L/usr/X11R6/lib -L/usr/X11/lib -lX11 -lXext LIBS = $(XLIBS) -lm early-targets : $(EARLY_TARGETS) $(MAKE) -C device/x .PHONY: early-targets $(TESTS) : $(TESTS:=.c) $(OFILES) Makefile -mv -f $@ $@.tmp $(CC) $(CFLAGS) -o $@ $@.c $(OFILES) $(LIBS) qr/signbit.h : qr/signbit qr/signbit > $@ qr/signbit : qr/signbit.c clean : -find . '(' -name '*.[soi]' -o -name '*.tmp' -o -name '*~' ')' -print | xargs rm -f -rm -f $(TESTS) .PHONY: clean q3d0.1/src/q3d/PKG0100644000175200017560000000021406662461260014054 0ustar stephensstephengNAME=q3d VERSION=0.1 DESC='A fast prototype RenderMan rendering library.' CATEGORY="Geometric Modeling" REQUIRES_PKGS="" REQUIRES_OTHERS="" q3d0.1/src/q3d/archive/0040755000175200017560000000000007306140063015126 5ustar stephensstephengq3d0.1/src/q3d/archive/CVS/0040755000175200017560000000000007306135676015577 5ustar stephensstephengq3d0.1/src/q3d/archive/CVS/Root0100644000175200017560000000003407236675453016443 0ustar stephensstepheng:local://cvs/ioncvs/cvsroot q3d0.1/src/q3d/archive/CVS/Repository0100644000175200017560000000003107236675453017674 0ustar stephensstephenghome/ion/src/q3d/archive q3d0.1/src/q3d/archive/CVS/Entries0100644000175200017560000000020107306135676017121 0ustar stephensstepheng/archive.h/1.2/Fri Feb 19 09:26:37 1999// /context.c/1.3/Thu Apr 22 05:29:55 1999// /dispatch.c/1.5/Sat Jun 2 10:11:10 2001// D q3d0.1/src/q3d/archive/archive.h0100644000175200017560000000071506663227115016731 0ustar stephensstepheng#ifndef _archive_archive_h #ifndef __rcs_id__ #ifndef __rcs_id_archive_archive_h__ #define __rcs_id_archive_archive_h__ static const char __rcs_id_archive_archive_h[] = "$Id: archive.h,v 1.2 1999/02/19 09:26:37 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #define _archive_archive_h #include "ri/ri.h" RtToken _archive_RiBeginV(RtString handle, _RIV_PARMS); RtToken _archive_RiContextV(RtToken handle, _RIV_PARMS); RtVoid _archive_RiEnd(void); #endif q3d0.1/src/q3d/archive/context.c0100644000175200017560000000270606707531723016773 0ustar stephensstepheng#ifndef __rcs_id__ #ifndef __rcs_id_archive_context_c__ #define __rcs_id_archive_context_c__ static const char __rcs_id_archive_context_c[] = "$Id: context.c,v 1.3 1999/04/22 05:29:55 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "archive.h" #include "common/context.h" #include "common/error.h" #include RtToken _archive_RiBeginV(RtString handle, _RIV_PARMS) { RtInt i; RtString filepath = "ri.rib"; RtString format = (RtString) RI_ASCIIFILE; FILE *fp = 0; for ( i = 0; i < parmn; i ++ ) { if ( strcmp(tokens[i], RI_FILEPATH) == 0 ){ filepath = *(RtString*)parms[i]; } else if ( strcmp(tokens[i], RI_FILEPOINTER) == 0 ){ fp = *(RtPointer*)parms[i]; } else if ( strcmp(tokens[i], RI_FORMAT) == 0 ) { format = *(RtString*)parms[i]; } } _ri_context->data2 = 0; /* don't close */ if ( ! fp ) { if ( strcmp(filepath, "-") == 0 ) { fp = stdout; } else { _ri_context->data2 = (void*) 1; if ( ! (fp = fopen(filepath, "+w")) ) { _riError(RIE_NOFILE, RIE_ERROR, "Cannot open '%s' for writing", filepath); return RI_NULL; } } } if ( fp ) { _ri_context->data1 = fp; } return handle; } RtToken _archive_RiContextV(RtToken handle, _RIV_PARMS) { return handle; } RtVoid _archive_RiEnd(void) { if ( _ri_context->data2 && _ri_context->data1 ) { fclose((FILE*) _ri_context->data1); _ri_context->data1 = _ri_context->data2 = 0; } } q3d0.1/src/q3d/archive/dispatch.c0100644000175200017560000001277507306135676017120 0ustar stephensstepheng#ifndef __rcs_id__ #ifndef __rcs_id_archive_dispatch_c__ #define __rcs_id_archive_dispatch_c__ static const char __rcs_id_archive_dispatch_c[] = "$Id: dispatch.c,v 1.5 2001/06/02 10:11:10 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ri/ri.h" #include "dispatch/dispatch.h" #include "archive.h" #include "common/token.h" #include "common/util.h" #include "common/context.h" #include #include #define S (FILE*)_ri_context->data1 static void ri_print(const char *command, const char *format, ...) { int n = 1; int isarray = 0; int isfirst = 1; va_list vap; va_start(vap,format); fprintf(S, "%s ", command); while ( *format ) { switch ( *(format ++) ) { case '[': fprintf(S, "[ "); isarray = 1; break; case ']': fprintf(S, "] "); isarray = 0; break; case 'n': n *= va_arg(vap, int); break; case 'i': if ( isfirst && (*format == 'V' || *format == '[') ) { va_arg(vap,RtInt); } else { if ( isarray ) { RtInt *p = va_arg(vap, RtInt*); while ( n -- ) fprintf(S, "%ld ", (long) *(p ++)); } else { while ( n -- ) fprintf(S, "%ld ", (long) va_arg(vap, RtInt)); } } n = 1; break; case 't': case 's': if ( isarray ) { RtToken *p = va_arg(vap, RtToken*); while ( n -- ) fprintf(S, "\"%s\" ", (char*) *(p ++)); } else { while ( n -- ) fprintf(S, "\"%s\" ", (char*) va_arg(vap, RtToken)); } n = 1; break; case 'b': n *= 6; goto do_floats; case 'm': n *= 16; goto do_floats; case 'p': n *= 3; goto do_floats; case 'c': n *= 3; /* IMPLEMENT: Handle Other color spaces */ goto do_floats; do_floats: isarray = 1; case 'f': if ( isarray ) { RtFloat *p = va_arg(vap, RtFloat*); while ( n -- ) fprintf(S, "%g ", (double) *(p ++)); } else { while ( n -- ) fprintf(S, "%g ", (double) va_arg(vap, double)); } isarray = 0; n = 1; break; case 'F': { RtPointer f = va_arg(vap, RtFunc); RtToken s; if ( f == RiErrorIgnore ) s = "ignore"; else if ( f == RiErrorPrint ) s = "print"; else if ( f == RiErrorAbort ) s = "abort"; else s = ""; fprintf(S, "\"%s\" ", s); } break; case 'V': { RtInt nvertices, nvarying, nuniform; _RIV_DECLS; RtInt i, j; nvertices = va_arg(vap, RtInt); nvarying = va_arg(vap, RtInt); nuniform = va_arg(vap, RtInt); parmn = va_arg(vap, RtInt); tokens = va_arg(vap, RtToken*); parms = va_arg(vap, RtPointer*); for ( i = 0; i < parmn; i ++ ) { rtToken t = RtToken_to_rtToken_safe(tokens[i]); RtInt n = t->_nelements; char *p = parms[i]; if ( t->_vertex ) n *= nvertices; if ( t->_varying ) n *= nvarying; if ( t->_uniform ) n *= nuniform; fprintf(S, "\n\t\"%s\" [ ", tokens[i]); if ( t->_float ) { while ( n -- ) { fprintf(S, "%g ", (double) *(RtFloat*) p); p += sizeof(RtFloat); } } else if ( t->_integer ) { while ( n -- ) { fprintf(S, "%ld ", (long) *(RtInt*) p); p += sizeof(RtInt); } } else if ( t->_string ) { while ( n -- ) { fprintf(S, "\"%s\" ", (char*) *(RtString*) p); p += sizeof(RtString); } } fprintf(S, "] "); } } n = 1; break; } isfirst = 0; } fprintf(S, "\n"); va_end(vap); } /* Translate typenames into format strings */ #define RtInt_f "i" #define RtBoolean_f "i" #define RtFloat_f "f" #define RtPoint_f "p" #define RtColor_f "c" #define RtBound_f "[b]" #define RtBasis_f "[m]" #define RtMatrix_f "[m]" #define RtToken_f "t" #define RtString_f "s" #define RtFunc_f "F" #define RtFloatFunc_f "F" #define RtLightHandle_f "t" #define RtObjectHandle_f "t" #define f_L0() "" #define f_L1(t1,n1) t1##_f #define f_L2(t1,n1,t2,n2) t1##_f t2##_f #define f_L3(t1,n1,t2,n2,t3,n3) t1##_f t2##_f t3##_f #define f_L4(t1,n1,t2,n2,t3,n3,t4,n4) t1##_f t2##_f t3##_f t4##_f #define f_L5(t1,n1,t2,n2,t3,n3,t4,n4,t5,n5) t1##_f t2##_f t3##_f t4##_f t5##_f #define f_L6(t1,n1,t2,n2,t3,n3,t4,n4,t5,n5,t6,n6) t1##_f t2##_f t3##_f t4##_f t5##_f t6##_f #define Ri(RTN,NAME,ARGS) \ static RTN _archive_Ri##NAME( _RIPARMS(ARGS) ) \ { \ ri_print(#NAME, f_##ARGS _RI_1COM(ARGS) _RIARGS(ARGS)); \ } #define RiVpvu(p,v,u) RtInt _nvertices = p; RtInt _nvarying = v; RtInt _nuniform = u; #define RiVPVU(RTN,NAME,ARGS,PVU) \ static RTN _archive_Ri##NAME##V( _RIPARMS(ARGS), _RIV_PARMS ) \ { \ PVU; \ ri_print(#NAME, f_##ARGS "V" _RI_1COM(ARGS) _RIARGS(ARGS), _nvertices, _nvarying, _nuniform, parmn, tokens, parms, 0); \ } Ri(RtVoid,ErrorHandler,L1(RtFunc,handler)) #define _Ri_NO_CONTEXT #define _Ri_NO_PTRS #include "ri/procs.def" #undef RiVpvu static RtVoid _archive_RiMotionBeginV(RtInt n, RtFloat *t) { ri_print("MotionBegin", "[nf]", n, t); } static RtVoid _archive_RiArchiveRecordV(RtToken type, RtString format, RtVaList vap) { fprintf(S, type[0] == 's' ? "##" : "#"); vfprintf(S, format, vap); fprintf(S, "\n"); } #undef S rtDispatch _ri_dispatch_archive() { static struct _rtDispatch _d = { "archive" }; static int inited; if ( ! inited ) { inited ++; #define Ri(RTN,NAME,ARGS) _d._##NAME = &_archive_Ri##NAME; #define RiV(RTN,NAME,ARGS) _d._##NAME##V = &_archive_Ri##NAME##V, #define _Ri_NO_PTRS Ri(RtVoid,MotionBeginV,L0()) Ri(RtVoid,ArchiveRecordV,L0()) #include "ri/procs.def" _rtDispatch_overlay(&_d, _ri_dispatch_NotImplemented()); } return &_d; } q3d0.1/src/q3d/common/0040755000175200017560000000000007306140063014775 5ustar stephensstephengq3d0.1/src/q3d/common/CVS/0040755000175200017560000000000007306135676015446 5ustar stephensstephengq3d0.1/src/q3d/common/CVS/Root0100644000175200017560000000003407236675453016312 0ustar stephensstepheng:local://cvs/ioncvs/cvsroot q3d0.1/src/q3d/common/CVS/Repository0100644000175200017560000000003007236675453017542 0ustar stephensstephenghome/ion/src/q3d/common q3d0.1/src/q3d/common/CVS/Entries0100644000175200017560000000177307306135676017007 0ustar stephensstepheng/common.h/1.2/Fri Feb 19 09:26:37 1999// /context.c/1.3/Thu Apr 22 05:29:56 1999// /context.h/1.2/Fri Feb 19 09:26:37 1999// /dispatch.c/1.2/Fri Feb 19 09:26:38 1999// /dither.c/1.4/Mon Jun 28 14:05:01 1999// /error.c/1.2/Fri Feb 19 09:26:38 1999// /error.h/1.3/Thu Apr 22 05:29:56 1999// /handle.h/1.2/Fri Feb 19 09:26:38 1999// /image.c/1.3/Mon Jun 28 14:05:01 1999// /image.h/1.3/Mon Jun 28 14:05:02 1999// /mem.c/1.3/Thu Apr 22 05:29:56 1999// /mem.h/1.2/Fri Feb 19 09:26:38 1999// /resource.c/1.3/Thu Apr 22 05:29:56 1999// /rixform.c/1.2/Fri Feb 19 09:26:39 1999// /shader.h/1.3/Thu Apr 22 05:29:57 1999// /shadervars.h/1.3/Thu Apr 22 05:29:57 1999// /token.c/1.4/Mon Jun 28 14:05:03 1999// /token.h/1.3/Thu Apr 22 05:29:57 1999// /util.c/1.3/Fri Feb 19 09:26:40 1999// /util.h/1.2/Fri Feb 19 09:26:40 1999// /xform.h/1.3/Thu Apr 22 05:29:57 1999// /common.c/1.5/Sat Jun 2 10:11:10 2001// /ndc.c/1.2/Sat Jun 2 10:11:10 2001// /resource.h/1.4/Sat Jun 2 10:11:10 2001// /xform.c/1.4/Sat Jun 2 10:11:10 2001// D q3d0.1/src/q3d/common/common.c0100644000175200017560000001472407306135676016454 0ustar stephensstepheng#ifndef __rcs_id__ #ifndef __rcs_id_common_common_c__ #define __rcs_id_common_common_c__ static const char __rcs_id_common_common_c[] = "$Id: common.c,v 1.5 2001/06/02 10:11:10 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ri/ri.h" #include "dispatch/dispatch.h" #include "common/mem.h" #include "common/context.h" #include "common/common.h" #include "common/token.h" #include #include /***************************************************************************/ #define _attrib _ri_context->attrib #define _xform _attrib->xform RtToken _ri_RiDeclare(RtString name, RtString decl) { rtToken t; t = _rtToken_RiDeclare(name, decl); if ( ! t ) return 0; t->prev = _attrib->tokens; _attrib->tokens = t; return rtToken_to_RtToken(t); } RtVoid _ri_RiAttributeBegin(void) { rtAttributes x = _ri_calloc(sizeof(*x)); x->prev = _attrib; _attrib = x; _ri_RiTransformBegin(); } void _ri_setAttr(rtToken t, void *value) { /* ** If this token has not been set in this attribute block. ** save its current value to be restored by _ri_RiAttributeEnd. */ if ( t->attribBlock != _attrib ) { rtSavedValue sv = _ri_malloc(sizeof(*sv)); sv->token = t; sv->value = * (rtTokenValue*) t; sv->prev = _attrib->savedValues; _attrib->savedValues = sv; /* Mark the token as set by this attribute block */ t->attribBlock = _attrib; /* Allocate new value storage. */ t->value = _ri_malloc(t->_sizeof); } /* HANDLE COLOR */ memcpy(t->value, value, t->_sizeof); } RtVoid _ri_RiAttributeEnd(void) { rtAttributes x = _ri_context->attrib; _ri_RiTransformEnd(); /* Restore saved values. */ { rtSavedValue t, tp; for ( t = x->savedValues; t; t = tp ) { * (rtTokenValue*) t->token = t->value; tp = t->prev; _ri_free(t); } } /* Free any local declarations. */ { rtToken t, tp; for ( t = x->tokens; t; t = tp ) { tp = t->prev; _rtToken_free(t); } } /* Go back to previous attribute block. */ _attrib = x->prev; _ri_free(x); } static void _ri_unwindToAttr(rtAttributes x) { while ( _attrib != x ) { assert(_attrib); _ri_RiAttributeEnd(); } } /****************************************************************************/ RtToken _ri_RiBeginV(RtString context, _RIV_PARMS) { rtContext c = _ri_calloc(sizeof(*c)); rtToken handle; handle = _rtToken_RiDeclare(context, "*r"); handle->value = c; c->name = rtToken_to_RtToken(handle); c->dispatch = _ri_dispatch; _ri_context = c; _ri_contextName = c->name; /* Begin an attribute block */ _ri_RiAttributeBegin(); /* Set up the first transformation */ _xform->toSpace = RI_REAL; _xform->fromSpace = RI_SCREEN; _ri_RiIdentity(); /* frame */ { RtInt x = 0; _ri_setAttr(RT(_frame), &x); } /* clipping */ _ri_RiClipping(RI_EPSILON, RI_INFINITY); /* basis */ _ri_RiBasis(RiBezierBasis, RI_BEZIERSTEP, RiBezierBasis, RI_BEZIERSTEP); /* color and opacity */ { RtFloat one[] = { 1, 1, 1 }; _ri_setAttr(RT(_Ci), one); _ri_setAttr(RT(_Oi), one); } /* Return a token for the handle */ return rtToken_to_RtToken(handle); } RtToken _ri_RiContextV(RtToken context, _RIV_PARMS) { return RI_NULL; } RtVoid _ri_RiEnd(void) { } /**************************************************************************/ RtVoid _ri_RiFrameBegin(RtInt frame) { if ( _ri_context->frame ) { _riError(RIE_NESTING, RIE_ERROR, "Already in RiFrameBegin/End block"); return; } _ri_RiAttributeBegin(); _ri_context->frame = _attrib; _ri_setAttr(RT(_frame), &frame); } RtVoid _ri_RiFrameEnd(RtInt frame) { if ( ! _ri_context->frame ) { _riError(RIE_NESTING, RIE_ERROR, "Not in RiFrameBegin/End block"); return; } _ri_unwindToAttr(_ri_context->frame); _ri_RiAttributeEnd(); _ri_context->frame = 0; } /**************************************************************************/ RtVoid _ri_RiPixel(RtFloat *p) { _ri_setAttr(RT(_pixel), p); } RtVoid _ri_RiRaster(RtFloat *r) { _ri_setAttr(RT(_raster), r); } RtVoid _ri_RiFormat(RtInt xres, RtInt yres, RtFloat par) { RtFloat r[5]; r[0] = xres; r[1] = yres; r[2] = par; _ri_setAttr(RT(_format), r); r[2] = 1; r[3] = 1; r[4] = 0; _ri_RiRaster(r); } RtVoid _ri_RiClipping(RtFloat near, RtFloat far) { RtFloat nearfar[2]; if ( near > far ) { _riError(RIE_RANGE, RIE_ERROR, "near > far"); } if ( near < RI_EPSILON ) { near = RI_EPSILON; } if ( far > RI_INFINITY ) { far = RI_INFINITY; } nearfar[0] = near; nearfar[1] = far; _ri_setAttr(RT(_clipping), nearfar); } static void _ri_replaceXform(RtToken from, RtToken to) { rtXform x; x = _rtXform_create(); x->toSpace = to; x->fromSpace = from; x->prev = _xform; _xform = x; _ri_RiIdentity(); } RtVoid _ri_RiProjectionV(RtToken name, _RIV_PARMS) { _ri_context->xformScreen = _xform; _ri_replaceXform(RI_CAMERA, RI_SCREEN); _rtXform_RiClipping(_xform, RTpoint(_clipping)[0], RTpoint(_clipping)[1]); _rtXform_RiProjectionV(_xform, name, _RIV_ARGS); _ri_context->xformProjection = _xform; _ri_replaceXform(RI_WORLD, RI_CAMERA); _xform->prev = _ri_context->xformScreen->prev; } /**************************************************************************/ RtVoid _ri_RiWorldBegin(void) { if ( _ri_context->world ) { _riError(RIE_NESTING, RIE_ERROR, "Already in RiWorldBegin/End block"); return; } if ( ! _ri_context->xformProjection ) { _ri_RiProjectionV(RI_ORTHOGRAPHIC, 0, 0, 0); } _ri_context->xformCamera = _xform; _ri_replaceXform(RI_OBJECT, RI_WORLD); _ri_context->world = _attrib; } RtVoid _ri_RiWorldEnd(void) { if ( ! _ri_context->world ) { _riError(RIE_NESTING, RIE_ERROR, "Not in RiWorldBegin/End block"); return; } _ri_unwindToAttr(_ri_context->world); _ri_RiAttributeEnd(); _ri_context->world = 0; } /**************************************************************************/ /* IMPLEMENT: Basis Matricies */ RtConst RtBasis RiBezierBasis, RiBSplineBasis, RiCatmulRomBasis, RiHermiteBasis, RiPowerBasis; #ifdef _ri_ustep #undef _ri_ustep #endif RtInt _ri_ustep(void) { return RTint(_ustep); } #ifdef _ri_vstep #undef _ri_vstep #endif RtInt _ri_vstep(void) { return RTint(_vstep); } RtVoid _ri_RiBasis(RtBasis ubasis, RtInt ustep, RtBasis vbasis, RtInt vstep) { _ri_setAttr(RT(_ubasis), ubasis); _ri_setAttr(RT(_vbasis), vbasis); _ri_setAttr(RT(_ustep), &ustep); _ri_setAttr(RT(_vstep), &vstep); } q3d0.1/src/q3d/common/common.h0100644000175200017560000000155306663227115016450 0ustar stephensstepheng#ifndef _common_common_h #ifndef __rcs_id__ #ifndef __rcs_id_common_common_h__ #define __rcs_id_common_common_h__ static const char __rcs_id_common_common_h[] = "$Id: common.h,v 1.2 1999/02/19 09:26:37 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #define _common_common_h #include "ri/ri.h" #include "common/token.h" RtToken _ri_RiDeclare(RtString name, RtString decl); RtVoid _ri_RiAttributeBegin(void); RtVoid _ri_RiAttributeEnd(void); RtVoid _ri_setAttr(rtToken token, void *value); RtVoid _ri_RiBasis(RtBasis ubasis, RtInt ustep, RtBasis vbasis, RtInt vstep); #define _ri_ustep RTint(_ustep) #define _ri_vstep RTint(_vstep) RtVoid _ri_RiFrameBegin(RtInt frame); RtVoid _ri_RiFrameEnd(); RtVoid _ri_RiClipping(RtFloat near, RtFloat far); RtVoid _ri_RiProjectionV(RtToken name, _RIV_PARMS); RtVoid _ri_RiWorldBegin(void); RtVoid _ri_RiWorldEnd(void); #endif q3d0.1/src/q3d/common/context.c0100644000175200017560000000441606707531724016643 0ustar stephensstepheng#ifndef __rcs_id__ #ifndef __rcs_id_common_context_c__ #define __rcs_id_common_context_c__ static const char __rcs_id_common_context_c[] = "$Id: context.c,v 1.3 1999/04/22 05:29:56 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "ri/ri.h" #include "dispatch/dispatch.h" #include "common/mem.h" #include "common/context.h" #include "common/common.h" #include "common/token.h" #include RtToken _ri_contextName = RI_NULL; rtContext _ri_context = 0; RtToken RiBeginV(RtString name, _RIV_PARMS) { RtToken handle; RtToken renderer = RI_DRAFT; rtDispatch dispatch = _ri_dispatch_NoContext(); RtInt i; _ri_dispatch_common = _ri_dispatch_ri(); _riInitTokens(); for ( i = 0; i < parmn; i ++ ) { if ( strcmp(tokens[i], RI_RENDERER) == 0 ) { renderer = ((RtToken*) parms[i])[0]; } } if ( strcmp(renderer, RI_DRAFT) == 0 || strcmp(renderer, "qrman") == 0 ) { dispatch = _ri_dispatch_qr(); } else if ( strcmp(renderer, RI_ARCHIVE) == 0 ) { dispatch = _ri_dispatch_archive(); } if ( name == RI_NULL ) { static int contextId; static char buf[64]; sprintf(buf, "resource:context:RiContext%d", ++ contextId); name = buf; } handle = _ri_RiBeginV(name, _RIV_ARGS); if ( handle != RI_NULL ) { handle = dispatch->_BeginV((RtString) handle, _RIV_ARGS); } if ( handle != RI_NULL ) { _ri_dispatch = dispatch; RiLastError = RIE_NOERROR; } return handle; } RtToken RiContextV(RtToken handle, _RIV_PARMS) { RtToken oldHandle = _ri_contextName; if ( handle == _ri_contextName ) { return handle; } /* Save global vars */ if ( _ri_context ) { _ri_context->lastError = RiLastError; _ri_context->dispatch = _ri_dispatch; } /* Notify old context of switch */ _ri_dispatch->_ContextV(handle, _RIV_ARGS); /* Restore global vars */ _ri_contextName = handle; _ri_context = RtToken_to_rtToken(_ri_contextName)->value; _ri_dispatch = _ri_context->dispatch; RiLastError = _ri_context->lastError; /* Notify new context of switch */ _ri_dispatch->_ContextV(handle, _RIV_ARGS); return oldHandle; } RtVoid RiEnd(void) { if ( _ri_contextName != RI_NULL ) { _ri_dispatch->_End(); _ri_dispatch = _ri_dispatch_NoContext(); _ri_context = 0; _ri_contextName = RI_NULL; } } q3d0.1/src/q3d/common/context.h0100644000175200017560000000220606663227115016640 0ustar stephensstepheng#ifndef _common_context_h #ifndef __rcs_id__ #ifndef __rcs_id_common_context_h__ #define __rcs_id_common_context_h__ static const char __rcs_id_common_context_h[] = "$Id: context.h,v 1.2 1999/02/19 09:26:37 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #define _common_context_h #include "resource.h" #include "xform.h" #include "dispatch/dispatch.h" #include "token.h" typedef struct _rtSavedValue { rtToken token; rtTokenValue value; struct _rtSavedValue *prev; /* stack */ } *rtSavedValue; typedef struct _rtAttributes { rtXform xform; rtToken tokens; /* new declarations */ rtSavedValue savedValues; struct _rtAttributes *prev; /* stack */ } *rtAttributes; typedef struct _rtContext { struct rtResource _super; rtAttributes attrib, frame, world; rtXform xformScreen, xformProjection, xformCamera; rtXform worldToNDC, NDCToReal; RtToken name; rtDispatch dispatch; RtInt lastError; void *data1, *data2; } *rtContext; extern rtContext _ri_context; extern RtToken _ri_contextName; RtToken _ri_RiBeginV(RtString handle, _RIV_PARMS); RtToken _ri_RiContextV(RtToken handle, _RIV_PARMS); RtVoid _ri_RiEnd(void); #endif q3d0.1/src/q3d/common/dispatch.c0100644000175200017560000000171506663227116016753 0ustar stephensstepheng #ifndef __rcs_id__ #ifndef __rcs_id_common_dispatch_c__ #define __rcs_id_common_dispatch_c__ static const char __rcs_id_common_dispatch_c[] = "$Id: dispatch.c,v 1.2 1999/02/19 09:26:38 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "dispatch/dispatch.h" #define Ri(RTN,NAME,ARGS) extern RTN _ri_Ri##NAME(); #define RiV(RTN,NAME,ARGS) extern RTN _ri_Ri##NAME##V(); #include "ri/procs.def" rtDispatch _ri_dispatch_ri() { static int inited; static struct _rtDispatch _d = { "ri" }; if ( ! inited ) { inited ++; #define F(X) _d._##X = (void*) &_ri_Ri##X; F(Declare) F(AttributeBegin) F(AttributeEnd) F(FrameBegin) F(FrameEnd) F(Clipping) F(ProjectionV) F(WorldBegin) F(WorldEnd) F(TransformBegin) F(TransformEnd) F(Identity) F(Transform) F(ConcatTransform) F(Perspective) F(Rotate) F(Scale) F(Translate) F(Basis) #undef F _rtDispatch_overlay(&_d, _ri_dispatch_Null()); } return &_d; } q3d0.1/src/q3d/common/dither.c0100644000175200017560000000357706735700415016441 0ustar stephensstepheng#ifndef __rcs_id__ #ifndef __rcs_id_common_dither_c__ #define __rcs_id_common_dither_c__ static const char __rcs_id_common_dither_c[] = "$Id: dither.c,v 1.4 1999/06/28 14:05:01 stephensk Exp $"; #endif #endif /* __rcs_id__ */ typedef float RtFloat; typedef unsigned long rTPixel; static RtFloat _rands[256]; /* IMPLEMENT: connect to rtImage. */ #define BASE_INDEX 0 #define R_MAX 255 #define G_MAX 255 #define B_MAX 255 #define R_MULT 1 #define G_MULT 256 #define B_MULT G_MULT*G_MULT static int x, y; static RtFloat *Ci; static rTPixel colorToDevice_nodither(void) { return BASE_INDEX + (unsigned long) (Ci[0] * R_MAX + 0.5) * R_MULT + (unsigned long) (Ci[1] * G_MAX + 0.5) * G_MULT + (unsigned long) (Ci[2] * B_MAX + 0.5) * B_MULT; } static __inline rTPixel dither(int x, int y, RtFloat value) { int ivalue = (int) value; return ivalue + (_rands[(x ^ (x >> 2) ^ (y >> 1) ^ (y >> 3)) & 255] < (value - (RtFloat) ivalue)); } static rTPixel colorToDevice_dither(void) { return BASE_INDEX + dither(x, y, Ci[0] * R_MAX) * R_MULT + dither(x + 7, y, Ci[1] * G_MAX) * G_MULT + dither(x + 7, y + 7, Ci[2] * B_MAX) * B_MULT; } #if 0 static void doColor(void) { int i; printf("Ci = { %g, %g, %g }\n", Ci[0], Ci[1], Ci[2]); for ( x = 0; x < 8; x ++ ) { for ( y = 0; y < 8; y ++ ) { printf("%06x ", colorToDevice_dither()); } printf("\n"); } } int main(int argc, char **argv) { int i; RtFloat _Ci[3]; rTPixel Cp; Ci = _Ci; srand((time(0) << 7) ^ time(0)); #define frand() (((double) (rand() & 32767)) / 32767.0) for ( i = 0; i < sizeof(_rands)/sizeof(_rands[0]); i ++ ) { _rands[i] = frand(); } for ( i = 0; i <= 10; i ++ ) { Ci[0] = Ci[1] = Ci[2] = (double) i / 16.0; doColor(); } for ( i = 0; i < 16; i ++ ) { Ci[0] = frand(); Ci[1] = frand(); Ci[2] = frand(); doColor(); } return 0; } #endif q3d0.1/src/q3d/common/error.c0100644000175200017560000000463506663227116016311 0ustar stephensstepheng #ifndef __rcs_id__ #ifndef __rcs_id_common_error_c__ #define __rcs_id_common_error_c__ static const char __rcs_id_common_error_c[] = "$Id: error.c,v 1.2 1999/02/19 09:26:38 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "ri/ri.h" #include "error.h" #include "dispatch/dispatch.h" #include #include /* strchr() */ #include #define RI_ERROR_ARGS code, severity, message, context, routine #define RiErrorHandlerDecl(X) \ RtVoid X (RtInt code, RtInt severity, RtString message, RtToken context, RtToken routine) RiErrorHandlerDecl(RiErrorIgnore) { } RiErrorHandlerDecl(RiErrorPrint) { fprintf(stderr, "RiError %s\n", message); fflush(stderr); } RiErrorHandlerDecl(RiErrorAbort) { RiErrorPrint(RI_ERROR_ARGS); abort(); } static RiErrorHandlerDecl((*_ri_errorHandler)) = RiErrorPrint; RtInt RiLastError = RIE_NOERROR; RtVoid RiErrorHandler(RtFunc func) { _ri_errorHandler = (void*) func; (*_ri_dispatch->_ErrorHandler)(func); } extern RtToken _ri_contextName, _ri_funcName; RtVoid _riErrorV(RtInt code, RtInt severity, RtString format, va_list vap) { #ifndef _RI_ERROR_MSG_SIZE #define _RI_ERROR_MSG_SIZE 1023 #endif RtToken context = _ri_contextName; RtToken routine = _ri_funcName; RtToken codeStr, severityStr; char message[_RI_ERROR_MSG_SIZE + 1]; char *s; RiLastError = code; /* Get a string for the code */ switch ( code ) { default: { static char buf[32]; sprintf(buf, "%d", code); codeStr = buf; } break; #define RIE(N,V,S) case RIE_##N: codeStr = #N; break; #define RIES(N,V,S) #include "ri/errors.def" } /* Get a string for the code */ switch ( severity ) { default: { static char buf[32]; sprintf(buf, "%d", severity); severityStr = buf; } break; #define RIE(N,V,S) #define RIES(N,V,S) case RIE_##N: severityStr = #N; break; #include "ri/errors.def" } message[_RI_ERROR_MSG_SIZE] = '\01'; sprintf(message, "context %s, proc %s, code %s, severity %s, ", context, routine, codeStr, severityStr); s = strchr(message, '\0'); vsprintf(s, format, vap); va_end(vap); if ( message[_RI_ERROR_MSG_SIZE] != '\01' ) { fprintf(stderr, "RI: cannot format error message, aborting!\n"); abort(); } (*_ri_errorHandler)(RI_ERROR_ARGS); if ( severity >= RIE_SEVERE ) { abort(); } } RtVoid _riError(RtInt code, RtInt severity, RtString format, ...) { va_list vap; va_start(vap,format); _riErrorV(code, severity, format, vap); } q3d0.1/src/q3d/common/error.h0100644000175200017560000000070106707531724016306 0ustar stephensstepheng#ifndef _error_h #define _error_h #ifndef __rcs_id__ #ifndef __rcs_id_common_error_h__ #define __rcs_id_common_error_h__ static const char __rcs_id_common_error_h[] = "$Id: error.h,v 1.3 1999/04/22 05:29:56 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "ri/ri.h" #include RtVoid _riErrorV(RtInt code, RtInt severity, RtString format, va_list vap); RtVoid _riError(RtInt code, RtInt severity, RtString format, ...); #endif q3d0.1/src/q3d/common/handle.h0100644000175200017560000000104306663227116016406 0ustar stephensstepheng#ifndef _common_handle_h #ifndef __rcs_id__ #ifndef __rcs_id_common_handle_h__ #define __rcs_id_common_handle_h__ static const char __rcs_id_common_handle_h[] = "$Id: handle.h,v 1.2 1999/02/19 09:26:38 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #define _common_handle_h struct _rtHandle; typedef struct _rtHandle *rtHandle; struct _rtHandleMethods; typedef struct _rtHandleMethods *rtHandleMethods; struct _rtHandleMethods { RtVoid (*destroy)(RtPointer h); }; struct _rthandle { rtHandleMethods methods; RtToken name; }; #endif q3d0.1/src/q3d/common/image.c0100644000175200017560000000427606735700415016241 0ustar stephensstepheng #ifndef __rcs_id__ #ifndef __rcs_id_common_image_c__ #define __rcs_id_common_image_c__ static const char __rcs_id_common_image_c[] = "$Id: image.c,v 1.3 1999/06/28 14:05:01 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "image.h" #include "common/mem.h" #include #include rtImage *_rtImage_init(rtImage *image, int sx, int sy, int bitsPerPixel, rtPixel *pixels) { int i; if ( image == 0 ) { image = _ri_malloc(sizeof(*image)); } image->sx = sx; image->sy = sy; image->mx = image->sx - 1; image->my = image->sy - 1; image->sz = ~0; image->bitsPerPixel = bitsPerPixel; image->bytesPerPixel = (bitsPerPixel + 7) / 8; image->pixels = _ri_malloc(sizeof(image->pixels[0]) * image->sy); image->pixels[0] = pixels ? pixels : _ri_malloc(sizeof(image->pixels[0][0]) * image->bytesPerPixel * image->sy * image->sx); for ( i = 1; i < image->sy; i ++ ) { image->pixels[i] = image->pixels[0] + (i * image->sx * image->bytesPerPixel); } image->zbuffer = 0; return image; } void _rtImage_destroy(rtImage *image) { _ri_free(image->pixels[0]); _ri_free(image->pixels); if ( image->zbuffer ) { _ri_free(image->zbuffer[0]); _ri_free(image->zbuffer); } } void _rtImage_set(rtImage *image, rtPixel *pixel) { rtPixel **pp, *p; int n; for ( p = image->pixels[0], n = image->sx; n --; p += image->bytesPerPixel) { memcpy(p, pixel, image->bytesPerPixel); } for ( pp = image->pixels + image->sy; -- pp > image->pixels; ) { memcpy(*pp, image->pixels[0], image->sx * image->bytesPerPixel); } } void _rtImage_initZbuffer(rtImage *image) { int i; if ( image->zbuffer ) { free(image->zbuffer[0]); free(image->zbuffer); } image->zbuffer = malloc(sizeof(image->zbuffer[0]) * image->sy); image->zbuffer[0] = malloc(sizeof(image->zbuffer[0][0]) * image->sy * image->sx); for ( i = 1; i < image->sy; i ++ ) { image->zbuffer[i] = image->zbuffer[0] + (i * image->sx); } } void _rtImage_clearZbuffer(rtImage *image) { rtZValue **pp, *p; if ( ! image->zbuffer ) return; for ( pp = image->zbuffer + image->sy; -- pp >= image->zbuffer; ) for ( p = *pp + image->sx; -- p >= *pp; ) *p = image->sz; } q3d0.1/src/q3d/common/image.h0100644000175200017560000000155006735700416016237 0ustar stephensstepheng#ifndef _qr_image_h #define _qr_image_h #ifndef __rcs_id__ #ifndef __rcs_id_common_image_h__ #define __rcs_id_common_image_h__ static const char __rcs_id_common_image_h[] = "$Id: image.h,v 1.3 1999/06/28 14:05:02 stephensk Exp $"; #endif #endif /* __rcs_id__ */ typedef unsigned char rtPixel; typedef unsigned short rtZValue; typedef struct rtImage { rtPixel **pixels; rtZValue **zbuffer; short sx, sy; short mx, my; int bitsPerPixel, bytesPerPixel; rtZValue sz; unsigned long baseIndex, rMax, gMax, bMax, rMult, gMult, bMult; } rtImage; typedef rtImage rtTexture; rtImage *_rtImage_init(rtImage *image, int sx, int sy, int bitsPerPixel, rtPixel *pixels); void _rtImage_destroy(rtImage *image); void _rtImage_set(rtImage *image, rtPixel *pixel); void _rtImage_initZbuffer(rtImage *image); void _rtImage_clearZbuffer(rtImage *image); #endif q3d0.1/src/q3d/common/mem.c0100644000175200017560000000114106707531724015725 0ustar stephensstepheng#ifndef __rcs_id__ #ifndef __rcs_id_common_mem_c__ #define __rcs_id_common_mem_c__ static const char __rcs_id_common_mem_c[] = "$Id: mem.c,v 1.3 1999/04/22 05:29:56 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "error.h" #include #include void *_ri_malloc(size_t t) { void *p; if ( ! t ) return 0; p = malloc(t); if ( ! p ) { _riError(RIE_NOMEM, RIE_SEVERE, "Out of memory"); } return p; } void *_ri_calloc(size_t t) { void *p = _ri_malloc(t); if ( p ) memset(p, 0, t); return p; } void _ri_free(void *p) { if ( p ) free(p); } q3d0.1/src/q3d/common/mem.h0100644000175200017560000000057706663227116015744 0ustar stephensstepheng#ifndef _common_mem_h #ifndef __rcs_id__ #ifndef __rcs_id_common_mem_h__ #define __rcs_id_common_mem_h__ static const char __rcs_id_common_mem_h[] = "$Id: mem.h,v 1.2 1999/02/19 09:26:38 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #define _common_mem_h #include /* size_t */ void *_ri_malloc(size_t t); void *_ri_calloc(size_t t); void _ri_free(void *p); #endif q3d0.1/src/q3d/common/ndc.c0100644000175200017560000000415407306135676015724 0ustar stephensstepheng#ifndef __rcs_id__ #ifndef __rcs_id_q3d_common_ndc_c__ #define __rcs_id_q3d_common_ndc_c__ static const char __rcs_id_q3d_common_ndc_c[] = "$Id: ndc.c,v 1.2 2001/06/02 10:11:10 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "context.h" #include "xform.h" #define World2NDC _ri_context->worldToNDC #define NDC2Real _ri_context->NDCToReal RtVoid _ri_computeScreenTransforms() { RtFloat rx, ry, rz; RtFloat px, py, pz; RtFloat ap, af; RtFloat xm, xM, ym, yM; World2NDC = _rtXform_create(); _rtXform_RiIdentity(World2NDC); NDC2Real = _rtXform_create(); _rtXform_RiIdentity(NDC2Real); /* Compute raster image size */ if ( RTfp(_raster)[0] > 0 ) { rx = RTfp(_raster)[0]; } else { rx = RTfp(_raster)[0] = 640; } if ( RTfp(_raster)[1] > 0 ) { ry = RTfp(_raster)[1]; } else { ry = RTfp(_raster)[1] = 640; } if ( RTfp(_raster)[2] > 0 ) { rz = RTfp(_raster)[2]; } else { rz = RTfp(_raster)[2] = 1; } /* Compute pixel aspect ratio */ if ( RTfp(_format)[2] > 0 ) { ap = RTfp(_format)[2]; py = 1; px = ap / py; pz = 1; } else { if ( RTfp(_pixel)[0] > 0 ) { px = RTfp(_pixel)[0]; } else { px = RTfp(_pixel)[0] = 1; } if ( RTfp(_pixel)[1] > 0 ) { py = RTfp(_pixel)[1]; } else { py = RTfp(_pixel)[1] = 1; } if ( RTfp(_pixel)[2] > 0 ) { pz = RTfp(_pixel)[2]; } else { pz = RTfp(_pixel)[2] = 1; } ap = px / py; } /* Compute frame aspect ratio */ if ( RTfloat(_frameAspectRatio) > 0 ) { af = RTfloat(_frameAspectRatio); } else { af = ap * rx / ry; } /* Compute screen to NDC */ if ( RTfp(_screenWindow)[0] == RTfp(_screenWindow)[1] ) { xm = af < 1 ? -1 : - af; xM = af < 1 ? 1 : af; } if ( RTfp(_screenWindow)[2] == RTfp(_screenWindow)[3] ) { ym = af < 1 ? -1 / af : - 1; yM = af < 1 ? 1 / af : 1; } { RtMatrix m = { { 1. / (xM - xm), 0, 0, 0 }, { 0, -1. / (yM - ym), 0, 0 }, { 0, 0, 1, 0 }, { -xm / (xM - xm), yM / (yM - ym), 0, 1 } }; } } q3d0.1/src/q3d/common/resource.c0100644000175200017560000000060306707531724017000 0ustar stephensstepheng#ifndef __rcs_id__ #ifndef __rcs_id_common_resource_c__ #define __rcs_id_common_resource_c__ static const char __rcs_id_common_resource_c[] = "$Id: resource.c,v 1.3 1999/04/22 05:29:56 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "resource.h" RtVoid _rtResource_destroy(rtResource res) { if ( -- res->refCount <= 0 ) { (res->methods->destroy)((RtPointer) res); } } q3d0.1/src/q3d/common/resource.h0100644000175200017560000000105207306135676017006 0ustar stephensstepheng#ifndef _resource_h #define _resource_h #ifndef __rcs_id__ #ifndef __rcs_id_common_resource_h__ #define __rcs_id_common_resource_h__ static const char __rcs_id_common_resource_h[] = "$Id: resource.h,v 1.4 2001/06/02 10:11:10 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include typedef struct rtResourceMethods { RtVoid (*destroy)(RtPointer res); } *rtResourceMethods; typedef struct rtResource { rtResourceMethods methods; RtInt refCount; RtToken handle; } *rtResource; RtVoid _rtResource_destroy(rtResource res); #endif q3d0.1/src/q3d/common/rixform.c0100644000175200017560000000243606663227117016644 0ustar stephensstepheng #ifndef __rcs_id__ #ifndef __rcs_id_common_rixform_c__ #define __rcs_id_common_rixform_c__ static const char __rcs_id_common_rixform_c[] = "$Id: rixform.c,v 1.2 1999/02/19 09:26:39 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "xform.h" #include "context.h" #define _xform _ri_context->attrib->xform RtVoid _ri_RiTransformBegin(void) { rtXform x; x = _rtXform_create(); if ( ! x ) return; if ( _xform ) *x = *_xform; x->copyOnWrite = 0; x->prev = _xform; _xform = x; } RtVoid _ri_RiTransformEnd(void) { if ( _xform->prev ) { _xform = _xform->prev; } else { _riError(RIE_NESTING, RIE_ERROR, "Too many RiTransformEnd calls"); } } RtVoid _ri_RiTransform(RtMatrix m) { _rtXform_RiTransform(_xform, m); } RtVoid _ri_RiIdentity(void) { _rtXform_RiIdentity(_xform); } RtVoid _ri_RiConcatTransform(RtMatrix m) { _rtXform_RiConcatTransform(_xform, m); } void _ri_RiPerspective(RtFloat fov) { _rtXform_RiPerspective(_xform, fov); } void _ri_RiRotate(RtFloat a, RtFloat dx, RtFloat dy, RtFloat dz) { _rtXform_RiRotate(_xform, a, dx, dy, dz); } void _ri_RiScale(RtFloat sx, RtFloat sy, RtFloat sz) { _rtXform_RiScale(_xform, sx, sy, sz); } void _ri_RiTranslate(RtFloat sx, RtFloat sy, RtFloat sz) { _rtXform_RiTranslate(_xform, sx, sy, sz); } q3d0.1/src/q3d/common/shader.h0100644000175200017560000000106206707531725016425 0ustar stephensstepheng#ifndef _common_shader_h #define _common_shader_h #ifndef __rcs_id__ #ifndef __rcs_id_common_shader_h__ #define __rcs_id_common_shader_h__ static const char __rcs_id_common_shader_h[] = "$Id: shader.h,v 1.3 1999/04/22 05:29:57 stephensk Exp $"; #endif #endif /* __rcs_id__ */ typedef struct _rtShader { #define rtShaderFuncDecl(X) void X (void) rtShaderFuncDecl((*func)); const char *name; rtToken *inputs; rtToken *outputs; } *rtShader; typedef struct _rtShaderInstance { rtShader shader; RtToken name; _RIV_DECLS; } *rtShaderInstance; #endif q3d0.1/src/q3d/common/shadervars.h0100644000175200017560000000151006707531725017317 0ustar stephensstepheng#ifndef _common_shadervars_h #define _common_shadervars_h #ifndef __rcs_id__ #ifndef __rcs_id_common_shadervars_h__ #define __rcs_id_common_shadervars_h__ static const char __rcs_id_common_shadervars_h[] = "$Id: shadervars.h,v 1.3 1999/04/22 05:29:57 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #define Cs RTcolor(CS) #define Os RTcolor(OS) #define P RTpoint(P) #define dPdu RTpoint(_dPdu) #define dPdv RTpoint(_dPdv) #define N RTpoint(N) #define Ng RTpoint(_Ng) #define u RTfloat(_u) #define v RTfloat(_v) #define du RTfloat(_du) #define dv RTfloat(_dv) #define s RTfloat(S) #define t RTfloat(T) #define L RTpoint(_L) #define Cl RTpoint(_Cl) #define Ol RTpoint(_Ol) #define E RTpoint(_E) #define I RTpoint(_I) #define ncomps RTfloat(_ncomps) #define time RTfloat(_time) #define Ci RTcolor(_Ci) #define Oi RTcolor(_Oi) #endif q3d0.1/src/q3d/common/token.c0100644000175200017560000001317206735700417016274 0ustar stephensstepheng#ifndef __rcs_id__ #ifndef __rcs_id_common_token_c__ #define __rcs_id_common_token_c__ static const char __rcs_id_common_token_c[] = "$Id: token.c,v 1.4 1999/06/28 14:05:03 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "token.h" #include "mem.h" #include /* calloc() */ #include #include #define rtToken_magic(t) t rtToken _rtToken_init(rtToken t) { t->magic = rtToken_magic(t); if ( t->name != t->namebuf ) { strcpy(t->namebuf, t->name); t->name = t->namebuf; } /* Parse type */ { const char *s; s = t->decl; t->_nelements = 1; t->_uniform = 1; while ( isspace(*s) ) s ++; switch ( *s ) { case 'v': if ( s[1] == 'e' && strncmp(s, "vertex", 6) == 0 ) { s += 6; t->_vertex = 1; t->_uniform = 0; } else if ( s[1] == 'a' && strncmp(s, "varying", 7) == 0 ) { s += 7; t->_varying = 1; t->_uniform = 0; } break; case 'u': if ( strncmp(s, "uniform", 7) == 0 ) { s += 7; t->_uniform = 1; } break; } while ( isspace(*s) ) s ++; switch ( s[0] ) { case 'i': if ( strncmp(s, "integer", 7) == 0 ) { s += 7; t->_integer = 1; t->_sizeofElement = sizeof(RtInt); } break; case 'f': if ( strncmp(s, "float", 5) == 0 ) { s += 5; t->_float = 1; t->_sizeofElement = sizeof(RtFloat); } break; case 'p': if ( strncmp(s, "point", 5) == 0 ) { s += 5; t->_float = 1; t->_point = 1; t->_sizeofElement = sizeof(RtFloat); t->_nelements *= 3; } break; case 'c': if ( strncmp(s, "color", 5) == 0 ) { s += 5; t->_color = 1; t->_float = 1; t->_sizeofElement = sizeof(RtFloat); t->_nelements *= 3; } break; case 's': if ( strncmp(s, "string", 6) == 0 ) { s += 6; t->_string = 1; t->_vertex = 0; t->_varying = 0; t->_uniform = 1; t->_sizeofElement = sizeof(RtString); } break; case '*': if ( strncmp(s, "*r", 2) == 0 ) { s += 2; t->_resource = 1; t->_vertex = 0; t->_varying = 0; t->_uniform = 0; t->_sizeofElement = 0; } break; default: _ri_Error(RIE_MISSINGDATA, RIE_ERROR, "Declaration has unknown type \"%s\"", s); return 0; break; } while ( isspace(*s) ) s ++; if ( *s == '[' ) { int n = 0; s ++; while ( isspace(*s) ) s ++; while ( isdigit(*s) ) { n *= 10; n += *(s ++) - '0'; } while ( isspace(*s) ) s ++; if ( *s == ']' ) s ++; t->_nelements *= n; } } t->_sizeof = t->_sizeofElement * t->_nelements; t->value = 0; t->offset = -1; return t; } #define RI(NAME,STR,TYPE) \ static const char _RIn_##NAME[] = STR; \ RtToken RI_##NAME = _RIn_##NAME; \ struct _rtToken _rit_##NAME = { 0, 0, 0, 0, 0, _RIn_##NAME, TYPE }; #include "ri/tokens.def" static RtToken *tokens[] = { #define RI(NAME,STR,TYPE) &RI_##NAME, #include "ri/tokens.def" 0 }; static rtToken toks[] = { #define RI(NAME,STR,TYPE) &_rit_##NAME, #include "ri/tokens.def" 0 }; rtToken _rtToken_globals; void _riInitTokens() { static int inited; int i; if ( inited ) return; inited ++; for ( i = 0; toks[i]; i ++ ) { _rtToken_init(toks[i]); toks[i]->prev = _rtToken_globals; _rtToken_globals = toks[i]; *(tokens[i]) = rtToken_to_RtToken(toks[i]); } } static __inline parseName(RtString name, RtString *namespace, RtString *table, RtString *var) { static char buf[128]; char *s; strcpy(buf, name); s = buf; *namespace = ""; *table = ""; *var = s; while ( *s ) { if ( *s == ':' ) { *s = '\0'; if ( ! (*namespace)[0] ) { *namespace = *var; *var = ++ s; } else if ( ! (*table)[0] ) { *table = *var; *var = ++ s; break; } } else s ++; } } rtToken RtToken_to_rtToken_safe(RtToken x) { rtToken t; t = RtToken_to_rtToken(x); if ( t->magic == rtToken_magic(t) ) return t; _riInitTokens(); { int i; for ( i = 0; toks[i]; i ++ ) { if ( strcmp(x, toks[i]->name) == 0 ) { return toks[i]; } } } /* IMPLEMENT: Error */ return 0; } static __inline char *_ri_strdup(const char *x) { return x ? strcpy(_ri_malloc(strlen(x) + 1), x) : 0; } rtToken _rtToken_RiDeclare(RtString name, RtString decl) { rtToken t; char *namespace, *table, *var; char *s; parseName(name, &namespace, &table, &var); t = _ri_calloc(sizeof(*t) - sizeof(t->namebuf) + strlen(name) + strlen(decl) + 6); t->name = t->namebuf; strcpy(t->name, var); t->namespace = strchr(t->name, '\0') + 1; strcpy(t->namespace, namespace); t->table = strchr(t->namespace, '\0') + 1; strcpy(t->table, table); t->decl = strchr(t->table, '\0') + 1; strcpy(t->decl, decl); if ( ! _rtToken_init(t) ) { _ri_free(t); t = 0; } return t; } void _rtToken_setValue(rtToken t, RtPointer value) { int i; if ( t->_resource ) { t->value = value; return; } if ( ! t->value ) { t->value = _ri_malloc(t->_sizeof); t->_malloced = 1; } else if ( t->_string ) { for ( i = 0; i < t->_nelements; i ++ ) { _ri_free(((RtString*)(t->value))[i]); } } memcpy(t->value, value, t->_sizeof); if ( t->_string ) { for ( i = 0; i < t->_nelements; i ++ ) { ((RtString*)(t->value))[i] = _ri_strdup(((RtString*)(t->value))[i]); } } } void _rtToken_unsetValue(rtToken t) { if ( t->_malloced ) { if ( t->_string ) { int i; for ( i = 0; i < t->_nelements; i ++ ) { _ri_free(((RtString*)(t->value))[i]); } } _ri_free(t->value); } t->value = 0; t->_malloced = 0; } void _rtToken_free(rtToken t) { _rtToken_unsetValue(t); _ri_free(t); } q3d0.1/src/q3d/common/token.h0100644000175200017560000000347106707531725016305 0ustar stephensstepheng#ifndef _token_h #define _token_h #ifndef __rcs_id__ #ifndef __rcs_id_common_token_h__ #define __rcs_id_common_token_h__ static const char __rcs_id_common_token_h[] = "$Id: token.h,v 1.3 1999/04/22 05:29:57 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "ri/ri.h" #define _rtTokenValue_SLOTS \ void *value; \ int offset; \ char _malloced; \ unsigned int _shaderInput; \ void *attribBlock; typedef struct _rtTokenValue { _rtTokenValue_SLOTS } rtTokenValue; typedef struct _rtToken { _rtTokenValue_SLOTS const char *name; const char *decl; const char *table; const char *namespace; unsigned int _vertex : 1; unsigned int _varying : 1; unsigned int _uniform : 1; unsigned int _integer : 1; unsigned int _float : 1; unsigned int _point : 1; unsigned int _color : 1; unsigned int _string : 1; unsigned int _resource : 1; unsigned _nelements; unsigned _sizeofElement; unsigned _sizeof; struct _rtToken *prev; /* stack */ void *magic; char namebuf[32]; } *rtToken; rtToken _rtToken_init(rtToken t); void _rtToken_free(rtToken t); #define rtToken_to_RtToken(x) ((RtToken)(&((x)->namebuf))) #define RtToken_to_rtToken(x) ((rtToken)(((char*)(x))-(size_t)(rtToken_to_RtToken((rtToken)0)))) rtToken RtToken_to_rtToken_safe(RtToken x); #define RI(NAME,STR,TYPE) extern struct _rtToken _rit_##NAME; #include "ri/tokens.def" void _riInitTokens(void); rtToken _rtToken_declare(RtString name, RtString decl); #define RT(x) (&_rit_##x) #define RTint(x) (*(RtInt*)(RT(x)->value)) #define RTfp(x) ((RtFloat*)(RT(x)->value)) #define RTfloat(x) (*(RtFloat*)(RT(x)->value)) #define RTcolor(x) (*(RtColor*)(RT(x)->value)) #define RTpoint(x) (*(RtPoint*)(RT(x)->value)) rtToken _rtToken_RiDeclare(RtString name, RtString decl); void _rtToken_setValue(rtToken t, RtPointer value); #endif q3d0.1/src/q3d/common/util.c0100644000175200017560000000114406663227120016120 0ustar stephensstepheng #ifndef __rcs_id__ #ifndef __rcs_id_common_util_c__ #define __rcs_id_common_util_c__ static const char __rcs_id_common_util_c[] = "$Id: util.c,v 1.3 1999/02/19 09:26:40 stephensk Exp $"; #endif #endif /* __rcs_id__ */ /* $Id: util.c,v 1.3 1999/02/19 09:26:40 stephensk Exp $ */ #include "common/util.h" #include RtInt _RtInt_sum(RtInt n, RtInt *v) { RtInt sum = 0; while ( n -- > 0 ) { sum += *(v ++); } return sum; } RtInt _RtInt_max(RtInt n, RtInt *v) { RtInt sum = v[0]; assert(n > 0); while ( -- n > 0 ) { if ( sum < *(++ v) ){ sum = *v; } } return sum; } q3d0.1/src/q3d/common/util.h0100644000175200017560000000056106663227120016127 0ustar stephensstepheng#ifndef _common_util_h #ifndef __rcs_id__ #ifndef __rcs_id_common_util_h__ #define __rcs_id_common_util_h__ static const char __rcs_id_common_util_h[] = "$Id: util.h,v 1.2 1999/02/19 09:26:40 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #define _common_util_h #include "ri/ri.h" RtInt _RtInt_sum(RtInt n, RtInt *v); RtInt _RtInt_max(RtInt n, RtInt *v); #endif q3d0.1/src/q3d/common/xform.c0100644000175200017560000000626007306135676016313 0ustar stephensstepheng#ifndef __rcs_id__ #ifndef __rcs_id_common_xform_c__ #define __rcs_id_common_xform_c__ static const char __rcs_id_common_xform_c[] = "$Id: xform.c,v 1.4 2001/06/02 10:11:10 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "xform.h" #include "mem.h" #include rtXform _rtXform_create(void) { rtXform x = _ri_calloc(sizeof(*x)); x->refCount = 1; return x; } void _rtXform_destroy(rtXform x) { if ( -- x->refCount == 0 ) { _ri_free(x); } } struct _rtMatrix { RtMatrix m; }; RtMatrix _RtMatrix_identity = { { 1, 0, 0, 0 }, { 0, 1, 0, 0 }, { 0, 0, 1, 0 }, { 0, 0, 0, 1 } }; void _rtXform_RiTransform(rtXform x, RtMatrix M) { *(struct _rtMatrix*)(x->M) = *(struct _rtMatrix *)M; x->M1_ok = x->M_toNDC_ok = 0; } void _rtXform_RiIdentity(rtXform x) { _rtXform_RiTransform(x, _RtMatrix_identity); } void _rtXform_RiConcatTransform(rtXform x, RtMatrix M) { RtMatrix c; #define a M #define b (x->M) #define R(i,j) c[i][j] = a[i][0] * b[0][j] + a[i][1] * b[1][j] + a[i][2] * b[2][j] + a[i][3] * b[3][j] #define S(i) R(i,0); R(i,1); R(i,2); R(i,3); S(0); S(1); S(2); S(3); #undef a #undef b #undef R #undef S _rtXform_RiTransform(x, c); } void _rtXform_RiPerspective(rtXform x, RtFloat a) { RtFloat tana = tan(a / (2 * M_PI / 180)); RtMatrix M = { { 1, 0, 0, 0 }, { 0, 1, 0, 0 }, { 0, 0, tana, tana }, { 0, 0, - tana, 0 } }; _rtXform_RiConcatTransform(x, M); } void _rtXform_RiRotate(rtXform x, RtFloat a, RtFloat dx, RtFloat dy, RtFloat dz) { RtFloat tana = tan(a / (2 * M_PI / 180)); RtMatrix M = { { 1, 0, 0, 0 }, { 0, 1, 0, 0 }, { 0, 0, tana, tana }, { 0, 0, - tana, 0 } }; _rtXform_RiConcatTransform(x, M); } void _rtXform_RiScale(rtXform x, RtFloat sx, RtFloat sy, RtFloat sz) { RtMatrix M = { { sx, 0, 0, 0 }, { 0, sy, 0, 0 }, { 0, 0, sz, 0 }, { 0, 0, 0, 1 } }; _rtXform_RiConcatTransform(x, M); } void _rtXform_RiTranslate(rtXform x, RtFloat sx, RtFloat sy, RtFloat sz) { RtMatrix M = { { 1, 0, 0, 0 }, { 0, 1, 0, 0 }, { 0, 0, 1, 0 }, { sx, sy, sz, 1 } }; _rtXform_RiConcatTransform(x, M); } static RtFloat zm = RI_EPSILON, zM = RI_INFINITY; void _rtXform_RiClipping(rtXform x, RtFloat near, RtFloat far) { x->zm = near; x->zM = far; x->M1_ok = x->M_toNDC_ok = 0; } void _rtXform_RiProjectionV(rtXform x, RtToken name, _RIV_PARMS) { RtFloat _zM_zm = 1.0 / (x->zM - x->zm); if ( name[0] == 'o' ) { RtMatrix M = { { 1, 0, 0, 0 }, { 0, 1, 0, 0 }, { 0, 0, _zM_zm, 0 }, { 0, 0, - x->zm * _zM_zm, 1 } }; _rtXform_RiConcatTransform(x, M); } else if ( name[0] == 'p' ) { RtFloat a = ( parmn && tokens[0][0] == 'f' ) ? *(RtFloat*) parms[0] : 90.0; RtFloat _1_tana = 1.0 / tan(a / (2. * M_PI / 180.0)); RtMatrix M = { { _1_tana, 0, 0, 0 }, { 0, _1_tana, 0, 0 }, { 0, 0, x->zM * _zM_zm, 0 }, { 0, 0, - x->zm * x->zM * _zM_zm, 1 } }; _rtXform_RiConcatTransform(x, M); } } q3d0.1/src/q3d/common/xform.h0100644000175200017560000000234506707531725016317 0ustar stephensstepheng#ifndef _common_xform_h #define _common_xform_h #ifndef __rcs_id__ #ifndef __rcs_id_common_xform_h__ #define __rcs_id_common_xform_h__ static const char __rcs_id_common_xform_h[] = "$Id: xform.h,v 1.3 1999/04/22 05:29:57 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "ri/ri.h" typedef struct _rtXform { RtToken fromSpace; RtToken toSpace; RtMatrix M; RtMatrix M1; RtMatrix M_toNDC; unsigned int copyOnWrite : 1; unsigned int M1_ok : 1; unsigned int M_toNDC_ok : 1; unsigned int refCount; RtFloat zm; /* RiClipping() */ RtFloat zM; /* RiClipping() */ struct _rtXform *prev; } *rtXform; rtXform _rtXform_create(void); void _rtXform_destroy(rtXform x); void _rtXform_RiTransform(rtXform x, RtMatrix m); void _rtXform_RiIdentity(rtXform x); void _rtXform_RiConcatTransform(rtXform x, RtMatrix m); void _rtXform_RiPerspective(rtXform x, RtFloat fov); void _rtXform_RiRotate(rtXform x, RtFloat a, RtFloat dx, RtFloat dy, RtFloat dz); void _rtXform_RiScale(rtXform x, RtFloat sx, RtFloat sy, RtFloat sz); void _rtXform_RiTranslate(rtXform x, RtFloat sx, RtFloat sy, RtFloat sz); void _rtXform_RiClipping(rtXform x, RtFloat near, RtFloat far); void _rtXform_RiProjectionV(rtXform x, RtToken name, _RIV_PARMS); #endif q3d0.1/src/q3d/device/0040755000175200017560000000000007306140063014744 5ustar stephensstephengq3d0.1/src/q3d/device/CVS/0040755000175200017560000000000007236675453015421 5ustar stephensstephengq3d0.1/src/q3d/device/CVS/Root0100644000175200017560000000003407236675453016261 0ustar stephensstepheng:local://cvs/ioncvs/cvsroot q3d0.1/src/q3d/device/CVS/Repository0100644000175200017560000000003007236675453017511 0ustar stephensstephenghome/ion/src/q3d/device q3d0.1/src/q3d/device/CVS/Entries0100644000175200017560000000001007236675453016741 0ustar stephensstephengD/x//// q3d0.1/src/q3d/device/x/0040755000175200017560000000000007306140063015213 5ustar stephensstephengq3d0.1/src/q3d/device/x/CVS/0040755000175200017560000000000007306135676015664 5ustar stephensstephengq3d0.1/src/q3d/device/x/CVS/Root0100644000175200017560000000003407236675453016530 0ustar stephensstepheng:local://cvs/ioncvs/cvsroot q3d0.1/src/q3d/device/x/CVS/Repository0100644000175200017560000000003207236675453017762 0ustar stephensstephenghome/ion/src/q3d/device/x q3d0.1/src/q3d/device/x/CVS/Entries0100644000175200017560000000016307306135676017215 0ustar stephensstepheng/Makefile/1.2/Fri Feb 19 09:26:40 1999// /x.h/1.3/Thu Apr 22 05:29:57 1999// /x.c/1.4/Sat Jun 2 10:11:10 2001// D q3d0.1/src/q3d/device/x/Makefile0100644000175200017560000000052406663227120016656 0ustar stephensstepheng# $Id: Makefile,v 1.2 1999/02/19 09:26:40 stephensk Exp $ DEFINES = -DSHM CFLAGS = $(DEFINES) -I../../common -I../../qr -I../.. -I. CFILES = \ x.c OFILES = $(CFILES:.c=.o) $(OTHER_OFILES) all : early-targets ../x.o .PHONY: all ../x.o : $(OFILES) Makefile $(CC) -nostdlib -r -o $@ $(OFILES) early-targets : .PHONY: early-targets q3d0.1/src/q3d/device/x/x.c0100644000175200017560000002023407306135676015642 0ustar stephensstepheng#ifndef __rcs_id__ #ifndef __rcs_id_x_x_c__ #define __rcs_id_x_x_c__ static const char __rcs_id_x_x_c[] = "$Id: x.c,v 1.4 2001/06/02 10:11:10 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "x.h" #include "ri/ri.h" #include "common/error.h" #include "common/mem.h" #ifdef SHM #include #include #endif /* * Error handling. */ static int riXErrorFlag = 0; static int riHandleXError( Display *dpy, XErrorEvent *event ) { riXErrorFlag = 1; return 0; } static int check_for_xshm( Display *display ) { #ifdef SHM int major, minor, ignore; Bool pixmaps; if (XQueryExtension( display, "MIT-SHM", &ignore, &ignore, &ignore )) { if (XShmQueryVersion( display, &major, &minor, &pixmaps )==True) { return (pixmaps==True) ? 2 : 1; } else { return 0; } } else { return 0; } #else /* Can't compile XSHM support */ return 0; #endif } #define display dev->_display #define screen_num dev->_screen_num static int get_rgb_map(rtXDevice dev) { XStandardColormap *bmi; XColor *exact_defs; XSetWindowAttributes attrib; unsigned long attribmask; int i, j, k, l; int ncells; XVisualInfo *vlist, vinfo_template, *v; int num_vis; int count; #define USE_DEFAULT_COLORMAP 1 #define USE_STANDARD_COLORMAP 0 int strategy = USE_STANDARD_COLORMAP; if ( XGetRGBColormap(display, RootWindow(display, screen_num), &bmi, &count, XA_RGB_BEST_MAP) == 0 ) { _riError(RIE_SYSTEM, RIE_WARNING, "XA_RGB_BEST_MAP colormap property not set."); get_color(); strategy = USE_DEFAULT_COLORMAP; } else if ( bmi->colormap ) { if ( bmi->red_max == 0 ) { _riError(RIE_SYSTEM, RIE_WARNING, "XA_RGB_BEST_MAP colormap property set, but is missing data"); strategy = USE_DEFAULT_COLORMAP; } else { attrib.colormap = bmi->colormap; } } else if ( bmi->visualid == 0 ) { _riError(RIE_SYSTEM, RIE_WARNING, "XA_RGB_BEST_MAP colormap property set, but is missing data"); strategy = USE_DEFAULT_COLORMAP; } else { vlist = XGetVisualInfo(display, VisualNoMask, &vinfo_template, &num_vis); for ( v = vlist; v < vlist + num_vis; v ++ ) { if ( v->visualid == bmi->visualid ) { dev->visual = v->visual; break; } } bmi->colormap = XCreateColormap(display, RootWindow(display, screen_num), dev->visual, AllocAll); if ( bmi->colormap == DefaultColormap(display, screen_num) ) { _riError(RIE_SYSTEM, RIE_WARNING, "hardware colormap is immutable"); } attrib.colormap = bmi->colormap; ncells = bmi->base_pixel + ((bmi->red_max + 1) * (bmi->green_max + 1) * (bmi->blue_max + 1)); exact_defs = (XColor*) _ri_malloc(sizeof(exact_defs[0]) * ncells); l = bmi->base_pixel; for ( i = 0; i < bmi->blue_max; i ++ ) { for ( j = 0; j < bmi->green_max; j ++ ) { for ( k = 0; k < bmi->red_max; k ++ ) { exact_defs[l].red = 0xffff * k / bmi->red_max; exact_defs[l].green = 0xffff * j / bmi->green_max; exact_defs[l].blue = 0xffff * i / bmi->blue_max; l ++; } } } XStoreColors(display, bmi->colormap, exact_defs, count); } dev->colormap = *bmi; return 0; } static int alloc_shm_back_buffer(rtXDevice dev) { #ifdef SHM /* * We have to do a _lot_ of error checking here to be sure we can * really use the XSHM extension. It seems different servers trigger * errors at different points if the extension won't work. Therefore * we have to be very careful... */ GC gc; int (*old_handler)( Display *, XErrorEvent * ); dev->backimage = XShmCreateImage( display, dev->visual, dev->depth, ZPixmap, NULL, &dev->shminfo, dev->width, dev->height ); if (dev->backimage == NULL) { error("alloc_back_buffer: Shared memory error (XShmCreateImage), disabling."); dev->shm = 0; return 0; } dev->shminfo.shmid = shmget( IPC_PRIVATE, dev->backimage->bytes_per_line * dev->backimage->height, IPC_CREAT|0777 ); if (dev->shminfo.shmid < 0) { if (getenv("RI_DEBUG")) perror("alloc_back_buffer"); XDestroyImage( dev->backimage ); dev->backimage = NULL; error("alloc_back_buffer: Shared memory error (shmget), disabling."); dev->shm = 0; return 0; } dev->shminfo.shmaddr = dev->backimage->data = (char*)shmat( dev->shminfo.shmid, 0, 0 ); if (dev->shminfo.shmaddr == (char *) -1) { if (getenv("RI_DEBUG")) perror("alloc_back_buffer"); XDestroyImage( dev->backimage ); shmctl( dev->shminfo.shmid, IPC_RMID, 0 ); dev->backimage = NULL; error("alloc_back_buffer: Shared memory error (shmat), disabling."); dev->shm = 0; return 0; } dev->shminfo.readOnly = False; riXErrorFlag = 0; old_handler = XSetErrorHandler( riHandleXError ); /* This may trigger the X protocol error we're ready to catch: */ XShmAttach( display, &dev->shminfo ); XSync( display, False ); if (riXErrorFlag) { /* we are on a remote display, this error is normal, don't print it */ XFlush( display ); riXErrorFlag = 0; XDestroyImage( dev->backimage ); shmdt( dev->shminfo.shmaddr ); shmctl( dev->shminfo.shmid, IPC_RMID, 0 ); dev->backimage = NULL; dev->shm = 0; (void) XSetErrorHandler( old_handler ); return 0; } shmctl( dev->shminfo.shmid, IPC_RMID, 0 ); /* nobody else needs it */ /* Finally, try an XShmPutImage to be really sure the extension works */ gc = XCreateGC( display, dev->frontbuffer, 0, NULL ); XShmPutImage( display, dev->frontbuffer, gc, dev->backimage, 0, 0, 0, 0, 1, 1 /*one pixel*/, False ); XSync( display, False ); XFreeGC( display, gc ); (void) XSetErrorHandler( old_handler ); if (riXErrorFlag) { XFlush( display ); riXErrorFlag = 0; XDestroyImage( dev->backimage ); shmdt( dev->shminfo.shmaddr ); shmctl( dev->shminfo.shmid, IPC_RMID, 0 ); dev->backimage = NULL; dev->shm = 0; return 0; } return 1; #else /* Can't compile XSHM support */ return 0; #endif } rtXDevice _x_riDisplayV() { rtXDevice dev; dev = _ri_calloc(sizeof(*dev)); dev->display_name = _ri_strdup(getenv("DISPLAY")); if ( ! display ) { display = XOpenDisplay(dev->display_name); } if ( ! display ) { _riError(RIE_SYSTEM, RIE_ERROR, "XOpenDisplay('%s')", dev->display_name ? dev->display_name : ""); _ri_free(dev); return 0; } screen_num = DefaultScreen(display); dev->visual = DefaultVisual(display, screen_num); dev->shm = check_for_xshm(display); { XGCValues gcvalues; gcvalues.graphics_exposures = False; dev->cleargc = XCreateGC( display, dev->frontbuffer, GCGraphicsExposures, &gcvalues); XSetFunction( display, dev->cleargc, GXcopy ); } /* get_color_map(); */ return dev; } RtVoid _x_riDisplayFlush(RtPointer _dev) { rtXDevice dev = _dev; if (dev->backimage) { /* Copy Ximage from host's memory to server's window */ #ifdef SHM if (dev->shm) { XShmPutImage( display, dev->frontbuffer, dev->cleargc, dev->backimage, 0, 0, 0, 0, dev->width, dev->height, False ); /* wait for finished event??? */ } else #endif { XPutImage( display, dev->frontbuffer, dev->cleargc, dev->backimage, 0, 0, 0, 0, dev->width, dev->height ); } } else { /* Copy pixmap to window on server */ XCopyArea( display, dev->backpixmap, /* source drawable */ dev->frontbuffer, /* dest. drawable */ dev->cleargc, 0, 0, dev->width, dev->height, /* source region */ 0, 0 /* dest region */ ); } XSync( display, False ); } RtVoid _x_riDisplayDestroy(RtPointer _dev) { rtXDevice dev = _dev; if (dev->cleargc) XFreeGC( display, dev->cleargc ); if (dev->backimage) { #ifdef SHM if (dev->shm) { XShmDetach( display, &dev->shminfo ); XDestroyImage( dev->backimage ); shmdt( dev->shminfo.shmaddr ); } else #endif XDestroyImage( dev->backimage ); } if ( dev->backpixmap ) { XFreePixmap( display, dev->backpixmap ); } } q3d0.1/src/q3d/device/x/x.h0100644000175200017560000000146306707531725015651 0ustar stephensstepheng#ifndef _device_x_x_h #define _device_x_x_h #ifndef __rcs_id__ #ifndef __rcs_id_x_x_h__ #define __rcs_id_x_x_h__ static const char __rcs_id_x_x_h[] = "$Id: x.h,v 1.3 1999/04/22 05:29:57 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include #include #include #include #ifndef SHM #define SHM 1 #endif #ifdef SHM #include #endif typedef struct _rtXDevice { const char *display_name; Display *_display; int _screen_num; Visual *visual; Window win; XStandardColormap colormap; unsigned long RtoPixel[512], GtoPixel[512], BtoPixel[512]; int shm; #ifdef SHM XShmSegmentInfo shminfo; #endif XImage *backimage; Pixmap backpixmap; Drawable frontbuffer; GC cleargc; int width, height, depth; } *rtXDevice; #endif q3d0.1/src/q3d/dispatch/0040755000175200017560000000000007306140063015304 5ustar stephensstephengq3d0.1/src/q3d/dispatch/CVS/0040755000175200017560000000000007236675453015761 5ustar stephensstephengq3d0.1/src/q3d/dispatch/CVS/Root0100644000175200017560000000003407236675453016621 0ustar stephensstepheng:local://cvs/ioncvs/cvsroot q3d0.1/src/q3d/dispatch/CVS/Repository0100644000175200017560000000003207236675453020053 0ustar stephensstephenghome/ion/src/q3d/dispatch q3d0.1/src/q3d/dispatch/CVS/Entries0100644000175200017560000000037007236675453017312 0ustar stephensstepheng/dispatch.c/1.2/Fri Feb 19 09:26:41 1999// /dispatch.h/1.2/Fri Feb 19 09:26:41 1999// /nocntx.c/1.2/Fri Feb 19 09:26:41 1999// /notimpl.c/1.2/Fri Feb 19 09:26:41 1999// /null.c/1.2/Fri Feb 19 09:26:41 1999// /riv.c/1.3/Mon Jun 28 14:05:06 1999// D q3d0.1/src/q3d/dispatch/dispatch.c0100644000175200017560000000265506663227121017262 0ustar stephensstepheng #ifndef __rcs_id__ #ifndef __rcs_id_dispatch_dispatch_c__ #define __rcs_id_dispatch_dispatch_c__ static const char __rcs_id_dispatch_dispatch_c[] = "$Id: dispatch.c,v 1.2 1999/02/19 09:26:41 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "ri/ri.h" #include "dispatch.h" #include void _rtDispatch_overlay(rtDispatch _dst, rtDispatch _src) { void **dst = (void**) _dst, **src = (void**) _src; size_t size = sizeof(*_dst) / sizeof(dst[0]); while ( size -- ) { if ( *dst == 0 ) *dst = *src; dst ++; src ++; } } extern struct _rtDispatch __ri_dispatch_NoContext, __ri_dispatch_Null; rtDispatch _ri_dispatch_common = &__ri_dispatch_Null; rtDispatch _ri_dispatch = &__ri_dispatch_NoContext; RtToken _ri_funcName = ""; #define _Ri_NO_CONTEXT /* NOT THREAD SAFE */ static const void * handle; #define SET_RESULT(X) handle = (X) #define Ri(RTN,NAME,ARGS) \ RTN Ri##NAME( _RIPARMS(ARGS) ) \ { \ _ri_funcName = #NAME; \ _RIVAL(RTN,SET_RESULT,(*_ri_dispatch_common->_##NAME)(_RIARGS(ARGS))); \ (*_ri_dispatch->_##NAME)(_RIARGS(ARGS)); \ _RIVAL(RTN,return,handle); \ } #define RiV(RTN,NAME,ARGS) \ RTN Ri##NAME##V( _RIPARMS(ARGS), _RIV_PARMS ) \ { \ _ri_funcName = #NAME; \ _RIVAL(RTN,SET_RESULT,(*_ri_dispatch_common->_##NAME##V)(_RIARGS(ARGS), _RIV_ARGS)); \ (*_ri_dispatch->_##NAME##V)(_RIARGS(ARGS), _RIV_ARGS); \ _RIVAL(RTN,return,handle); \ } #include "ri/procs.def" q3d0.1/src/q3d/dispatch/dispatch.h0100644000175200017560000000160506663227121017261 0ustar stephensstepheng#ifndef _dispatch_h #ifndef __rcs_id__ #ifndef __rcs_id_dispatch_dispatch_h__ #define __rcs_id_dispatch_dispatch_h__ static const char __rcs_id_dispatch_dispatch_h[] = "$Id: dispatch.h,v 1.2 1999/02/19 09:26:41 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #define _dispatch_h #include "ri/ri.h" typedef struct _rtDispatch { const char *name; #define Ri(RTN,NAME,ARGS) RTN (*_##NAME)(_RIPARMS(ARGS)); #define RiV(RTN,NAME,ARGS) RTN (*_##NAME##V)(_RIPARMS(ARGS), RtInt parmn, RtToken *tokens, RtPointer *parms); #include "ri/procs.def" void *_ununsed; } *rtDispatch; extern rtDispatch _ri_dispatch, _ri_dispatch_common; extern RtToken _ri_funcName; void _rtDispatch_overlay(rtDispatch _dst, rtDispatch _src); extern rtDispatch _ri_dispatch_NoContext(), _ri_dispatch_NotImplemented(), _ri_dispatch_Null(), _ri_dispatch_ri(), _ri_dispatch_qr(), _ri_dispatch_archive(); #endif q3d0.1/src/q3d/dispatch/nocntx.c0100644000175200017560000000153506663227121016770 0ustar stephensstepheng #ifndef __rcs_id__ #ifndef __rcs_id_dispatch_nocntx_c__ #define __rcs_id_dispatch_nocntx_c__ static const char __rcs_id_dispatch_nocntx_c[] = "$Id: nocntx.c,v 1.2 1999/02/19 09:26:41 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "ri/ri.h" #include "dispatch.h" #include "common/error.h" #define Ri(RTN,NAME,ARGS) \ static RTN _nc_##NAME( _RIPARMS(ARGS) ) \ { \ _riError(RIE_NOTSTARTED, RIE_ERROR, "No context"); \ } #define RiV(RTN,NAME,ARGS) \ static RTN _nc_##NAME##V( _RIPARMS(ARGS), _RIV_PARMS ) \ { \ _riError(RIE_NOTSTARTED, RIE_ERROR, "No context"); \ } #include "ri/procs.def" struct _rtDispatch __ri_dispatch_NoContext = { "noContext", #define Ri(RTN,NAME,ARGS) &_nc_##NAME, #define RiV(RTN,NAME,ARGS) &_nc_##NAME##V, #include "ri/procs.def" 0 }; rtDispatch _ri_dispatch_NoContext() { return &__ri_dispatch_NoContext; } q3d0.1/src/q3d/dispatch/notimpl.c0100644000175200017560000000137706663227121017145 0ustar stephensstepheng #ifndef __rcs_id__ #ifndef __rcs_id_dispatch_notimpl_c__ #define __rcs_id_dispatch_notimpl_c__ static const char __rcs_id_dispatch_notimpl_c[] = "$Id: notimpl.c,v 1.2 1999/02/19 09:26:41 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "ri/ri.h" #include "dispatch.h" #include "common/error.h" #include "common/context.h" #define Ri(RTN,NAME,ARGS) \ static RTN _ni_##NAME( _RIPARMS(ARGS) ) \ { \ } #define RiV(RTN,NAME,ARGS) \ static RTN _ni_##NAME##V( _RIPARMS(ARGS), _RIV_PARMS ) \ { \ } #include "ri/procs.def" rtDispatch _ri_dispatch_NotImplemented() { static struct _rtDispatch _d = { "", #define Ri(RTN,NAME,ARGS) &_ni_##NAME, #define RiV(RTN,NAME,ARGS) &_ni_##NAME##V, #include "ri/procs.def" 0 }; return &_d; } q3d0.1/src/q3d/dispatch/null.c0100644000175200017560000000150606663227121016427 0ustar stephensstepheng #ifndef __rcs_id__ #ifndef __rcs_id_dispatch_null_c__ #define __rcs_id_dispatch_null_c__ static const char __rcs_id_dispatch_null_c[] = "$Id: null.c,v 1.2 1999/02/19 09:26:41 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "dispatch.h" #include "common/error.h" #include "common/context.h" static void *handle = 0; #define Ri(RTN,NAME,ARGS) \ static RTN _null_##NAME( _RIPARMS(ARGS) ) \ { \ _RIVAL(RTN,return,handle); \ } #define RiV(RTN,NAME,ARGS) \ static RTN _null_##NAME##V( _RIPARMS(ARGS), _RIV_PARMS ) \ { \ _RIVAL(RTN,return,handle); \ } #include "ri/procs.def" struct _rtDispatch __ri_dispatch_Null = { "", #define Ri(RTN,NAME,ARGS) &_null_##NAME, #define RiV(RTN,NAME,ARGS) &_null_##NAME##V, #include "ri/procs.def" 0 }; rtDispatch _ri_dispatch_Null() { return &__ri_dispatch_Null; } q3d0.1/src/q3d/dispatch/riv.c0100644000175200017560000000313506735700422016255 0ustar stephensstepheng #ifndef __rcs_id__ #ifndef __rcs_id_dispatch_riv_c__ #define __rcs_id_dispatch_riv_c__ static const char __rcs_id_dispatch_riv_c[] = "$Id: riv.c,v 1.3 1999/06/28 14:05:06 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "ri/ri.h" #include static RtInt _getparmn(va_list vap) { RtInt parmn = 0; while ( va_arg(vap, RtToken) != RI_NULL ) { va_arg(vap, RtPointer); parmn ++; } return parmn; } static void _fillparms(va_list vap, RtToken *tokens, RtPointer *parms) { while ( (*(tokens ++) = va_arg(vap, RtToken)) != RI_NULL ) { *(parms ++) = va_arg(vap, RtPointer); } *(parms ++) = RI_NULL; } #define Ri(RTN,NAME,ARGS) #define RiV(RTN,NAME,ARGS) \ RTN Ri##NAME( _RIPARMS(ARGS), ... ) { \ _RIV_DECLS; \ \ { \ va_list vap; \ va_start(vap,_RILASTARG(ARGS)); \ parmn = _getparmn(vap); \ tokens = alloca(sizeof(tokens[0]) * (parmn + 1)); \ parms = alloca(sizeof(parms[0]) * (parmn + 1)); \ _fillparms(vap, tokens, parms); \ va_end(vap); \ } \ \ _RIVAL(RTN,return,Ri##NAME##V(_RIARGS(ARGS), _RIV_ARGS)); \ } #include "ri/procs.def" /* The only odd-balls that do not use parmn, tokens, parms as the Ri*V last arguments. */ RtVoid RiMotionBegin(RtInt n, ...) { RtFloat *t = alloca(sizeof(t[0]) * n); va_list vap; va_start(vap,n); { RtInt i; for ( i = 0; i < n; i ++ ) { t[i] = va_arg(vap, double); } } RiMotionBeginV(n, t); va_end(vap); } RtVoid RiArchiveRecord(RtToken type, RtString format, ...) { va_list vap; va_start(vap,format); RiArchiveRecordV(type, format, vap); va_end(vap); } q3d0.1/src/q3d/macro/0040755000175200017560000000000007236675453014630 5ustar stephensstephengq3d0.1/src/q3d/macro/CVS/0040755000175200017560000000000007236675453015263 5ustar stephensstephengq3d0.1/src/q3d/macro/CVS/Root0100644000175200017560000000003407236675453016123 0ustar stephensstepheng:local://cvs/ioncvs/cvsroot q3d0.1/src/q3d/macro/CVS/Repository0100644000175200017560000000002707236675453017361 0ustar stephensstephenghome/ion/src/q3d/macro q3d0.1/src/q3d/macro/CVS/Entries0100644000175200017560000000017707236675453016621 0ustar stephensstepheng/context.c/1.2/Fri Feb 19 09:26:41 1999// /dispatch.c/1.3/Mon Jun 28 14:05:09 1999// /macro.h/1.3/Mon Jun 28 14:05:11 1999// D q3d0.1/src/q3d/macro/context.c0100644000175200017560000000100006663227121016430 0ustar stephensstepheng #ifndef __rcs_id__ #ifndef __rcs_id_macro_context_c__ #define __rcs_id_macro_context_c__ static const char __rcs_id_macro_context_c[] = "$Id: context.c,v 1.2 1999/02/19 09:26:41 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "macro.h" #include "common/context.h" #include "common/error.h" #include RtToken _ri_RiMacroBeginV(RtString handle, _RIV_PARMS) { return handle; } RtToken _ri_RiMacroEnd(void) { return handle; } RtVoid _ri_RiMacroInstanceV(RtString handle, _RIV_PARMS) { } q3d0.1/src/q3d/macro/dispatch.c0100644000175200017560000000725206735700425016565 0ustar stephensstepheng #ifndef __rcs_id__ #ifndef __rcs_id_macro_dispatch_c__ #define __rcs_id_macro_dispatch_c__ static const char __rcs_id_macro_dispatch_c[] = "$Id: dispatch.c,v 1.3 1999/06/28 14:05:09 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "macro/macro.h" #include "dispatch/dispatch.h" #include "archive.h" #include "common/token.h" #include "common/util.h" #include "common/context.h" #include #include /****************************************************************************/ #define MA(X) ma_##X #define ma_L0() #define ma_L1(t1,n1) _mE->n1 #define ma_L2(t1,n1,t2,n2) _mE->n1, _mE->n2 #define ma_L3(t1,n1,t2,n2,t3,n3) _mE->n1, _mE->n2, _mE->n3 #define ma_L4(t1,n1,t2,n2,t3,n3,t4,n4) _mE->n1, _mE->n2, _mE->n3, _mE->n4 #define ma_L5(t1,n1,t2,n2,t3,n3,t4,n4,t5,n5) _mE->n1, _mE->n2, _mE->n3, _mE->n4, _mE->n5 #define ma_L6(t1,n1,t2,n2,t3,n3,t4,n4,t5,n5,t6,n6) _mE->n1, _mE->n2, _mE->n3, _mE->n4, _mE->n5, _mE->n6 #define Ri(RTN,NAME,ARGS) \ static RtVoid _ma_##NAME( RtPointer _p ) \ { \ rtMacroElement_##NAME _mE = _p; \ Ri##NAME(MA(ARGS)); \ } #define RiV(RTN,NAME,ARGS) \ static RtVoid _ma_##NAME(RtPointer _p ) \ { \ rtMacroElement_##NAME _mE = _p; \ Ri##NAME##V(MA(ARGS), _ME->parmn, _mE->tokens, _mE->parms); \ } #define _Ri_NO_CONTEXT #define _Ri_NO_PTRS #include "ri/procs.def" /****************************************************************************/ #define Ri(RTN,NAME,ARGS) \ static RtVoid _md_##NAME( RtPointer _p ) \ { \ _ri_free(_p); \ } #define RiV(RTN,NAME,ARGS) \ static RtVoid _md_##NAME(RtPointer _p ) \ { \ _ri_free(_p->tokens); \ _ri_free(_p->parms); \ /* IMPLEMENT: free string and other parm elements. */ \ _ri_free(_p); \ } #define _Ri_NO_CONTEXT #define _Ri_NO_PTRS #include "ri/procs.def" /****************************************************************************/ #define Ri(RTN,NAME,ARGS) \ static RtVoid _mm_##NAME = { _ma_##NAME, _md_##NAME }; #define RiV(RTN,NAME,ARGS) Ri(RTN,NAME,ARGS) #define _Ri_NO_CONTEXT #define _Ri_NO_PTRS #include "ri/procs.def" /****************************************************************************/ #define MS(X) ms_##X #define ms_L0() #define ms_L1(t1,n1) _mE->n1 = n1; #define ms_L2(t1,n1,t2,n2) _mE->n1 = n1; _mE->n2 = n2; #define ms_L3(t1,n1,t2,n2,t3,n3) _mE->n1 = n1; _mE->n2 = n2; _mE->n3 = n3; #define ms_L4(t1,n1,t2,n2,t3,n3,t4,n4) _mE->n1 = n1; _mE->n2 = n2; _mE->n3 = n3; _mE->n4 = n4 #define ms_L5(t1,n1,t2,n2,t3,n3,t4,n4,t5,n5) _mE->n1 = n1; _mE->n2 = n2; _mE->n3 = n3; _mE->n4 = n4; _mE->n5 = n5; #define ms_L6(t1,n1,t2,n2,t3,n3,t4,n4,t5,n5,t6,n6) _mE->n1 = n1; _mE->n2 = n2; _mE->n3 = n3; _mE->n4 = n4; _mE->n5 = n5; _mE->n6 = n6; static const void * handle; #define Ri(RTN,NAME,ARGS) \ static RTN _m_##NAME( _RIPARMS(ARGS) ) \ { \ rtMacroElement_##NAME _mE = _ri_malloc(sizeof(*_mE)); \ _ri_funcName = #NAME; \ _mE->super.methods = _mm_##NAME; \ MS(ARGS); \ _macro_append(_mE); \ } #define RiV(RTN,NAME,ARGS) \ static RTN _m_##NAME( _RIPARMS(ARGS), _RIV_PARMS ) \ { \ rtMacroElement_##NAME _mE = _ri_malloc(sizeof(*_mE)); \ _ri_funcName = #NAME; \ _mE->super.methods = _mm_##NAME; \ MS(ARGS); \ _macro_append(_mE); \ } #define _Ri_NO_CONTEXT #define _Ri_NO_PTRS #include "ri/procs.def" /****************************************************************************/ rtDispatch _ri_dispatch_macro() { static struct _rtDispatch _d = { "macro" }; static int inited; if ( ! inited ) { inited ++; #define Ri(RTN,NAME,ARGS) _d._##NAME = &_m_Ri##NAME; #define RiV(RTN,NAME,ARGS) _d._##NAME##V = &_m_Ri##NAME, #define _Ri_NO_CONTEXT #define _Ri_NO_PTRS #include "ri/procs.def" _rtDispatch_overlay(&_d, _ri_dispatch_Null()); } return &_d; } q3d0.1/src/q3d/macro/macro.h0100644000175200017560000000205506735700427016072 0ustar stephensstepheng#ifndef _macro_macro_h #define _macro_macro_h #ifndef __rcs_id__ #ifndef __rcs_id_macro_macro_h__ #define __rcs_id_macro_macro_h__ static const char __rcs_id_macro_macro_h[] = "$Id: macro.h,v 1.3 1999/06/28 14:05:11 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "ri/ri.h" typedef struct _rtMacroElementMethods { RtVoid (*apply)(RtPointer macroElement); RtVoid (*destroy)(RtPointer macroElement); } *tMacroElementMethods; typedef struct _rtMacroElement { rtMacroElementMethods methods; struct _rtMatroElement *next; } rtMacroElement; typedef struct _rtMacro { struct _rtMacroElement _super; RtToken handle; rtMacroElement *head, *tail; } *rtMacro; #define Ri(RTN,NAME,ARGS) \ typedef struct _rtMacroElement_##NAME { \ struct _rtMacroElement _super; \ _RIDECLS(ARGS) \ } *rtMacro_##NAME; #define RiV(RTN,NAME,ARGS) \ typedef struct _rtMacroElement_##NAME##V { \ struct _rtMacroElement _super; \ _RIDECLS(ARGS) \ _RIV_DECLS; \ RtInt _nvertices, _nvarying, _nuniform; \ } *rtMacro_##NAME##V; #include "ri/procs.def" #endif q3d0.1/src/q3d/qr/0040755000175200017560000000000007306140063014127 5ustar stephensstephengq3d0.1/src/q3d/qr/CVS/0040755000175200017560000000000007306135676014600 5ustar stephensstephengq3d0.1/src/q3d/qr/CVS/Root0100644000175200017560000000003407236675453015444 0ustar stephensstepheng:local://cvs/ioncvs/cvsroot q3d0.1/src/q3d/qr/CVS/Repository0100644000175200017560000000002407236675453016677 0ustar stephensstephenghome/ion/src/q3d/qr q3d0.1/src/q3d/qr/CVS/Entries0100644000175200017560000000053207306135676016131 0ustar stephensstepheng/context.c/1.3/Thu Apr 22 05:29:58 1999// /dispatch.c/1.3/Thu Apr 22 05:29:58 1999// /dopixel.c/1.2/Fri Feb 19 09:26:42 1999// /qr.h/1.3/Thu Apr 22 05:29:58 1999// /shader.c/1.3/Thu Apr 22 05:29:58 1999// /signbit.c/1.2/Fri Feb 19 09:26:42 1999// D/shaders//// /polyscan.c/1.4/Sat Jun 2 10:11:10 2001// /signbit.h/1.3/Sat Jun 2 09:39:00 2001// q3d0.1/src/q3d/qr/context.c0100644000175200017560000000063106707531726015772 0ustar stephensstepheng#ifndef __rcs_id__ #ifndef __rcs_id_qr_context_c__ #define __rcs_id_qr_context_c__ static const char __rcs_id_qr_context_c[] = "$Id: context.c,v 1.3 1999/04/22 05:29:58 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "qr.h" RtToken _qr_RiBeginV(RtString handle, _RIV_PARMS) { return handle; } RtToken _qr_RiContextV(RtToken handle, _RIV_PARMS) { return handle; } RtVoid _qr_RiEnd(void) { } q3d0.1/src/q3d/qr/dispatch.c0100644000175200017560000000115606707531726016110 0ustar stephensstepheng#ifndef __rcs_id__ #ifndef __rcs_id_qr_dispatch_c__ #define __rcs_id_qr_dispatch_c__ static const char __rcs_id_qr_dispatch_c[] = "$Id: dispatch.c,v 1.3 1999/04/22 05:29:58 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "ri/ri.h" #include "dispatch/dispatch.h" #include "qr.h" rtDispatch _ri_dispatch_qr() { static int inited; static struct _rtDispatch _d = { "qr" }; if ( ! inited ) { inited ++; #define F(X) _d._##X = _qr_Ri##X; F(BeginV) F(ContextV) F(End) F(SurfaceV) F(PolygonV) #undef F _rtDispatch_overlay(&_d, _ri_dispatch_Null()); } return &_d; } q3d0.1/src/q3d/qr/dopixel.c0100644000175200017560000000170606663227122015747 0ustar stephensstepheng #ifndef __rcs_id__ #ifndef __rcs_id_qr_dopixel_c__ #define __rcs_id_qr_dopixel_c__ static const char __rcs_id_qr_dopixel_c[] = "$Id: dopixel.c,v 1.2 1999/02/19 09:26:42 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #if STATS _qr_stats.npixels ++; #endif /* Divide z by w */ _pw[2] = _p[2] * _p[3]; /* Check against zbuffer */ { rtZValue pwz = _pw[2]; if ( *zbuf >= pwz ) { /* Divide varying by w */ { RtFloat *PW = _pw + 4, *P = _p + 4; DO(_valuesPerPoint - 4, *(PW ++) = *(P ++) * _p[3]); } /* Call shader */ (*_qr_surfaceShader->func)(); /* Check for transparency */ if ( RTcolor(_Oi)[0] || RTcolor(_Oi)[1] || RTcolor(_Oi)[2] ) { *pix = RTcolor(_Ci)[0]; *zbuf = pwz; } } } /* Increment pixel and zbuffer points */ pix += _riImage->bytesPerPixel; zbuf ++; /* Increment point */ { RtFloat *P = _p + 2, *PDX = _pdx + 2; _p[0] ++; DO(_valuesPerPoint - 2, *(P ++) += *(PDX ++)); } q3d0.1/src/q3d/qr/polyscan.c0100644000175200017560000003310507306135676016140 0ustar stephensstepheng#ifndef __rcs_id__ #ifndef __rcs_id_qr_polyscan_c__ #define __rcs_id_qr_polyscan_c__ static const char __rcs_id_qr_polyscan_c[] = "$Id: polyscan.c,v 1.4 2001/06/02 10:11:10 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "qr.h" #include "common/mem.h" #include #include /***************************************************************************/ /* Current output device */ rtImage *_riImage; #ifndef STATS #define STATS 1 #endif #ifndef DEBUG_PRINT #define DEBUG_PRINT 0 #endif static struct qr_stats { unsigned long npolys, npolys_out, npolys_in, npolys_clipped, npolys_drawn, nrows, npixels; int t0, t1, dt; } _qr_stats; void _qr_stats_begin() { _qr_stats.t0 = time(0); } void _qr_stats_end() { _qr_stats.t1 = time(0); _qr_stats.dt = _qr_stats.t1 - _qr_stats.t0; if ( _qr_stats.dt == 0 ) _qr_stats.dt ++; printf("npolys %u\n", _qr_stats.npolys); printf("npolys_out %u\n", _qr_stats.npolys_out); printf("npolys_in %u\n", _qr_stats.npolys_in); printf("npolys_clipped %u\n", _qr_stats.npolys_clipped); printf("npolys_drawn %u\n", _qr_stats.npolys_drawn); printf("nrows %u\n", _qr_stats.nrows); printf("npixels %u\n", _qr_stats.npixels); printf("npolys/sec %g\n", (double) _qr_stats.npolys / (double)(_qr_stats.dt)); printf("npixels/poly %g\n", (double) _qr_stats.npixels / _qr_stats.npolys_drawn); printf("npixels/row %g\n", (double) _qr_stats.npixels / _qr_stats.nrows); printf("npixels/sec %g\n", (double) _qr_stats.npixels / (double)(_qr_stats.dt)); } /* ** Use a globally allocated arrays for interpolated values */ #define DO(N,X) \ switch ( N ) { \ default: \ case 16: X; \ case 15: X; \ case 14: X; \ case 13: X; \ case 12: X; \ case 11: X; \ case 10: X; \ case 9: X; \ case 8: X; \ case 7: X; \ case 6: X; \ case 5: X; \ case 4: X; \ case 3: X; \ case 2: X; \ case 1: X; \ case 0: break; } static unsigned int _valuesPerPoint = 0; static RtFloat *_p, /* scanline point */ *_pw, /* _p * _p[3] */ *_pdx, /* scanline x delta */ *_p0, *_p1, /* span points */ *_p0dy, *_p1dy; /* span y deltas */ static void _setValuesPerPoint(int x) { if ( x > 16 ) abort(); if ( _valuesPerPoint < x) { _ri_free(_pw); _pw = _ri_malloc(sizeof(_pw[0]) * _valuesPerPoint * 7); _p = _pw + _valuesPerPoint; _pdx = _p + _valuesPerPoint; _p0 = _pdx + _valuesPerPoint; _p1 = _p0 + _valuesPerPoint; _p0dy = _p1 + _valuesPerPoint; _p1dy = _p0dy + _valuesPerPoint; } _valuesPerPoint = x; } void _qr_shaderInputs(rtToken *tokens) { rtToken *t, tp; int n; n = 4; /* x, y, z, w */ for ( t = tokens; tp = *t; t ++ ) { if ( tp->_varying ) { if ( tp == RT(S) || tp == RT(T) ) { tp = RT(ST); } n += tp->_nelements; } } _setValuesPerPoint(n); n = 4; for ( t = tokens; tp = *t; t ++ ) { if ( tp->_varying ) { if ( tp == RT(S) || tp == RT(T) ) { tp = RT(ST); } tp->value = _pw + (tp->offset = n); if ( tp == RT(ST) ) { RT(S)->value = _pw + (RT(S)->offset = n); RT(T)->value = _pw + (RT(T)->offset = n + 1); } n += tp->_nelements; } } } /* ** Points are in RASTER space premultipled by 1/w, with w' = 1/w. ** points are not modified */ static void draw_Polygon(RtFloat **pb, int npoints) { RtFloat **p, /* general point loop */ **pe, /* end of point array */ **pt, /* top point (smallest y) */ **p0p, **p1p /* left and right span pointers */ ; int p0y, p1y; int y, yM; pe = pb + (npoints - 1); /* Locate top point and remember biggest y */ pt = pb; yM = -1; for ( p = pb; p <= pe; p ++ ) { RtFloat *P = *p; /* Transform NDC to RASTER space */ /* Pw' = 1.0 / Pw' */ P[3] = 1.0 / P[3]; /* Px' = Px * Pw' */ P[0] *= P[3] * _riImage->sx; y = P[1] = (1.0 - P[1] * P[3]) * _riImage->sy; /* Find min y point */ if ( yM < y ) { yM = y; } if ( (*pt)[1] > P[1] ) { pt = p; } P[2] *= P[3] * _riImage->sz; { RtFloat *PP = P + 4; DO(_valuesPerPoint - 4, *(PP ++) *= P[3]); } #if DEBUG_PRINT printf("pR = { %g, %g, %g, %g, %g, %g }\n", (P[0]), (P[1]), (P[2]), (P[3]), (P[4]), (P[5]) ); #endif } p0p = p1p = pt; p0y = p1y = y = (int) (*pt)[1]; #if DEBUG_PRINT printf("y = [%d, %d], pt = %d\n", y, yM, pt - pb); #endif #if STATS _qr_stats.npolys_drawn ++; #endif while ( y < yM ) { #define DY(p0) { \ RtFloat *P = *p; \ RtFloat dy = 1.0 / (p0##y - y); \ RtFloat *PDY = _##p0##dy, *P0P = *p0##p, *P0 = _##p0; \ PDY[0] = (P0P[0] - (P0[0] = P[0])) * dy; \ PDY += 2, P0P += 2, P0 += 2, P += 2; \ DO(_valuesPerPoint - 2, (*(PDY ++) = (*(P0P ++) - (*(P0 ++) = *(P ++))) * dy)) \ } _p[1] = y; if ( y >= p0y ) { do { p = p0p; if ( (-- p0p) < pb ) p0p = pe; p0y = (int) (*p0p)[1]; } while ( p0p != pt && y >= p0y ); DY(p0); #if DEBUG_PRINT printf("y = %d, p0p = %d\n", y, p0p - pb); printf("p0y = %d\n", p0y); printf("p0dy = { %g, 1, %g, %g, %g, %g }\n", (_p0dy[0]), (_p0dy[2]), (_p0dy[3]), (_p0dy[4]), (_p0dy[5])); #endif } if ( y >= p1y ) { do { p = p1p; if ( (++ p1p) > pe ) p1p = pb; p1y = (int) (*p1p)[1]; } while ( p1p != pt && y >= p1y ); DY(p1); #if DEBUG_PRINT printf("y = %d, p1p = %d\n", y, p1p - pb); printf("p1y = %d\n", p1y); printf("p1dy = { %g, 1, %g, %g, %g, %g }\n", (_p1dy[0]), (_p1dy[2]), (_p1dy[3]), (_p1dy[4]), (_p1dy[5])); #endif } #undef DY while ( y < p0y && y < p1y ) { #if DEBUG_PRINT printf("p0 = { %g, %d, %g, %g, %g, %g }, p1 = { %g, %d, %g, %g, %g, %g }\n", (_p0[0]), y, (_p0[2]), (_p0[3]), (_p0[4]), (_p0[5]), (_p1[0]), y, (_p1[2]), (_p1[3]), (_p1[4]), (_p1[5]) ); #endif { RtFloat *p0 = _p0, *p1 = _p1; int x, dx; /* Make p0x < p1.x */ if ( p0[0] > p1[0] ) { void *t = p0; p0 = p1; p1 = t; } if ( (dx = ((int) p1[0]) - (x = (int) p0[0]))) { rtPixel *pix; rtZValue *zbuf; /* Compute dp/dx */ { RtFloat _dx = 1 / (RtFloat) dx; RtFloat *PDX = _pdx + 2, *P1 = p1 + 2, *P = _p + 2, *P0 = p0 + 2; DO(_valuesPerPoint - 2, *(PDX ++) = _dx * (*(P1 ++) - (*(P ++) = *(P0 ++)))) } _p[0] = x; #if DEBUG_PRINT printf("dx = %d, pdx = { 1, 0, %g, %g, %g, %g }\n", dx, _pdx[2], _pdx[3], _pdx[4], _pdx[5]); #endif /* Set up dst pixel pointers */ pix = _riImage->pixels[y] + x * _riImage->bytesPerPixel; zbuf = _riImage->zbuffer[y] + x; #if STATS _qr_stats.nrows ++; #endif /* Unroll pixel loops */ while ( dx >= 8 ) { #include "dopixel.c" #include "dopixel.c" #include "dopixel.c" #include "dopixel.c" #include "dopixel.c" #include "dopixel.c" #include "dopixel.c" #include "dopixel.c" dx -= 8; } switch ( dx ) { case 7: #include "dopixel.c" case 6: #include "dopixel.c" case 5: #include "dopixel.c" case 4: #include "dopixel.c" case 3: #include "dopixel.c" case 2: #include "dopixel.c" case 1: #include "dopixel.c" case 0: break; } } } /* Increment p0 and p1 by their respective dys */ #define INC(p0) {\ RtFloat *P = p0, *PDY = p0##dy; \ P[0] += PDY[0]; \ P += 2, PDY += 2; \ DO(_valuesPerPoint - 2, *(P ++) += *(PDY ++)); \ } INC(_p0); INC(_p1); #undef INC y ++; } } } /* ** Points are in NDC space and are modified to be in RASTER space */ #include "signbit.h" static __inline int poly_clipToHalfspace(RtFloat **in, int npoints, RtFloat **out, int index, int sign, int k, RtFloat *outb) { RtFloat **op = out, **inend; RtFloat **_u, **_v; RtFloat *u, *v; RtFloat tu, tv; inend = in + (npoints - 1); _u = inend; u = *_u; tu = sign * u[index] - u[3] * k; for ( v = *(_v = in); _v <= inend; u = v, tu = tv, v = *(_u = _v ++) ) { tv = sign * v[index] - v[3] * k; #if DEBUG_PRINT printf("%c = %d, p = %d, tu = %g, tv = %g\n", "xyz"[index], k, _v - in, tu, tv); #endif if ( (tu <= 0) ^ (tv <= 0) ) { RtFloat t = tu / (tu - tv); RtFloat *up = u, *vp = v; *(op ++) = outb; DO(_valuesPerPoint, (*(outb ++) = t * (*(vp ++) - *up) + *up, up ++)) } if ( tv <= 0 ) { *(op ++) = *_v; } } return op - out; } static void clip_Polygon(RtFloat **pb, int npoints) { RtFloat **p, **pe; int ocOr; #if STATS _qr_stats.npolys ++; #endif pe = pb + (npoints - 1); { RtFloat **pp; int ocAnd; ocAnd = ~0; ocOr = 0; /* Do all (out/in) processing */ for ( pp = pb; pp <= pe; pp ++) { RtFloat *p = *pp; int oc; oc = RtFloat_signbitset( RtFloat_posbit((p[0] - p[3]), 0) | RtFloat_negbit((p[0] ), 1) | RtFloat_posbit((p[1] - p[3]), 2) | RtFloat_negbit((p[1] ), 3) | RtFloat_posbit((p[2] - p[3]), 4) | RtFloat_negbit((p[2] ), 5) ); #if DEBUG_PRINT printf("P = { %g, %g, %g, %g }, oc = %x\n", p[0], p[1], p[2], p[3], oc); #endif ocAnd &= oc; ocOr |= oc; } /* all out one side */ if ( ocAnd ) { #if STATS _qr_stats.npolys_out ++; #endif #if DEBUG_PRINT printf("clip: all out %d\n", ocAnd); #endif return; } /* all in */ if ( ! ocOr ) { #if STATS _qr_stats.npolys_in ++; #endif #if DEBUG_PRINT printf("clip: all in\n"); #endif draw_Polygon(pb, npoints); return; } } /* needs clipping */ { RtFloat *npab, *npbb; RtFloat **npa, **npb; RtFloat **a, **b; int nnp; #if DEBUG_PRINT printf("clip: clipped\n"); #endif #if STATS _qr_stats.npolys_clipped ++; #endif npab = alloca(sizeof(npab[0]) * (npoints * 2) * _valuesPerPoint); npbb = alloca(sizeof(npbb[0]) * (npoints * 2) * _valuesPerPoint); npa = alloca(sizeof(npa[0]) * (npoints * 2)); npb = alloca(sizeof(npb[0]) * (npoints * 2)); nnp = npoints; a = pb; b = npa; #define CLIP_AND_SWAP(elem, sign, k) { \ if ( (nnp = poly_clipToHalfspace(a, nnp, b, elem, sign, sign * k, npab)) ) { \ void *temp; \ temp = npab; npab = npbb; npbb = temp; \ temp = a; a = b; b = temp; \ if ( b == pb ) b = npb; \ } else { \ return; \ } \ } if ( ocOr & (1 << 0) ) CLIP_AND_SWAP(0, 1, 1); if ( ocOr & (1 << 1) ) CLIP_AND_SWAP(0, -1, 0); if ( ocOr & (1 << 2) ) CLIP_AND_SWAP(1, 1, 1); if ( ocOr & (1 << 3) ) CLIP_AND_SWAP(1, -1, 0); if ( ocOr & (1 << 4) ) CLIP_AND_SWAP(2, 1, 1); if ( ocOr & (1 << 5) ) CLIP_AND_SWAP(2, -1, 0); #undef CLIP_AND_SWAP draw_Polygon(a, nnp); } } #define _riTokens() \ rtToken *toks = alloca(sizeof(toks[0]) * (parmn + 1)); \ RtPointer *tokValues = alloca(sizeof(tokValues[0]) * (parmn)); \ { \ RtInt i; \ for ( i = 0; i < parmn; i ++ ) { \ toks[i] = RtToken_to_rtToken_safe(tokens[i]); \ tokValues[i] = toks[i]->value; \ } \ toks[i] = 0; \ } #define _riTokensEnd() { \ RtInt i; \ for ( i = 0; i < parmn; i ++ ) { \ tokValues[i] = toks[i]->value = tokValues[i]; \ } \ } /*************************************************************************/ /* IMPLEMENT: Transform object to NDC space for clipping */ #define P_object2NDC(D, S) { \ (D)[0] = (S)[0]; \ (D)[1] = (S)[1]; \ (D)[2] = (S)[2]; \ (D)[3] = 1.0; \ } #define Pw_object2NDC(D, S) { \ (D)[0] = (S)[0]; \ (D)[1] = (S)[1]; \ (D)[2] = (S)[2]; \ (D)[3] = (S)[3]; \ } /*************************************************************************/ /* Low-level triangle */ RtVoid _qr_RiTriangle(RtFloat **Pw) { RtFloat *pp[3], *np, *p, *P, *PS; np = alloca(sizeof(pp[0]) * 3 * _valuesPerPoint); pp[0] = np; pp[1] = pp[0] + _valuesPerPoint; pp[2] = pp[1] + _valuesPerPoint; P_object2NDC(pp[0], Pw[0]); P_object2NDC(pp[1], Pw[1]); P_object2NDC(pp[2], Pw[2]); memcpy(pp[0] + 4, Pw[0] + 4, sizeof(pp[0][0]) * (_valuesPerPoint - 4)); memcpy(pp[1] + 4, Pw[1] + 4, sizeof(pp[1][0]) * (_valuesPerPoint - 4)); memcpy(pp[2] + 4, Pw[2] + 4, sizeof(pp[2][0]) * (_valuesPerPoint - 4)); clip_Polygon(pp, 3); } /*************************************************************************/ /* User-level convex polygon */ RtVoid _qr_RiPolygonV(RtInt nvertices, RtInt parmn, RtToken *tokens, RtPointer *parms) { RtFloat **pp, *np, *p, *P; RtInt Pi, i; _riTokens(); pp = alloca(sizeof(pp[0]) * nvertices); np = alloca(sizeof(np[0]) * nvertices * _valuesPerPoint); P = 0; for ( Pi = 0; Pi < parmn; Pi ++ ) { if ( toks[Pi] == RT(P) ) { P = parms[Pi]; for ( p = np, i = 0; i < nvertices; i ++ ) { pp[i] = p; P_object2NDC(P, P); p += _valuesPerPoint; } break; } else if ( toks[Pi] == RT(PW) ) { P = parms[Pi]; for ( p = np, i = 0; i < nvertices; i ++ ) { pp[i] = p; Pw_object2NDC(p, P); p += _valuesPerPoint; } break; } } if ( P == 0 ) { _riError(RIE_MISSINGDATA, RIE_ERROR, "needs P or Pw"); return; } for ( i = 0; i < parmn; i ++ ) { /* Skip P or Pw */ if ( i == Pi ) continue; /* Is it a varying parameter that is requested by the shader? */ if ( toks[i]->_varying && toks[i]->offset > 0 ) { RtInt j; P = parms[i]; p = np; for ( j = 0; j < nvertices; j ++ ) { int k; for ( k = 0; k < toks[i]->_nelements; k ++ ) { p[toks[i]->offset + k] = *(P ++); } p += _valuesPerPoint; } /* is it a uniform parameter */ } else if ( toks[i]->_uniform ) { toks[i]->value = parms[i]; } } clip_Polygon(pp, nvertices); _riTokensEnd(); } q3d0.1/src/q3d/qr/qr.h0100644000175200017560000000150306707531726014734 0ustar stephensstepheng#ifndef _qr_qr_h #define _qr_qr_h #ifndef __rcs_id__ #ifndef __rcs_id_qr_qr_h__ #define __rcs_id_qr_qr_h__ static const char __rcs_id_qr_qr_h[] = "$Id: qr.h,v 1.3 1999/04/22 05:29:58 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "ri/ri.h" #include "common/image.h" extern rtImage *_riImage; #include "common/token.h" #include "common/shader.h" extern rtShader _qr_surfaceShader; RtToken _qr_RiBeginV(RtString handle, _RIV_PARMS); RtToken _qr_RiContextV(RtToken handle, _RIV_PARMS); RtVoid _qr_RiEnd(void); RtVoid _qr_RiColor(RtColor c); RtVoid _qr_RiOpacity(RtColor c); RtVoid _qr_RiSurfaceV(RtToken shader, _RIV_PARMS); /* polyscan.c */ void _qr_ShaderInputs(rtToken *tokens); void _qr_stats_begin(), _qr_stats_end(); RtVoid _qr_RiTriangle(RtFloat **Pw); RtVoid _qr_RiPolygonV(RtInt npoints, _RIV_PARMS); #endif q3d0.1/src/q3d/qr/shader.c0100644000175200017560000000113106707531726015550 0ustar stephensstepheng#ifndef __rcs_id__ #ifndef __rcs_id_qr_shader_c__ #define __rcs_id_qr_shader_c__ static const char __rcs_id_qr_shader_c[] = "$Id: shader.c,v 1.3 1999/04/22 05:29:58 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "qr.h" #include rtShader _qr_surfaceShader = 0; RtVoid _qr_RiSurfaceV(RtToken name, RtInt nparms, RtToken *tokens, RtPointer *parms) { rtShader shader = 0; if ( strcmp(name, "texmap") == 0 ) { extern struct _rtShader _riS_texmap; shader = &_riS_texmap; } if ( shader ) { _qr_surfaceShader = shader; _qr_shaderInputs(shader->inputs); } } q3d0.1/src/q3d/qr/signbit.c0100644000175200017560000000321706663227122015741 0ustar stephensstepheng #ifndef __rcs_id__ #ifndef __rcs_id_qr_signbit_c__ #define __rcs_id_qr_signbit_c__ static const char __rcs_id_qr_signbit_c[] = "$Id: signbit.c,v 1.2 1999/02/19 09:26:42 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "ri/ri.h" #include int main(int argc, char **argv) { union { RtFloat f; unsigned int i; } pos, neg; unsigned int signbit, setforneg; unsigned int mask, shift; memset(&pos, 0, sizeof(pos)); memset(&neg, 0, sizeof(pos)); pos.f = 1234.234234; neg.f = - pos.f; signbit = pos.i ^ neg.i; setforneg = neg.i & signbit; mask = 1; shift = 0; if ( signbit ) { while ( (signbit & mask) == 0 ) { mask <<= 1; shift ++; } } printf("/* { %g, 0x%x }, { %g, 0x%x } 0x%x */\n", pos.f, pos.i, neg.f, neg.i, signbit); printf("#define RtFloat_signbitset(X) %s\n", setforneg ? "(X)" : "~(X)"); if ( signbit ) { char format[1024]; #define BASIC "#define RtFloat_%%s(X,S) ({union { RtFloat _f; unsigned int _i; } _u; _u._f = (X); " if ( shift <= 0 ) { sprintf(format, BASIC "((%%s_u._i) & 1) << (S); })\n"); } else if ( shift >= 5 ) { sprintf(format, BASIC "(((%%s_u._i) & 0x%x) >> (%d - (S))); })\n", signbit, shift); } else { sprintf(format, BASIC "%d > (S) ? (((%%s_u._i) & 0x%x) >> (%d - (S))) : (((%%s_u._i) & 0x%x) << ((S) - %d)); })\n", shift, signbit, shift, signbit, shift); } printf(format, "negbit", "", ""); printf(format, "posbit", "~", "~"); } else { printf("#define RtFloat_negbit(X,S) (((X)<0)<<(S))\n"); printf("#define RtFloat_posbit(X,S) (((X)>0)<<(S))\n"); } return 0; } q3d0.1/src/q3d/qr/signbit.h0100644000175200017560000000055007306132064015736 0ustar stephensstepheng/* { 1234.23, 0x449a477f }, { -1234.23, 0xc49a477f } 0x80000000 */ #define RtFloat_signbitset(X) (X) #define RtFloat_negbit(X,S) ({union { RtFloat _f; unsigned int _i; } _u; _u._f = (X); (((_u._i) & 0x80000000) >> (31 - (S))); }) #define RtFloat_posbit(X,S) ({union { RtFloat _f; unsigned int _i; } _u; _u._f = (X); (((~_u._i) & 0x80000000) >> (31 - (S))); }) q3d0.1/src/q3d/qr/shaders/0040755000175200017560000000000007306140063015560 5ustar stephensstephengq3d0.1/src/q3d/qr/shaders/CVS/0040755000175200017560000000000007236675453016235 5ustar stephensstephengq3d0.1/src/q3d/qr/shaders/CVS/Root0100644000175200017560000000003407236675453017075 0ustar stephensstepheng:local://cvs/ioncvs/cvsroot q3d0.1/src/q3d/qr/shaders/CVS/Repository0100644000175200017560000000003407236675453020331 0ustar stephensstephenghome/ion/src/q3d/qr/shaders q3d0.1/src/q3d/qr/shaders/CVS/Entries0100644000175200017560000000005307236675453017564 0ustar stephensstepheng/texmap.c/1.2/Fri Feb 19 09:26:43 1999// D q3d0.1/src/q3d/qr/shaders/texmap.c0100644000175200017560000000157206663227123017234 0ustar stephensstepheng #ifndef __rcs_id__ #ifndef __rcs_id_shaders_texmap_c__ #define __rcs_id_shaders_texmap_c__ static const char __rcs_id_shaders_texmap_c[] = "$Id: texmap.c,v 1.2 1999/02/19 09:26:43 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "qr/qr.h" #include "common/shadervars.h" /* Current texture map */ rtTexture *texmap_texture; static rtShaderFuncDecl(_riSf_texmap) { int si, ti; rtPixel tp; si = s * texmap_texture->sx; ti = t * texmap_texture->sy; tp = texmap_texture->pixels[ti & texmap_texture->my][(si & texmap_texture->mx) * texmap_texture->bytesPerPixel]; Ci[0] = Ci[1] = Ci[2] = tp; Oi[0] = Oi[1] = Oi[2] = tp != 0; } static rtToken _riSinputs_texmap[] = { RT(ST), 0 }; static rtToken _riSoutputs_texmap[] = { RT(_Ci), RT(_Oi), 0 }; struct _rtShader _riS_texmap = { _riSf_texmap, "texmap", _riSinputs_texmap, _riSoutputs_texmap }; q3d0.1/src/q3d/qr/signbit0100755000175200017560000006210507306132064015517 0ustar stephensstephengELFƒ4ôW4 (44€4€ÀÀôô€ô€€€¬ ¬ ¬ ¬™¬™ìø ø™ø™   /lib/ld-linux.so.2GNU q0ƒ"0@ƒ¬"_Pƒà`ƒ2!pƒ"Pd†H€ƒ- __gmon_start__libc.so.6printf__cxa_finalize__deregister_frame_infosprintf_IO_stdin_used__libc_start_main__register_frame_infoGLIBC_2.1.3GLIBC_2.0si ‡ii “ô™Ü™à™ä™è™ì™ð™U‰åƒìè¡è7èÒÉÃÿ5Ô™ÿ%Ø™ÿ%Ü™héàÿÿÿÿ%à™héÐÿÿÿÿ%ä™héÀÿÿÿÿ%è™hé°ÿÿÿÿ%ì™h é ÿÿÿÿ%ð™h(éÿÿÿ1í^‰áƒäøPTRh,†hƒQVhŒ„èŸÿÿÿôU‰åSPè[˃$…ÀtÿЋ]üÉÃU‹¸™‰åƒì…ÒuI‹´™‹…Àtt&B£´™ÿ‹´™‹ …Éuê¸@ƒ…Àtƒì h¼™èÿÿÿƒÄ¸£¸™‰ì]ÃvU‰åƒì‰ì]öU‰å¸0ƒƒì…Àtƒìh˜šh¼™è¿þÿÿƒÄ‰ì]ô&U‰åƒì‰ì]ÃU‰åWVSì,Ç…äûÿÿÇ…äûÿÿGšD‹…äûÿÿ‰Âò€‰Ð‹äûÿÿ1Éß!Ǹ¾…Ût÷Ãu ‰öÁàF…ØtøSR‰•ÔûÿÿÙ…Ôûÿÿd$øÝ$ÿµäûÿÿÙ…äûÿÿd$øÝ$h‡èFþÿÿƒÄ¸'‡…ÿu¸+‡Ph@‡è*þÿÿƒÄ…Û„ƒ…öu ƒìh€‡ë ƒþvVShˆ…èûÿÿPèþÿÿƒÄëvƒìVSVSVh€ˆ…èûÿÿPè÷ýÿÿƒÄ h-‰h-‰h.‰èûÿÿSè¹ýÿÿh5‰h5‰h7‰Sè¤ýÿÿƒÄ ëvƒì h@‰èýÿÿÇ$€‰èƒýÿÿƒÄ¸eô[^_]ÃU¡À™‰åSƒìƒøÿ»À™tv¼'ƒëÿЋƒøÿuôX[]ÃU‰åƒì‰ì]ÃU‰åSRè[Úvè›ýÿÿ‹]üÉÃ$Id: signbit.c,v 1.2 1999/02/19 09:26:42 stephensk Exp $$Id: ri.h,v 1.2 1999/02/19 09:26:43 stephensk Exp $/* { %g, 0x%x }, { %g, 0x%x } 0x%x */ (X)~(X)#define RtFloat_signbitset(X) %s #define RtFloat_%%s(X,S) ({union { RtFloat _f; unsigned int _i; } _u; _u._f = (X); ((%%s_u._i) & 1) << (S); }) #define RtFloat_%%s(X,S) ({union { RtFloat _f; unsigned int _i; } _u; _u._f = (X); (((%%s_u._i) & 0x%x) >> (%d - (S))); }) #define RtFloat_%%s(X,S) ({union { RtFloat _f; unsigned int _i; } _u; _u._f = (X); %d > (S) ? (((%%s_u._i) & 0x%x) >> (%d - (S))) : (((%%s_u._i) & 0x%x) << ((S) - %d)); }) negbit~posbit#define RtFloat_negbit(X,S) (((X)<0)<<(S)) #define RtFloat_posbit(X,S) (((X)>0)<<(S)) Ì™ÿÿÿÿÿÿÿÿø™6ƒFƒVƒfƒvƒ†ƒ ƒ ,†(ð` ‡ Й0Ø‚Ђþÿÿo ‚ÿÿÿoðÿÿoŽ‚’8d´ƒd´ƒ)<8€b€|€«€ã€ €q€Â€í€€F€o€‰€¤€Å€þ€!€F€p€™‚³‚¢¢é‚gV‚‰s,‚B‚Y‚¢¢¢m‚ئ€Ç¢º€ Ñ€!è€"ý€#€%+€&A€1X€2p€3‡€4 €5¸€6Ñ€8é€9€;"€=8€>N€?d€@z€A‘€B©€C¿€DÖ€Eì€F€G€H4€II€N¯€QÇ€Rç€Sþ€T€U5€VM€Xe€[€^—€b¯€xù€{ €~) €‚C €‡\ €ˆw €‹’ €Œ¯ €Ê €ç €“ÿ €– €™3 €šO €h € ‚ ‚ùŒ¶ ‚ˆÞ €¢ €Z €#– €4 €<ê €C" €F> €SÑ €Z€^,€€l!€tu€y–€€†\€Œ¢¢m‚ t€Š€8¢Ÿ‚²‚bm‚¢Ä‚¢ñ€H¢¢t€·€#ü‚‚5ÁŸ²‚m¢m €ÿ€6€G`€J€KÀ€Tó€Y.€]g€`Ÿ€a×€„€-€#€š€¬¢¢¾€51€7I€8a€9{€:¢• "d´ƒ«dŒ„ÇdŒ„)<8€b€|€«€ã€ €q€Â€í€€F€o€‰€¤€Å€þ€!€F€p€Ô&€†+‚7œ3&À†_‚v ˜€+µ€n¢Ê€ß€ö€€'€D€Z€|€¦€È€ß€ €G€_€v€”€³€Ð€ î€)€*=‚¢K‚uY€¢)‚¢¢6‚ÊK‚c‚¢|‚¢¢mÂØ•‚¿km¯€ Ç€!߀"õ€# €%% €&< €1T €2m €3… €4Ÿ €5¸ €6Ò €8ë €9!€;(!€=@!€>X!€?p!€@ˆ!€A¡!€B»!€CÒ!€Dë!€E"€F"€G4"€HO"€If"€Nª"€QÃ"€RÝ"€Sõ"€T#€U.#€VG#€X`#€[{#€^”#€b­#€xý#€{$€~/$€‚J$€‡d$€ˆ$€‹ž$€Œ½$€Ú$€ù$€“%€–.%€™J%€šg%€%€ œ%‚Æé½%‚ˆ×%€¢ &€T&€#“&€4ž'€<ï'€C)(€FF(€SÝ(€Z)€^;)€Œ¢¢T)€1r)€;†)‚Æ›)‚bVm ´)‚`mÂÉ)‚¢ã)€H¢f*€¬*€#ô*‚À´)‚m¢m +€è+€,€GI,€Jx,€K©,€TÜ,€Y-€]P-€`ˆ-€aÀ-€m.€0€1€|1€¬¢ 1€52€7/2€8H2€9c2€:¢~2€¨˜2€õ2€Y3€6€?36€VZ6€_‚6€g§6€j¢Í6€Iâ6‚¢7€ç7‚¢¢/7$ Œ„;7  G7  D D DD D.D8D<DAD FD!JD"TD#WD$XD'\D,ŽD-ªD.µD2µD3¹D4ÁD5ÄD6ÉD8ÜD9äD=ýD?D@DA0DB8DCEDDQDFTDGY\7€äûÿÿ…7@‘7@ 7@±7@½7@Ê7€.èûÿÿ$aî7 Adí…init.c/usr/src/bs/BUILD/glibc-2.2/csu/gcc2_compiled.int:t(0,1)=r(0,1);-2147483648;2147483647;char:t(0,2)=r(0,2);0;127;long int:t(0,3)=r(0,3);-2147483648;2147483647;unsigned int:t(0,4)=r(0,4);0000000000000;0037777777777;long unsigned int:t(0,5)=r(0,5);0000000000000;0037777777777;long long int:t(0,6)=@s64;r(0,6);01000000000000000000000;0777777777777777777777;long long unsigned int:t(0,7)=@s64;r(0,7);0000000000000;01777777777777777777777;short int:t(0,8)=@s16;r(0,8);-32768;32767;short unsigned int:t(0,9)=@s16;r(0,9);0;65535;signed char:t(0,10)=@s8;r(0,10);-128;127;unsigned char:t(0,11)=@s8;r(0,11);0;255;float:t(0,12)=r(0,1);4;0;double:t(0,13)=r(0,1);8;0;long double:t(0,14)=r(0,1);12;0;complex int:t(0,15)=s8real:(0,1),0,32;imag:(0,1),32,32;;complex float:t(0,16)=r(0,16);8;0;complex double:t(0,17)=r(0,17);16;0;complex long double:t(0,18)=r(0,18);24;0;__builtin_va_list:t(0,19)=*(0,20)=(0,20)../include/libc-symbols.h/usr/src/bs/BUILD/glibc-2.2/build-i386-linux/config.h../sysdeps/gnu/_G_config.h../sysdeps/unix/sysv/linux/bits/types.h../include/features.h../include/sys/cdefs.h../misc/sys/cdefs.h/usr/lib/gcc-lib/i386-redhat-linux/2.96/include/stddef.hsize_t:t(8,1)=(0,4)__u_char:t(4,1)=(0,11)__u_short:t(4,2)=(0,9)__u_int:t(4,3)=(0,4)__u_long:t(4,4)=(0,5)__u_quad_t:t(4,5)=(0,7)__quad_t:t(4,6)=(0,6)__int8_t:t(4,7)=(0,10)__uint8_t:t(4,8)=(0,11)__int16_t:t(4,9)=(0,8)__uint16_t:t(4,10)=(0,9)__int32_t:t(4,11)=(0,1)__uint32_t:t(4,12)=(0,4)__int64_t:t(4,13)=(0,6)__uint64_t:t(4,14)=(0,7)__qaddr_t:t(4,15)=(4,16)=*(4,6)__dev_t:t(4,17)=(4,5)__uid_t:t(4,18)=(4,3)__gid_t:t(4,19)=(4,3)__ino_t:t(4,20)=(4,4)__mode_t:t(4,21)=(4,3)__nlink_t:t(4,22)=(4,3)__off_t:t(4,23)=(0,3)__loff_t:t(4,24)=(4,6)__pid_t:t(4,25)=(0,1)__ssize_t:t(4,26)=(0,1)__rlim_t:t(4,27)=(4,4)__rlim64_t:t(4,28)=(4,5)__id_t:t(4,29)=(4,3)__fsid_t:t(4,30)=(4,31)=s8__val:(4,32)=ar(4,33)=r(4,33);0000000000000;0037777777777;;0;1;(0,1),0,64;;__daddr_t:t(4,34)=(0,1)__caddr_t:t(4,35)=(4,36)=*(0,2)__time_t:t(4,37)=(0,3)__useconds_t:t(4,38)=(0,4)__suseconds_t:t(4,39)=(0,3)__swblk_t:t(4,40)=(0,3)__clock_t:t(4,41)=(0,3)__clockid_t:t(4,42)=(0,1)__timer_t:t(4,43)=(0,1)__fd_mask:t(4,44)=(0,5)__fd_set:t(4,45)=(4,46)=s128fds_bits:(4,47)=ar(4,33);0;31;(4,44),0,1024;;__key_t:t(4,48)=(0,1)__ipc_pid_t:t(4,49)=(0,9)__blksize_t:t(4,50)=(0,3)__blkcnt_t:t(4,51)=(0,3)__blkcnt64_t:t(4,52)=(4,6)__fsblkcnt_t:t(4,53)=(4,4)__fsblkcnt64_t:t(4,54)=(4,5)__fsfilcnt_t:t(4,55)=(4,4)__fsfilcnt64_t:t(4,56)=(4,5)__ino64_t:t(4,57)=(4,5)__off64_t:t(4,58)=(4,24)__t_scalar_t:t(4,59)=(0,3)__t_uscalar_t:t(4,60)=(0,5)__intptr_t:t(4,61)=(0,1)__socklen_t:t(4,62)=(0,4)../linuxthreads/sysdeps/pthread/bits/pthreadtypes.h../sysdeps/unix/sysv/linux/bits/sched.h__sched_param:T(10,1)=s4sched_priority:(0,1),0,32;;_pthread_fastlock:T(9,1)=s8__status:(0,3),0,32;__spinlock:(0,1),32,32;;_pthread_descr:t(9,2)=(9,3)=*(9,4)=xs_pthread_descr_struct:pthread_attr_t:t(9,5)=(9,6)=s36__detachstate:(0,1),0,32;__schedpolicy:(0,1),32,32;__schedparam:(10,1),64,32;__inheritsched:(0,1),96,32;__scope:(0,1),128,32;__guardsize:(8,1),160,32;__stackaddr_set:(0,1),192,32;__stackaddr:(0,19),224,32;__stacksize:(8,1),256,32;;pthread_cond_t:t(9,7)=(9,8)=s12__c_lock:(9,1),0,64;__c_waiting:(9,2),64,32;;pthread_condattr_t:t(9,9)=(9,10)=s4__dummy:(0,1),0,32;;pthread_key_t:t(9,11)=(0,4)pthread_mutex_t:t(9,12)=(9,13)=s24__m_reserved:(0,1),0,32;__m_count:(0,1),32,32;__m_owner:(9,2),64,32;__m_kind:(0,1),96,32;__m_lock:(9,1),128,64;;pthread_mutexattr_t:t(9,14)=(9,15)=s4__mutexkind:(0,1),0,32;;pthread_once_t:t(9,16)=(0,1)_pthread_rwlock_t:T(9,17)=s32__rw_lock:(9,1),0,64;__rw_readers:(0,1),64,32;__rw_writer:(9,2),96,32;__rw_read_waiting:(9,2),128,32;__rw_write_waiting:(9,2),160,32;__rw_kind:(0,1),192,32;__rw_pshared:(0,1),224,32;;pthread_rwlock_t:t(9,18)=(9,17)pthread_rwlockattr_t:t(9,19)=(9,20)=s8__lockkind:(0,1),0,32;__pshared:(0,1),32,32;;pthread_spinlock_t:t(9,21)=(0,1)pthread_barrier_t:t(9,22)=(9,23)=s20__ba_lock:(9,1),0,64;__ba_required:(0,1),64,32;__ba_present:(0,1),96,32;__ba_waiting:(9,2),128,32;;pthread_barrierattr_t:t(9,24)=(9,25)=s4__pshared:(0,1),0,32;;pthread_t:t(9,26)=(0,5)wchar_t:t(11,1)=(0,3)wint_t:t(11,2)=(0,4)../include/wchar.h../wcsmbs/wchar.h../sysdeps/unix/sysv/linux/i386/bits/wchar.h__mbstate_t:t(13,1)=(13,2)=s8__count:(0,1),0,32;__value:(13,3)=u4__wch:(11,2),0,32;__wchb:(13,4)=ar(4,33);0;3;(0,2),0,32;;,32,32;;_G_fpos_t:t(3,1)=(3,2)=s12__pos:(4,23),0,32;__state:(13,1),32,64;;_G_fpos64_t:t(3,3)=(3,4)=s16__pos:(4,58),0,64;__state:(13,1),64,64;;../include/gconv.h../iconv/gconv.h :T(17,1)=e__GCONV_OK:0,__GCONV_NOCONV:1,__GCONV_NODB:2,__GCONV_NOMEM:3,__GCONV_EMPTY_INPUT:4,__GCONV_FULL_OUTPUT:5,__GCONV_ILLEGAL_INPUT:6,__GCONV_INCOMPLETE_INPUT:7,__GCONV_ILLEGAL_DESCRIPTOR:8,__GCONV_INTERNAL_ERROR:9,; :T(17,2)=e__GCONV_IS_LAST:1,__GCONV_IGNORE_ERRORS:2,;__gconv_fct:t(17,3)=(17,4)=*(17,5)=f(0,1)__gconv_init_fct:t(17,6)=(17,7)=*(17,8)=f(0,1)__gconv_end_fct:t(17,9)=(17,10)=*(17,11)=f(0,20)__gconv_trans_fct:t(17,12)=(17,13)=*(17,14)=f(0,1)__gconv_trans_context_fct:t(17,15)=(17,16)=*(17,17)=f(0,1)__gconv_trans_query_fct:t(17,18)=(17,19)=*(17,20)=f(0,1)__gconv_trans_init_fct:t(17,21)=(17,22)=*(17,23)=f(0,1)__gconv_trans_end_fct:t(17,24)=(17,25)=*(17,26)=f(0,20)__gconv_trans_data:T(17,27)=s20__trans_fct:(17,12),0,32;__trans_context_fct:(17,15),32,32;__trans_end_fct:(17,24),64,32;__data:(0,19),96,32;__next:(17,28)=*(17,27),128,32;;__gconv_step:T(17,29)=s56__shlib_handle:(17,30)=*(17,31)=xs__gconv_loaded_object:,0,32;__modname:(17,32)=*(0,2),32,32;__counter:(0,1),64,32;__from_name:(4,36),96,32;__to_name:(4,36),128,32;__fct:(17,3),160,32;__init_fct:(17,6),192,32;__end_fct:(17,9),224,32;__min_needed_from:(0,1),256,32;__max_needed_from:(0,1),288,32;__min_needed_to:(0,1),320,32;__max_needed_to:(0,1),352,32;__stateful:(0,1),384,32;__data:(0,19),416,32;;__gconv_step_data:T(17,33)=s36__outbuf:(17,34)=*(0,11),0,32;__outbufend:(17,34),32,32;__flags:(0,1),64,32;__invocation_counter:(0,1),96,32;__internal_use:(0,1),128,32;__statep:(17,35)=*(13,1),160,32;__state:(13,1),192,64;__trans:(17,28),256,32;;__gconv_info:T(17,36)=s8__nsteps:(8,1),0,32;__steps:(17,37)=*(17,29),32,32;__data:(17,38)=ar(4,33);0;-1;(17,33),64,0;;__gconv_t:t(17,39)=(17,40)=*(17,36)_G_iconv_t:t(3,5)=(3,6)=u44__cd:(17,36),0,64;__combined:(3,7)=s44__cd:(17,36),0,64;__data:(17,33),64,288;;,0,352;;_G_int16_t:t(3,8)=(0,8)_G_int32_t:t(3,9)=(0,1)_G_uint16_t:t(3,10)=(0,9)_G_uint32_t:t(3,11)=(0,4)_IO_stdin_used:G(0,1)/home/stephens/ion/src/q3d/qr/signbit.c__rcs_id_qr_signbit_c:S(0,21)=ar(0,22)=r(0,22);0000000000000;0037777777777;;0;56;(0,2)ri/ri.h__rcs_id_ri_ri_h:S(1,1)=ar(0,22);0;51;(0,2)/usr/lib/gcc-lib/i386-redhat-linux/2.96/include/stdarg.h__gnuc_va_list:t(2,1)=(0,19)va_list:t(2,2)=(2,1)RtVoid:t(1,2)=(0,20)RtBoolean:t(1,3)=(0,8)RtPointer:t(1,4)=(1,5)=*(1,2)RtInt:t(1,6)=(0,1)RtIntPtr:t(1,7)=(1,8)=*(0,1)RtFloat:t(1,9)=(0,12)RtFloatPtr:t(1,10)=(1,11)=*(0,12)RtPoint:t(1,12)=(1,13)=ar(0,22);0;2;(1,9)RtPointPtr:t(1,14)=(1,15)=*(1,12)RtColor:t(1,16)=(1,13)RtBound:t(1,17)=(1,18)=ar(0,22);0;5;(1,9)RtBasis:t(1,19)=(1,20)=ar(0,22);0;3;(1,21)=ar(0,22);0;3;(1,9)RtMatrix:t(1,22)=(1,20)RtVaList:t(1,23)=(2,2)RtToken:t(1,24)=(1,25)=*(0,2)RtString:t(1,26)=(1,27)=*(0,2)RtLightHandle:t(1,28)=(1,24)RtObjectHandle:t(1,29)=(1,24)RtFunc:t(1,30)=(1,31)=*(1,32)=f(1,2)RtFloatFunc:t(1,33)=(1,34)=*(1,35)=f(1,9)ri/tokens.defri/errors.defRIE:T(4,1)=eRIE_NOERROR:0,RIE_NOMEM:1,RIE_SYSTEM:2,RIE_NOFILE:3,RIE_BADFILE:4,RIE_VERSION:5,RIE_INCAPABLE:11,RIE_UNIMPLEMENT:12,RIE_LIMIT:13,RIE_BUG:14,RIE_NOTSTARTED:23,RIE_NESTING:24,RIE_NOTOPTIONS:25,RIE_NOTATTRIBS:26,RIE_NOTPRIMS:27,RIE_ILLSTATE:28,RIE_BADMOTION:29,RIE_BADSOLID:30,RIE_BADTOKEN:41,RIE_RANGE:42,RIE_CONSISTENCY:43,RIE_BADHANDLE:44,RIE_NOSHADER:45,RIE_MISSINGDATA:46,RIE_SYNTAX:47,RIE_MATH:61,RIE_INFO:0,RIE_WARNING:1,RIE_ERROR:2,RIE_SEVERE:3,;ri/procs.def/usr/include/stdio.h/usr/include/features.h/usr/include/sys/cdefs.h/usr/include/gnu/stubs.h/usr/include/bits/types.h__u_char:t(11,1)=(0,11)__u_short:t(11,2)=(0,9)__u_int:t(11,3)=(0,4)__u_long:t(11,4)=(0,5)__u_quad_t:t(11,5)=(0,7)__quad_t:t(11,6)=(0,6)__int8_t:t(11,7)=(0,10)__uint8_t:t(11,8)=(0,11)__int16_t:t(11,9)=(0,8)__uint16_t:t(11,10)=(0,9)__int32_t:t(11,11)=(0,1)__uint32_t:t(11,12)=(0,4)__int64_t:t(11,13)=(0,6)__uint64_t:t(11,14)=(0,7)__qaddr_t:t(11,15)=(11,16)=*(11,6)__dev_t:t(11,17)=(11,5)__uid_t:t(11,18)=(11,3)__gid_t:t(11,19)=(11,3)__ino_t:t(11,20)=(11,4)__mode_t:t(11,21)=(11,3)__nlink_t:t(11,22)=(11,3)__off_t:t(11,23)=(0,3)__loff_t:t(11,24)=(11,6)__pid_t:t(11,25)=(0,1)__ssize_t:t(11,26)=(0,1)__rlim_t:t(11,27)=(11,4)__rlim64_t:t(11,28)=(11,5)__id_t:t(11,29)=(11,3)__fsid_t:t(11,30)=(11,31)=s8__val:(11,32)=ar(0,22);0;1;(0,1),0,64;;__daddr_t:t(11,33)=(0,1)__caddr_t:t(11,34)=(1,27)__time_t:t(11,35)=(0,3)__useconds_t:t(11,36)=(0,4)__suseconds_t:t(11,37)=(0,3)__swblk_t:t(11,38)=(0,3)__clock_t:t(11,39)=(0,3)__clockid_t:t(11,40)=(0,1)__timer_t:t(11,41)=(0,1)__fd_mask:t(11,42)=(0,5)__fd_set:t(11,43)=(11,44)=s128__fds_bits:(11,45)=ar(0,22);0;31;(11,42),0,1024;;__key_t:t(11,46)=(0,1)__ipc_pid_t:t(11,47)=(0,9)__blksize_t:t(11,48)=(0,3)__blkcnt_t:t(11,49)=(0,3)__blkcnt64_t:t(11,50)=(11,6)__fsblkcnt_t:t(11,51)=(11,4)__fsblkcnt64_t:t(11,52)=(11,5)__fsfilcnt_t:t(11,53)=(11,4)__fsfilcnt64_t:t(11,54)=(11,5)__ino64_t:t(11,55)=(11,5)__off64_t:t(11,56)=(11,24)__t_scalar_t:t(11,57)=(0,3)__t_uscalar_t:t(11,58)=(0,5)__intptr_t:t(11,59)=(0,1)__socklen_t:t(11,60)=(0,4)/usr/include/bits/pthreadtypes.h/usr/include/bits/sched.h__sched_param:T(14,1)=s4sched_priority:(0,1),0,32;;_pthread_fastlock:T(13,1)=s8__status:(0,3),0,32;__spinlock:(0,1),32,32;;_pthread_descr:t(13,2)=(13,3)=*(13,4)=xs_pthread_descr_struct:pthread_attr_t:t(13,5)=(13,6)=s36__detachstate:(0,1),0,32;__schedpolicy:(0,1),32,32;__schedparam:(14,1),64,32;__inheritsched:(0,1),96,32;__scope:(0,1),128,32;__guardsize:(10,1),160,32;__stackaddr_set:(0,1),192,32;__stackaddr:(0,19),224,32;__stacksize:(10,1),256,32;;pthread_cond_t:t(13,7)=(13,8)=s12__c_lock:(13,1),0,64;__c_waiting:(13,2),64,32;;pthread_condattr_t:t(13,9)=(13,10)=s4__dummy:(0,1),0,32;;pthread_key_t:t(13,11)=(0,4)pthread_mutex_t:t(13,12)=(13,13)=s24__m_reserved:(0,1),0,32;__m_count:(0,1),32,32;__m_owner:(13,2),64,32;__m_kind:(0,1),96,32;__m_lock:(13,1),128,64;;pthread_mutexattr_t:t(13,14)=(13,15)=s4__mutexkind:(0,1),0,32;;pthread_once_t:t(13,16)=(0,1)pthread_t:t(13,17)=(0,5)FILE:t(6,1)=(6,2)=xs_IO_FILE:__FILE:t(6,3)=(6,2)/usr/include/libio.h/usr/include/_G_config.h/usr/include/wchar.h/usr/include/bits/wchar.h__mbstate_t:t(18,1)=(18,2)=s8__count:(0,1),0,32;__value:(18,3)=u4__wch:(17,2),0,32;__wchb:(18,4)=ar(0,22);0;3;(0,2),0,32;;,32,32;;_G_fpos_t:t(16,1)=(16,2)=s12__pos:(11,23),0,32;__state:(18,1),32,64;;_G_fpos64_t:t(16,3)=(16,4)=s16__pos:(11,56),0,64;__state:(18,1),64,64;;/usr/include/gconv.h :T(21,1)=e__GCONV_OK:0,__GCONV_NOCONV:1,__GCONV_NODB:2,__GCONV_NOMEM:3,__GCONV_EMPTY_INPUT:4,__GCONV_FULL_OUTPUT:5,__GCONV_ILLEGAL_INPUT:6,__GCONV_INCOMPLETE_INPUT:7,__GCONV_ILLEGAL_DESCRIPTOR:8,__GCONV_INTERNAL_ERROR:9,; :T(21,2)=e__GCONV_IS_LAST:1,__GCONV_IGNORE_ERRORS:2,;__gconv_fct:t(21,3)=(21,4)=*(21,5)=f(0,1)__gconv_init_fct:t(21,6)=(21,7)=*(21,8)=f(0,1)__gconv_end_fct:t(21,9)=(21,10)=*(21,11)=f(0,20)__gconv_trans_fct:t(21,12)=(21,13)=*(21,14)=f(0,1)__gconv_trans_context_fct:t(21,15)=(21,16)=*(21,17)=f(0,1)__gconv_trans_query_fct:t(21,18)=(21,19)=*(21,20)=f(0,1)__gconv_trans_init_fct:t(21,21)=(21,22)=*(21,23)=f(0,1)__gconv_trans_end_fct:t(21,24)=(21,25)=*(21,26)=f(0,20)__gconv_trans_data:T(21,27)=s20__trans_fct:(21,12),0,32;__trans_context_fct:(21,15),32,32;__trans_end_fct:(21,24),64,32;__data:(0,19),96,32;__next:(21,28)=*(21,27),128,32;;__gconv_step:T(21,29)=s56__shlib_handle:(21,30)=*(21,31)=xs__gconv_loaded_object:,0,32;__modname:(1,25),32,32;__counter:(0,1),64,32;__from_name:(1,27),96,32;__to_name:(1,27),128,32;__fct:(21,3),160,32;__init_fct:(21,6),192,32;__end_fct:(21,9),224,32;__min_needed_from:(0,1),256,32;__max_needed_from:(0,1),288,32;__min_needed_to:(0,1),320,32;__max_needed_to:(0,1),352,32;__stateful:(0,1),384,32;__data:(0,19),416,32;;__gconv_step_data:T(21,32)=s36__outbuf:(21,33)=*(0,11),0,32;__outbufend:(21,33),32,32;__flags:(0,1),64,32;__invocation_counter:(0,1),96,32;__internal_use:(0,1),128,32;__statep:(21,34)=*(18,1),160,32;__state:(18,1),192,64;__trans:(21,28),256,32;;__gconv_info:T(21,35)=s8__nsteps:(10,1),0,32;__steps:(21,36)=*(21,29),32,32;__data:(21,37)=ar(0,22);0;-1;(21,32),64,0;;__gconv_t:t(21,38)=(21,39)=*(21,35)_G_iconv_t:t(16,5)=(16,6)=u44__cd:(21,35),0,64;__combined:(16,7)=s44__cd:(21,35),0,64;__data:(21,32),64,288;;,0,352;;_G_int16_t:t(16,8)=(0,8)_G_int32_t:t(16,9)=(0,1)_G_uint16_t:t(16,10)=(0,9)_G_uint32_t:t(16,11)=(0,4)_IO_lock_t:t(15,1)=(0,20)_IO_marker:T(15,2)=s12_next:(15,3)=*(15,2),0,32;_sbuf:(15,4)=*(6,2),32,32;_pos:(0,1),64,32;;__codecvt_result:T(15,5)=e__codecvt_ok:0,__codecvt_partial:1,__codecvt_error:2,__codecvt_noconv:3,;_IO_FILE:T(6,2)=s148_flags:(0,1),0,32;_IO_read_ptr:(1,27),32,32;_IO_read_end:(1,27),64,32;_IO_read_base:(1,27),96,32;_IO_write_base:(1,27),128,32;_IO_write_ptr:(1,27),160,32;_IO_write_end:(1,27),192,32;_IO_buf_base:(1,27),224,32;_IO_buf_end:(1,27),256,32;_IO_save_base:(1,27),288,32;_IO_backup_base:(1,27),320,32;_IO_save_end:(1,27),352,32;_markers:(15,3),384,32;_chain:(15,4),416,32;_fileno:(0,1),448,32;_blksize:(0,1),480,32;_old_offset:(11,23),512,32;_cur_column:(0,9),544,16;_vtable_offset:(0,10),560,8;_shortbuf:(15,6)=ar(0,22);0;0;(0,2),568,8;_lock:(15,7)=*(15,1),576,32;_offset:(11,56),608,64;__pad1:(0,19),672,32;__pad2:(0,19),704,32;_mode:(0,1),736,32;_unused2:(15,8)=ar(0,22);0;51;(0,2),768,416;;_IO_FILE:t(15,9)=(6,2)__io_read_fn:t(15,10)=(15,11)=f(11,26)__io_write_fn:t(15,12)=(15,13)=f(11,26)__io_seek_fn:t(15,14)=(15,15)=f(0,1)__io_close_fn:t(15,16)=(15,17)=f(0,1)fpos_t:t(6,4)=(16,1)/usr/include/bits/stdio_lim.hoff_t:t(6,5)=(11,23)/usr/include/bits/stdio.hmain:F(0,1)argc:p(0,1)argv:p(0,23)=*(1,27)pos:(0,24)=u4f:(1,9),0,32;i:(0,4),0,32;;neg:r(0,24)signbit:r(0,4)setforneg:r(0,4)mask:r(0,4)shift:r(0,4)format:(0,25)=ar(0,22);0;1023;(0,2)RiLastError:G(1,6)GCC: (GNU) 2.96 20000731 (Red Hat Linux 7.0)GCC: (GNU) 2.96 20000731 (Red Hat Linux 7.0)GCC: (GNU) 2.96 20000731 (Red Hat Linux 7.0)GCC: (GNU) 2.96 20000731 (Red Hat Linux 7.0)GCC: (GNU) 2.96 20000731 (Red Hat Linux 7.0)GCC: (GNU) 2.96 20000731 (Red Hat Linux 7.0)01.0101.0101.0101.0101.0101.01.symtab.strtab.shstrtab.interp.note.ABI-tag.hash.dynsym.dynstr.gnu.version.gnu.version_r.rel.got.rel.plt.init.plt.text.fini.rodata.data.eh_frame.ctors.dtors.got.dynamic.sbss.bss.stab.stabstr.comment.noteô€ô# 1((87 ``?ððGÿÿÿoŽ‚ŽTþÿÿo ‚ 0c ЂÐl Ø‚Ø0 uƒ{ ƒ p€ƒœ†,†,Œ`†`L ”¬™¬ š¼™¼ ¤À™À «È™È ²ЙÐ (·ø™ø  À˜š˜ Ƙš˜ ˘ ä Ñ|8Ú}Uã‘Vx Wé¤\ < Äaô€(`ðŽ‚ ‚ЂØ‚ ƒ ƒ ƒ ,† `†¬™¼™À™È™Йø™˜š˜šñÿ ´ƒ ´ƒ +ñÿ2ñÿ àƒ =´™AÈ™O¸™[àƒ q¼™„@„ ˜š˜P„ ¤€„ ¯¼™½À™2ñÿ ð… Ëð… áÄ™¤ † ¯¼™îÌ™û¼™ñÿ ,† ñÿ€†9)À†4:ø™C0ƒ"dk°™xƒ ~@ƒ¬"¡°š­ƒ ´˜šñÿÀŒ„a ÅPƒà⬙ í`ƒ2ÿ,† pƒ"!˜šñÿ(Й>´šñÿCd†R€ƒ-e¬™r initfini.cgcc2_compiled.call_gmon_startinit.ccrtstuff.cp.0__DTOR_LIST__completed.1__do_global_dtors_aux__EH_FRAME_BEGIN__fini_dummyobject.2frame_dummyinit_dummyforce_to_data__CTOR_LIST____do_global_ctors_aux__CTOR_END____DTOR_END____FRAME_END__signbit.c__rcs_id_qr_signbit_c__rcs_id_ri_ri_h_DYNAMIC__register_frame_info@@GLIBC_2.0_fp_hw__dso_handle_init__deregister_frame_info@@GLIBC_2.0RiLastError_start__bss_startmain__libc_start_main@@GLIBC_2.0data_startprintf@@GLIBC_2.0_fini__cxa_finalize@@GLIBC_2.1.3_edata_GLOBAL_OFFSET_TABLE__end_IO_stdin_usedsprintf@@GLIBC_2.0__data_start__gmon_start__q3d0.1/src/q3d/rcs/0040755000175200017560000000000007236675453014316 5ustar stephensstephengq3d0.1/src/q3d/rcs/CVS/0040755000175200017560000000000007236675453014751 5ustar stephensstephengq3d0.1/src/q3d/rcs/CVS/Root0100644000175200017560000000003407236675453015611 0ustar stephensstepheng:local://cvs/ioncvs/cvsroot q3d0.1/src/q3d/rcs/CVS/Repository0100644000175200017560000000002507236675453017045 0ustar stephensstephenghome/ion/src/q3d/rcs q3d0.1/src/q3d/rcs/CVS/Entries0100644000175200017560000000000207236675453016272 0ustar stephensstephengD q3d0.1/src/q3d/ri/0040755000175200017560000000000007236675453014141 5ustar stephensstephengq3d0.1/src/q3d/ri/CVS/0040755000175200017560000000000007236675453014574 5ustar stephensstephengq3d0.1/src/q3d/ri/CVS/Root0100644000175200017560000000003407236675453015434 0ustar stephensstepheng:local://cvs/ioncvs/cvsroot q3d0.1/src/q3d/ri/CVS/Repository0100644000175200017560000000002407236675453016667 0ustar stephensstephenghome/ion/src/q3d/ri q3d0.1/src/q3d/ri/CVS/Entries0100644000175200017560000000032307236675453016123 0ustar stephensstepheng/errors.def/1.2/Fri Feb 19 09:26:43 1999// /listmacro.h/1.2/Fri Feb 19 09:26:43 1999// /procs.def/1.2/Fri Feb 19 09:26:43 1999// /ri.h/1.2/Fri Feb 19 09:26:43 1999// /tokens.def/1.2/Fri Feb 19 09:26:43 1999// D q3d0.1/src/q3d/ri/errors.def0100644000175200017560000000341706663227123016125 0ustar stephensstepheng/* $Id: errors.def,v 1.2 1999/02/19 09:26:43 stephensk Exp $ */ /* Error Codes 1 - 10 System and File Errors 11 - 20 Program Limitations 21 - 40 State Errors 41 - 60 Parameter and Protocol Errors 61 - 80 Execution Errors */ #ifndef RIE #define _RIE enum RIE { #define RIE(N,V,S) RIE_##N = V, #endif #ifndef RIES #define RIES(N,V,S) RIE(N,V,S) #endif RIE(NOERROR ,0, "No error") RIE(NOMEM ,1, "Out of memory") RIE(SYSTEM ,2, "Miscellaneous system error") RIE(NOFILE ,3, "File nonexistent") RIE(BADFILE ,4, "Bad file format") RIE(VERSION ,5, "File version mismatch") RIE(INCAPABLE ,11, "Optional RI feature") RIE(UNIMPLEMENT ,12, "Unimplemented feature") RIE(LIMIT ,13, "Arbitrary program limit") RIE(BUG ,14, "Probably a bug in renderer") RIE(NOTSTARTED ,23, "RiBegin not called") RIE(NESTING ,24, "Bad begin-end nesting") RIE(NOTOPTIONS ,25, "Invalid state for options") RIE(NOTATTRIBS ,26, "Invalid state for attribs") RIE(NOTPRIMS ,27, "Invalid state for primitives") RIE(ILLSTATE ,28, "Other invalid state") RIE(BADMOTION ,29, "Badly formed motion block") RIE(BADSOLID ,30, "Badly formed solid block") RIE(BADTOKEN ,41, "Invalid token for request") RIE(RANGE ,42, "Parameter out of range") RIE(CONSISTENCY ,43, "Parameters inconsistent") RIE(BADHANDLE ,44, "Bad object/light handle") RIE(NOSHADER ,45, "Can't load requested shader") RIE(MISSINGDATA ,46, "Required parameters not provided") RIE(SYNTAX ,47, "Declare type syntax error") RIE(MATH ,61, "Zerodivide, noninvert matrix, etc.") /* Error severity levels */ RIES(INFO ,0, "Rendering stats and other info") RIES(WARNING ,1, "Something seems wrong, maybe okay") RIES(ERROR ,2, "Problem. Results may be wrong") RIES(SEVERE ,3, "So bad you should probably abort") #ifdef _RIE #undef _RIE }; #endif #undef RIE #undef RIES q3d0.1/src/q3d/ri/listmacro.h0100644000175200017560000000132706663227123016275 0ustar stephensstepheng#ifndef _ri_listmacro_h #ifndef __rcs_id__ #ifndef __rcs_id_ri_listmacro_h__ #define __rcs_id_ri_listmacro_h__ static const char __rcs_id_ri_listmacro_h[] = "$Id: listmacro.h,v 1.2 1999/02/19 09:26:43 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #define _ri_listmacro_h #define llength(L) llength_##L #define llength_L0() 0 #define llength_L1(_1) 1 #define llength_L2(_1,_2) 2 #define llength_L3(_1,_2,_3) 3 #define llength_L4(_1,_2,_3,_4) 4 #define llength_L5(_1,_2,_3,_4,_5) 5 #define llength_L6(_1,_2,_3,_4,_5,_6) 6 #define llength_L7(_1,_2,_3,_4,_5,_6,_7) 7 #define llength_L8(_1,_2,_3,_4,_5,_6,_7,_8) 8 #define llength_L9(_1,_2,_3,_4,_5,_6,_7,_8,_9) 9 #define llength_L10(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10) 10 #endif q3d0.1/src/q3d/ri/procs.def0100644000175200017560000002401206663227123015731 0ustar stephensstepheng/* $Id: procs.def,v 1.2 1999/02/19 09:26:43 stephensk Exp $ */ #ifndef _RIPARMS #define _RIPARMS(L) _RIPARMS_##L #define _RIPARMS_L0() void #define _RIPARMS_L1(t1,n1) t1 n1 #define _RIPARMS_L2(t1,n1,t2,n2) t1 n1, t2 n2 #define _RIPARMS_L3(t1,n1,t2,n2,t3,n3) t1 n1, t2 n2, t3 n3 #define _RIPARMS_L4(t1,n1,t2,n2,t3,n3,t4,n4) t1 n1, t2 n2, t3 n3, t4 n4 #define _RIPARMS_L5(t1,n1,t2,n2,t3,n3,t4,n4,t5,n5) t1 n1, t2 n2, t3 n3, t4 n4, t5 n5 #define _RIPARMS_L6(t1,n1,t2,n2,t3,n3,t4,n4,t5,n5,t6,n6) t1 n1, t2 n2, t3 n3, t4 n4, t5 n5, t6 n6 #endif #ifndef _RIDECLS #define _RIDECLS(L) _RIDECLS_##L #define _RIDECLS_L0() #define _RIDECLS_L1(t1,n1) t1 n1; #define _RIDECLS_L2(t1,n1,t2,n2) t1 n1; t2 n2; #define _RIDECLS_L3(t1,n1,t2,n2,t3,n3) t1 n1; t2 n2; t3 n3; #define _RIDECLS_L4(t1,n1,t2,n2,t3,n3,t4,n4) t1 n1; t2 n2; t3 n3; t4 n4; #define _RIDECLS_L5(t1,n1,t2,n2,t3,n3,t4,n4,t5,n5) t1 n1; t2 n2; t3 n3; t4 n4; t5 n5; #define _RIDECLS_L6(t1,n1,t2,n2,t3,n3,t4,n4,t5,n5,t6,n6) t1 n1; t2 n2; t3 n3; t4 n4; t5 n5; t6 n6; #endif #ifndef _RIARGS #define _RIARGS(L) _RIARGS_##L #define _RIARGS_L0() #define _RIARGS_L1(t1,n1) n1 #define _RIARGS_L2(t1,n1,t2,n2) n1, n2 #define _RIARGS_L3(t1,n1,t2,n2,t3,n3) n1, n2, n3 #define _RIARGS_L4(t1,n1,t2,n2,t3,n3,t4,n4) n1, n2, n3, n4 #define _RIARGS_L5(t1,n1,t2,n2,t3,n3,t4,n4,t5,n5) n1, n2, n3, n4, n5 #define _RIARGS_L6(t1,n1,t2,n2,t3,n3,t4,n4,t5,n5,t6,n6) n1, n2, n3, n4, n5, n6 #endif #ifndef _RILASTARG #define _RILASTARG(L) _RILASTARG_##L #define _RILASTARG_L0() #define _RILASTARG_L1(t1,n1) n1 #define _RILASTARG_L2(t1,n1,t2,n2) n2 #define _RILASTARG_L3(t1,n1,t2,n2,t3,n3) n3 #define _RILASTARG_L4(t1,n1,t2,n2,t3,n3,t4,n4) n4 #define _RILASTARG_L5(t1,n1,t2,n2,t3,n3,t4,n4,t5,n5) n5 #define _RILASTARG_L6(t1,n1,t2,n2,t3,n3,t4,n4,t5,n5,t6,n6) n6 #endif #ifndef _RI_1COM #define _RI_1COM(L) _RI_1COM_##L #define _RI_1COM_L0() #define _RI_1COM_L1(t1,n1) , #define _RI_1COM_L2(t1,n1,t2,n2) , #define _RI_1COM_L3(t1,n1,t2,n2,t3,n3) , #define _RI_1COM_L4(t1,n1,t2,n2,t3,n3,t4,n4) , #define _RI_1COM_L5(t1,n1,t2,n2,t3,n3,t4,n4,t5,n5) , #endif #ifndef _RIVAL #define _RIVAL(T,F,V) _RIVAL_##T(F,V) #define _RIVAL_RtVoid(F,V) (V) #define _RIVAL_RtInt(F,V) F(V) #define _RIVAL_RtToken(F,V) F(V) #define _RIVAL_RtFloat(F,V) F(V) #define _RIVAL_RtPointPtr(F,V) F(V) #define _RIVAL_RtLightHandle(F,V) F(V) #define _RIVAL_RtObjectHandle(F,V) F(V) #endif #ifndef _RIRESULT #define _RIRESULT(T,N) _RIRESULT_##T(N) #define _RIRESULT_RtVoid(N) #define _RIRESULT_RtInt(N) RtInt N #define _RIRESULT_RtToken(N) RtToken N #define _RIRESULT_RtFloat(N) RtFloat N #define _RIRESULT_RtPointPtr(N) RtPointPtr N #define _RIRESULT_RtLightHandle(N) RtLightHandle N #define _RIRESULT_RtObjectHandle(N) RtObjectHandle N #endif #ifndef _RIV_PARMS #define _RIV_PARMS RtInt parmn, RtToken *tokens, RtPointer *parms #define _RIV_DECLS RtInt parmn; RtToken *tokens; RtPointer *parms #define _RIV_ARGS parmn, tokens, parms #endif #ifndef Ri #define Ri(RTN,NAME,ARGS) RTN Ri##NAME ( _RIPARMS(ARGS) ); #endif /* PVU is points, varying, uniform */ #ifndef RiVPVU #define RiVPVU(RTN,NAME,ARGS,PVU) RiV(RTN,NAME,ARGS) #endif #ifndef RiV #define RiV(RTN,NAME,ARGS) \ RTN Ri##NAME ( _RIPARMS(ARGS), ...), Ri##NAME##V ( _RIPARMS(ARGS), _RIV_PARMS); #endif /****************************************************************************/ #ifndef _Ri_NO_CONTEXT RiV(RtToken,Begin,L1(RtString,name)) RiV(RtToken,Context,L1(RtToken,name)) Ri(RtVoid,End,L0()) Ri(RtVoid,ErrorHandler,L1(RtFunc,handler)) #endif Ri(RtToken,Declare,L2(RtString,handle,RtString,decl)) Ri(RtVoid,FrameBegin,L1(RtInt,frame)) Ri(RtVoid,FrameEnd,L0()) Ri(RtVoid,Format,L3(RtInt,xres,RtInt,yres,RtFloat,par)) Ri(RtVoid,FrameAspectRatio,L1(RtFloat,frameaspectratio)) Ri(RtVoid,ScreenWindow,L4(RtFloat,left,RtFloat,right,RtFloat,bottom,RtFloat,top)) Ri(RtVoid,CropWindow,L4(RtFloat,xmin,RtFloat,xmax,RtFloat,ymin,RtFloat,ymax)) RiVPVU(RtVoid,Projection,L1(RtToken,name),RiVpvu(1,1,1)) Ri(RtVoid,Clipping,L2(RtFloat,near,RtFloat,far)) Ri(RtVoid,DepthOfField,L3(RtFloat,fstop,RtFloat,focallength,RtFloat,focaldistance)) Ri(RtVoid,Shutter,L2(RtFloat,min,RtFloat,max)) Ri(RtVoid,PixelVariance,L1(RtFloat,variation)) Ri(RtVoid,PixelSamples,L2(RtFloat,xsamples,RtFloat,ysamples)) Ri(RtVoid,PixelFilter,L3(RtFloatFunc,filterfunc,RtFloat,xwidth,RtFloat,ywidth)) Ri(RtVoid,Exposure,L2(RtFloat,gain,RtFloat,gamma)) RiVPVU(RtVoid,Imager,L1(RtToken,name),RiVpvu(1,1,1)) Ri(RtVoid,Quantize,L5(RtToken,type,RtInt,one,RtInt,min,RtInt,max,RtFloat,ditheramplitude)) RiVPVU(RtVoid,Display,L3(RtString,name,RtToken,type,RtToken,mode),RiVpvu(1,1,1)) RiVPVU(RtVoid,Hider,L1(RtToken,name),RiVpvu(1,1,1)) #ifndef _Ri_NO_PTRS Ri(RtVoid,ColorSamples,L3(RtInt,n,RtFloatPtr,nRGB,RtFloatPtr,RGBn)) #endif Ri(RtVoid,RelativeDetail,L1(RtFloat,relativedetail)) RiVPVU(RtVoid,Option,L1(RtToken,name),RiVpvu(1,1,1)) Ri(RtVoid,WorldBegin,L0()) Ri(RtVoid,WorldEnd,L0()) Ri(RtVoid,AttributeBegin,L0()) Ri(RtVoid,AttributeEnd,L0()) RiVPVU(RtVoid,Attribute,L1(RtToken,name),RiVpvu(1,1,1)) Ri(RtVoid,Color,L1(RtColor,c)) Ri(RtVoid,Opacity,L1(RtColor,c)) #ifndef _Ri_NO_PTRS RiVPVU(RtLightHandle,LightSource,L2(RtToken,handle,RtToken,name),RiVpvu(1,1,1)) RiVPVU(RtLightHandle,AreaLightSource,L2(RtToken,handle,RtToken,name),RiVpvu(1,1,1)) #endif Ri(RtVoid,Illuminate,L2(RtLightHandle,light,RtBoolean,onoff)) RiVPVU(RtVoid,Surface,L1(RtToken,name),RiVpvu(1,1,1)) RiVPVU(RtVoid,Atmosphere,L1(RtToken,name),RiVpvu(1,1,1)) RiVPVU(RtVoid,Interior,L1(RtToken,name),RiVpvu(1,1,1)) RiVPVU(RtVoid,Exterior,L1(RtToken,name),RiVpvu(1,1,1)) Ri(RtVoid,ShadingRate,L1(RtFloat,size)) Ri(RtVoid,ShadingInterpolation,L1(RtToken,type)) Ri(RtVoid,Matte,L1(RtBoolean,onoff)) Ri(RtVoid,Bound,L1(RtBound,bound)) Ri(RtVoid,Detail,L1(RtBound,bound)) Ri(RtVoid,DetailRange,L4(RtFloat,minvisible,RtFloat,lowertransition,RtFloat,uppertransition,RtFloat,maxvisible)) RiVPVU(RtVoid,GeometricApproximation,L1(RtToken,type),RiVpvu(1,1,1)) Ri(RtVoid,Orientation,L1(RtToken,orientation)) Ri(RtVoid,ReverseOrientation,L0()) Ri(RtVoid,Sides,L1(RtInt,sides)) Ri(RtVoid,TransformBegin,L0()) Ri(RtVoid,TransformEnd,L0()) Ri(RtVoid,Identity,L0()) Ri(RtVoid,Transform,L1(RtMatrix,transform)) Ri(RtVoid,ConcatTransform,L1(RtMatrix,transform)) Ri(RtVoid,Perspective,L1(RtFloat,fov)) Ri(RtVoid,Translate,L3(RtFloat,dx,RtFloat,dy,RtFloat,dz)) Ri(RtVoid,Rotate,L4(RtFloat,angle,RtFloat,dx,RtFloat,dy,RtFloat,dz)) Ri(RtVoid,Scale,L3(RtFloat,sx,RtFloat,sy,RtFloat,sz)) RiVPVU(RtVoid,Polygon,L1(RtInt,nvertices),RiVpvu(nvertices,nvertices,1)) #ifndef _Ri_NO_PTRS RiVPVU(RtVoid,GeneralPolygon,L2(RtInt,nloops,RtIntPtr,nvertices),RiVpvu(_RtInt_sum(nloops,nvertices),_nvertices,1)) RiVPVU(RtVoid,PointsPolygon,L3(RtInt,npolys,RtIntPtr,nvertices,RtIntPtr,vertices),RiVpvu(_RtInt_max(_RtInt_sum(nloops,nvertices),vertices)+1,_nvertices,npolys)) RiVPVU(RtVoid,PointsGeneralPolygon,L4(RtInt,npolys,RtIntPtr,nloops,RtIntPtr,nvertices,RtIntPtr,vertices),RiVpvu(_RtInt_max(_RtInt_sum(_RtInt_sum(npolys,nloops),nvertices),vertices)+1,_nvertices,npolys)) #endif Ri(RtVoid,Basis,L4(RtBasis,ubasis,RtInt,ustep,RtBasis,vbasis,RtInt,vstep)) RiVPVU(RtVoid,Patch,L1(RtToken,type),RiVpvu(type == RI_BILINEAR ? 4 : 16, 4, 1)) RiVPVU(RtVoid,Sphere,L4(RtFloat,radius,RtFloat,zmin,RtFloat,zmax,RtFloat,thetamax),RiVpvu(4,4,1)) RiVPVU(RtVoid,Cone,L3(RtFloat,height,RtFloat,radius,RtFloat,thetamax),RiVpvu(4,4,1)) RiVPVU(RtVoid,Cylinder,L4(RtFloat,radius,RtFloat,zmin,RtFloat,zmax,RtFloat,thetamax),RiVpvu(4,4,1)) RiVPVU(RtVoid,Hyperboloid,L3(RtPoint,point1,RtPoint,point2,RtFloat,thetamax),RiVpvu(4,4,1)) RiVPVU(RtVoid,Paraboloid,L4(RtFloat,rmax,RtFloat,zmin,RtFloat,zmax,RtFloat,thetamax),RiVpvu(4,4,1)) RiVPVU(RtVoid,Disk,L3(RtFloat,height,RtFloat,radius,RtFloat,thetamax),RiVpvu(4,4,1)) RiVPVU(RtVoid,Torus,L5(RtFloat,majorradius,RtFloat,minorradius,RtFloat,phimin,RtFloat,phimax,RtFloat,thetamax),RiVpvu(4,4,1)) Ri(RtVoid,SolidBegin,L1(RtToken,operation)) Ri(RtVoid,SolidEnd,L0()) #ifndef _Ri_NO_PTRS RiVPVU(RtObjectHandle,ObjectBegin,L1(RtToken,handle),RiVpvu(1,1,1)) #endif Ri(RtVoid,ObjectEnd,L0()) Ri(RtVoid,ObjectInstance,L1(RtObjectHandle,handle)) #ifndef _Ri_NO_PTRS Ri(RtVoid,MotionBeginV,L2(RtInt,n,RtFloatPtr,t)) #endif Ri(RtVoid,MotionEnd,L0()) #ifndef _Ri_NO_PTRS Ri(RtVoid,ArchiveRecordV,L3(RtToken,type,RtString,format,RtVaList,vap)) #endif /* QuickRenderMan additions */ Ri(RtVoid,CoordSysTransform,L1(RtToken,space)) #ifndef _Ri_NO_PTRS Ri(RtToken,CreateHandle,L2(RtString,handle,RtToken,type)) #endif RiVPVU(RtVoid,Drawing,L1(RtToken,name),RiVpvu(1,1,1)) Ri(RtVoid,FreeParameter,L3(RtToken,dict,RtToken,key,RtToken,handle)) Ri(RtVoid,FreeResource,L2(RtToken,dict,RtToken,key)) RiVPVU(RtVoid,Card,L2(RtPoint,p1,RtPoint,p2),RiVpvu(1,1,1)) RiVPVU(RtVoid,Circle,L2(RtFloat,radius,RtFloat,thetamax),RiVpvu(1,1,1)) RiVPVU(RtVoid,Curve,L3(RtToken,type,RtInt,nvertices,RtToken,wrap),RiVpvu(nvertices,2,1)) RiVPVU(RtVoid,Line,L1(RtInt,nvertices),RiVpvu(nvertices,nvertices,1)) #ifndef _Ri_NO_PTRS RiVPVU(RtVoid,PointsLine,L3(RtInt,nlines,RtIntPtr,nvertices,RtIntPtr,vertices),RiVpvu(_RtInt_max(_RtInt_sum(nlines,nvertices),vertices)+1,_nvertices,nlines)) Ri(RtVoid,LineStyle,L5(RtFloat,width,RtInt,n,RtFloatPtr,pattern,RtToken,cap,RtToken,join)) #endif #ifndef _Ri_NO_PTRS RiVPVU(RtToken,MacroBegin,L1(RtToken,handle),RiVpvu(1,1,1)) #endif Ri(RtVoid,MacroEnd,L0()) RiVPVU(RtVoid,MacroInstance,L1(RtToken,handle),RiVpvu(1,1,1)) #ifndef _Ri_NO_PTRS RiVPVU(RtVoid,NuCurve,L5(RtInt,nvertices,RtInt,order,RtFloatPtr,knots,RtFloat,umin,RtFloat,umax),RiVpvu(nvertices,2,1)) #endif RiVPVU(RtVoid,Parameter,L3(RtToken,dict,RtToken,key,RtString,parameter),RiVpvu(1,1,1)) Ri(RtVoid,PreemptBegin,L0()) Ri(RtVoid,PreemptEnd,L0()) RiVPVU(RtVoid,ReadArchive,L2(RtString,resource,RtFunc,callback),RiVpvu(1,1,1)) #ifndef _Ri_NO_PTRS RiVPVU(RtToken,Resource,L2(RtString,resource,RtToken,type),RiVpvu(1,1,1)) #endif Ri(RtVoid,ShadingInterval,L1(RtFloat,interval)) Ri(RtVoid,Syncronize,L1(RtToken,mode)) Ri(RtVoid,Version,L1(RtFloat,version)) /****************************************************************************/ #undef Ri #undef RiV #undef RiVPVU #ifdef _Ri_NO_CONTEXT #undef _Ri_NO_CONTEXT #endif #ifdef _Ri_NO_PTRS #undef _Ri_NO_PTRS #endif q3d0.1/src/q3d/ri/ri.h0100644000175200017560000000354506663227123014716 0ustar stephensstepheng#ifndef _ri_ri_h #ifndef __rcs_id__ #ifndef __rcs_id_ri_ri_h__ #define __rcs_id_ri_ri_h__ static const char __rcs_id_ri_ri_h[] = "$Id: ri.h,v 1.2 1999/02/19 09:26:43 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #define _ri_ri_h #include /* va_list */ #define RtConst const typedef void RtVoid; typedef short RtBoolean; typedef RtVoid *RtPointer; typedef int RtInt, *RtIntPtr; typedef float RtFloat, *RtFloatPtr; typedef RtFloat RtPoint[3]; typedef RtPoint *RtPointPtr; typedef RtFloat RtColor[3]; typedef RtFloat RtBound[6]; typedef RtFloat RtBasis[4][4]; typedef RtFloat RtMatrix[4][4]; typedef va_list RtVaList; typedef RtConst char *RtToken; typedef char *RtString; typedef RtToken RtLightHandle; typedef RtToken RtObjectHandle; #define RI_FALSE 0 #define RI_TRUE (! RI_FALSE) #define RI_INFINITY 1.0e38 #define RI_EPSILON 1.0e-10 #define RI_NULL ((RtPointer)0) typedef RtVoid (*RtFunc)(); typedef RtFloat (*RtFloatFunc)(); /****************************************************************************/ extern RtToken #define RI(NAME,STR,DECL) RI_##NAME, #include "ri/tokens.def" _RI_; /****************************************************************************/ extern RtConst RtBasis RiBezierBasis, RiBSplineBasis, RiCatmullRomBasis, RiHermiteBasis, RiPowerBasis; #define RI_BEZIERSTEP ((RtInt)3) #define RI_BSPLINESTEP ((RtInt)1) #define RI_CATMULLROMSTEP ((RtInt)1) #define RI_HERMITESTEP ((RtInt)2) #define RI_POWERSTEP ((RtInt)4) /****************************************************************************/ RtVoid RiErrorIgnore(), RiErrorPrint(), RiErrorAbort(); RtInt RiLastError; RtVoid RiErrorHandler(RtFunc func); #include "ri/errors.def" /****************************************************************************/ #include "ri/procs.def" /****************************************************************************/ #endif q3d0.1/src/q3d/ri/tokens.def0100644000175200017560000000453006663227123016111 0ustar stephensstepheng/* $Id: tokens.def,v 1.2 1999/02/19 09:26:43 stephensk Exp $ */ /* Standard Geometric */ RI(P, "P", "vertex point") RI(PZ, "Pz", "vertex float") RI(PW, "Pw", "vertex float[4]") RI(N, "N", "varying point") RI(CS, "cs", "color") RI(OS, "os", "color") RI(S, "s", "varying float") RI(T, "t", "varying float") RI(ST, "st", "varying float[2]") /* Other system tokens */ /* RiBegin() */ RI(RENDERER, "renderer", "string") RI(DRAFT, "draft", "") RI(ARCHIVE, "archive", "") RI(ADDRESS, "address", "") RI(FILEPATH, "filepath", "string") RI(FILEPOINTER, "filepointer", "") RI(FORMAT, "format", "string") RI(ASCIIFILE, "asciifile", "string") RI(BINARYFILE, "binaryfile", "string") /* RiProjection() */ RI(ORTHOGRAPHIC, "orthographic", "") RI(PERSPECTIVE, "perspective", "") RI(FOV, "fov", "float") /* RiPatch */ RI(BILINEAR, "bilinear", "") RI(BICUBIC, "bicubic", "") /* RiPatchMesh */ RI(PERIODIC, "periodic", "") RI(NONPERIODIC, "nonperiodic", "") /* RiArchiveRecord */ RI(COMMENT, "comment", "") RI(STRUCTURE, "structure", "") /* Named coordinate systems */ RI(REAL, "real", "") RI(RASTER, "raster", "") RI(SCREEN, "screen", "") RI(CAMERA, "camera", "") RI(WORLD, "world", "") RI(OBJECT, "object", "") RI(SHADER, "shader", "") /* Shader level tokens */ RI(_Ci, "Ci", "varying color") RI(_Oi, "Oi", "varying color") RI(_dPdu, "dPdu", "varying point") RI(_dPdv, "dPdv", "varying point") RI(_Ng, "Ng", "uniform point") RI(_u, "u", "varying float") RI(_v, "v", "varying float") RI(_du, "du", "varying float") RI(_dv, "dv", "varying float") RI(_L, "L", "varying point") RI(_Cl, "Cl", "varying color") RI(_Ol, "Ol", "varying color") /* System level tokens */ /* RiFrameBegin */ RI(_frame, "*frame", "integer") /* RiClipping */ RI(_clipping, "*clipping", "float[2]") /* RiTextureCoordinates */ RI(_tc, "*tc", "float[8]") /* RiSides */ RI(_sides, "*sides", "integer") /* RiBasis */ RI(_ubasis, "*ubasis", "float[16]") RI(_vbasis, "*vbasis", "float[16]") RI(_ustep, "*ustep", "integer") RI(_vstep, "*vstep", "integer") /* RiFormat */ RI(_format, "*format", "float[3]") /* RiPixel */ RI(_pixel, "*pixel", "float[5]") /* RiOrigin */ RI(_origin, "*origin", "float[5]") /* RiRaster */ RI(_raster, "*raster", "float[5]") /* RiFrameAspectRatio */ RI(_frameAspectRatio, "*frameAspectRatio", "float") /* RiScreenWindow */ RI(_screenWindow, "*screenWindow", "float[4]") #undef RI q3d0.1/src/q3d/tests/0040755000175200017560000000000007306134456014660 5ustar stephensstephengq3d0.1/src/q3d/tests/CVS/0040755000175200017560000000000007236675453015324 5ustar stephensstephengq3d0.1/src/q3d/tests/CVS/Root0100644000175200017560000000003407236675453016164 0ustar stephensstepheng:local://cvs/ioncvs/cvsroot q3d0.1/src/q3d/tests/CVS/Repository0100644000175200017560000000002707236675453017422 0ustar stephensstephenghome/ion/src/q3d/tests q3d0.1/src/q3d/tests/CVS/Entries0100644000175200017560000000012207236675453016650 0ustar stephensstepheng/test1.c/1.2/Fri Feb 19 09:26:44 1999// /test2.c/1.2/Fri Feb 19 09:26:44 1999// D q3d0.1/src/q3d/tests/test1.c0100644000175200017560000000261006663227124016060 0ustar stephensstepheng #ifndef __rcs_id__ #ifndef __rcs_id_tests_test1_c__ #define __rcs_id_tests_test1_c__ static const char __rcs_id_tests_test1_c[] = "$Id: test1.c,v 1.2 1999/02/19 09:26:44 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "ri/ri.h" #include "qr/qr.h" #include "common/image.h" int main(int argc, char **argv) { int npolys = argc > 1 ? atoi(argv[1]) : 1; RiBeginV(0, 0, 0, 0); _riImage = _rtImage_init(0, 78, 23, 8, 0); _rtImage_set(_riImage, " "); _rtImage_initZbuffer(_riImage); _rtImage_clearZbuffer(_riImage); RiWorldBegin(); { extern rtTexture *texmap_texture; texmap_texture = _rtImage_init(0, 4, 4, 8, "012345\000789ABCDEF"); RiSurfaceV("texmap", 0, 0, 0); } { int i; RtPoint P[] = { { .20, .80, 0 }, { .80, .90, 0 }, { .70, .20, 0 }, { .10, .10, 0 } }; RtFloat st[] = { 0, 0, 1, 0, 1, 1, 0, 1 }; RtToken tokens[] = { RI_P, RI_ST }; RtPointer parms[] = { P, st }; _qr_stats_begin(); for ( i = 0; i < npolys; i ++ ) { _qr_RiPolygonV(4, 2, tokens, parms); /* RiPolygonV(4, 2, tokens, parms); */ } _qr_stats_end(); } { int i, j; for ( i = 0; i < _riImage->sy; i ++ ) { for ( j = 0; j < _riImage->sx; j ++ ) { putchar(_riImage->pixels[i][j]); } putchar('\n'); } } RiWorldEnd(); RiEnd(); return 0; } q3d0.1/src/q3d/tests/test2.c0100644000175200017560000000155106663227124016064 0ustar stephensstepheng #ifndef __rcs_id__ #ifndef __rcs_id_tests_test2_c__ #define __rcs_id_tests_test2_c__ static const char __rcs_id_tests_test2_c[] = "$Id: test2.c,v 1.2 1999/02/19 09:26:44 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "ri/ri.h" int main(int argc, char **argv) { { RtString filepath = "-"; RiBegin(RI_NULL, RI_RENDERER, &RI_ARCHIVE, RI_FILEPATH, &filepath, RI_NULL); } RiProjection(RI_PERSPECTIVE, RI_NULL); RiWorldBegin(); RiSurfaceV("texmap", 0, 0, 0); { RtPoint P[] = { { .20, 1.20, 0 }, { .80, .90, 0 }, { .70, .20, 0 }, { .10, .10, 0 } }; RtFloat st[] = { 0, 0, 1, 0, 1, 1, 0, 1 }; RtToken tokens[] = { RI_P, RI_ST }; RtPointer parms[] = { P, st }; RiPolygonV(4, 2, tokens, parms); } RiWorldEnd(); RiEnd(); return 0; } q3d0.1/src/GUM_BUILD_ROOT0100644000175200017560000000060607306140063015152 0ustar stephensstepheng# $Id: GUM_BUILD_ROOT,v 1.3 2001/04/07 10:26:24 stephens Exp $ # Build options DEBUG=YES #OPTIMIZE=NO # output root is ../gumo GUM_GENERATED_ROOT:=$(shell cd $(GUM_BUILD_ROOT)/../gumo && /bin/pwd)# # Quick install. GUM_GENERATED_LIB_DIR=$(INSTALL_DIR_LIB)# # Pick up /iimp stuff PATH:=/iimp/bin:$(PATH) INCLUDE_DIRS_GLOBAL:=$(GUM_BUILD_ROOT) /iimp/include# LIB_DIRS_GLOBAL:=/iimp/lib# q3d0.1/README0100644000175200017560000000141107306140063013101 0ustar stephensstephengq3d 0.1 README ============================================================================== Copyright (c) 1997-2001 Kurt A. Stephens and Ion, Inc., All Rights Reserved. http://www.acm.org/~stephensk Kurt A. Stephens and Ion, Inc. MAKE NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. Kurt A. Stephens and Ion, Inc. SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. $Id: COPYRIGHT,v 1.3 2001/04/03 18:37:16 stephens Exp $ ============================================================================== q3d0.1/COPYRIGHT0100644000175200017560000000113107306140063013513 0ustar stephensstephengCopyright (c) 1997-2001 Kurt A. Stephens and Ion, Inc., All Rights Reserved. http://www.acm.org/~stephensk Kurt A. Stephens and Ion, Inc. MAKE NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. Kurt A. Stephens and Ion, Inc. SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. $Id: COPYRIGHT,v 1.3 2001/04/03 18:37:16 stephens Exp $ q3d0.1/CHANGES0100644000175200017560000000014007306140063013212 0ustar stephensstephengq3d 0.1 CHANGES ============================================================================== q3d0.1/TOC0100644000175200017560000002726407306140066012612 0ustar stephensstephengq3d 0.1 Table of Contents ============================================================================== q3d0.1: total 7 drwxr-xr-x 3 stephens stepheng 1024 Jun 2 05:30 . drwxr-xr-x 3 stephens stepheng 1024 Jun 2 05:30 .. -rw-r--r-- 1 stephens stepheng 96 Jun 2 05:30 CHANGES -rw-r--r-- 1 stephens stepheng 601 Jun 2 05:30 COPYRIGHT -rw-r--r-- 1 stephens stepheng 777 Jun 2 05:30 README -rw-r--r-- 1 stephens stepheng 105 Jun 2 05:30 TOC drwxr-xr-x 3 stephens stepheng 1024 Jun 2 05:30 src q3d0.1/src: total 4 drwxr-xr-x 3 stephens stepheng 1024 Jun 2 05:30 . drwxr-xr-x 3 stephens stepheng 1024 Jun 2 05:30 .. -rw-r--r-- 1 stephens stepheng 390 Jun 2 05:30 GUM_BUILD_ROOT drwxr-xr-x 12 stephens stepheng 1024 Jun 2 05:30 q3d q3d0.1/src/q3d: total 15 drwxr-xr-x 12 stephens stepheng 1024 Jun 2 05:30 . drwxr-xr-x 3 stephens stepheng 1024 Jun 2 05:30 .. drwxr-xr-x 2 stephens stepheng 1024 Jun 2 05:11 CVS -rw-r--r-- 1 stephens stepheng 1282 Jun 2 05:11 Makefile -rw-r--r-- 1 stephens stepheng 140 Feb 17 1999 PKG drwxr-xr-x 3 stephens stepheng 1024 Jun 2 05:30 archive drwxr-xr-x 3 stephens stepheng 1024 Jun 2 05:30 common drwxr-xr-x 4 stephens stepheng 1024 Jun 2 05:30 device drwxr-xr-x 3 stephens stepheng 1024 Jun 2 05:30 dispatch drwxr-xr-x 3 stephens stepheng 1024 Feb 2 21:29 macro drwxr-xr-x 4 stephens stepheng 1024 Jun 2 05:30 qr drwxr-xr-x 3 stephens stepheng 1024 Feb 2 21:29 rcs drwxr-xr-x 3 stephens stepheng 1024 Feb 2 21:29 ri drwxr-xr-x 3 stephens stepheng 1024 Jun 2 05:00 tests q3d0.1/src/q3d/CVS: total 5 drwxr-xr-x 2 stephens stepheng 1024 Jun 2 05:11 . drwxr-xr-x 12 stephens stepheng 1024 Jun 2 05:30 .. -rw-r--r-- 1 stephens stepheng 188 Jun 2 05:11 Entries -rw-r--r-- 1 stephens stepheng 17 Feb 2 21:29 Repository -rw-r--r-- 1 stephens stepheng 28 Feb 2 21:29 Root q3d0.1/src/q3d/archive: total 12 drwxr-xr-x 3 stephens stepheng 1024 Jun 2 05:30 . drwxr-xr-x 12 stephens stepheng 1024 Jun 2 05:30 .. drwxr-xr-x 2 stephens stepheng 1024 Jun 2 05:11 CVS -rw-r--r-- 1 stephens stepheng 461 Feb 19 1999 archive.h -rw-r--r-- 1 stephens stepheng 1478 Apr 22 1999 context.c -rw-r--r-- 1 stephens stepheng 5629 Jun 2 05:11 dispatch.c q3d0.1/src/q3d/archive/CVS: total 5 drwxr-xr-x 2 stephens stepheng 1024 Jun 2 05:11 . drwxr-xr-x 3 stephens stepheng 1024 Jun 2 05:30 .. -rw-r--r-- 1 stephens stepheng 129 Jun 2 05:11 Entries -rw-r--r-- 1 stephens stepheng 25 Feb 2 21:29 Repository -rw-r--r-- 1 stephens stepheng 28 Feb 2 21:29 Root q3d0.1/src/q3d/common: total 55 drwxr-xr-x 3 stephens stepheng 1024 Jun 2 05:30 . drwxr-xr-x 12 stephens stepheng 1024 Jun 2 05:30 .. drwxr-xr-x 2 stephens stepheng 1024 Jun 2 05:11 CVS -rw-r--r-- 1 stephens stepheng 6612 Jun 2 05:11 common.c -rw-r--r-- 1 stephens stepheng 875 Feb 19 1999 common.h -rw-r--r-- 1 stephens stepheng 2318 Apr 22 1999 context.c -rw-r--r-- 1 stephens stepheng 1158 Feb 19 1999 context.h -rw-r--r-- 1 stephens stepheng 973 Feb 19 1999 dispatch.c -rw-r--r-- 1 stephens stepheng 1919 Jun 28 1999 dither.c -rw-r--r-- 1 stephens stepheng 2461 Feb 19 1999 error.c -rw-r--r-- 1 stephens stepheng 449 Apr 22 1999 error.h -rw-r--r-- 1 stephens stepheng 547 Feb 19 1999 handle.h -rw-r--r-- 1 stephens stepheng 2238 Jun 28 1999 image.c -rw-r--r-- 1 stephens stepheng 872 Jun 28 1999 image.h -rw-r--r-- 1 stephens stepheng 609 Apr 22 1999 mem.c -rw-r--r-- 1 stephens stepheng 383 Feb 19 1999 mem.h -rw-r--r-- 1 stephens stepheng 2156 Jun 2 05:11 ndc.c -rw-r--r-- 1 stephens stepheng 387 Apr 22 1999 resource.c -rw-r--r-- 1 stephens stepheng 554 Jun 2 05:11 resource.h -rw-r--r-- 1 stephens stepheng 1310 Feb 19 1999 rixform.c -rw-r--r-- 1 stephens stepheng 562 Apr 22 1999 shader.h -rw-r--r-- 1 stephens stepheng 840 Apr 22 1999 shadervars.h -rw-r--r-- 1 stephens stepheng 5754 Jun 28 1999 token.c -rw-r--r-- 1 stephens stepheng 1849 Apr 22 1999 token.h -rw-r--r-- 1 stephens stepheng 612 Feb 19 1999 util.c -rw-r--r-- 1 stephens stepheng 369 Feb 19 1999 util.h -rw-r--r-- 1 stephens stepheng 3248 Jun 2 05:11 xform.c -rw-r--r-- 1 stephens stepheng 1253 Apr 22 1999 xform.h q3d0.1/src/q3d/common/CVS: total 5 drwxr-xr-x 2 stephens stepheng 1024 Jun 2 05:11 . drwxr-xr-x 3 stephens stepheng 1024 Jun 2 05:30 .. -rw-r--r-- 1 stephens stepheng 1019 Jun 2 05:11 Entries -rw-r--r-- 1 stephens stepheng 24 Feb 2 21:29 Repository -rw-r--r-- 1 stephens stepheng 28 Feb 2 21:29 Root q3d0.1/src/q3d/device: total 4 drwxr-xr-x 4 stephens stepheng 1024 Jun 2 05:30 . drwxr-xr-x 12 stephens stepheng 1024 Jun 2 05:30 .. drwxr-xr-x 2 stephens stepheng 1024 Feb 2 21:29 CVS drwxr-xr-x 3 stephens stepheng 1024 Jun 2 05:30 x q3d0.1/src/q3d/device/CVS: total 5 drwxr-xr-x 2 stephens stepheng 1024 Feb 2 21:29 . drwxr-xr-x 4 stephens stepheng 1024 Jun 2 05:30 .. -rw-r--r-- 1 stephens stepheng 8 Feb 2 21:29 Entries -rw-r--r-- 1 stephens stepheng 24 Feb 2 21:29 Repository -rw-r--r-- 1 stephens stepheng 28 Feb 2 21:29 Root q3d0.1/src/q3d/device/x: total 14 drwxr-xr-x 3 stephens stepheng 1024 Jun 2 05:30 . drwxr-xr-x 4 stephens stepheng 1024 Jun 2 05:30 .. drwxr-xr-x 2 stephens stepheng 1024 Jun 2 05:11 CVS -rw-r--r-- 1 stephens stepheng 340 Feb 19 1999 Makefile -rw-r--r-- 1 stephens stepheng 8348 Jun 2 05:11 x.c -rw-r--r-- 1 stephens stepheng 819 Apr 22 1999 x.h q3d0.1/src/q3d/device/x/CVS: total 5 drwxr-xr-x 2 stephens stepheng 1024 Jun 2 05:11 . drwxr-xr-x 3 stephens stepheng 1024 Jun 2 05:30 .. -rw-r--r-- 1 stephens stepheng 115 Jun 2 05:11 Entries -rw-r--r-- 1 stephens stepheng 26 Feb 2 21:29 Repository -rw-r--r-- 1 stephens stepheng 28 Feb 2 21:29 Root q3d0.1/src/q3d/dispatch: total 11 drwxr-xr-x 3 stephens stepheng 1024 Jun 2 05:30 . drwxr-xr-x 12 stephens stepheng 1024 Jun 2 05:30 .. drwxr-xr-x 2 stephens stepheng 1024 Feb 2 21:29 CVS -rw-r--r-- 1 stephens stepheng 1453 Feb 19 1999 dispatch.c -rw-r--r-- 1 stephens stepheng 901 Feb 19 1999 dispatch.h -rw-r--r-- 1 stephens stepheng 861 Feb 19 1999 nocntx.c -rw-r--r-- 1 stephens stepheng 767 Feb 19 1999 notimpl.c -rw-r--r-- 1 stephens stepheng 838 Feb 19 1999 null.c -rw-r--r-- 1 stephens stepheng 1629 Jun 28 1999 riv.c q3d0.1/src/q3d/dispatch/CVS: total 5 drwxr-xr-x 2 stephens stepheng 1024 Feb 2 21:29 . drwxr-xr-x 3 stephens stepheng 1024 Jun 2 05:30 .. -rw-r--r-- 1 stephens stepheng 248 Feb 2 21:29 Entries -rw-r--r-- 1 stephens stepheng 26 Feb 2 21:29 Repository -rw-r--r-- 1 stephens stepheng 28 Feb 2 21:29 Root q3d0.1/src/q3d/macro: total 10 drwxr-xr-x 3 stephens stepheng 1024 Feb 2 21:29 . drwxr-xr-x 12 stephens stepheng 1024 Jun 2 05:30 .. drwxr-xr-x 2 stephens stepheng 1024 Feb 2 21:29 CVS -rw-r--r-- 1 stephens stepheng 512 Feb 19 1999 context.c -rw-r--r-- 1 stephens stepheng 3754 Jun 28 1999 dispatch.c -rw-r--r-- 1 stephens stepheng 1069 Jun 28 1999 macro.h q3d0.1/src/q3d/macro/CVS: total 5 drwxr-xr-x 2 stephens stepheng 1024 Feb 2 21:29 . drwxr-xr-x 3 stephens stepheng 1024 Feb 2 21:29 .. -rw-r--r-- 1 stephens stepheng 127 Feb 2 21:29 Entries -rw-r--r-- 1 stephens stepheng 23 Feb 2 21:29 Repository -rw-r--r-- 1 stephens stepheng 28 Feb 2 21:29 Root q3d0.1/src/q3d/qr: total 54 drwxr-xr-x 4 stephens stepheng 1024 Jun 2 05:30 . drwxr-xr-x 12 stephens stepheng 1024 Jun 2 05:30 .. drwxr-xr-x 2 stephens stepheng 1024 Jun 2 05:11 CVS -rw-r--r-- 1 stephens stepheng 409 Apr 22 1999 context.c -rw-r--r-- 1 stephens stepheng 622 Apr 22 1999 dispatch.c -rw-r--r-- 1 stephens stepheng 966 Feb 19 1999 dopixel.c -rw-r--r-- 1 stephens stepheng 13893 Jun 2 05:11 polyscan.c -rw-r--r-- 1 stephens stepheng 835 Apr 22 1999 qr.h -rw-r--r-- 1 stephens stepheng 601 Apr 22 1999 shader.c drwxr-xr-x 3 stephens stepheng 1024 Jun 2 05:30 shaders -rwxr-xr-x 1 stephens stepheng 25669 Jun 2 04:39 signbit -rw-r--r-- 1 stephens stepheng 1679 Feb 19 1999 signbit.c -rw-r--r-- 1 stephens stepheng 360 Jun 2 04:39 signbit.h q3d0.1/src/q3d/qr/CVS: total 5 drwxr-xr-x 2 stephens stepheng 1024 Jun 2 05:11 . drwxr-xr-x 4 stephens stepheng 1024 Jun 2 05:30 .. -rw-r--r-- 1 stephens stepheng 346 Jun 2 05:11 Entries -rw-r--r-- 1 stephens stepheng 20 Feb 2 21:29 Repository -rw-r--r-- 1 stephens stepheng 28 Feb 2 21:29 Root q3d0.1/src/q3d/qr/shaders: total 4 drwxr-xr-x 3 stephens stepheng 1024 Jun 2 05:30 . drwxr-xr-x 4 stephens stepheng 1024 Jun 2 05:30 .. drwxr-xr-x 2 stephens stepheng 1024 Feb 2 21:29 CVS -rw-r--r-- 1 stephens stepheng 890 Feb 19 1999 texmap.c q3d0.1/src/q3d/qr/shaders/CVS: total 5 drwxr-xr-x 2 stephens stepheng 1024 Feb 2 21:29 . drwxr-xr-x 3 stephens stepheng 1024 Jun 2 05:30 .. -rw-r--r-- 1 stephens stepheng 43 Feb 2 21:29 Entries -rw-r--r-- 1 stephens stepheng 28 Feb 2 21:29 Repository -rw-r--r-- 1 stephens stepheng 28 Feb 2 21:29 Root q3d0.1/src/q3d/rcs: total 3 drwxr-xr-x 3 stephens stepheng 1024 Feb 2 21:29 . drwxr-xr-x 12 stephens stepheng 1024 Jun 2 05:30 .. drwxr-xr-x 2 stephens stepheng 1024 Feb 2 21:29 CVS q3d0.1/src/q3d/rcs/CVS: total 5 drwxr-xr-x 2 stephens stepheng 1024 Feb 2 21:29 . drwxr-xr-x 3 stephens stepheng 1024 Feb 2 21:29 .. -rw-r--r-- 1 stephens stepheng 2 Feb 2 21:29 Entries -rw-r--r-- 1 stephens stepheng 21 Feb 2 21:29 Repository -rw-r--r-- 1 stephens stepheng 28 Feb 2 21:29 Root q3d0.1/src/q3d/ri: total 22 drwxr-xr-x 3 stephens stepheng 1024 Feb 2 21:29 . drwxr-xr-x 12 stephens stepheng 1024 Jun 2 05:30 .. drwxr-xr-x 2 stephens stepheng 1024 Feb 2 21:29 CVS -rw-r--r-- 1 stephens stepheng 1807 Feb 19 1999 errors.def -rw-r--r-- 1 stephens stepheng 727 Feb 19 1999 listmacro.h -rw-r--r-- 1 stephens stepheng 10250 Feb 19 1999 procs.def -rw-r--r-- 1 stephens stepheng 1893 Feb 19 1999 ri.h -rw-r--r-- 1 stephens stepheng 2392 Feb 19 1999 tokens.def q3d0.1/src/q3d/ri/CVS: total 5 drwxr-xr-x 2 stephens stepheng 1024 Feb 2 21:29 . drwxr-xr-x 3 stephens stepheng 1024 Feb 2 21:29 .. -rw-r--r-- 1 stephens stepheng 211 Feb 2 21:29 Entries -rw-r--r-- 1 stephens stepheng 20 Feb 2 21:29 Repository -rw-r--r-- 1 stephens stepheng 28 Feb 2 21:29 Root q3d0.1/src/q3d/tests: total 6 drwxr-xr-x 3 stephens stepheng 1024 Jun 2 05:00 . drwxr-xr-x 12 stephens stepheng 1024 Jun 2 05:30 .. drwxr-xr-x 2 stephens stepheng 1024 Feb 2 21:29 CVS -rw-r--r-- 1 stephens stepheng 1416 Feb 19 1999 test1.c -rw-r--r-- 1 stephens stepheng 873 Feb 19 1999 test2.c q3d0.1/src/q3d/tests/CVS: total 5 drwxr-xr-x 2 stephens stepheng 1024 Feb 2 21:29 . drwxr-xr-x 3 stephens stepheng 1024 Jun 2 05:00 .. -rw-r--r-- 1 stephens stepheng 82 Feb 2 21:29 Entries -rw-r--r-- 1 stephens stepheng 23 Feb 2 21:29 Repository -rw-r--r-- 1 stephens stepheng 28 Feb 2 21:29 Root