Clean up after conversion to bitmasks.
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
#include "shared.h"
#include "shaderobj.h"
#include "shaderimage.h"
-#include "util/simple_list.h"
#include "util/strtod.h"
#include "state.h"
#include "stencil.h"
dst->Hint = src->Hint;
}
if (mask & GL_LIGHTING_BIT) {
- GLuint i;
- /* begin with memcpy */
+ /* OK to memcpy */
dst->Light = src->Light;
- /* fixup linked lists to prevent pointer insanity */
- make_empty_list( &(dst->Light.EnabledList) );
- for (i = 0; i < MAX_LIGHTS; i++) {
- if (dst->Light.Light[i].Enabled) {
- insert_at_tail(&(dst->Light.EnabledList), &(dst->Light.Light[i]));
- }
- }
}
if (mask & GL_LINE_BIT) {
/* OK to memcpy */
#include "enable.h"
#include "errors.h"
#include "light.h"
-#include "util/simple_list.h"
#include "mtypes.h"
#include "enums.h"
#include "api_arrayelt.h"
ctx->Light.Light[cap-GL_LIGHT0].Enabled = state;
if (state) {
ctx->Light._EnabledLights |= 1u << (cap - GL_LIGHT0);
- insert_at_tail(&ctx->Light.EnabledList,
- &ctx->Light.Light[cap-GL_LIGHT0]);
}
else {
ctx->Light._EnabledLights &= ~(1u << (cap - GL_LIGHT0));
- remove_from_list(&ctx->Light.Light[cap-GL_LIGHT0]);
}
break;
case GL_LIGHTING:
#include "enums.h"
#include "light.h"
#include "macros.h"
-#include "util/simple_list.h"
#include "mtypes.h"
#include "math/m_matrix.h"
#include "util/bitscan.h"
static void
init_light( struct gl_light *l, GLuint n )
{
- make_empty_list( l );
-
ASSIGN_4V( l->Ambient, 0.0, 0.0, 0.0, 1.0 );
if (n==0) {
ASSIGN_4V( l->Diffuse, 1.0, 1.0, 1.0, 1.0 );
for (i = 0; i < MAX_LIGHTS; i++) {
init_light( &ctx->Light.Light[i], i );
}
- make_empty_list( &ctx->Light.EnabledList );
init_lightmodel( &ctx->Light.Model );
init_material( &ctx->Light.Material );
*/
struct gl_light
{
- struct gl_light *next; /**< double linked list with sentinel */
- struct gl_light *prev;
-
GLfloat Ambient[4]; /**< ambient color */
GLfloat Diffuse[4]; /**< diffuse color */
GLfloat Specular[4]; /**< specular color */
GLboolean _NeedEyeCoords;
GLboolean _NeedVertices; /**< Use fast shader? */
- struct gl_light EnabledList; /**< List sentinel */
GLfloat _BaseColor[2][3];
/*@}*/