summaryrefslogtreecommitdiff
path: root/graphics/aqsis
diff options
context:
space:
mode:
authorjoerg <joerg@pkgsrc.org>2006-05-11 18:55:31 +0000
committerjoerg <joerg@pkgsrc.org>2006-05-11 18:55:31 +0000
commit54791df01a83706bb3eec18c495f4b98cfcafd54 (patch)
treea43eb332e4862abb98a8871b47a14f95c3e43a86 /graphics/aqsis
parent4c49c57c7e8e202cd2a731c8c56b7783dccf1874 (diff)
downloadpkgsrc-54791df01a83706bb3eec18c495f4b98cfcafd54.tar.gz
Fix C++ to work with GCC 3.4. Fix linkage to make at least some sense.
Always link with -lddmsock, it might be overridden in the application though. The former guranties that the libraries don't have unresolved symbols. Bump revision.
Diffstat (limited to 'graphics/aqsis')
-rw-r--r--graphics/aqsis/Makefile5
-rw-r--r--graphics/aqsis/distinfo11
-rw-r--r--graphics/aqsis/patches/patch-aa23
-rw-r--r--graphics/aqsis/patches/patch-ah34
-rw-r--r--graphics/aqsis/patches/patch-ai34
-rw-r--r--graphics/aqsis/patches/patch-aj139
-rw-r--r--graphics/aqsis/patches/patch-ak13
-rw-r--r--graphics/aqsis/patches/patch-al204
-rw-r--r--graphics/aqsis/patches/patch-am13
-rw-r--r--graphics/aqsis/patches/patch-an13
10 files changed, 476 insertions, 13 deletions
diff --git a/graphics/aqsis/Makefile b/graphics/aqsis/Makefile
index 5ed7bff0eb1..5d9008aa9a8 100644
--- a/graphics/aqsis/Makefile
+++ b/graphics/aqsis/Makefile
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.24 2006/03/04 21:29:46 jlam Exp $
+# $NetBSD: Makefile,v 1.25 2006/05/11 18:55:31 joerg Exp $
#
DISTNAME= aqsis-0.6.4
-PKGREVISION= 5
+PKGREVISION= 6
CATEGORIES= graphics
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=aqsis/}
@@ -23,6 +23,7 @@ USE_LANGUAGES+= c c++
.include "../../devel/libargparse/buildlink3.mk"
.include "../../graphics/Mesa/buildlink3.mk"
.include "../../graphics/tiff/buildlink3.mk"
+.include "../../mk/dlopen.buildlink3.mk"
.include "../../mk/x11.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/graphics/aqsis/distinfo b/graphics/aqsis/distinfo
index 51df1b65337..832807f031f 100644
--- a/graphics/aqsis/distinfo
+++ b/graphics/aqsis/distinfo
@@ -1,12 +1,19 @@
-$NetBSD: distinfo,v 1.4 2005/02/24 08:45:03 agc Exp $
+$NetBSD: distinfo,v 1.5 2006/05/11 18:55:31 joerg Exp $
SHA1 (aqsis-0.6.4.tar.gz) = 7a8e10db5502907840d8d2f4269eb3b489875dd4
RMD160 (aqsis-0.6.4.tar.gz) = d2b034e05d47e31aa040471be37b34750154e6e5
Size (aqsis-0.6.4.tar.gz) = 857020 bytes
-SHA1 (patch-aa) = c7d5c7f758d3b9faa2d0f98ac4baeb284c343829
+SHA1 (patch-aa) = b129d38fb94e1c44ec459022e382b3c619eb8302
SHA1 (patch-ab) = 2f0f878996aa551a35c65d90299162e13661cbab
SHA1 (patch-ac) = 5633148c8f7617ddef0e8831bd003dc9cb3f3596
SHA1 (patch-ad) = d5dc010175fc749268075e391fcb9fd5ff0ae6b9
SHA1 (patch-ae) = d2ce4d8833a0ea27aaa6242c476fe542efe92574
SHA1 (patch-af) = 5251aedf37fd4ab8e954d90e484d82bdcf0a8e45
SHA1 (patch-ag) = 673c7fb0a9619d5a8f8a0ad0906c5f29fb639358
+SHA1 (patch-ah) = 30c2605ef5f0f82df71fc1b494c3ed5beeea78e8
+SHA1 (patch-ai) = 60ab77412e3e4a223604028087f377f94d113bdc
+SHA1 (patch-aj) = 0cd6dcc80463ffb1193e25b55f6c160849ef0ab6
+SHA1 (patch-ak) = 45ee2a15967b5c0f75ed4ba7ecc3790373f5e44d
+SHA1 (patch-al) = 3f721b5a28714c7ed601aace984096ef142c105b
+SHA1 (patch-am) = 8227295b85018e5294ab1c8ca5c415dbe0371282
+SHA1 (patch-an) = 2a0dead7923ce600b70577f9f476bc0bab527131
diff --git a/graphics/aqsis/patches/patch-aa b/graphics/aqsis/patches/patch-aa
index 3bd89a985b9..d748e5296da 100644
--- a/graphics/aqsis/patches/patch-aa
+++ b/graphics/aqsis/patches/patch-aa
@@ -1,16 +1,21 @@
-$NetBSD: patch-aa,v 1.1.1.1 2002/10/28 15:12:36 agc Exp $
+$NetBSD: patch-aa,v 1.2 2006/05/11 18:55:31 joerg Exp $
---- teqser/Makefile.in 2002/06/24 19:29:00 1.1
-+++ teqser/Makefile.in 2002/06/24 19:29:28
-@@ -81,7 +81,11 @@
+--- teqser/Makefile.in.orig 2002-05-24 08:33:04.000000000 +0000
++++ teqser/Makefile.in
+@@ -81,7 +81,7 @@ YACC = @YACC@
bin_PROGRAMS = teqser
teqser_SOURCES = teqser.cpp
-+ifdef HAVE_LIBDL
- teqser_LDADD = $(top_builddir)/render/libaqsis.la $(top_builddir)/libddmsimple/libddmsimple.la $(top_builddir)/libaqsistypes/libaqsistypes.la $(top_builddir)/libshadervm/libshadervm.la $(top_builddir)/libshaderexecenv/libshaderexecenv.la -ltiff -largparse -ldl
-+else
-+teqser_LDADD = $(top_builddir)/render/libaqsis.la $(top_builddir)/libddmsimple/libddmsimple.la $(top_builddir)/libaqsistypes/libaqsistypes.la $(top_builddir)/libshadervm/libshadervm.la $(top_builddir)/libshaderexecenv/libshaderexecenv.la -ltiff -largparse
-+endif
+-teqser_LDADD = $(top_builddir)/render/libaqsis.la $(top_builddir)/libddmsimple/libddmsimple.la $(top_builddir)/libaqsistypes/libaqsistypes.la $(top_builddir)/libshadervm/libshadervm.la $(top_builddir)/libshaderexecenv/libshaderexecenv.la -ltiff -largparse -ldl
++teqser_LDADD = $(top_builddir)/render/libaqsis.la $(top_builddir)/libaqsistypes/libaqsistypes.la $(top_builddir)/libshadervm/libshadervm.la $(top_builddir)/libshaderexecenv/libshaderexecenv.la -largparse ${DL_LIBS}
@DEBUG_TRUE@AM_CXXFLAGS = -g -Wall
@DEBUG_FALSE@AM_CXXFLAGS =
+@@ -100,7 +100,6 @@ LDFLAGS = @LDFLAGS@
+ LIBS = @LIBS@
+ teqser_OBJECTS = teqser.o
+ teqser_DEPENDENCIES = $(top_builddir)/render/libaqsis.la \
+-$(top_builddir)/libddmsimple/libddmsimple.la \
+ $(top_builddir)/libaqsistypes/libaqsistypes.la \
+ $(top_builddir)/libshadervm/libshadervm.la \
+ $(top_builddir)/libshaderexecenv/libshaderexecenv.la
diff --git a/graphics/aqsis/patches/patch-ah b/graphics/aqsis/patches/patch-ah
new file mode 100644
index 00000000000..ad59375c03a
--- /dev/null
+++ b/graphics/aqsis/patches/patch-ah
@@ -0,0 +1,34 @@
+$NetBSD: patch-ah,v 1.1 2006/05/11 18:55:31 joerg Exp $
+
+--- render/motion.h.orig 2006-04-28 16:12:32.000000000 +0000
++++ render/motion.h
+@@ -74,9 +74,9 @@ class CqMotionSpec
+ {
+ m_aTimes.clear();
+ m_aObjects.clear();
+- for ( std::vector<TqFloat>::const_iterator t = From.m_aTimes.begin(); t<From.m_aTimes.end(); t++ )
++ for ( typename std::vector<TqFloat>::const_iterator t = From.m_aTimes.begin(); t<From.m_aTimes.end(); t++ )
+ m_aTimes.push_back( *t );
+- for( std::vector<T>::const_iterator o = From.m_aObjects.begin(); o<From.m_aObjects.end(); o++ )
++ for( typename std::vector<T>::const_iterator o = From.m_aObjects.begin(); o<From.m_aObjects.end(); o++ )
+ m_aObjects.push_back( *o );
+ m_DefObject = From.m_DefObject;
+ }
+@@ -105,7 +105,7 @@ class CqMotionSpec
+ {
+ // Insert the timeslot at the proper place.
+ std::vector<TqFloat>::iterator itime = m_aTimes.begin();
+- std::vector<T>::iterator iobj = m_aObjects.begin();
++ typename std::vector<T>::iterator iobj = m_aObjects.begin();
+ while ( itime != m_aTimes.end() && *itime < time ) itime++, iobj++;
+ m_aTimes.insert( itime, time );
+ m_aObjects.insert( iobj, Object );
+@@ -135,7 +135,7 @@ class CqMotionSpec
+ */
+ void ConcatAllTimeSlots( const T& Object )
+ {
+- for ( std::vector<T>::iterator i = m_aObjects.begin(); i<m_aObjects.end(); i++ )
++ for ( typename std::vector<T>::iterator i = m_aObjects.begin(); i<m_aObjects.end(); i++ )
+ ( *i ) = ConcatMotionObjects( ( *i ), Object );
+ }
+ /** Get the frame time at the specified timeslot index.
diff --git a/graphics/aqsis/patches/patch-ai b/graphics/aqsis/patches/patch-ai
new file mode 100644
index 00000000000..1a0ca5f4e14
--- /dev/null
+++ b/graphics/aqsis/patches/patch-ai
@@ -0,0 +1,34 @@
+$NetBSD: patch-ai,v 1.1 2006/05/11 18:55:31 joerg Exp $
+
+--- render/parameters.h.orig 2006-04-28 16:14:58.000000000 +0000
++++ render/parameters.h
+@@ -463,7 +463,7 @@ class CqParameterTypedVaryingArray : pub
+ m_aValues.resize( size );
+ TqInt j;
+ for ( j = 0; j < size; j++ )
+- m_aValues[ j ].resize( m_Count );
++ m_aValues[ j ].resize( this->m_Count );
+ }
+ virtual TqUint Size() const
+ {
+@@ -541,9 +541,9 @@ class CqParameterTypedVaryingArray : pub
+ TqUint j;
+ for ( j = 0; j < m_aValues.size(); j++ )
+ {
+- m_aValues[ j ].resize( m_Count );
++ m_aValues[ j ].resize( this->m_Count );
+ TqInt i;
+- for ( i = 0; i < m_Count; i++ )
++ for ( i = 0; i < this->m_Count; i++ )
+ m_aValues[ j ][ i ] = From.m_aValues[ j ][ i ];
+ }
+ return ( *this );
+@@ -650,7 +650,7 @@ class CqParameterTypedUniformArray : pub
+ {
+ m_aValues.resize( From.m_aValues.size() );
+ TqInt i2 = 0;
+- for ( std::vector<T>::iterator i = From.m_aValues.being(); i != From.m_aValues.end(); i++, i2++ )
++ for ( typename std::vector<T>::iterator i = From.m_aValues.being(); i != From.m_aValues.end(); i++, i2++ )
+ m_aValues[ i2 ] = ( *i );
+ return ( *this );
+ }
diff --git a/graphics/aqsis/patches/patch-aj b/graphics/aqsis/patches/patch-aj
new file mode 100644
index 00000000000..27b184d6d6a
--- /dev/null
+++ b/graphics/aqsis/patches/patch-aj
@@ -0,0 +1,139 @@
+$NetBSD: patch-aj,v 1.1 2006/05/11 18:55:31 joerg Exp $
+
+--- render/surface.h.orig 2006-04-28 16:19:45.000000000 +0000
++++ render/surface.h
+@@ -425,8 +425,8 @@ class CqMotionSurface : public CqBasicSu
+ virtual ~CqMotionSurface()
+ {
+ TqInt i;
+- for ( i = 0; i < cTimes(); i++ )
+- GetMotionObject( Time( i ) ) ->Release();
++ for ( i = 0; i < this->cTimes(); i++ )
++ GetMotionObject( this->Time( i ) ) ->Release();
+ }
+
+ /** Get combnied bound for all times
+@@ -436,8 +436,8 @@ class CqMotionSurface : public CqBasicSu
+ {
+ CqBound B( FLT_MAX, FLT_MAX, FLT_MAX, -FLT_MAX, -FLT_MAX, -FLT_MAX );
+ TqInt i;
+- for ( i = 0; i < cTimes(); i++ )
+- B = B.Combine( GetMotionObject( Time( i ) ) ->Bound() );
++ for ( i = 0; i < this->cTimes(); i++ )
++ B = B.Combine( GetMotionObject( this->Time( i ) ) ->Bound() );
+
+ return ( B );
+ }
+@@ -447,10 +447,10 @@ class CqMotionSurface : public CqBasicSu
+ {
+ CqMotionMicroPolyGrid * pGrid = new CqMotionMicroPolyGrid;
+ TqInt i;
+- for ( i = 0; i < cTimes(); i++ )
++ for ( i = 0; i < this->cTimes(); i++ )
+ {
+- CqMicroPolyGridBase* pGrid2 = GetMotionObject( Time( i ) ) ->Dice();
+- pGrid->AddTimeSlot( Time( i ), pGrid2 );
++ CqMicroPolyGridBase* pGrid2 = GetMotionObject( this->Time( i ) ) ->Dice();
++ pGrid->AddTimeSlot( this->Time( i ), pGrid2 );
+ }
+ return ( pGrid );
+ }
+@@ -459,11 +459,11 @@ class CqMotionSurface : public CqBasicSu
+ virtual TqInt Split( std::vector<CqBasicSurface*>& aSplits )
+ {
+ std::vector<std::vector<CqBasicSurface*> > aaMotionSplits;
+- aaMotionSplits.resize( cTimes() );
++ aaMotionSplits.resize( this->cTimes() );
+ TqInt cSplits = 0;
+ TqInt i;
+- for ( i = 0; i < cTimes(); i++ )
+- cSplits = GetMotionObject( Time( i ) ) ->Split( aaMotionSplits[ i ] );
++ for ( i = 0; i < this->cTimes(); i++ )
++ cSplits = GetMotionObject( this->Time( i ) ) ->Split( aaMotionSplits[ i ] );
+
+ // Now build motion surfaces from the splits and pass them back.
+ for ( i = 0; i < cSplits; i++ )
+@@ -473,8 +473,8 @@ class CqMotionSurface : public CqBasicSu
+ pNewMotion->m_fDiceable = TqTrue;
+ pNewMotion->m_EyeSplitCount = m_EyeSplitCount;
+ TqInt j;
+- for ( j = 0; j < cTimes(); j++ )
+- pNewMotion->AddTimeSlot( Time( j ), reinterpret_cast<T>( aaMotionSplits[ j ][ i ] ) );
++ for ( j = 0; j < this->cTimes(); j++ )
++ pNewMotion->AddTimeSlot( this->Time( j ), reinterpret_cast<T>( aaMotionSplits[ j ][ i ] ) );
+ aSplits.push_back( pNewMotion );
+ }
+ return ( cSplits );
+@@ -485,11 +485,11 @@ class CqMotionSurface : public CqBasicSu
+ */
+ virtual TqBool Diceable()
+ {
+- TqBool f = GetMotionObject( Time( 0 ) ) ->Diceable();
++ TqBool f = GetMotionObject( this->Time( 0 ) ) ->Diceable();
+ // Copy the split info so that at each time slot, the gprims split the same.
+ TqInt i;
+- for ( i = 1; i < cTimes(); i++ )
+- GetMotionObject( Time( i ) ) ->CopySplitInfo( *GetMotionObject( Time( 0 ) ) );
++ for ( i = 1; i < this->cTimes(); i++ )
++ GetMotionObject( this->Time( i ) ) ->CopySplitInfo( *GetMotionObject( this->Time( 0 ) ) );
+ return ( f );
+ }
+
+@@ -500,7 +500,7 @@ class CqMotionSurface : public CqBasicSu
+ */
+ virtual void Transform( const CqMatrix& matTx, const CqMatrix& matITTx, const CqMatrix& matRTx )
+ {
+- GetMotionObject( 0 ) ->Transform( matTx, matITTx, matRTx );
++ this->GetMotionObject( 0 ) ->Transform( matTx, matITTx, matRTx );
+ }
+
+ /** Set the surface parameters of all GPrims to match those on the spefified one.
+@@ -509,8 +509,8 @@ class CqMotionSurface : public CqBasicSu
+ virtual void SetSurfaceParameters( const CqBasicSurface& From )
+ {
+ TqInt i;
+- for ( i = 0; i < cTimes(); i++ )
+- GetMotionObject( Time( i ) ) ->SetSurfaceParameters( From );
++ for ( i = 0; i < this->cTimes(); i++ )
++ GetMotionObject( this->Time( i ) ) ->SetSurfaceParameters( From );
+ }
+ /** Force all GPrims to be undiceable.
+ */
+@@ -518,8 +518,8 @@ class CqMotionSurface : public CqBasicSu
+ {
+ CqBasicSurface::ForceUndiceable();
+ TqInt i;
+- for ( i = 0; i < cTimes(); i++ )
+- GetMotionObject( Time( i ) ) ->ForceUndiceable();
++ for ( i = 0; i < this->cTimes(); i++ )
++ GetMotionObject( this->Time( i ) ) ->ForceUndiceable();
+ }
+
+ /** Mark all GPrims to be discarded.
+@@ -528,21 +528,21 @@ class CqMotionSurface : public CqBasicSu
+ {
+ CqBasicSurface::Discard();
+ TqInt i;
+- for ( i = 0; i < cTimes(); i++ )
+- GetMotionObject( Time( i ) ) ->Discard();
++ for ( i = 0; i < this->cTimes(); i++ )
++ GetMotionObject( this->Time( i ) ) ->Discard();
+ }
+
+ virtual TqUint cUniform() const
+ {
+- return ( GetMotionObject( Time( 0 ) ) ->cUniform() );
++ return ( GetMotionObject( this->Time( 0 ) ) ->cUniform() );
+ }
+ virtual TqUint cVarying() const
+ {
+- return ( GetMotionObject( Time( 0 ) ) ->cVarying() );
++ return ( GetMotionObject( this->Time( 0 ) ) ->cVarying() );
+ }
+ virtual TqUint cVertex() const
+ {
+- return ( GetMotionObject( Time( 0 ) ) ->cVertex() );
++ return ( GetMotionObject( this->Time( 0 ) ) ->cVertex() );
+ }
+
+ // Overrides from CqMotionSpec
diff --git a/graphics/aqsis/patches/patch-ak b/graphics/aqsis/patches/patch-ak
new file mode 100644
index 00000000000..ccb03e437d4
--- /dev/null
+++ b/graphics/aqsis/patches/patch-ak
@@ -0,0 +1,13 @@
+$NetBSD: patch-ak,v 1.1 2006/05/11 18:55:31 joerg Exp $
+
+--- libshaderexecenv/Makefile.in.orig 2006-05-11 16:56:35.000000000 +0000
++++ libshaderexecenv/Makefile.in
+@@ -83,7 +83,7 @@ EXTRA_DIST = libshaderexecenv.dsp
+ lib_LTLIBRARIES = libshaderexecenv.la
+
+ libshaderexecenv_la_SOURCES = shaderexecenv.cpp shaderexecenv.h shadeops.cpp
+-libshaderexecenv_la_LDFLAGS = -rpath $(libdir)
++libshaderexecenv_la_LDFLAGS = -rpath $(libdir) ../render/libaqsis.la
+ @DEBUG_TRUE@AM_CXXFLAGS = -g -Wall
+ @DEBUG_FALSE@AM_CXXFLAGS =
+
diff --git a/graphics/aqsis/patches/patch-al b/graphics/aqsis/patches/patch-al
new file mode 100644
index 00000000000..ea831d8e9e5
--- /dev/null
+++ b/graphics/aqsis/patches/patch-al
@@ -0,0 +1,204 @@
+$NetBSD: patch-al,v 1.1 2006/05/11 18:55:31 joerg Exp $
+
+--- render/subdivision.h.orig 2002-04-25 09:08:54.000000000 +0000
++++ render/subdivision.h
+@@ -181,46 +181,7 @@ class CqWVert : public CqPoolable<CqWVer
+ * \param pSurf Pointer to the CqWSurf on which we are working.
+ */
+ template <class T>
+- T GetSmoothedScalar( T& t, T( CqSubdivider::*F ) ( CqPolygonPoints*, TqInt ), CqSubdivider* pSurf, CqPolygonPoints* pPoints )
+- {
+- // NOTE: Checks should have been made prior to this call to ensure it is neither
+- // a boundary point or a crease/corner point with sharp edges.
+-
+- // Q the average of the face points surrounding the vertex.
+- T Q = T( 0.0f );
+- std::vector<CqWEdge*>::iterator iE;
+- CqWFace* pF;
+- TqInt cE = 0;
+-
+- for ( iE = m_apEdges.begin(); iE != m_apEdges.end(); iE++ )
+- {
+- if ( ( *iE ) ->pvHead() == this ) pF = ( *iE ) ->pfLeft();
+- else pF = ( *iE ) ->pfRight();
+- if ( pF )
+- {
+- Q += ( pSurf->*F ) ( pPoints, pF->pvSubdivide() ->iVertex() );
+- cE++;
+- }
+- }
+- Q *= ( 1.0f / ( cE * cE ) );
+-
+- // R average of the midpoints of the edges that share the old vertex.
+- T R = T( 0.0f );
+- cE = 0;
+- for ( iE = m_apEdges.begin(); iE != m_apEdges.end(); iE++ )
+- {
+- if ( ( *iE ) ->IsValid() )
+- {
+- if ( ( *iE ) ->pvHead() == this ) R += ( pSurf->*F ) ( pPoints, ( *iE ) ->pvTail() ->iVertex() );
+- else R += ( pSurf->*F ) ( pPoints, ( *iE ) ->pvHead() ->iVertex() );
+- cE++;
+- }
+- }
+- R *= ( 1.0f / ( cE * cE ) );
+-
+- T S = ( pSurf->*F ) ( pPoints, iVertex() ) * ( ( cE - 2.0f ) / ( TqFloat ) cE );
+- return ( S + R + Q );
+- }
++ T GetSmoothedScalar( T& t, T( CqSubdivider::*F ) ( CqPolygonPoints*, TqInt ), CqSubdivider* pSurf, CqPolygonPoints* pPoints );
+
+ /** Templatised function to perform the subdivision arithmetic on a paramter type.
+ * \param t Temp of the template type to overcome the VC++ problem with template functions.
+@@ -228,35 +189,7 @@ class CqWVert : public CqPoolable<CqWVer
+ * \param pSurf Pointer to the CqWSurf on which we are working.
+ */
+ template <class T>
+- T GetCreaseScalar( T& t, T( CqSubdivider::*F ) ( CqPolygonPoints*, TqInt ), CqSubdivider* pSurf, CqPolygonPoints* pPoints )
+- {
+- T P = T( 0.0f );
+- std::vector<CqWEdge*>::iterator iE;
+- TqFloat S = 0.0;
+- TqInt cS = 0;
+-
+- for ( iE = m_apEdges.begin(); iE != m_apEdges.end(); iE++ )
+- {
+- if ( ( *iE ) ->Sharpness() > 0 && ( *iE ) ->IsValid() )
+- {
+- if ( ( *iE ) ->pvHead() == this ) P += ( pSurf->*F ) ( pPoints, ( *iE ) ->pvTail() ->iVertex() );
+- else P += ( pSurf->*F ) ( pPoints, ( *iE ) ->pvHead() ->iVertex() );
+- S += ( *iE ) ->Sharpness();
+- cS++;
+- }
+- }
+- P += ( pSurf->*F ) ( pPoints, iVertex() ) * 6.0f;
+- P /= 8.0f; // Crease point
+-
+- S /= ( TqFloat ) cS;
+- if ( cS == 2 && S > 0.0f && S < 1.0f )
+- {
+- T P2;
+- P2 = GetSmoothedScalar( P2, F, pSurf, pPoints );
+- P = ( P2 * ( 1.0f - S ) ) + ( P * S ); // Linear blend for variable crease.
+- }
+- return ( P );
+- }
++ T GetCreaseScalar( T& t, T( CqSubdivider::*F ) ( CqPolygonPoints*, TqInt ), CqSubdivider* pSurf, CqPolygonPoints* pPoints );
+
+ /** Templatised function to perform the subdivision arithmetic on a paramter type.
+ * \param t Temp of the template type to overcome the VC++ problem with template functions.
+@@ -264,19 +197,7 @@ class CqWVert : public CqPoolable<CqWVer
+ * \param pSurf Pointer to the CqWSurf on which we are working.
+ */
+ template <class T>
+- T GetBoundaryScalar( T& t, T( CqSubdivider::*F ) ( CqPolygonPoints*, TqInt ), CqSubdivider* pSurf, CqPolygonPoints* pPoints )
+- {
+- T P = T( 0.0f );
+- std::vector<CqWEdge*>::iterator iE;
+- for ( iE = m_apEdges.begin(); iE != m_apEdges.end(); iE++ )
+- if ( ( *iE ) ->IsBoundary() )
+- if ( ( *iE ) ->pvHead() == this ) P += ( pSurf->*F ) ( pPoints, ( *iE ) ->pvTail() ->iVertex() );
+- else P += ( pSurf->*F ) ( pPoints, ( *iE ) ->pvHead() ->iVertex() );
+-
+- P += ( pSurf->*F ) ( pPoints, iVertex() ) * 6.0f;
+- P /= 8.0f;
+- return ( P );
+- }
++ T GetBoundaryScalar( T& t, T( CqSubdivider::*F ) ( CqPolygonPoints*, TqInt ), CqSubdivider* pSurf, CqPolygonPoints* pPoints );
+
+ private:
+ TqInt m_iVertex; ///< Index of the vertex in the vertex list
+@@ -1168,6 +1089,93 @@ inline CqWFace* CqWReference::pfRight()
+ return ( m_pFace == m_pEdge->pfLeft() ? m_pEdge->pfRight() : m_pEdge->pfLeft() );
+ }
+
++template <class T> inline
++T CqWVert::GetSmoothedScalar( T& t, T( CqSubdivider::*F ) ( CqPolygonPoints*, TqInt ), CqSubdivider* pSurf, CqPolygonPoints* pPoints )
++{
++ // NOTE: Checks should have been made prior to this call to ensure it is neither
++ // a boundary point or a crease/corner point with sharp edges.
++
++ // Q the average of the face points surrounding the vertex.
++ T Q = T( 0.0f );
++ std::vector<CqWEdge*>::iterator iE;
++ CqWFace* pF;
++ TqInt cE = 0;
++
++ for ( iE = m_apEdges.begin(); iE != m_apEdges.end(); iE++ )
++ {
++ if ( ( *iE ) ->pvHead() == this ) pF = ( *iE ) ->pfLeft();
++ else pF = ( *iE ) ->pfRight();
++ if ( pF )
++ {
++ Q += ( pSurf->*F ) ( pPoints, pF->pvSubdivide() ->iVertex() );
++ cE++;
++ }
++ }
++ Q *= ( 1.0f / ( cE * cE ) );
++
++ // R average of the midpoints of the edges that share the old vertex.
++ T R = T( 0.0f );
++ cE = 0;
++ for ( iE = m_apEdges.begin(); iE != m_apEdges.end(); iE++ )
++ {
++ if ( ( *iE ) ->IsValid() )
++ {
++ if ( ( *iE ) ->pvHead() == this ) R += ( pSurf->*F ) ( pPoints, ( *iE ) ->pvTail() ->iVertex() );
++ else R += ( pSurf->*F ) ( pPoints, ( *iE ) ->pvHead() ->iVertex() );
++ cE++;
++ }
++ }
++ R *= ( 1.0f / ( cE * cE ) );
++
++ T S = ( pSurf->*F ) ( pPoints, iVertex() ) * ( ( cE - 2.0f ) / ( TqFloat ) cE );
++ return ( S + R + Q );
++}
++
++template <class T> inline
++T CqWVert::GetCreaseScalar( T& t, T( CqSubdivider::*F ) ( CqPolygonPoints*, TqInt ), CqSubdivider* pSurf, CqPolygonPoints* pPoints )
++{
++ T P = T( 0.0f );
++ std::vector<CqWEdge*>::iterator iE;
++ TqFloat S = 0.0;
++ TqInt cS = 0;
++
++ for ( iE = m_apEdges.begin(); iE != m_apEdges.end(); iE++ )
++ {
++ if ( ( *iE ) ->Sharpness() > 0 && ( *iE ) ->IsValid() )
++ {
++ if ( ( *iE ) ->pvHead() == this ) P += ( pSurf->*F ) ( pPoints, ( *iE ) ->pvTail() ->iVertex() );
++ else P += ( pSurf->*F ) ( pPoints, ( *iE ) ->pvHead() ->iVertex() );
++ S += ( *iE ) ->Sharpness();
++ cS++;
++ }
++ }
++ P += ( pSurf->*F ) ( pPoints, iVertex() ) * 6.0f;
++ P /= 8.0f; // Crease point
++
++ S /= ( TqFloat ) cS;
++ if ( cS == 2 && S > 0.0f && S < 1.0f )
++ {
++ T P2;
++ P2 = GetSmoothedScalar( P2, F, pSurf, pPoints );
++ P = ( P2 * ( 1.0f - S ) ) + ( P * S ); // Linear blend for variable crease.
++ }
++ return ( P );
++}
++
++template <class T> inline
++T CqWVert::GetBoundaryScalar( T& t, T( CqSubdivider::*F ) ( CqPolygonPoints*, TqInt ), CqSubdivider* pSurf, CqPolygonPoints* pPoints )
++{
++ T P = T( 0.0f );
++ std::vector<CqWEdge*>::iterator iE;
++ for ( iE = m_apEdges.begin(); iE != m_apEdges.end(); iE++ )
++ if ( ( *iE ) ->IsBoundary() )
++ if ( ( *iE ) ->pvHead() == this ) P += ( pSurf->*F ) ( pPoints, ( *iE ) ->pvTail() ->iVertex() );
++ else P += ( pSurf->*F ) ( pPoints, ( *iE ) ->pvHead() ->iVertex() );
++
++ P += ( pSurf->*F ) ( pPoints, iVertex() ) * 6.0f;
++ P /= 8.0f;
++ return ( P );
++}
+
+ //-----------------------------------------------------------------------
+
diff --git a/graphics/aqsis/patches/patch-am b/graphics/aqsis/patches/patch-am
new file mode 100644
index 00000000000..00cc86226cc
--- /dev/null
+++ b/graphics/aqsis/patches/patch-am
@@ -0,0 +1,13 @@
+$NetBSD: patch-am,v 1.1 2006/05/11 18:55:31 joerg Exp $
+
+--- libaqsistypes/memorypool.h.orig 2002-03-01 18:58:57.000000000 +0000
++++ libaqsistypes/memorypool.h
+@@ -165,7 +165,7 @@ class CqPoolable
+ /** Define the static memory pool for a poolable class.
+ */
+
+-#define DEFINE_STATIC_MEMORYPOOL(A) CqMemoryPool<A> CqPoolable<A>::m_thePool
++#define DEFINE_STATIC_MEMORYPOOL(A) template<> CqMemoryPool<A> CqPoolable<A>::m_thePool = CqMemoryPool<A>()
+
+
+ //-----------------------------------------------------------------------
diff --git a/graphics/aqsis/patches/patch-an b/graphics/aqsis/patches/patch-an
new file mode 100644
index 00000000000..21449819190
--- /dev/null
+++ b/graphics/aqsis/patches/patch-an
@@ -0,0 +1,13 @@
+$NetBSD: patch-an,v 1.1 2006/05/11 18:55:31 joerg Exp $
+
+--- render/Makefile.in.orig 2006-05-11 17:00:59.000000000 +0000
++++ render/Makefile.in
+@@ -100,7 +100,7 @@ DEFS = @DEFS@ -I. -I$(srcdir)
+ CPPFLAGS = @CPPFLAGS@
+ LDFLAGS = @LDFLAGS@
+ LIBS = @LIBS@
+-libaqsis_la_LIBADD =
++libaqsis_la_LIBADD = ../libddmsock/libddmsock.la -ltiff -lm
+ libaqsis_la_OBJECTS = attributes.lo bound.lo context.lo imagebuffer.lo \
+ lights.lo messages.lo micropolygon.lo nurbs.lo options.lo parameters.lo \
+ patch.lo polygon.lo quadrics.lo points.lo render.lo renderer.lo ri.lo \