From 7327e35020620a7209b3339910571f382414d9c6 Mon Sep 17 00:00:00 2001 From: mfranz Date: Thu, 15 Jun 2006 00:21:06 +0000 Subject: [PATCH] remove the rest of the static variables (except one); cleanup --- src/Cockpit/hud.cxx | 53 ++++++++++++++++++++------------------------- 1 file changed, 23 insertions(+), 30 deletions(-) diff --git a/src/Cockpit/hud.cxx b/src/Cockpit/hud.cxx index d712e53f2..ad2e65811 100644 --- a/src/Cockpit/hud.cxx +++ b/src/Cockpit/hud.cxx @@ -51,7 +51,7 @@ #include #include -#include +//#include #include // FGFontCache #include
#include
@@ -64,16 +64,11 @@ static HUD_Properties *HUDprop = 0; static char units[5]; -// The following routines obtain information concerning the aircraft's -// current state and return it to calling instrument display routines. -// They should eventually be member functions of the aircraft. -// - -deque< instr_item * > HUD_deque; +deque HUD_deque; -fgTextList HUD_TextList; -fgLineList HUD_LineList; -fgLineList HUD_StippleLineList; +fgTextList HUD_TextList; +fgLineList HUD_LineList; +fgLineList HUD_StippleLineList; fntRenderer *HUDtext = 0; fntTexFont *HUD_Font = 0; @@ -82,21 +77,13 @@ int HUD_style = 0; float HUD_matrix[16]; -static string name; -static string label_format; -static string prelabel; -static string postlabel; -static string type; -static string type_pointer; -static string type_tick; -static string length_tick; - int readHud( istream &input ); int readInstrument ( const SGPropertyNode * node); static void drawHUD(); static void fgUpdateHUDVirtual(); + class locRECT { public: RECT rect; @@ -115,15 +102,6 @@ locRECT :: locRECT( UINT left, UINT top, UINT right, UINT bottom) } // #define DEBUG -//========================= End of Class Implementations=================== -// fgHUDInit -// -// Constructs a HUD object and then adds in instruments. At the present -// the instruments are hard coded into the routine. Ultimately these need -// to be defined by the aircraft's instrumentation records so that the -// display for a Piper Cub doesn't show the speed range of a North American -// mustange and the engine readouts of a B36! -// @@ -155,10 +133,15 @@ int readInstrument(const SGPropertyNode * node) int nCards = card_group->nChildren(); for (int j = 0; j < nCards; j++) { const char *type = card_group->getChild(j)->getStringValue("type", "gauge"); + if (!strcmp(type, "gauge")) HIptr = static_cast(new gauge_instr(card_group->getChild(j))); else if (!strcmp(type, "dial") || !strcmp(type, "tape")) HIptr = static_cast(new hud_card(card_group->getChild(j))); + else { + SG_LOG(SG_INPUT, SG_WARN, "HUD: unknown 'card' type: " << type); + continue; + } HUD_deque.insert(HUD_deque.begin(), HIptr); } } @@ -244,6 +227,14 @@ int readHud( istream &input ) } +// fgHUDInit +// +// Constructs a HUD object and then adds in instruments. At the present +// the instruments are hard coded into the routine. Ultimately these need +// to be defined by the aircraft's instrumentation records so that the +// display for a Piper Cub doesn't show the speed range of a North American +// mustange and the engine readouts of a B36! +// int fgHUDInit( fgAIRCRAFT * /* current_aircraft */ ) { @@ -295,6 +286,7 @@ int fgHUDInit( fgAIRCRAFT * /* current_aircraft */ ) } + int fgHUDInit2( fgAIRCRAFT * /* current_aircraft */ ) { @@ -424,6 +416,7 @@ void fgUpdateHUDVirtual() glPopMatrix(); } + void fgUpdateHUD( GLfloat x_start, GLfloat y_start, GLfloat x_end, GLfloat y_end ) { @@ -444,6 +437,7 @@ void fgUpdateHUD( GLfloat x_start, GLfloat y_start, glPopMatrix(); } + void drawHUD() { if ( !HUD_deque.size() ) // Trust everyone, but ALWAYS cut the cards! @@ -559,7 +553,6 @@ void drawHUD() } - void fgTextList::draw() { if (!Font) @@ -590,7 +583,6 @@ void fgTextList::draw() } - // HUD property listener class // HUD_Properties::HUD_Properties() : @@ -669,3 +661,4 @@ void HUD_Properties::setColor() const glColor3f(_r, _g, _b); } + -- 2.39.5