X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fmain%2Fpoints.c;h=eab9d13d6d9ca26b04f322a8831af555f10a43b2;hb=f0c32629276a0bf33eed5ba519e3536061e239ad;hp=fbedbcb22c497756a6e607f76c0d08070c73bb38;hpb=7158203b081ad34c03382f07e0df748eae235e9b;p=mesa.git diff --git a/src/mesa/main/points.c b/src/mesa/main/points.c index fbedbcb22c4..eab9d13d6d9 100644 --- a/src/mesa/main/points.c +++ b/src/mesa/main/points.c @@ -5,7 +5,7 @@ /* * Mesa 3-D graphics library - * Version: 7.0 + * Version: 7.1 * * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. * @@ -32,7 +32,6 @@ #include "context.h" #include "macros.h" #include "points.h" -#include "texstate.h" #include "mtypes.h" @@ -69,23 +68,33 @@ _mesa_PointSize( GLfloat size ) void GLAPIENTRY _mesa_PointParameteri( GLenum pname, GLint param ) { - const GLfloat value = (GLfloat) param; - _mesa_PointParameterfv(pname, &value); + GLfloat p[3]; + p[0] = (GLfloat) param; + p[1] = p[2] = 0.0F; + _mesa_PointParameterfv(pname, p); } void GLAPIENTRY _mesa_PointParameteriv( GLenum pname, const GLint *params ) { - const GLfloat value = (GLfloat) params[0]; - _mesa_PointParameterfv(pname, &value); + GLfloat p[3]; + p[0] = (GLfloat) params[0]; + if (pname == GL_DISTANCE_ATTENUATION_EXT) { + p[1] = (GLfloat) params[1]; + p[2] = (GLfloat) params[2]; + } + _mesa_PointParameterfv(pname, p); } void GLAPIENTRY _mesa_PointParameterf( GLenum pname, GLfloat param) { - _mesa_PointParameterfv(pname, ¶m); + GLfloat p[3]; + p[0] = param; + p[1] = p[2] = 0.0F; + _mesa_PointParameterfv(pname, p); } @@ -105,6 +114,11 @@ _mesa_PointParameterfv( GLenum pname, const GLfloat *params) ctx->Point._Attenuated = (ctx->Point.Params[0] != 1.0 || ctx->Point.Params[1] != 0.0 || ctx->Point.Params[2] != 0.0); + + if (ctx->Point._Attenuated) + ctx->_TriangleCaps |= DD_POINT_ATTEN; + else + ctx->_TriangleCaps &= ~DD_POINT_ATTEN; } else { _mesa_error(ctx, GL_INVALID_ENUM, @@ -190,6 +204,11 @@ _mesa_PointParameterfv( GLenum pname, const GLfloat *params) } break; case GL_POINT_SPRITE_COORD_ORIGIN: + /* This is not completely correct. GL_POINT_SPRITE_COORD_ORIGIN was + * added to point sprites when the extension was merged into OpenGL + * 2.0. It is expected that an implementation supporting OpenGL 1.4 + * and GL_ARB_point_sprite will generate an error here. + */ if (ctx->Extensions.ARB_point_sprite) { GLenum value = (GLenum) params[0]; if (value != GL_LOWER_LEFT && value != GL_UPPER_LEFT) { @@ -247,7 +266,7 @@ _mesa_init_point(GLcontext *ctx) ctx->Point.PointSprite = GL_FALSE; /* GL_ARB/NV_point_sprite */ ctx->Point.SpriteRMode = GL_ZERO; /* GL_NV_point_sprite (only!) */ ctx->Point.SpriteOrigin = GL_UPPER_LEFT; /* GL_ARB_point_sprite */ - for (i = 0; i < MAX_TEXTURE_UNITS; i++) { + for (i = 0; i < Elements(ctx->Point.CoordReplace); i++) { ctx->Point.CoordReplace[i] = GL_FALSE; /* GL_ARB/NV_point_sprite */ } }