From ef751eb08b055d3c5b86ee10edc834a8767b7bc3 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 7 Jul 2003 16:46:27 +0000 Subject: minor fixes in _mesa_TexGen[id]v() to silence valgrind --- src/mesa/main/texstate.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'src/mesa/main/texstate.c') diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index f27c346ec2f..9359c7b1b19 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -2154,9 +2154,14 @@ _mesa_TexGeniv(GLenum coord, GLenum pname, const GLint *params ) { GLfloat p[4]; p[0] = (GLfloat) params[0]; - p[1] = (GLfloat) params[1]; - p[2] = (GLfloat) params[2]; - p[3] = (GLfloat) params[3]; + if (pname == GL_TEXTURE_GEN_MODE) { + p[1] = p[2] = p[3] = 0.0F; + } + else { + p[1] = (GLfloat) params[1]; + p[2] = (GLfloat) params[2]; + p[3] = (GLfloat) params[3]; + } _mesa_TexGenfv(coord, pname, p); } @@ -2174,9 +2179,14 @@ _mesa_TexGendv(GLenum coord, GLenum pname, const GLdouble *params ) { GLfloat p[4]; p[0] = (GLfloat) params[0]; - p[1] = (GLfloat) params[1]; - p[2] = (GLfloat) params[2]; - p[3] = (GLfloat) params[3]; + if (pname == GL_TEXTURE_GEN_MODE) { + p[1] = p[2] = p[3] = 0.0F; + } + else { + p[1] = (GLfloat) params[1]; + p[2] = (GLfloat) params[2]; + p[3] = (GLfloat) params[3]; + } _mesa_TexGenfv( coord, pname, p ); } -- cgit v1.2.3