X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmesa%2Ftnl%2Ft_vb_light.c;h=f47f99397c9ad29bf59664884f66325f1d25d879;hb=97a1fd158c9acfaa3a8deda7eb5bf0b253e85c15;hp=1deab4d43a6a45a14982bf78bd5593eb8afd7e69;hpb=6f973f33679e034b7cb63806f1ddfabdbdd70123;p=mesa.git diff --git a/src/mesa/tnl/t_vb_light.c b/src/mesa/tnl/t_vb_light.c index 1deab4d43a6..f47f99397c9 100644 --- a/src/mesa/tnl/t_vb_light.c +++ b/src/mesa/tnl/t_vb_light.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.3 + * Version: 6.5 * - * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -24,13 +24,13 @@ -#include "glheader.h" -#include "colormac.h" -#include "light.h" -#include "macros.h" -#include "imports.h" -#include "simple_list.h" -#include "mtypes.h" +#include "main/glheader.h" +#include "main/colormac.h" +#include "main/light.h" +#include "main/macros.h" +#include "main/imports.h" +#include "main/simple_list.h" +#include "main/mtypes.h" #include "math/m_translate.h" @@ -135,7 +135,7 @@ prepare_materials(GLcontext *ctx, * update_materials(), above, that'll actually copy the vertex color to * the material attribute(s). */ - for (i = _TNL_ATTRIB_MAT_FRONT_AMBIENT ; i < _TNL_ATTRIB_INDEX ; i++) { + for (i = _TNL_FIRST_MAT; i <= _TNL_LAST_MAT; i++) { if (VB->AttribPtr[i]->stride) { const GLuint j = store->mat_count++; const GLuint attr = i - _TNL_ATTRIB_MAT_FRONT_AMBIENT; @@ -203,7 +203,7 @@ static GLboolean run_lighting( GLcontext *ctx, GLvector4f *input = ctx->_NeedEyeCoords ? VB->EyePtr : VB->ObjPtr; GLuint idx; - if (!ctx->Light.Enabled || ctx->VertexProgram._Enabled) + if (!ctx->Light.Enabled || ctx->VertexProgram._Current) return GL_TRUE; /* Make sure we can talk about position x,y and z: @@ -248,7 +248,7 @@ static GLboolean run_lighting( GLcontext *ctx, VB->AttribPtr[_TNL_ATTRIB_COLOR0] = VB->ColorPtr[0]; VB->AttribPtr[_TNL_ATTRIB_COLOR1] = VB->SecondaryColorPtr[0]; - VB->AttribPtr[_TNL_ATTRIB_INDEX] = VB->IndexPtr[0]; + VB->AttribPtr[_TNL_ATTRIB_COLOR_INDEX] = VB->IndexPtr[0]; return GL_TRUE; } @@ -261,7 +261,7 @@ static void validate_lighting( GLcontext *ctx, { light_func *tab; - if (!ctx->Light.Enabled || ctx->VertexProgram._Enabled) + if (!ctx->Light.Enabled || ctx->VertexProgram._Current) return; if (ctx->Visual.rgbMode) {