- if ( v[0] > v[3] || v[0] < -v[3]
- || v[1] > v[3] || v[1] < -v[3]
- || v[2] > v[3] || v[2] < -v[3] ) {
- return 0;
- }
- else {
- return 1;
- }
-}
-
-/*
- * Clip a point against the user clipping planes.
- * Input: v - vertex-vector describing the point to clip.
- * Return: 0 = point was clipped
- * 1 = point not clipped
- */
-GLuint gl_userclip_point( GLcontext* ctx, const GLfloat v[] )
-{
- GLuint p;
-
- for (p=0;p<MAX_CLIP_PLANES;p++) {
- if (ctx->Transform.ClipEnabled[p]) {
- GLfloat dot = v[0] * ctx->Transform.ClipUserPlane[p][0]
- + v[1] * ctx->Transform.ClipUserPlane[p][1]
- + v[2] * ctx->Transform.ClipUserPlane[p][2]
- + v[3] * ctx->Transform.ClipUserPlane[p][3];
- if (dot < 0.0F) {
- return 0;
- }
- }
- }
-
- return 1;
-}
-
-
-
-
-#if defined(__i386__)
-#define NEGATIVE(x) ((*(int *)&x)<0)
-#else
-#define NEGATIVE(x) (x < 0)
-#endif
-
-
-static clip_poly_func gl_poly_clip_tab[2][5];
-static clip_line_func gl_line_clip_tab[2][5];
-
-#define W(i) coord[i][3]
-#define Z(i) coord[i][2]
-#define Y(i) coord[i][1]
-#define X(i) coord[i][0]
-#define SIZE 4
-#define IND 0
-#define TAG(x) x##_4
-#include "clip_funcs.h"
-
-#define W(i) 1.0
-#define Z(i) coord[i][2]
-#define Y(i) coord[i][1]
-#define X(i) coord[i][0]
-#define SIZE 3
-#define IND 0
-#define TAG(x) x##_3
-#include "clip_funcs.h"
-
-#define W(i) 1.0
-#define Z(i) 0.0
-#define Y(i) coord[i][1]
-#define X(i) coord[i][0]
-#define SIZE 2
-#define IND 0
-#define TAG(x) x##_2
-#include "clip_funcs.h"
-
-#define W(i) coord[i][3]
-#define Z(i) coord[i][2]
-#define Y(i) coord[i][1]
-#define X(i) coord[i][0]
-#define SIZE 4
-#define IND CLIP_TAB_EDGEFLAG
-#define TAG(x) x##_4_edgeflag
-#include "clip_funcs.h"
-
-#define W(i) 1.0
-#define Z(i) coord[i][2]
-#define Y(i) coord[i][1]
-#define X(i) coord[i][0]
-#define SIZE 3
-#define IND CLIP_TAB_EDGEFLAG
-#define TAG(x) x##_3_edgeflag
-#include "clip_funcs.h"
-
-#define W(i) 1.0
-#define Z(i) 0.0
-#define Y(i) coord[i][1]
-#define X(i) coord[i][0]
-#define SIZE 2
-#define IND CLIP_TAB_EDGEFLAG
-#define TAG(x) x##_2_edgeflag
-#include "clip_funcs.h"
-
-
-
-
-void gl_update_clipmask( GLcontext *ctx )
-{
- GLuint mask = 0;
-
- if (ctx->Visual->RGBAflag)
- {
- if (ctx->Light.ShadeModel==GL_SMOOTH)
- {
- mask |= CLIP_RGBA0;
-
- if (ctx->TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_SEPERATE_SPECULAR))
- mask |= CLIP_RGBA1;
- }
-
- if (ctx->Texture.ReallyEnabled & 0xf0)
- mask |= CLIP_TEX1|CLIP_TEX0;