From: david Date: Fri, 12 Apr 2002 12:44:58 +0000 (+0000) Subject: Patch from Norman Vine to save some property lookups. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=03c431aa56f61e33aee98cc1986bce76ea64c57e;p=flightgear.git Patch from Norman Vine to save some property lookups. --- diff --git a/src/Cockpit/panel.cxx b/src/Cockpit/panel.cxx index 18887b83b..f04ec8f73 100644 --- a/src/Cockpit/panel.cxx +++ b/src/Cockpit/panel.cxx @@ -786,10 +786,15 @@ void FGLayeredInstrument::draw () { if (test()) { + float z = 0.1f; + float z_inc = 0.01; + bool vc = fgGetBool("/sim/virtual-cockpit"); for (int i = 0; i < (int)_layers.size(); i++) { glPushMatrix(); - if(!fgGetBool("/sim/virtual-cockpit")) - glTranslatef(0.0, 0.0, (i / 100.0) + 0.1); + if(!vc) { + glTranslatef(0.0, 0.0, z); + z += z_inc; + } _layers[i]->draw(); glPopMatrix(); }