]> git.mxchange.org Git - flightgear.git/commitdiff
Replace the hud rendering for loop (which linearly searches the the hud
authorcurt <curt>
Mon, 20 Jul 1998 12:47:55 +0000 (12:47 +0000)
committercurt <curt>
Mon, 20 Jul 1998 12:47:55 +0000 (12:47 +0000)
list to find the entry with the proper position) with a simple linear
traversal using an "iterator."

Cockpit/hud.cxx

index 1e2cf55d392aac6de2446a7ed2c8cbe227307ca5..00bdfd8e6d367fa8946fa5ca5989a426f97320ef 100644 (file)
@@ -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.