-/* $Id: rastpos.c,v 1.18 2000/12/26 05:09:29 keithw Exp $ */
+/* $Id: rastpos.c,v 1.19 2001/01/03 15:56:41 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Return: 0 = outside view volume
* 1 = inside view volume
*/
-static GLuint gl_viewclip_point( const GLfloat v[] )
+static GLuint
+viewclip_point( const GLfloat v[] )
{
if ( v[0] > v[3] || v[0] < -v[3]
|| v[1] > v[3] || v[1] < -v[3]
}
}
+
/*
* 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
*/
-static GLuint gl_userclip_point( GLcontext* ctx, const GLfloat v[] )
+static GLuint
+userclip_point( GLcontext* ctx, const GLfloat v[] )
{
GLuint p;
* get a little closer to the vertex buffer, and to use the
* GLvector objects directly.
*/
-static void gl_shade_rastpos( GLcontext *ctx,
- GLfloat vertex[4],
- GLfloat normal[3],
- GLfloat Rcolor[4],
- GLuint *index )
+static void
+shade_rastpos(GLcontext *ctx,
+ const GLfloat vertex[4],
+ const GLfloat normal[3],
+ GLfloat Rcolor[4],
+ GLuint *index)
{
GLfloat (*base)[3] = ctx->Light._BaseColor;
const GLchan *sumA = ctx->Light._BaseAlpha;
(light->LinearAttenuation + d *
light->QuadraticAttenuation));
- if (light->_Flags & LIGHT_SPOT)
- {
+ if (light->_Flags & LIGHT_SPOT) {
GLfloat PV_dot_dir = - DOT3(VP, light->_NormDirection);
if (PV_dot_dir<light->_CosCutoff) {
continue;
}
- else
- {
+ else {
double x = PV_dot_dir * (EXP_TABLE_SIZE-1);
int k = (int) x;
GLfloat spot = (GLfloat) (light->_SpotExpTable[k][0]
/*
* Caller: context->API.RasterPos4f
*/
-static void raster_pos4f( GLcontext *ctx,
- GLfloat x, GLfloat y, GLfloat z, GLfloat w )
+static void
+raster_pos4f(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
{
GLfloat v[4], eye[4], clip[4], ndc[3], d;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
TRANSFORM_POINT( eye, ctx->ModelView.m, v );
/* raster color */
- if (ctx->Light.Enabled)
- {
+ if (ctx->Light.Enabled) {
GLfloat *norm, eyenorm[3];
GLfloat *objnorm = ctx->Current.Normal;
GLfloat *inv = ctx->ModelView.inv;
TRANSFORM_NORMAL( eyenorm, objnorm, inv );
norm = eyenorm;
- } else {
+ }
+ else {
norm = objnorm;
}
- gl_shade_rastpos( ctx, v, norm,
- ctx->Current.RasterColor,
- &ctx->Current.RasterIndex );
+ shade_rastpos( ctx, v, norm,
+ ctx->Current.RasterColor,
+ &ctx->Current.RasterIndex );
}
else {
TRANSFORM_POINT( clip, ctx->ProjectionMatrix.m, eye );
/* clip to view volume */
- if (gl_viewclip_point( clip )==0) {
+ if (viewclip_point( clip )==0) {
ctx->Current.RasterPosValid = GL_FALSE;
return;
}
/* clip to user clipping planes */
- if ( ctx->Transform._AnyClip &&
- gl_userclip_point(ctx, clip) == 0)
- {
+ if (ctx->Transform._AnyClip &&
+ userclip_point(ctx, clip) == 0) {
ctx->Current.RasterPosValid = GL_FALSE;
return;
}