From d8039a551e6758c30a00e56a47af89cd51250b4e Mon Sep 17 00:00:00 2001 From: curt Date: Mon, 20 Jul 1998 12:47:55 +0000 Subject: [PATCH] Replace the hud rendering for loop (which linearly searches the the hud list to find the entry with the proper position) with a simple linear traversal using an "iterator." --- Cockpit/hud.cxx | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/Cockpit/hud.cxx b/Cockpit/hud.cxx index 1e2cf55d3..00bdfd8e6 100644 --- a/Cockpit/hud.cxx +++ b/Cockpit/hud.cxx @@ -621,9 +621,18 @@ void fgUpdateHUD( void ) { glLineWidth(1); - for( i = hud_displays; i; --i) { // Draw everything -// if( HUD_deque.at(i)->enabled()) { - pHUDInstr = HUD_deque[i - 1]; + deque < instr_item * > :: iterator current; + deque < instr_item * > :: iterator last; + + current = HUD_deque.begin(); + last = HUD_deque.end(); + while ( current != last ) { + pHUDInstr = *current; + current++; + + // for( i = hud_displays; i; --i) { // Draw everything + // if( HUD_deque.at(i)->enabled()) { + // pHUDInstr = HUD_deque[i - 1]; if( pHUDInstr->enabled()) { // We should to respond to a dial instead // or as well to the of time of day. Of @@ -686,9 +695,14 @@ void fgUpdateHUD( void ) { } /* $Log$ -/* Revision 1.17 1998/07/13 21:28:02 curt -/* Converted the aoa scale to a radio altimeter. +/* Revision 1.18 1998/07/20 12:47:55 curt +/* Replace the hud rendering for loop (which linearly searches the the hud +/* list to find the entry with the proper position) with a simple linear +/* traversal using an "iterator." /* + * Revision 1.17 1998/07/13 21:28:02 curt + * Converted the aoa scale to a radio altimeter. + * * Revision 1.16 1998/07/13 21:00:47 curt * Integrated Charlies latest HUD updates. * Wrote access functions for current fgOPTIONS. -- 2.39.2