summaryrefslogtreecommitdiff
path: root/xc/extras/Mesa/src/clip.c
diff options
context:
space:
mode:
Diffstat (limited to 'xc/extras/Mesa/src/clip.c')
-rw-r--r--xc/extras/Mesa/src/clip.c109
1 files changed, 26 insertions, 83 deletions
diff --git a/xc/extras/Mesa/src/clip.c b/xc/extras/Mesa/src/clip.c
index dfb7c6837..84a9fad29 100644
--- a/xc/extras/Mesa/src/clip.c
+++ b/xc/extras/Mesa/src/clip.c
@@ -1,8 +1,7 @@
-/* $Id: clip.c,v 1.1.1.1 2000/01/06 13:26:44 faith Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -25,19 +24,10 @@
*/
-
-
-
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "clip.h"
#include "context.h"
#include "macros.h"
@@ -51,15 +41,6 @@
-#define CLIP_RGBA0 0x1
-#define CLIP_RGBA1 0x2
-#define CLIP_TEX0 0x4
-#define CLIP_TEX1 0x8
-#define CLIP_INDEX0 0x10
-#define CLIP_INDEX1 0x20
-#define CLIP_FOG_COORD 0x40
-
-
/* Linear interpolation between A and B: */
#define LINTERP( T, A, B ) ( (A) + (T) * ( (B) - (A) ) )
@@ -76,7 +57,16 @@ do { \
} while(0)
-static clip_interp_func clip_interp_tab[0x80];
+
+
+#define CLIP_RGBA0 0x1
+#define CLIP_RGBA1 0x2
+#define CLIP_TEX0 0x4
+#define CLIP_TEX1 0x8
+#define CLIP_INDEX0 0x10
+#define CLIP_INDEX1 0x20
+
+static clip_interp_func clip_interp_tab[0x40];
#define IND 0
#define NAME clip_nil
@@ -122,50 +112,6 @@ static clip_interp_func clip_interp_tab[0x80];
#define NAME clipINDEX0_INDEX1
#include "interp_tmp.h"
-#define IND (CLIP_FOG_COORD)
-#define NAME clip_FOG
-#include "interp_tmp.h"
-
-#define IND (CLIP_RGBA0|CLIP_FOG_COORD)
-#define NAME clipRGBA0_FOG
-#include "interp_tmp.h"
-
-#define IND (CLIP_RGBA0|CLIP_RGBA1|CLIP_FOG_COORD)
-#define NAME clipRGBA0_RGBA1_FOG
-#include "interp_tmp.h"
-
-#define IND (CLIP_TEX0|CLIP_RGBA0|CLIP_FOG_COORD)
-#define NAME clipTEX0_RGBA0_FOG
-#include "interp_tmp.h"
-
-#define IND (CLIP_TEX0|CLIP_RGBA0|CLIP_RGBA1|CLIP_FOG_COORD)
-#define NAME clipTEX0_RGBA0_RGBA1_FOG
-#include "interp_tmp.h"
-
-#define IND (CLIP_TEX1|CLIP_TEX0|CLIP_RGBA0|CLIP_FOG_COORD)
-#define NAME clipTEX1_TEX0_RGBA0_FOG
-#include "interp_tmp.h"
-
-#define IND (CLIP_TEX0|CLIP_FOG_COORD)
-#define NAME clipTEX0_FOG
-#include "interp_tmp.h"
-
-#define IND (CLIP_TEX1|CLIP_TEX0|CLIP_FOG_COORD)
-#define NAME clipTEX1_TEX0_FOG
-#include "interp_tmp.h"
-
-#define IND (CLIP_TEX1|CLIP_TEX0|CLIP_RGBA0|CLIP_RGBA1|CLIP_FOG_COORD)
-#define NAME clipTEX1_TEX0_RGBA0_RGBA1_FOG
-#include "interp_tmp.h"
-
-#define IND (CLIP_INDEX0|CLIP_FOG_COORD)
-#define NAME clipINDEX0_FOG
-#include "interp_tmp.h"
-
-#define IND (CLIP_INDEX0|CLIP_INDEX1|CLIP_FOG_COORD)
-#define NAME clipINDEX0_INDEX1_FOG
-#include "interp_tmp.h"
-
@@ -175,9 +121,17 @@ static clip_interp_func clip_interp_tab[0x80];
-void gl_ClipPlane( GLcontext* ctx, GLenum plane, const GLfloat *equation )
+void
+_mesa_ClipPlane( GLenum plane, const GLdouble *eq )
{
+ GET_CURRENT_CONTEXT(ctx);
GLint p;
+ GLfloat equation[4];
+
+ equation[0] = eq[0];
+ equation[1] = eq[1];
+ equation[2] = eq[2];
+ equation[3] = eq[3];
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glClipPlane");
@@ -228,8 +182,10 @@ void gl_update_userclip( GLcontext *ctx )
}
}
-void gl_GetClipPlane( GLcontext* ctx, GLenum plane, GLdouble *equation )
+void
+_mesa_GetClipPlane( GLenum plane, GLdouble *equation )
{
+ GET_CURRENT_CONTEXT(ctx);
GLint p;
ASSERT_OUTSIDE_BEGIN_END(ctx, "glGetClipPlane");
@@ -396,8 +352,6 @@ void gl_update_clipmask( GLcontext *ctx )
mask |= CLIP_INDEX1;
}
- if (ctx->FogMode == FOG_FRAGMENT && (ctx->TriangleCaps & DD_CLIP_FOG_COORD))
- mask |= CLIP_FOG_COORD;
ctx->ClipInterpFunc = clip_interp_tab[mask];
ctx->poly_clip_tab = gl_poly_clip_tab[0];
@@ -493,22 +447,11 @@ void gl_init_clip(void)
clip_interp_tab[CLIP_TEX1|CLIP_TEX0|CLIP_RGBA0] = clipTEX1_TEX0_RGBA0;
clip_interp_tab[CLIP_TEX1|CLIP_TEX0|CLIP_RGBA0|CLIP_RGBA1] =
clipTEX1_TEX0_RGBA0_RGBA1;
+
clip_interp_tab[CLIP_TEX0] = clipTEX0;
clip_interp_tab[CLIP_TEX1|CLIP_TEX0] = clipTEX1_TEX0;
+
clip_interp_tab[CLIP_INDEX0] = clipINDEX0;
clip_interp_tab[CLIP_INDEX0|CLIP_INDEX1] = clipINDEX0_INDEX1;
-
- clip_interp_tab[CLIP_FOG_COORD] = clip_FOG;
- clip_interp_tab[CLIP_RGBA0|CLIP_FOG_COORD] = clipRGBA0_FOG;
- clip_interp_tab[CLIP_RGBA0|CLIP_RGBA1|CLIP_FOG_COORD] = clipRGBA0_RGBA1_FOG;
- clip_interp_tab[CLIP_TEX0|CLIP_RGBA0|CLIP_FOG_COORD] = clipTEX0_RGBA0_FOG;
- clip_interp_tab[CLIP_TEX0|CLIP_RGBA0|CLIP_RGBA1|CLIP_FOG_COORD] = clipTEX0_RGBA0_RGBA1_FOG;
- clip_interp_tab[CLIP_TEX1|CLIP_TEX0|CLIP_RGBA0|CLIP_FOG_COORD] = clipTEX1_TEX0_RGBA0_FOG;
- clip_interp_tab[CLIP_TEX1|CLIP_TEX0|CLIP_RGBA0|CLIP_RGBA1|CLIP_FOG_COORD] =
- clipTEX1_TEX0_RGBA0_RGBA1_FOG;
- clip_interp_tab[CLIP_TEX0|CLIP_FOG_COORD] = clipTEX0_FOG;
- clip_interp_tab[CLIP_TEX1|CLIP_TEX0|CLIP_FOG_COORD] = clipTEX1_TEX0_FOG;
- clip_interp_tab[CLIP_INDEX0|CLIP_FOG_COORD] = clipINDEX0_FOG;
- clip_interp_tab[CLIP_INDEX0|CLIP_INDEX1|CLIP_FOG_COORD] = clipINDEX0_INDEX1_FOG;
}