1998-09-29 14:56:30 +00:00
|
|
|
// hud.hxx -- hud defines and prototypes (initial draft)
|
|
|
|
//
|
|
|
|
// Written by Michele America, started September 1997.
|
|
|
|
//
|
|
|
|
// Copyright (C) 1997 Michele F. America - nomimarketing@mail.telepac.pt
|
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License as
|
|
|
|
// published by the Free Software Foundation; either version 2 of the
|
|
|
|
// License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful, but
|
|
|
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
// General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
//
|
|
|
|
// $Id$
|
1997-08-29 18:03:19 +00:00
|
|
|
|
|
|
|
|
1998-04-24 00:45:53 +00:00
|
|
|
#ifndef _HUD_HXX
|
|
|
|
#define _HUD_HXX
|
|
|
|
|
1998-05-11 18:13:10 +00:00
|
|
|
#ifndef __cplusplus
|
1998-04-24 00:45:53 +00:00
|
|
|
# error This library requires C++
|
1998-05-11 18:13:10 +00:00
|
|
|
#endif
|
1998-04-24 00:45:53 +00:00
|
|
|
|
2000-10-02 21:49:04 +00:00
|
|
|
#include <simgear/compiler.h>
|
|
|
|
|
1998-06-12 00:55:58 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include <config.h>
|
|
|
|
#endif
|
1998-05-11 18:13:10 +00:00
|
|
|
|
1998-07-03 13:16:27 +00:00
|
|
|
#ifdef HAVE_WINDOWS_H
|
|
|
|
# include <windows.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <GL/glut.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
2000-05-13 00:02:43 +00:00
|
|
|
//#ifdef HAVE_VALUES_H
|
|
|
|
//# include <values.h> // for MAXINT
|
|
|
|
//#endif
|
1998-05-11 18:13:10 +00:00
|
|
|
|
1999-04-27 19:27:45 +00:00
|
|
|
#include <vector> // STL vector
|
1999-05-12 02:04:38 +00:00
|
|
|
#include <deque> // STL double ended queue
|
1999-03-02 01:02:31 +00:00
|
|
|
|
2000-02-15 03:30:01 +00:00
|
|
|
#include <simgear/constants.h>
|
|
|
|
|
2000-09-06 22:46:43 +00:00
|
|
|
#include <Include/fg_typedefs.h>
|
1998-10-16 23:26:44 +00:00
|
|
|
#include <Aircraft/aircraft.hxx>
|
1999-02-01 21:33:23 +00:00
|
|
|
#include <FDM/flight.hxx>
|
1998-10-17 01:33:52 +00:00
|
|
|
#include <Controls/controls.hxx>
|
1999-06-01 21:17:10 +00:00
|
|
|
#include <GUI/gui.h>
|
1999-05-12 02:04:38 +00:00
|
|
|
|
2000-02-19 14:29:27 +00:00
|
|
|
#include "hud_opts.hxx"
|
|
|
|
|
2001-03-23 22:59:18 +00:00
|
|
|
SG_USING_STD(deque);
|
|
|
|
SG_USING_STD(vector);
|
|
|
|
SG_USING_NAMESPACE(std);
|
1999-06-28 18:41:01 +00:00
|
|
|
|
1998-05-11 18:13:10 +00:00
|
|
|
|
2000-02-19 14:29:27 +00:00
|
|
|
// some of Norman's crazy optimizations. :-)
|
|
|
|
|
1998-05-11 18:13:10 +00:00
|
|
|
#ifndef WIN32
|
|
|
|
typedef struct {
|
|
|
|
int x, y;
|
|
|
|
} POINT;
|
1998-07-03 13:16:27 +00:00
|
|
|
|
1998-05-11 18:13:10 +00:00
|
|
|
typedef struct {
|
|
|
|
int top, bottom, left, right;
|
|
|
|
} RECT;
|
|
|
|
#endif
|
|
|
|
|
1998-02-12 21:58:27 +00:00
|
|
|
// View mode definitions
|
1997-08-29 18:03:19 +00:00
|
|
|
|
1998-05-11 18:13:10 +00:00
|
|
|
enum VIEW_MODES{ HUD_VIEW, PANEL_VIEW, CHASE_VIEW, TOWER_VIEW };
|
1998-02-12 21:58:27 +00:00
|
|
|
|
1998-05-11 18:13:10 +00:00
|
|
|
// DAY, NIGHT and brightness levels need to be visible where dialogs and
|
|
|
|
// controls can be used to set intensity and appropriate color. This will
|
|
|
|
// be moved.
|
1998-02-19 13:05:43 +00:00
|
|
|
// Hud general constants
|
|
|
|
#define DAY 1
|
|
|
|
#define NIGHT 2
|
1998-07-13 21:00:45 +00:00
|
|
|
#define BRT_BLACK 3
|
|
|
|
#define BRT_DARK 4
|
|
|
|
#define BRT_MEDIUM 5
|
|
|
|
#define BRT_LIGHT 6
|
|
|
|
#define SIZE_SMALL 7
|
|
|
|
#define SIZE_LARGE 8
|
1998-02-19 13:05:43 +00:00
|
|
|
|
1998-02-12 21:58:27 +00:00
|
|
|
// Label constants
|
1998-02-07 15:29:31 +00:00
|
|
|
#define SMALL 1
|
|
|
|
#define LARGE 2
|
1998-05-11 18:13:10 +00:00
|
|
|
|
1998-02-07 15:29:31 +00:00
|
|
|
#define BLINK 3
|
|
|
|
#define NOBLINK 4
|
1998-05-11 18:13:10 +00:00
|
|
|
|
|
|
|
enum fgLabelJust{ LEFT_JUST, CENTER_JUST, RIGHT_JUST } ;
|
1997-08-29 18:03:19 +00:00
|
|
|
|
1998-02-12 21:58:27 +00:00
|
|
|
// Ladder constants
|
1998-02-07 15:29:31 +00:00
|
|
|
#define NONE 1
|
|
|
|
#define UPPER_LEFT 2
|
|
|
|
#define UPPER_CENTER 3
|
|
|
|
#define UPPER_RIGHT 4
|
|
|
|
#define CENTER_RIGHT 5
|
|
|
|
#define LOWER_RIGHT 6
|
|
|
|
#define LOWER_CENTER 7
|
|
|
|
#define LOWER_LEFT 8
|
|
|
|
#define CENTER_LEFT 9
|
|
|
|
#define SOLID_LINES 10
|
|
|
|
#define DASHED_LINES 11
|
|
|
|
#define DASHED_NEG_LINES 12
|
1997-08-29 18:03:19 +00:00
|
|
|
|
1998-05-11 18:13:10 +00:00
|
|
|
|
1999-05-12 02:04:38 +00:00
|
|
|
#define HORIZON_FIXED 1
|
|
|
|
#define HORIZON_MOVING 2
|
|
|
|
#define LABEL_COUNTER 1
|
|
|
|
#define LABEL_WARNING 2
|
1998-05-11 18:13:10 +00:00
|
|
|
|
1998-07-03 13:16:27 +00:00
|
|
|
#define HUDS_AUTOTICKS 0x0001
|
1998-07-24 21:36:55 +00:00
|
|
|
#define HUDS_VERT 0x0002
|
|
|
|
#define HUDS_HORZ 0x0000
|
|
|
|
#define HUDS_TOP 0x0004
|
|
|
|
#define HUDS_BOTTOM 0x0008
|
|
|
|
#define HUDS_LEFT HUDS_TOP
|
|
|
|
#define HUDS_RIGHT HUDS_BOTTOM
|
|
|
|
#define HUDS_BOTH (HUDS_LEFT | HUDS_RIGHT)
|
|
|
|
#define HUDS_NOTICKS 0x0010
|
|
|
|
#define HUDS_ARITHTIC 0x0020
|
|
|
|
#define HUDS_DECITICS 0x0040
|
|
|
|
#define HUDS_NOTEXT 0x0080
|
1998-07-03 13:16:27 +00:00
|
|
|
|
1998-02-12 21:58:27 +00:00
|
|
|
// Ladder orientaion
|
1997-08-29 18:03:19 +00:00
|
|
|
// #define HUD_VERTICAL 1
|
1999-05-12 02:04:38 +00:00
|
|
|
// #define HUD_HORIZONTAL 2
|
|
|
|
// #define HUD_FREEFLOAT 3
|
1997-08-29 18:03:19 +00:00
|
|
|
|
1998-02-12 21:58:27 +00:00
|
|
|
// Ladder orientation modes
|
1999-05-12 02:04:38 +00:00
|
|
|
// #define HUD_LEFT 1
|
|
|
|
// #define HUD_RIGHT 2
|
|
|
|
// #define HUD_TOP 1
|
|
|
|
// #define HUD_BOTTOM 2
|
|
|
|
// #define HUD_V_LEFT 1
|
|
|
|
// #define HUD_V_RIGHT 2
|
|
|
|
// #define HUD_H_TOP 1
|
|
|
|
// #define HUD_H_BOTTOM 2
|
1997-08-29 18:03:19 +00:00
|
|
|
|
|
|
|
|
1998-02-12 21:58:27 +00:00
|
|
|
// Ladder sub-types
|
1999-05-12 02:04:38 +00:00
|
|
|
// #define HUD_LIM 1
|
|
|
|
// #define HUD_NOLIM 2
|
|
|
|
// #define HUD_CIRC 3
|
|
|
|
|
|
|
|
// #define HUD_INSTR_LADDER 1
|
|
|
|
// #define HUD_INSTR_CLADDER 2
|
|
|
|
// #define HUD_INSTR_HORIZON 3
|
|
|
|
// #define HUD_INSTR_LABEL 4
|
|
|
|
|
|
|
|
// in cockpit.cxx
|
|
|
|
extern float get_throttleval ( void );
|
|
|
|
extern float get_aileronval ( void );
|
|
|
|
extern float get_elevatorval ( void );
|
|
|
|
extern float get_elev_trimval( void );
|
|
|
|
extern float get_rudderval ( void );
|
|
|
|
extern float get_speed ( void );
|
|
|
|
extern float get_aoa ( void );
|
|
|
|
extern float get_roll ( void );
|
|
|
|
extern float get_pitch ( void );
|
|
|
|
extern float get_heading ( void );
|
|
|
|
extern float get_view_direction( void );
|
|
|
|
extern float get_altitude ( void );
|
|
|
|
extern float get_agl ( void );
|
|
|
|
extern float get_sideslip ( void );
|
|
|
|
extern float get_frame_rate ( void );
|
|
|
|
extern float get_latitude ( void );
|
|
|
|
extern float get_lat_min ( void );
|
|
|
|
extern float get_longitude ( void );
|
|
|
|
extern float get_long_min ( void );
|
|
|
|
extern float get_fov ( void );
|
|
|
|
extern float get_vfc_ratio ( void );
|
|
|
|
extern float get_vfc_tris_drawn ( void );
|
|
|
|
extern float get_vfc_tris_culled ( void );
|
|
|
|
extern float get_climb_rate ( void );
|
2000-01-10 21:06:39 +00:00
|
|
|
extern float get_mach( void );
|
1999-05-12 02:04:38 +00:00
|
|
|
extern char *coord_format_lat(float);
|
|
|
|
extern char *coord_format_lon(float);
|
|
|
|
//extern char *coord_format_latlon(float latitude, float longitude); // cockpit.cxx
|
|
|
|
|
The following changes were made to flightgear-0.7.5 code to implement the follow
ing features:
a) ADA Flight model - ADA.cxx, ADA.hxx, flight.hxx
b) Fighter a/c HUD - flight.hxx, hud.hxx, hud.cxx, cockpit.cxx, hud_ladr.c
xx, hud_card.cxx
c) 3-window display - options.hxx, options.cxx, viewer.cxx
d) Moving objects (ship) - main.cxx
e) Patches - main.cxx
ADA.cxx, ADA.hxx
--------------------------
Interface to the external ADA flight dynamics package.
flight.hxx
----------
Included prototypes for accepting additional data fron the External flight
model for fighter aircraft HUD
Hud.hxx
-------
Included prototypes for accepting additional data for fighter HUD from Exernal F
light model.
Defined FIGHTER_HUD pre-processor directive to enable compilation of fighter hud
code.
hud.cxx, cockpit.cxx, hud_ladr.cxx, hud_card.cxx
---------------------------------------
Included code to initialise additional reticles/text for fighter HUD which is co
nditionally
compiled if FIGHTER_HUD is defined.
options.hxx
-----------
Added window_offset, and function to retrieve its value for 3 windows
options.cxx
-----------
Changed few options to suit ADA/CEF projection system/screens and checks for win
dow offset.
views.cxx
---------
Added code to retrieve view offset for window.
Main.cxx
--------
Added code to load and move an aircraft carrier.
Patch to enable clouds from command line until Curtis fixes it. By default cloud
s are disabled.
2000-10-19 19:46:13 +00:00
|
|
|
// $$$ begin - added, VS Renganathan, 13 Oct 2K
|
|
|
|
// #define FIGHTER_HUD
|
|
|
|
extern float get_anzg (void);
|
|
|
|
extern float get_Vx (void);
|
|
|
|
extern float get_Vy (void);
|
|
|
|
extern float get_Vz (void);
|
|
|
|
extern float get_Ax (void);
|
|
|
|
extern float get_Ay (void);
|
|
|
|
extern float get_Az (void);
|
|
|
|
extern int get_iaux1 (void);
|
|
|
|
extern int get_iaux2 (void);
|
|
|
|
extern int get_iaux3 (void);
|
|
|
|
extern int get_iaux4 (void);
|
|
|
|
extern int get_iaux5 (void);
|
|
|
|
extern int get_iaux6 (void);
|
|
|
|
extern int get_iaux7 (void);
|
|
|
|
extern int get_iaux8 (void);
|
|
|
|
extern int get_iaux9 (void);
|
|
|
|
extern int get_iaux10 (void);
|
|
|
|
extern int get_iaux11 (void);
|
|
|
|
extern int get_iaux12 (void);
|
|
|
|
extern float get_aux1(void);
|
|
|
|
extern float get_aux2(void);
|
|
|
|
extern float get_aux3(void);
|
|
|
|
extern float get_aux4(void);
|
|
|
|
extern float get_aux5 (void);
|
|
|
|
extern float get_aux6 (void);
|
|
|
|
extern float get_aux8(void);
|
|
|
|
extern float get_aux9(void);
|
|
|
|
extern float get_aux10(void);
|
|
|
|
extern float get_aux11(void);
|
|
|
|
extern float get_aux12(void);
|
|
|
|
extern float get_aux13(void);
|
|
|
|
extern float get_aux14(void);
|
|
|
|
extern float get_aux15(void);
|
|
|
|
extern float get_aux16(void);
|
|
|
|
extern float get_aux17(void);
|
|
|
|
extern float get_aux18(void);
|
|
|
|
// $$$ end - added, VS Renganathan, 13 Oct 2K
|
|
|
|
|
1999-05-12 02:04:38 +00:00
|
|
|
extern char *get_formated_gmt_time( void );
|
2000-05-13 00:02:43 +00:00
|
|
|
extern void fgHUDReshape(void);
|
1998-05-11 18:13:10 +00:00
|
|
|
|
|
|
|
enum hudinstype{ HUDno_instr,
|
1998-02-21 14:53:10 +00:00
|
|
|
HUDscale,
|
1998-05-11 18:13:10 +00:00
|
|
|
HUDlabel,
|
1998-02-21 14:53:10 +00:00
|
|
|
HUDladder,
|
|
|
|
HUDcirc_ladder,
|
|
|
|
HUDhorizon,
|
1998-05-11 18:13:10 +00:00
|
|
|
HUDguage,
|
|
|
|
HUDdual_inst,
|
|
|
|
HUDmoving_scale,
|
|
|
|
HUDtbi
|
|
|
|
};
|
|
|
|
|
1998-07-13 21:00:45 +00:00
|
|
|
typedef struct gltagRGBTRIPLE { // rgbt
|
|
|
|
GLfloat Blue;
|
|
|
|
GLfloat Green;
|
|
|
|
GLfloat Red;
|
|
|
|
} glRGBTRIPLE;
|
1999-05-12 02:04:38 +00:00
|
|
|
|
|
|
|
class fgLineSeg2D {
|
|
|
|
private:
|
1999-06-01 21:17:10 +00:00
|
|
|
GLfloat x0, y0, x1, y1;
|
1999-05-12 02:04:38 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
fgLineSeg2D( GLfloat a = 0, GLfloat b =0, GLfloat c = 0, GLfloat d =0 )
|
|
|
|
: x0(a), y0(b), x1(c), y1(d) {}
|
|
|
|
|
|
|
|
fgLineSeg2D( const fgLineSeg2D & image )
|
|
|
|
: x0(image.x0), y0(image.y0), x1(image.x1), y1(image.y1) {}
|
|
|
|
|
|
|
|
fgLineSeg2D& operator= ( const fgLineSeg2D & image ) {
|
|
|
|
x0 = image.x0; y0 = image.y0; x1 = image.x1; y1 = image.y1; return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
~fgLineSeg2D() {}
|
|
|
|
|
|
|
|
void draw()
|
|
|
|
{
|
|
|
|
glVertex2f(x0, y0);
|
|
|
|
glVertex2f(x1, y1);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#define USE_HUD_TextList
|
1999-06-01 21:17:10 +00:00
|
|
|
extern float HUD_TextSize;
|
|
|
|
extern fntRenderer *HUDtext;
|
|
|
|
extern float HUD_matrix[16];
|
1999-05-12 02:04:38 +00:00
|
|
|
|
1999-06-01 21:17:10 +00:00
|
|
|
class fgText {
|
1999-05-12 02:04:38 +00:00
|
|
|
private:
|
1999-06-17 20:07:19 +00:00
|
|
|
float x, y;
|
1999-10-10 16:47:51 +00:00
|
|
|
char msg[64];
|
1999-05-12 02:04:38 +00:00
|
|
|
public:
|
1999-06-20 01:52:31 +00:00
|
|
|
fgText( float x = 0, float y = 0, char *c = NULL )
|
1999-10-10 16:47:51 +00:00
|
|
|
: x(x), y(y) {strncpy(msg,c,64-1);}
|
1999-05-12 02:04:38 +00:00
|
|
|
|
1999-06-01 21:17:10 +00:00
|
|
|
fgText( const fgText & image )
|
|
|
|
: x(image.x), y(image.y) {strcpy(msg,image.msg);}
|
|
|
|
|
|
|
|
fgText& operator = ( const fgText & image ) {
|
|
|
|
strcpy(msg,image.msg); x = image.x; y = image.y;
|
1999-05-12 02:04:38 +00:00
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
1999-06-01 21:17:10 +00:00
|
|
|
~fgText() {msg[0]='\0';}
|
1999-05-12 02:04:38 +00:00
|
|
|
|
1999-06-01 21:17:10 +00:00
|
|
|
int getStringWidth ( char *str )
|
1999-05-12 02:04:38 +00:00
|
|
|
{
|
1999-06-01 21:17:10 +00:00
|
|
|
if ( HUDtext && str )
|
1999-05-12 02:04:38 +00:00
|
|
|
{
|
1999-06-01 21:17:10 +00:00
|
|
|
float r, l ;
|
|
|
|
guiFntHandle->getBBox ( str, HUD_TextSize, 0, &l, &r, NULL, NULL ) ;
|
|
|
|
return FloatToInt( r - l );
|
1999-05-12 02:04:38 +00:00
|
|
|
}
|
1999-06-01 21:17:10 +00:00
|
|
|
return 0 ;
|
|
|
|
}
|
|
|
|
|
|
|
|
int StringWidth (void )
|
|
|
|
{
|
|
|
|
if ( HUDtext && strlen( msg ))
|
1999-05-12 02:04:38 +00:00
|
|
|
{
|
1999-06-01 21:17:10 +00:00
|
|
|
float r, l ;
|
|
|
|
guiFntHandle->getBBox ( msg, HUD_TextSize, 0, &l, &r, NULL, NULL ) ;
|
|
|
|
return FloatToInt( r - l );
|
1999-05-12 02:04:38 +00:00
|
|
|
}
|
1999-06-01 21:17:10 +00:00
|
|
|
return 0 ;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Draw(fntRenderer *fnt)
|
|
|
|
{
|
|
|
|
fnt->start2f( x, y );
|
|
|
|
fnt->puts ( msg ) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Draw()
|
|
|
|
{
|
|
|
|
puDrawString ( guiFnt, msg, FloatToInt(x), FloatToInt(y) );
|
1999-05-12 02:04:38 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
1999-06-01 21:17:10 +00:00
|
|
|
class fgLineList {
|
|
|
|
vector < fgLineSeg2D > List;
|
|
|
|
public:
|
|
|
|
fgLineList( void ) {}
|
|
|
|
~fgLineList( void ) {}
|
|
|
|
void add( fgLineSeg2D seg ) { List.push_back(seg); }
|
|
|
|
void erase( void ) { List.erase( List.begin(), List.end() ); }
|
2000-05-13 00:02:43 +00:00
|
|
|
void draw( void ) {
|
|
|
|
vector < fgLineSeg2D > :: iterator curSeg;
|
|
|
|
vector < fgLineSeg2D > :: iterator lastSeg;
|
|
|
|
curSeg = List.begin();
|
|
|
|
lastSeg = List.end();
|
|
|
|
glBegin(GL_LINES);
|
|
|
|
for ( ; curSeg != lastSeg; curSeg++ ) {
|
|
|
|
curSeg->draw();
|
|
|
|
}
|
|
|
|
glEnd();
|
2000-05-11 19:17:02 +00:00
|
|
|
}
|
2000-05-13 00:02:43 +00:00
|
|
|
/* void draw( void ) {
|
1999-06-01 21:17:10 +00:00
|
|
|
vector < fgLineSeg2D > :: iterator curSeg;
|
|
|
|
vector < fgLineSeg2D > :: iterator lastSeg;
|
2000-05-13 00:02:43 +00:00
|
|
|
curSeg = List.begin();
|
1999-06-01 21:17:10 +00:00
|
|
|
lastSeg = List.end();
|
|
|
|
glBegin(GL_LINES);
|
|
|
|
for ( ; curSeg != lastSeg; curSeg++ ) {
|
|
|
|
curSeg->draw();
|
|
|
|
}
|
|
|
|
glEnd();
|
2000-05-13 00:02:43 +00:00
|
|
|
} */
|
1999-06-01 21:17:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class fgTextList {
|
|
|
|
fntRenderer *Font;
|
|
|
|
vector< fgText > List;
|
|
|
|
public:
|
|
|
|
fgTextList ( void ) { Font = 0; }
|
|
|
|
~fgTextList( void ) {}
|
|
|
|
|
|
|
|
void setFont( fntRenderer *Renderer ) { Font = Renderer; }
|
|
|
|
void add( fgText String ) { List.push_back(String); }
|
|
|
|
void erase( void ) { List.erase( List.begin(), List.end() ); }
|
|
|
|
|
|
|
|
void draw( void ) {
|
|
|
|
vector < fgText > :: iterator curString;
|
|
|
|
vector < fgText > :: iterator lastString;
|
|
|
|
if( Font == 0 ) return;
|
|
|
|
curString = List.begin();
|
|
|
|
lastString = List.end();
|
|
|
|
glPushAttrib( GL_COLOR_BUFFER_BIT );
|
|
|
|
glEnable ( GL_ALPHA_TEST ) ;
|
|
|
|
glEnable ( GL_BLEND ) ;
|
|
|
|
glAlphaFunc ( GL_GREATER, 0.1 ) ;
|
|
|
|
glBlendFunc ( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ) ;
|
|
|
|
|
|
|
|
Font->begin();
|
|
|
|
for( ; curString != lastString; curString++ ) {
|
|
|
|
curString->Draw(Font);
|
|
|
|
}
|
|
|
|
Font->end();
|
|
|
|
|
|
|
|
glDisable ( GL_TEXTURE_2D ) ;
|
|
|
|
glPopAttrib();
|
|
|
|
}
|
|
|
|
};
|
1999-05-12 02:04:38 +00:00
|
|
|
|
|
|
|
|
1999-06-01 21:17:10 +00:00
|
|
|
inline void Text( fgTextList &List, float x, float y, char *s)
|
|
|
|
{
|
|
|
|
List.add( fgText( x, y, s) );
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void Text( fgTextList &List, fgText &me)
|
|
|
|
{
|
|
|
|
List.add(me);
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void Line( fgLineList &List, float x1, float y1, float x2, float y2)
|
|
|
|
{
|
|
|
|
List.add(fgLineSeg2D(x1,y1,x2,y2));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Declare our externals
|
|
|
|
extern fgTextList HUD_TextList;
|
|
|
|
extern fgLineList HUD_LineList;
|
|
|
|
extern fgLineList HUD_StippleLineList;
|
|
|
|
|
1998-07-13 21:00:45 +00:00
|
|
|
|
1998-05-11 18:13:10 +00:00
|
|
|
class instr_item { // An Abstract Base Class (ABC)
|
|
|
|
private:
|
1998-07-13 21:00:45 +00:00
|
|
|
static UINT instances; // More than 64K instruments? Nah!
|
|
|
|
static int brightness;
|
|
|
|
static glRGBTRIPLE color;
|
|
|
|
|
|
|
|
UINT handle;
|
|
|
|
RECT scrn_pos; // Framing - affects scale dimensions
|
1998-05-11 18:13:10 +00:00
|
|
|
// and orientation. Vert vs Horz, etc.
|
1999-05-12 02:04:38 +00:00
|
|
|
FLTFNPTR load_value_fn;
|
|
|
|
float disp_factor; // Multiply by to get numbers shown on scale.
|
1998-07-13 21:00:45 +00:00
|
|
|
UINT opts;
|
|
|
|
bool is_enabled;
|
|
|
|
bool broken;
|
|
|
|
UINT scr_span; // Working values for draw;
|
|
|
|
POINT mid_span; //
|
1998-05-11 18:13:10 +00:00
|
|
|
|
|
|
|
public:
|
1998-07-03 13:16:27 +00:00
|
|
|
instr_item( int x,
|
|
|
|
int y,
|
|
|
|
UINT height,
|
|
|
|
UINT width,
|
1999-05-12 02:04:38 +00:00
|
|
|
FLTFNPTR data_source,
|
2001-01-05 16:44:48 +00:00
|
|
|
float data_scaling,
|
1998-07-03 13:16:27 +00:00
|
|
|
UINT options,
|
2001-01-05 16:44:48 +00:00
|
|
|
bool working = true);
|
1998-05-11 18:13:10 +00:00
|
|
|
|
|
|
|
instr_item( const instr_item & image );
|
|
|
|
|
|
|
|
instr_item & operator = ( const instr_item & rhs );
|
|
|
|
virtual ~instr_item ();
|
|
|
|
|
1999-06-01 21:17:10 +00:00
|
|
|
int get_brightness ( void ) { return brightness;}
|
|
|
|
RECT get_location ( void ) { return scrn_pos; }
|
|
|
|
bool is_broken ( void ) { return broken; }
|
|
|
|
bool enabled ( void ) { return is_enabled;}
|
|
|
|
bool data_available ( void ) { return !!load_value_fn; }
|
|
|
|
float get_value ( void ) { return load_value_fn(); }
|
|
|
|
float data_scaling ( void ) { return disp_factor; }
|
|
|
|
UINT get_span ( void ) { return scr_span; }
|
|
|
|
POINT get_centroid ( void ) { return mid_span; }
|
|
|
|
UINT get_options ( void ) { return opts; }
|
1998-05-11 18:13:10 +00:00
|
|
|
|
1999-05-12 02:04:38 +00:00
|
|
|
UINT huds_vert (UINT options) { return( options & HUDS_VERT ); }
|
|
|
|
UINT huds_left (UINT options) { return( options & HUDS_LEFT ); }
|
|
|
|
UINT huds_right (UINT options) { return( options & HUDS_RIGHT ); }
|
|
|
|
UINT huds_both (UINT options) { return( (options & HUDS_BOTH) == HUDS_BOTH ); }
|
|
|
|
UINT huds_noticks (UINT options) { return( options & HUDS_NOTICKS ); }
|
|
|
|
UINT huds_notext (UINT options) { return( options & HUDS_NOTEXT ); }
|
|
|
|
UINT huds_top (UINT options) { return( options & HUDS_TOP ); }
|
|
|
|
UINT huds_bottom (UINT options) { return( options & HUDS_BOTTOM ); }
|
|
|
|
|
1998-05-11 18:13:10 +00:00
|
|
|
virtual void display_enable( bool working ) { is_enabled = !! working;}
|
|
|
|
|
|
|
|
virtual void update( void );
|
|
|
|
virtual void break_display ( bool bad );
|
|
|
|
virtual void SetBrightness( int illumination_level ); // fgHUDSetBright...
|
1998-07-03 13:16:27 +00:00
|
|
|
void SetPosition ( int x, int y, UINT width, UINT height );
|
1999-06-01 21:17:10 +00:00
|
|
|
UINT get_Handle( void );
|
1998-05-11 18:13:10 +00:00
|
|
|
virtual void draw( void ) = 0; // Required method in derived classes
|
1999-05-12 02:04:38 +00:00
|
|
|
|
1999-06-01 21:17:10 +00:00
|
|
|
void drawOneLine( float x1, float y1, float x2, float y2)
|
1999-05-12 02:04:38 +00:00
|
|
|
{
|
1999-06-01 21:17:10 +00:00
|
|
|
HUD_LineList.add(fgLineSeg2D(x1,y1,x2,y2));
|
1999-05-12 02:04:38 +00:00
|
|
|
}
|
1999-06-01 21:17:10 +00:00
|
|
|
void drawOneStippleLine( float x1, float y1, float x2, float y2)
|
1999-05-12 02:04:38 +00:00
|
|
|
{
|
1999-06-01 21:17:10 +00:00
|
|
|
HUD_StippleLineList.add(fgLineSeg2D(x1,y1,x2,y2));
|
1999-05-12 02:04:38 +00:00
|
|
|
}
|
1999-06-01 21:17:10 +00:00
|
|
|
void TextString( char *msg, float x, float y )
|
1999-05-12 02:04:38 +00:00
|
|
|
{
|
1999-06-20 03:54:57 +00:00
|
|
|
HUD_TextList.add(fgText(x, y, msg));
|
1999-05-12 02:04:38 +00:00
|
|
|
}
|
1999-06-01 21:17:10 +00:00
|
|
|
int getStringWidth ( char *str )
|
|
|
|
{
|
|
|
|
if ( HUDtext && str )
|
|
|
|
{
|
|
|
|
float r, l ;
|
|
|
|
guiFntHandle->getBBox ( str, HUD_TextSize, 0, &l, &r, NULL, NULL ) ;
|
|
|
|
return FloatToInt( r - l );
|
|
|
|
}
|
|
|
|
return 0 ;
|
|
|
|
}
|
|
|
|
|
1998-05-11 18:13:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef instr_item *HIptr;
|
1999-05-12 02:04:38 +00:00
|
|
|
//typedef deque < instr_item * > hud_deque_type;
|
|
|
|
//typedef hud_deque_type::iterator hud_deque_iterator;
|
|
|
|
//typedef hud_deque_type::const_iterator hud_deque_const_iterator;
|
|
|
|
|
|
|
|
extern deque< instr_item *> HUD_deque;
|
1999-06-01 21:17:10 +00:00
|
|
|
extern int HUD_style;
|
1999-05-12 02:04:38 +00:00
|
|
|
//extern hud_deque_type HUD_deque;
|
1998-05-11 18:13:10 +00:00
|
|
|
|
|
|
|
// instr_item This class has no other purpose than to maintain
|
|
|
|
// a linked list of instrument and derived class
|
|
|
|
// object pointers.
|
|
|
|
|
|
|
|
|
|
|
|
class instr_label : public instr_item {
|
|
|
|
private:
|
|
|
|
const char *pformat;
|
|
|
|
const char *pre_str;
|
|
|
|
const char *post_str;
|
|
|
|
fgLabelJust justify;
|
|
|
|
int fontSize;
|
|
|
|
int blink;
|
1999-05-12 02:04:38 +00:00
|
|
|
char format_buffer[80];
|
2001-01-05 16:44:48 +00:00
|
|
|
bool lat;
|
|
|
|
bool lon;
|
1998-05-11 18:13:10 +00:00
|
|
|
|
|
|
|
public:
|
1998-07-03 13:16:27 +00:00
|
|
|
instr_label( int x,
|
|
|
|
int y,
|
|
|
|
UINT width,
|
|
|
|
UINT height,
|
1999-05-12 02:04:38 +00:00
|
|
|
FLTFNPTR data_source,
|
1998-05-11 18:13:10 +00:00
|
|
|
const char *label_format,
|
2001-01-05 16:44:48 +00:00
|
|
|
const char *pre_label_string,
|
|
|
|
const char *post_label_string,
|
|
|
|
float scale_data,
|
|
|
|
UINT options,
|
|
|
|
fgLabelJust justification,
|
|
|
|
int font_size,
|
|
|
|
int blinking,
|
|
|
|
bool latitude,
|
|
|
|
bool longitude,
|
|
|
|
bool working);
|
1998-05-11 18:13:10 +00:00
|
|
|
|
|
|
|
~instr_label();
|
|
|
|
|
|
|
|
instr_label( const instr_label & image);
|
|
|
|
instr_label & operator = (const instr_label & rhs );
|
|
|
|
virtual void draw( void ); // Required method in base class
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef instr_label * pInstlabel;
|
1998-02-07 15:29:31 +00:00
|
|
|
|
1999-05-12 02:04:38 +00:00
|
|
|
|
|
|
|
class lat_label : public instr_item {
|
|
|
|
private:
|
|
|
|
const char *pformat;
|
|
|
|
const char *pre_str;
|
|
|
|
const char *post_str;
|
|
|
|
fgLabelJust justify;
|
|
|
|
int fontSize;
|
|
|
|
int blink;
|
|
|
|
char format_buffer[80];
|
|
|
|
|
|
|
|
public:
|
|
|
|
lat_label( int x,
|
|
|
|
int y,
|
|
|
|
UINT width,
|
|
|
|
UINT height,
|
|
|
|
FLTFNPTR data_source,
|
|
|
|
const char *label_format,
|
2001-01-05 16:44:48 +00:00
|
|
|
const char *pre_label_string,
|
|
|
|
const char *post_label_string,
|
|
|
|
float scale_data,
|
|
|
|
UINT options,
|
|
|
|
fgLabelJust justification,
|
|
|
|
int font_size,
|
|
|
|
int blinking,
|
|
|
|
bool working);
|
1999-05-12 02:04:38 +00:00
|
|
|
|
|
|
|
~lat_label();
|
|
|
|
|
|
|
|
lat_label( const lat_label & image);
|
|
|
|
lat_label & operator = (const lat_label & rhs );
|
|
|
|
virtual void draw( void ); // Required method in base class
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef lat_label * pLatlabel;
|
|
|
|
|
|
|
|
class lon_label : public instr_item {
|
|
|
|
private:
|
|
|
|
const char *pformat;
|
|
|
|
const char *pre_str;
|
|
|
|
const char *post_str;
|
|
|
|
fgLabelJust justify;
|
|
|
|
int fontSize;
|
|
|
|
int blink;
|
|
|
|
char format_buffer[80];
|
|
|
|
|
|
|
|
public:
|
|
|
|
lon_label( int x,
|
|
|
|
int y,
|
|
|
|
UINT width,
|
|
|
|
UINT height,
|
|
|
|
FLTFNPTR data_source,
|
|
|
|
const char *label_format,
|
2001-01-05 16:44:48 +00:00
|
|
|
const char *pre_label_string,
|
|
|
|
const char *post_label_string,
|
|
|
|
float scale_data,
|
|
|
|
UINT options,
|
|
|
|
fgLabelJust justification,
|
|
|
|
int font_size,
|
|
|
|
int blinking,
|
|
|
|
bool working);
|
1999-05-12 02:04:38 +00:00
|
|
|
|
|
|
|
~lon_label();
|
|
|
|
|
|
|
|
lon_label( const lon_label & image);
|
|
|
|
lon_label & operator = (const lon_label & rhs );
|
|
|
|
virtual void draw( void ); // Required method in base class
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef lon_label * pLonlabel;
|
|
|
|
|
1998-05-11 18:13:10 +00:00
|
|
|
//
|
|
|
|
// instr_scale This class is an abstract base class for both moving
|
|
|
|
// scale and moving needle (fixed scale) indicators. It
|
|
|
|
// does not draw itself, but is not instanciable.
|
|
|
|
//
|
|
|
|
|
|
|
|
class instr_scale : public instr_item {
|
|
|
|
private:
|
1999-05-12 02:04:38 +00:00
|
|
|
float range_shown; // Width Units.
|
|
|
|
float Maximum_value; // ceiling.
|
|
|
|
float Minimum_value; // Representation floor.
|
|
|
|
float scale_factor; // factor => screen units/range values.
|
1998-05-11 18:13:10 +00:00
|
|
|
UINT Maj_div; // major division marker units
|
|
|
|
UINT Min_div; // minor division marker units
|
|
|
|
UINT Modulo; // Roll over point
|
1998-07-03 13:16:27 +00:00
|
|
|
int signif_digits; // digits to show to the right.
|
1998-05-11 18:13:10 +00:00
|
|
|
|
|
|
|
public:
|
1998-07-03 13:16:27 +00:00
|
|
|
instr_scale( int x,
|
|
|
|
int y,
|
|
|
|
UINT width,
|
|
|
|
UINT height,
|
1999-05-12 02:04:38 +00:00
|
|
|
FLTFNPTR load_fn,
|
1998-07-03 13:16:27 +00:00
|
|
|
UINT options,
|
1999-05-12 02:04:38 +00:00
|
|
|
float show_range,
|
2001-01-05 16:44:48 +00:00
|
|
|
float max_value,
|
|
|
|
float min_value,
|
|
|
|
float disp_scaling,
|
|
|
|
UINT major_divs,
|
|
|
|
UINT minor_divs,
|
|
|
|
UINT rollover,
|
|
|
|
int dp_showing,
|
|
|
|
bool working = true);
|
1998-05-11 18:13:10 +00:00
|
|
|
|
|
|
|
virtual ~instr_scale();
|
|
|
|
instr_scale( const instr_scale & image);
|
|
|
|
instr_scale & operator = (const instr_scale & rhs);
|
|
|
|
|
|
|
|
virtual void draw ( void ) {}; // No-op here. Defined in derived classes.
|
|
|
|
UINT div_min ( void ) { return Min_div;}
|
|
|
|
UINT div_max ( void ) { return Maj_div;}
|
1999-05-12 02:04:38 +00:00
|
|
|
float min_val ( void ) { return Minimum_value;}
|
|
|
|
float max_val ( void ) { return Maximum_value;}
|
1998-05-11 18:13:10 +00:00
|
|
|
UINT modulo ( void ) { return Modulo; }
|
1999-05-12 02:04:38 +00:00
|
|
|
float factor ( void ) { return scale_factor;}
|
|
|
|
float range_to_show( void ) { return range_shown;}
|
1998-05-11 18:13:10 +00:00
|
|
|
};
|
|
|
|
|
1998-07-03 13:16:27 +00:00
|
|
|
// hud_card_ This class displays the indicated quantity on
|
1998-05-11 18:13:10 +00:00
|
|
|
// a scale that moves past the pointer. It may be
|
|
|
|
// horizontal or vertical, read above(left) or below(right) of the base
|
|
|
|
// line.
|
|
|
|
|
1998-07-03 13:16:27 +00:00
|
|
|
class hud_card : public instr_scale {
|
1998-05-11 18:13:10 +00:00
|
|
|
private:
|
1999-05-12 02:04:38 +00:00
|
|
|
float val_span;
|
2001-01-05 16:44:48 +00:00
|
|
|
string type;
|
1999-05-12 02:04:38 +00:00
|
|
|
float half_width_units;
|
2001-01-05 16:44:48 +00:00
|
|
|
bool draw_tick_bottom;
|
|
|
|
bool draw_tick_top;
|
|
|
|
bool draw_tick_right;
|
|
|
|
bool draw_tick_left;
|
|
|
|
bool draw_cap_bottom;
|
|
|
|
bool draw_cap_top;
|
|
|
|
bool draw_cap_right;
|
|
|
|
bool draw_cap_left;
|
|
|
|
float marker_offset;
|
|
|
|
bool pointer;
|
|
|
|
string pointer_type;
|
|
|
|
|
1999-05-12 02:04:38 +00:00
|
|
|
|
1998-05-11 18:13:10 +00:00
|
|
|
public:
|
1998-07-03 13:16:27 +00:00
|
|
|
hud_card( int x,
|
|
|
|
int y,
|
|
|
|
UINT width,
|
|
|
|
UINT height,
|
1999-05-12 02:04:38 +00:00
|
|
|
FLTFNPTR load_fn,
|
1998-07-03 13:16:27 +00:00
|
|
|
UINT options,
|
2001-01-05 16:44:48 +00:00
|
|
|
float maxValue,
|
|
|
|
float minValue,
|
|
|
|
float disp_scaling,
|
|
|
|
UINT major_divs,
|
|
|
|
UINT minor_divs,
|
|
|
|
UINT modulator,
|
|
|
|
int dp_showing,
|
|
|
|
float value_span,
|
|
|
|
string type,
|
|
|
|
bool draw_tick_bottom,
|
|
|
|
bool draw_tick_top,
|
|
|
|
bool draw_tick_right,
|
|
|
|
bool draw_tick_left,
|
|
|
|
bool draw_cap_bottom,
|
|
|
|
bool draw_cap_top,
|
|
|
|
bool draw_cap_right,
|
|
|
|
bool draw_cap_left,
|
|
|
|
float marker_offset,
|
|
|
|
bool pointer,
|
|
|
|
string pointer_type,
|
|
|
|
bool working);
|
1998-07-03 13:16:27 +00:00
|
|
|
|
|
|
|
~hud_card();
|
|
|
|
hud_card( const hud_card & image);
|
|
|
|
hud_card & operator = (const hud_card & rhs );
|
1998-05-11 18:13:10 +00:00
|
|
|
// virtual void display_enable( bool setting );
|
|
|
|
virtual void draw( void ); // Required method in base class
|
|
|
|
};
|
|
|
|
|
1998-07-03 13:16:27 +00:00
|
|
|
typedef hud_card * pCardScale;
|
1998-05-11 18:13:10 +00:00
|
|
|
|
|
|
|
class guage_instr : public instr_scale {
|
|
|
|
public:
|
1998-07-03 13:16:27 +00:00
|
|
|
guage_instr( int x,
|
|
|
|
int y,
|
|
|
|
UINT width,
|
|
|
|
UINT height,
|
1999-05-12 02:04:38 +00:00
|
|
|
FLTFNPTR load_fn,
|
1998-07-03 13:16:27 +00:00
|
|
|
UINT options,
|
2001-01-05 16:44:48 +00:00
|
|
|
float disp_scaling,
|
|
|
|
float maxValue,
|
|
|
|
float minValue,
|
|
|
|
UINT major_divs,
|
|
|
|
UINT minor_divs,
|
|
|
|
int dp_showing,
|
|
|
|
UINT modulus,
|
|
|
|
bool working);
|
1998-05-11 18:13:10 +00:00
|
|
|
|
|
|
|
~guage_instr();
|
|
|
|
guage_instr( const guage_instr & image);
|
|
|
|
guage_instr & operator = (const guage_instr & rhs );
|
|
|
|
virtual void draw( void ); // Required method in base class
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef guage_instr * pGuageInst;
|
|
|
|
//
|
|
|
|
// dual_instr_item This class was created to form the base class
|
|
|
|
// for both panel and HUD Turn Bank Indicators.
|
|
|
|
|
|
|
|
class dual_instr_item : public instr_item {
|
|
|
|
private:
|
1999-05-12 02:04:38 +00:00
|
|
|
FLTFNPTR alt_data_source;
|
1998-05-11 18:13:10 +00:00
|
|
|
|
|
|
|
public:
|
1998-07-03 13:16:27 +00:00
|
|
|
dual_instr_item ( int x,
|
|
|
|
int y,
|
|
|
|
UINT width,
|
|
|
|
UINT height,
|
1999-05-12 02:04:38 +00:00
|
|
|
FLTFNPTR chn1_source,
|
|
|
|
FLTFNPTR chn2_source,
|
2001-01-05 16:44:48 +00:00
|
|
|
bool working,
|
|
|
|
UINT options );
|
1998-05-11 18:13:10 +00:00
|
|
|
|
|
|
|
virtual ~dual_instr_item() {};
|
|
|
|
dual_instr_item( const dual_instr_item & image);
|
|
|
|
dual_instr_item & operator = (const dual_instr_item & rhs );
|
|
|
|
|
1999-05-12 02:04:38 +00:00
|
|
|
float current_ch1( void ) { return (float)alt_data_source();}
|
|
|
|
float current_ch2( void ) { return (float)get_value();}
|
1998-05-11 18:13:10 +00:00
|
|
|
virtual void draw ( void ) { }
|
|
|
|
};
|
|
|
|
|
|
|
|
class fgTBI_instr : public dual_instr_item {
|
|
|
|
private:
|
|
|
|
UINT BankLimit;
|
|
|
|
UINT SlewLimit;
|
|
|
|
UINT scr_hole;
|
|
|
|
|
|
|
|
public:
|
1998-07-03 13:16:27 +00:00
|
|
|
fgTBI_instr( int x,
|
|
|
|
int y,
|
|
|
|
UINT width,
|
|
|
|
UINT height,
|
2001-01-05 16:44:48 +00:00
|
|
|
FLTFNPTR chn1_source,
|
|
|
|
FLTFNPTR chn2_source,
|
|
|
|
float maxBankAngle,
|
|
|
|
float maxSlipAngle,
|
|
|
|
UINT gap_width,
|
|
|
|
bool working);
|
1998-05-11 18:13:10 +00:00
|
|
|
|
|
|
|
fgTBI_instr( const fgTBI_instr & image);
|
|
|
|
fgTBI_instr & operator = (const fgTBI_instr & rhs );
|
|
|
|
|
|
|
|
~fgTBI_instr();
|
|
|
|
|
|
|
|
UINT bank_limit( void ) { return BankLimit;}
|
|
|
|
UINT slew_limit( void ) { return SlewLimit;}
|
|
|
|
|
|
|
|
virtual void draw( void ); // Required method in base class
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef fgTBI_instr * pTBI;
|
|
|
|
|
|
|
|
class HudLadder : public dual_instr_item {
|
|
|
|
private:
|
|
|
|
UINT width_units;
|
|
|
|
int div_units;
|
|
|
|
UINT minor_div;
|
|
|
|
UINT label_pos;
|
|
|
|
UINT scr_hole;
|
2001-01-05 16:44:48 +00:00
|
|
|
float vmax;
|
|
|
|
float vmin;
|
|
|
|
float factor;
|
|
|
|
string hudladder_type;
|
|
|
|
bool frl;
|
|
|
|
bool target_spot;
|
|
|
|
bool velocity_vector;
|
|
|
|
bool drift_marker;
|
|
|
|
bool alpha_bracket;
|
|
|
|
bool energy_marker;
|
|
|
|
bool climb_dive_marker;
|
|
|
|
bool glide_slope_marker;
|
|
|
|
float glide_slope;
|
|
|
|
bool energy_worm;
|
|
|
|
bool waypoint_marker;
|
1998-05-11 18:13:10 +00:00
|
|
|
|
1999-06-01 21:17:10 +00:00
|
|
|
fgTextList TextList;
|
|
|
|
fgLineList LineList;
|
|
|
|
fgLineList StippleLineList;
|
|
|
|
|
1998-05-11 18:13:10 +00:00
|
|
|
public:
|
2001-01-05 16:44:48 +00:00
|
|
|
HudLadder( string name,
|
|
|
|
int x,
|
1998-07-03 13:16:27 +00:00
|
|
|
int y,
|
|
|
|
UINT width,
|
|
|
|
UINT height,
|
2001-01-05 16:44:48 +00:00
|
|
|
float factor,
|
|
|
|
FLTFNPTR ptch_source,
|
|
|
|
FLTFNPTR roll_source,
|
|
|
|
float span_units,
|
|
|
|
float division_units,
|
|
|
|
float minor_division,
|
|
|
|
UINT screen_hole,
|
|
|
|
UINT lbl_pos,
|
|
|
|
bool frl,
|
|
|
|
bool target_spot,
|
|
|
|
bool velocity_vector,
|
|
|
|
bool drift_marker,
|
|
|
|
bool alpha_bracket,
|
|
|
|
bool energy_marker,
|
|
|
|
bool climb_dive_marker,
|
|
|
|
bool glide_slope_marker,
|
|
|
|
float glide_slope,
|
|
|
|
bool energy_worm,
|
|
|
|
bool waypoint_marker,
|
|
|
|
bool working);
|
1998-05-11 18:13:10 +00:00
|
|
|
|
|
|
|
~HudLadder();
|
|
|
|
|
|
|
|
HudLadder( const HudLadder & image );
|
|
|
|
HudLadder & operator = ( const HudLadder & rhs );
|
|
|
|
virtual void draw( void );
|
1999-06-01 21:17:10 +00:00
|
|
|
|
|
|
|
void Text( float x, float y, char *s)
|
|
|
|
{
|
|
|
|
TextList.add( fgText( x, y, s) );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Line( float x1, float y1, float x2, float y2)
|
|
|
|
{
|
|
|
|
LineList.add(fgLineSeg2D(x1,y1,x2,y2));
|
|
|
|
}
|
|
|
|
|
|
|
|
void StippleLine( float x1, float y1, float x2, float y2)
|
|
|
|
{
|
|
|
|
StippleLineList.add(fgLineSeg2D(x1,y1,x2,y2));
|
|
|
|
}
|
1998-05-11 18:13:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//using namespace std;
|
|
|
|
//deque <instr_item> * Hdeque_ptr;
|
|
|
|
|
2000-05-15 17:47:50 +00:00
|
|
|
extern void HUD_masterswitch( bool incr );
|
1998-07-13 21:00:45 +00:00
|
|
|
extern void HUD_brightkey( bool incr_bright );
|
1998-05-11 18:13:10 +00:00
|
|
|
extern int fgHUDInit( fgAIRCRAFT * /* current_aircraft */ );
|
1998-08-24 20:05:15 +00:00
|
|
|
extern int fgHUDInit2( fgAIRCRAFT * /* current_aircraft */ );
|
1998-05-11 18:13:10 +00:00
|
|
|
extern void fgUpdateHUD( void );
|
2001-06-13 20:31:49 +00:00
|
|
|
extern void fgUpdateHUD( GLfloat x_start, GLfloat y_start,
|
|
|
|
GLfloat x_end, GLfloat y_end );
|
1998-02-07 15:29:31 +00:00
|
|
|
|
1998-07-03 13:16:27 +00:00
|
|
|
extern void drawOneLine ( UINT x1, UINT y1, UINT x2, UINT y2);
|
|
|
|
extern void drawOneLine ( RECT &rect);
|
|
|
|
extern void textString ( int x,
|
|
|
|
int y,
|
|
|
|
char *msg,
|
|
|
|
void *font = GLUT_BITMAP_8_BY_13);
|
|
|
|
extern void strokeString( int x,
|
|
|
|
int y,
|
|
|
|
char *msg,
|
|
|
|
void *font = GLUT_STROKE_ROMAN,
|
|
|
|
float theta = 0);
|
2001-01-05 16:44:48 +00:00
|
|
|
|
1999-05-12 02:04:38 +00:00
|
|
|
//extern void strokeString(float xx,
|
|
|
|
// float yy,
|
|
|
|
// char *msg,
|
|
|
|
// void *font = GLUT_STROKE_ROMAN)
|
|
|
|
|
1998-02-07 15:29:31 +00:00
|
|
|
/*
|
1998-05-11 18:13:10 +00:00
|
|
|
bool AddHUDInstrument( instr_item *pBlackBox );
|
|
|
|
void DrawHUD ( void );
|
|
|
|
bool DamageInstrument( INSTR_HANDLE unit );
|
|
|
|
bool RepairInstrument( INSTR_HANDLE unit );
|
|
|
|
|
1998-02-07 15:29:31 +00:00
|
|
|
|
|
|
|
void fgUpdateHUD ( Hptr hud );
|
|
|
|
void fgUpdateHUD2( Hptr hud ); // Future use?
|
1998-05-11 18:13:10 +00:00
|
|
|
void fgHUDSetTimeMode( Hptr hud, int time_of_day );
|
|
|
|
*/
|
1997-08-29 18:03:19 +00:00
|
|
|
|
1998-05-11 18:13:10 +00:00
|
|
|
#endif // _HUD_H
|