On Thu, May 17, 2001 at 01:00:45AM +0200, Lars Munch Christensen wrote:
> On Mon, Mar 19, 2001 at 03:51:10PM -0700, Brian Paul wrote:
> > Ove Kaaven wrote:
> > > 
> > > I finally got around to testing the Half-Life problems with gl_ztrick
> > > again... I used the following patch, and then gl_ztrick 1 worked:
> > > 
> > > Index: extras/Mesa/src/matrix.c
> > > ===================================================================
> > > RCS file: /cvsroot/dri/xc/xc/extras/Mesa/src/matrix.c,v
> > > retrieving revision 1.12
> > > diff -u -r1.12 matrix.c
> > > --- extras/Mesa/src/matrix.c    2000/11/09 02:55:12     1.12
> > > +++ extras/Mesa/src/matrix.c    2001/03/19 22:28:01
> > > @@ -1451,6 +1451,7 @@
> > >  void
> > >  gl_Viewport( GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height )
> > >  {
> > > +   GLfloat n, f;
> > >     ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glViewport");
> > > 
> > >     if (width<0 || height<0) {
> > > @@ -1465,6 +1466,10 @@
> > >     width  = CLAMP( width,  1, MAX_WIDTH );
> > >     height = CLAMP( height, 1, MAX_HEIGHT );
> > > 
> > > +   /* Get depth range */
> > > +   n = ctx->Viewport.Near;
> > > +   f = ctx->Viewport.Far;
> > > +
> > >     /* Save viewport */
> > >     ctx->Viewport.X = x;
> > >     ctx->Viewport.Width = width;
> > > @@ -1476,8 +1481,8 @@
> > >     ctx->Viewport.WindowMap.m[MAT_TX] = ctx->Viewport.WindowMap.m[MAT_SX] + x;
> > >     ctx->Viewport.WindowMap.m[MAT_SY] = (GLfloat) height / 2.0F;
> > >     ctx->Viewport.WindowMap.m[MAT_TY] = ctx->Viewport.WindowMap.m[MAT_SY] + y;
> > > -   ctx->Viewport.WindowMap.m[MAT_SZ] = 0.5 * ctx->Visual->DepthMaxF;
> > > -   ctx->Viewport.WindowMap.m[MAT_TZ] = 0.5 * ctx->Visual->DepthMaxF;
> > > +   ctx->Viewport.WindowMap.m[MAT_SZ] = ctx->Visual->DepthMaxF * ((f - n) / 2.0);
> > > +   ctx->Viewport.WindowMap.m[MAT_TZ] = ctx->Visual->DepthMaxF * ((f - n) / 2.0 
>+ n);
> > > 
> > >     ctx->Viewport.WindowMap.flags = MAT_FLAG_GENERAL_SCALE|MAT_FLAG_TRANSLATION;
> > >     ctx->Viewport.WindowMap.type = MATRIX_3D_NO_ROT;
> > 
> > 
> > Great!  I'll apply the patch to the DRI and Mesa trees.
> 
> Did this patch ever make in to the cvs? I still have this problem on my
> V3.
> 
Yes. Make sure you've updated your libraries.

Alan.

_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to