remove the rest of the static variables (except one); cleanup
This commit is contained in:
parent
4e8a89c9c0
commit
7327e35020
1 changed files with 23 additions and 30 deletions
|
@ -51,7 +51,7 @@
|
|||
#include <simgear/misc/sg_path.hxx>
|
||||
|
||||
#include <Aircraft/aircraft.hxx>
|
||||
#include <Autopilot/xmlauto.hxx>
|
||||
//#include <Autopilot/xmlauto.hxx>
|
||||
#include <GUI/new_gui.hxx> // FGFontCache
|
||||
#include <Main/globals.hxx>
|
||||
#include <Main/fg_props.hxx>
|
||||
|
@ -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< instr_item * > 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<instr_item *>(new gauge_instr(card_group->getChild(j)));
|
||||
else if (!strcmp(type, "dial") || !strcmp(type, "tape"))
|
||||
HIptr = static_cast<instr_item *>(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);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue