/*
* Mesa 3-D graphics library
- * Version: 5.1
+ * Version: 6.3
*
- * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2005 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"),
case GL_SPOT_DIRECTION: {
GLfloat tmp[4];
/* transform direction by inverse modelview */
- if (ctx->ModelviewMatrixStack.Top->flags & MAT_DIRTY_INVERSE) {
+ if (_math_matrix_is_dirty(ctx->ModelviewMatrixStack.Top)) {
_math_matrix_analyse( ctx->ModelviewMatrixStack.Top );
}
TRANSFORM_NORMAL( tmp, params, ctx->ModelviewMatrixStack.Top->inv );
GLfloat (*mat)[4] = ctx->Light.Material.Attrib;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); /* update materials */
+ FLUSH_CURRENT(ctx, 0); /* update ctx->Light.Material from vertex buffer */
+
if (face==GL_FRONT) {
f = 0;
}
GLfloat (*mat)[4] = ctx->Light.Material.Attrib;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); /* update materials */
+ FLUSH_CURRENT(ctx, 0); /* update ctx->Light.Material from vertex buffer */
+
if (face==GL_FRONT) {
f = 0;
}
ASSERT(side < 2);
if (ctx->_ShineTable[side])
ctx->_ShineTable[side]->refcount--;
- ctx->_ShineTable[side] = 0;
+ ctx->_ShineTable[side] = NULL;
}
update_modelview_scale( GLcontext *ctx )
{
ctx->_ModelViewInvScale = 1.0F;
- if (ctx->ModelviewMatrixStack.Top->flags & (MAT_FLAG_UNIFORM_SCALE |
- MAT_FLAG_GENERAL_SCALE |
- MAT_FLAG_GENERAL_3D |
- MAT_FLAG_GENERAL) ) {
+ if (!_math_matrix_is_length_preserving(ctx->ModelviewMatrixStack.Top)) {
const GLfloat *m = ctx->ModelviewMatrixStack.Top->inv;
GLfloat f = m[2] * m[2] + m[6] * m[6] + m[10] * m[10];
if (f < 1e-12) f = 1.0;
{
const GLuint oldneedeyecoords = ctx->_NeedEyeCoords;
+ (void) new_state;
ctx->_NeedEyeCoords = 0;
if (ctx->_ForceEyeCoords ||
ctx->_NeedEyeCoords = 1;
if (ctx->Light.Enabled &&
- !TEST_MAT_FLAGS( ctx->ModelviewMatrixStack.Top,
- MAT_FLAGS_LENGTH_PRESERVING))
+ !_math_matrix_is_length_preserving(ctx->ModelviewMatrixStack.Top))
ctx->_NeedEyeCoords = 1;
ctx->Light.ColorMaterialMode = GL_AMBIENT_AND_DIFFUSE;
ctx->Light.ColorMaterialBitmask = _mesa_material_bitmask( ctx,
GL_FRONT_AND_BACK,
- GL_AMBIENT_AND_DIFFUSE, ~0, 0 );
+ GL_AMBIENT_AND_DIFFUSE, ~0,
+ NULL );
ctx->Light.ColorMaterialEnabled = GL_FALSE;