From dd963990dc2f69de180be90a509d4af35df91392 Mon Sep 17 00:00:00 2001 From: ehofman Date: Fri, 12 Sep 2003 22:09:54 +0000 Subject: [PATCH] Turn back to default lighting when specular-highlight gets disabled --- src/Main/main.cxx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Main/main.cxx b/src/Main/main.cxx index 34941f4c1..4332c28cd 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -333,8 +333,11 @@ void trRenderFrame( void ) { glLightModelfv( GL_LIGHT_MODEL_AMBIENT, black ); glLightModeli( GL_LIGHT_MODEL_LOCAL_VIEWER, GL_FALSE ); - if (fgGetBool("/sim/rendering/specular-highlight")) + if (fgGetBool("/sim/rendering/specular-highlight")) { glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR); + } else { + glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SINGLE_COLOR); + } ssgGetLight( 0 ) -> setColour( GL_AMBIENT, l->scene_ambient ); @@ -612,9 +615,13 @@ void fgRenderFrame() { // a completely dark scene. So, we set GL_LIGHT_MODEL_AMBIENT // explicitely to black. glLightModelfv( GL_LIGHT_MODEL_AMBIENT, black ); - if (fgGetBool("/sim/rendering/specular-highlight")) + if (fgGetBool("/sim/rendering/specular-highlight")) { glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR); + } else { + glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, + GL_SINGLE_COLOR); + } ssgGetLight( 0 ) -> setColour( GL_AMBIENT, l->scene_ambient ); ssgGetLight( 0 ) -> setColour( GL_DIFFUSE, l->scene_diffuse ); -- 2.39.5