summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/light.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/light.c')
-rw-r--r--src/mesa/main/light.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c
index bae17c76f60..0883832dbd6 100644
--- a/src/mesa/main/light.c
+++ b/src/mesa/main/light.c
@@ -26,7 +26,6 @@
#include "c99_math.h"
#include "glheader.h"
-#include "util/imports.h"
#include "context.h"
#include "enums.h"
#include "light.h"
@@ -613,7 +612,7 @@ _mesa_update_material( struct gl_context *ctx, GLuint bitmask )
{
GLfloat (*mat)[4] = ctx->Light.Material.Attrib;
- if (MESA_VERBOSE & VERBOSE_MATERIAL)
+ if (MESA_VERBOSE & VERBOSE_MATERIAL)
_mesa_debug(ctx, "_mesa_update_material, mask 0x%x\n", bitmask);
if (!bitmask)
@@ -625,7 +624,7 @@ _mesa_update_material( struct gl_context *ctx, GLuint bitmask )
while (mask) {
const int i = u_bit_scan(&mask);
struct gl_light *light = &ctx->Light.Light[i];
- SCALE_3V( light->_MatAmbient[0], light->Ambient,
+ SCALE_3V( light->_MatAmbient[0], light->Ambient,
mat[MAT_ATTRIB_FRONT_AMBIENT]);
}
}
@@ -635,7 +634,7 @@ _mesa_update_material( struct gl_context *ctx, GLuint bitmask )
while (mask) {
const int i = u_bit_scan(&mask);
struct gl_light *light = &ctx->Light.Light[i];
- SCALE_3V( light->_MatAmbient[1], light->Ambient,
+ SCALE_3V( light->_MatAmbient[1], light->Ambient,
mat[MAT_ATTRIB_BACK_AMBIENT]);
}
}
@@ -659,7 +658,7 @@ _mesa_update_material( struct gl_context *ctx, GLuint bitmask )
while (mask) {
const int i = u_bit_scan(&mask);
struct gl_light *light = &ctx->Light.Light[i];
- SCALE_3V( light->_MatDiffuse[0], light->Diffuse,
+ SCALE_3V( light->_MatDiffuse[0], light->Diffuse,
mat[MAT_ATTRIB_FRONT_DIFFUSE] );
}
}
@@ -669,7 +668,7 @@ _mesa_update_material( struct gl_context *ctx, GLuint bitmask )
while (mask) {
const int i = u_bit_scan(&mask);
struct gl_light *light = &ctx->Light.Light[i];
- SCALE_3V( light->_MatDiffuse[1], light->Diffuse,
+ SCALE_3V( light->_MatDiffuse[1], light->Diffuse,
mat[MAT_ATTRIB_BACK_DIFFUSE] );
}
}
@@ -680,7 +679,7 @@ _mesa_update_material( struct gl_context *ctx, GLuint bitmask )
while (mask) {
const int i = u_bit_scan(&mask);
struct gl_light *light = &ctx->Light.Light[i];
- SCALE_3V( light->_MatSpecular[0], light->Specular,
+ SCALE_3V( light->_MatSpecular[0], light->Specular,
mat[MAT_ATTRIB_FRONT_SPECULAR]);
}
}
@@ -857,12 +856,12 @@ _mesa_GetMaterialiv( GLenum face, GLenum pname, GLint *params )
params[3] = FLOAT_TO_INT( mat[MAT_ATTRIB_EMISSION(f)][3] );
break;
case GL_SHININESS:
- *params = IROUND( mat[MAT_ATTRIB_SHININESS(f)][0] );
+ *params = lroundf( mat[MAT_ATTRIB_SHININESS(f)][0] );
break;
case GL_COLOR_INDEXES:
- params[0] = IROUND( mat[MAT_ATTRIB_INDEXES(f)][0] );
- params[1] = IROUND( mat[MAT_ATTRIB_INDEXES(f)][1] );
- params[2] = IROUND( mat[MAT_ATTRIB_INDEXES(f)][2] );
+ params[0] = lroundf( mat[MAT_ATTRIB_INDEXES(f)][0] );
+ params[1] = lroundf( mat[MAT_ATTRIB_INDEXES(f)][1] );
+ params[2] = lroundf( mat[MAT_ATTRIB_INDEXES(f)][2] );
break;
default:
_mesa_error( ctx, GL_INVALID_ENUM, "glGetMaterialfv(pname)" );
@@ -1117,7 +1116,7 @@ _mesa_allow_light_in_model( struct gl_context *ctx, GLboolean flag )
* Initialize the n-th light data structure.
*
* \param l pointer to the gl_light structure to be initialized.
- * \param n number of the light.
+ * \param n number of the light.
* \note The defaults for light 0 are different than the other lights.
*/
static void
@@ -1161,7 +1160,7 @@ init_lightmodel( struct gl_lightmodel *lm )
/**
* Initialize the material data structure.
- *
+ *
* \param m pointer to the gl_material structure to be initialized.
*/
static void
@@ -1173,7 +1172,7 @@ init_material( struct gl_material *m )
ASSIGN_4V( m->Attrib[MAT_ATTRIB_FRONT_EMISSION], 0.0F, 0.0F, 0.0F, 1.0F );
ASSIGN_4V( m->Attrib[MAT_ATTRIB_FRONT_SHININESS], 0.0F, 0.0F, 0.0F, 0.0F );
ASSIGN_4V( m->Attrib[MAT_ATTRIB_FRONT_INDEXES], 0.0F, 1.0F, 1.0F, 0.0F );
-
+
ASSIGN_4V( m->Attrib[MAT_ATTRIB_BACK_AMBIENT], 0.2F, 0.2F, 0.2F, 1.0F );
ASSIGN_4V( m->Attrib[MAT_ATTRIB_BACK_DIFFUSE], 0.8F, 0.8F, 0.8F, 1.0F );
ASSIGN_4V( m->Attrib[MAT_ATTRIB_BACK_SPECULAR], 0.0F, 0.0F, 0.0F, 1.0F );