From: ehofman Date: Fri, 14 Jan 2005 13:36:38 +0000 (+0000) Subject: Add a make_grayscale function and call it from make_normalmap automatically, removing... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=dfc23c352890901dec3e69433d5efd270ba2cccc;p=simgear.git Add a make_grayscale function and call it from make_normalmap automatically, removing the need to do it make_grayscale prior to calling make_normalmap. --- diff --git a/simgear/screen/texture.cxx b/simgear/screen/texture.cxx index 91550edb..f306bc76 100644 --- a/simgear/screen/texture.cxx +++ b/simgear/screen/texture.cxx @@ -795,7 +795,7 @@ SGTexture::ConvertUint(unsigned *array, unsigned int length) { void -SGTexture::make_monochrome(GLubyte r, GLubyte g, GLubyte b) { +SGTexture::make_monochrome(float contrast, GLubyte r, GLubyte g, GLubyte b) { if (num_colors >= 3) return; @@ -815,8 +815,32 @@ SGTexture::make_monochrome(GLubyte r, GLubyte g, GLubyte b) { } } + void -SGTexture::make_normalmap(float brightness) { +SGTexture::make_grayscale(float contrast) { + if (num_colors >= 3) + return; + + GLubyte *map = (GLubyte *)malloc (texture_width * texture_height); + for (int y=0; y