void GLAPIENTRY imm_Lightfv (GLenum light, GLenum pname, const GLfloat *params) { LIGHT *li = &ctx_light[light - GL_LIGHT0]; FLUSH_VERTICES(); switch (pname) { case GL_AMBIENT: li->ambient[0] = params[0]; li->ambient[1] = params[1]; li->ambient[2] = params[2]; li->ambient[3] = params[3]; break; case GL_DIFFUSE: li->diffuse[0] = params[0]; li->diffuse[1] = params[1]; li->diffuse[2] = params[2]; li->diffuse[3] = params[3]; break; case GL_SPECULAR: li->specular[0] = params[0]; li->specular[1] = params[1]; li->specular[2] = params[2]; li->specular[3] = params[3]; break; case GL_POSITION: matrix_mul_vec4(li->position, ctx_mx_modelview_top->mat, params); NORM3(li->_posnorm, +, li->position); break; case GL_SPOT_DIRECTION: li->spot_direction[0] = params[0]; li->spot_direction[1] = params[1]; li->spot_direction[2] = params[2]; li->spot_direction[3] = 1.0F; matrix_mul_vec4(li->_spot_eye_norm, get_imv(), li->spot_direction); NORM3(li->_spot_eye_norm, -, li->_spot_eye_norm); break; case GL_SPOT_EXPONENT: li->spot_exponent = params[0]; break; case GL_SPOT_CUTOFF: li->spot_cutoff = params[0]; li->_spot_cutcos = COS(params[0] * M_PI / 180.0F); break; case GL_CONSTANT_ATTENUATION: li->attenuation[0] = params[0]; break; case GL_LINEAR_ATTENUATION: li->attenuation[1] = params[0]; break; case GL_QUADRATIC_ATTENUATION: li->attenuation[2] = params[0]; break; } ctx_gl_state |= NEW_LIGHT; }
static void tnl_texture_transform (void) { int j; for (j = 0; j < TNL_MAX_TEXCOORD; j++) { if (ctx_texture[j].enabled) { const MATRIX *tx = ctx_mx_texture_top[j]; if (!MAT_IDENTITY(tx)) { GLfloat4 *texcoord = tnl_vb.attr[j + TNL_TEXCOORD0].data; const GLuint texcoord_stride = tnl_vb.attr[j + TNL_TEXCOORD0].stride; if (texcoord_stride) { matrix_mul_vec4_batch(tnl_vb.texcoord[j], tx->mat, (const GLfloat4 *)texcoord[0], tnl_vb.len); } else { matrix_mul_vec4(tnl_vb.texcoord[j][0], tx->mat, texcoord[0]); } tnl_vb.attr[j + TNL_TEXCOORD0].data = tnl_vb.texcoord[j]; tnl_extra_flags |= TNL_TEXCOORD0W_BIT << j; } } } }