Added panel changes sent in by Friedemann.
This commit is contained in:
parent
7cc178d182
commit
e73cdc9500
3 changed files with 617 additions and 552 deletions
|
@ -52,6 +52,7 @@
|
|||
#include <Time/fg_timer.hxx>
|
||||
|
||||
#include "cockpit.hxx"
|
||||
#include "panel.hxx"
|
||||
|
||||
|
||||
// This is a structure that contains all data related to
|
||||
|
@ -226,7 +227,7 @@ bool fgCockpitInit( fgAIRCRAFT *cur_aircraft )
|
|||
ac_cockpit = new fg_Cockpit();
|
||||
|
||||
if ( current_options.get_panel_status() ) {
|
||||
fgPanelInit();
|
||||
new FGPanel;
|
||||
}
|
||||
|
||||
FG_LOG( FG_COCKPIT, FG_INFO,
|
||||
|
@ -254,12 +255,15 @@ void fgCockpitUpdate( void ) {
|
|||
xglViewport( 0, 0,
|
||||
current_view.get_winWidth(),
|
||||
current_view.get_winHeight() );
|
||||
fgPanelUpdate();
|
||||
FGPanel::OurPanel->Update();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// $Log$
|
||||
// Revision 1.31 1999/03/08 21:56:08 curt
|
||||
// Added panel changes sent in by Friedemann.
|
||||
//
|
||||
// Revision 1.30 1999/02/05 21:28:57 curt
|
||||
// Modifications to incorporate Jon S. Berndts flight model code.
|
||||
//
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -19,7 +19,7 @@
|
|||
// $Id$
|
||||
// (Log is kept at end of this file)
|
||||
|
||||
|
||||
#define LETTER_OFFSET 0.03515625
|
||||
|
||||
#ifndef _PANEL_HXX
|
||||
#define _PANEL_HXX
|
||||
|
@ -41,19 +41,151 @@
|
|||
#include <GL/glut.h>
|
||||
#include <XGL/xgl.h>
|
||||
|
||||
class FGInstrument;
|
||||
|
||||
typedef struct {
|
||||
unsigned short imagic;
|
||||
unsigned short type;
|
||||
unsigned short dim;
|
||||
unsigned short sizeX, sizeY, sizeZ;
|
||||
char name[128];
|
||||
unsigned char *data;
|
||||
} IMAGE;
|
||||
class FGPanel{
|
||||
|
||||
typedef struct {
|
||||
float XPos;
|
||||
float YPos;
|
||||
private:
|
||||
int height, width;
|
||||
GLuint FontList;
|
||||
|
||||
GLubyte *background;
|
||||
|
||||
// FGInstrument **instr_list;
|
||||
FGInstrument *test_instr[7];
|
||||
|
||||
void GetData(void);
|
||||
|
||||
public:
|
||||
static FGPanel *OurPanel;
|
||||
|
||||
FGPanel(void);
|
||||
|
||||
float get_height(void){
|
||||
return height;
|
||||
}
|
||||
|
||||
void ReInit( int x, int y, int finx, int finy);
|
||||
void Update(void);
|
||||
|
||||
void DrawLetter(void){
|
||||
glBegin(GL_POLYGON);
|
||||
glTexCoord2f(0.0, 0.0);
|
||||
glVertex2f(0.0, 0.0);
|
||||
glTexCoord2f(LETTER_OFFSET + 0.004, 0.0);
|
||||
glVertex2f(7.0, 0.0);
|
||||
glTexCoord2f(LETTER_OFFSET + 0.004, 0.0390625);
|
||||
glVertex2f(7.0, 9.0);
|
||||
glTexCoord2f(0.0, 0.0390625);
|
||||
glVertex2f(0.0, 9.0);
|
||||
glEnd();
|
||||
}
|
||||
|
||||
void DrawTestLetter(float X, float Y);
|
||||
void InitLists(void);
|
||||
void TexString(char *s, float XPos, float YPos, float size);
|
||||
|
||||
};
|
||||
|
||||
class FGInstrument{
|
||||
friend class FGPanel;
|
||||
|
||||
protected:
|
||||
float XPos, YPos;
|
||||
|
||||
public:
|
||||
FGInstrument(void){
|
||||
}
|
||||
|
||||
virtual ~FGInstrument(void){}
|
||||
|
||||
virtual void Init(void) = 0;
|
||||
virtual void Render(void) = 0;
|
||||
};
|
||||
|
||||
class FGHorizon : public FGInstrument {
|
||||
private:
|
||||
float texXPos;
|
||||
float texYPos;
|
||||
float radius;
|
||||
float bottom; // tell the program the offset between midpoint and bottom
|
||||
float top; // guess what ;-)
|
||||
float vertices[180][2];
|
||||
float normals[180][3];
|
||||
float texCoord[180][2];
|
||||
|
||||
public:
|
||||
FGHorizon(void){
|
||||
XPos = 0.0; YPos = 0.0;
|
||||
Init();
|
||||
}
|
||||
|
||||
FGHorizon(float inXPos, float inYPos){
|
||||
XPos = inXPos; YPos = inYPos;
|
||||
Init();
|
||||
}
|
||||
|
||||
virtual void Init(void);
|
||||
virtual void Render(void);
|
||||
|
||||
};
|
||||
|
||||
class FGTurnCoordinator : public FGInstrument {
|
||||
private:
|
||||
float PlaneTexXPos;
|
||||
float PlaneTexYPos;
|
||||
float alpha;
|
||||
float PlaneAlpha;
|
||||
float alphahist[2];
|
||||
float rollhist[2];
|
||||
float BallXPos;
|
||||
float BallYPos;
|
||||
float BallTexXPos;
|
||||
float BallTexYPos;
|
||||
float BallRadius;
|
||||
GLfloat vertices[72];
|
||||
|
||||
public:
|
||||
FGTurnCoordinator(void){
|
||||
XPos = 0.0; YPos = 0.0;
|
||||
Init();
|
||||
}
|
||||
|
||||
FGTurnCoordinator(float inXPos, float inYPos){
|
||||
XPos = inXPos; YPos = inYPos;
|
||||
Init();
|
||||
}
|
||||
|
||||
virtual void Init (void);
|
||||
virtual void Render(void);
|
||||
|
||||
};
|
||||
|
||||
class FGRpmGauge : public FGInstrument {
|
||||
private:
|
||||
GLuint list;
|
||||
|
||||
public:
|
||||
FGRpmGauge(void){
|
||||
XPos = 0.0; YPos = 0.0;
|
||||
Init();
|
||||
}
|
||||
|
||||
FGRpmGauge(float inXPos, float inYPos){
|
||||
XPos = inXPos; YPos = inYPos;
|
||||
Init();
|
||||
}
|
||||
|
||||
virtual void Init(void);
|
||||
virtual void Render(void);
|
||||
};
|
||||
|
||||
// temporary class until I get the software-only routines for the
|
||||
// instruments run
|
||||
|
||||
class FGTexInstrument : public FGInstrument {
|
||||
|
||||
private:
|
||||
float radius;
|
||||
float length;
|
||||
float width;
|
||||
|
@ -67,51 +199,53 @@ typedef struct {
|
|||
float texYpos;
|
||||
int variable;
|
||||
GLfloat vertices[20];
|
||||
} Pointer;
|
||||
|
||||
public:
|
||||
FGTexInstrument(void){
|
||||
XPos = 0.0; YPos = 0.0;
|
||||
Init();
|
||||
}
|
||||
|
||||
FGTexInstrument(float inXPos, float inYPos, float inradius, float inlength, float inwidth, float inangle, float invalue1, float invalue2, float inalpha1, float inalpha2, float intexXPos, float intexYPos, int invariable){
|
||||
|
||||
XPos = inXPos; YPos = inYPos;
|
||||
radius = inradius; angle = inangle;
|
||||
length = inlength; width = inwidth;
|
||||
value1 = invalue1; value2 = invalue2;
|
||||
alpha1 = inalpha1; alpha2 = inalpha2;
|
||||
teXpos = intexXPos; texYpos = intexYPos;
|
||||
variable = invariable;
|
||||
Init();
|
||||
}
|
||||
|
||||
void CreatePointer(void);
|
||||
void UpdatePointer(void);
|
||||
|
||||
void Init(void);
|
||||
void Render(void);
|
||||
};
|
||||
|
||||
typedef struct{
|
||||
float XPos;
|
||||
float YPos;
|
||||
float texXPos;
|
||||
float texYPos;
|
||||
float XPos;
|
||||
float YPos;
|
||||
float radius;
|
||||
float bottom; // tell the program the offset between midpoint and bottom
|
||||
float top; // guess what ;-)
|
||||
} arthor;
|
||||
float length;
|
||||
float width;
|
||||
float angle;
|
||||
float tape[2];
|
||||
float value1;
|
||||
float value2;
|
||||
float alpha1;
|
||||
float alpha2;
|
||||
float teXpos;
|
||||
float texYpos;
|
||||
int variable;
|
||||
GLfloat vertices[20];
|
||||
}Pointer;
|
||||
|
||||
typedef struct{
|
||||
float PlaneXPos;
|
||||
float PlaneYPos;
|
||||
float PlaneTexXPos;
|
||||
float PlaneTexYPos;
|
||||
float alpha;
|
||||
float PlaneAlpha;
|
||||
float PlaneAlphaHist;
|
||||
float alphahist;
|
||||
float rollhist;
|
||||
float BallXPos;
|
||||
float BallYPos;
|
||||
float BallTexXPos;
|
||||
float BallTexYPos;
|
||||
float BallRadius;
|
||||
GLfloat vertices[72];
|
||||
} TurnCoordinator;
|
||||
|
||||
void fgPanelInit( void);
|
||||
void fgPanelReInit( int x, int y, int finx, int finy );
|
||||
void fgPanelUpdate( void);
|
||||
void horizon( arthor hor);
|
||||
void fgHorizonInit( arthor hor);
|
||||
void CreatePointer(Pointer *pointer);
|
||||
void UpdatePointer(Pointer *pointer);
|
||||
void fgEraseArea(GLfloat *array, int NumVerti, GLfloat texXPos,
|
||||
GLfloat texYPos, GLfloat XPos, GLfloat YPos,
|
||||
int Texid, float ScaleFactor);
|
||||
void fgUpdateTurnCoordinator(TurnCoordinator *turn);
|
||||
void fgInitTurnCoordinator(TurnCoordinator *turn);
|
||||
void DrawScale(float XPos, float YPos, float InnerRadius, float OuterRadius,
|
||||
float alpha1, float alpha2, int steps, float LineWidth,
|
||||
float red, float green, float blue);
|
||||
void fgEraseArea(GLfloat *array, int NumVerti, GLfloat texXPos, GLfloat texYPos, GLfloat XPos, GLfloat YPos, int Texid, float ScaleFactor = 1);
|
||||
void DrawScale(float XPos, float YPos, float InnerRadius, float OuterRadius, float alpha1, float alpha2, int steps, float LineWidth, float red, float green, float blue, bool filled = false);
|
||||
void DrawBeechcraftLogo(float XPos, float YPos, float Width, float Height);
|
||||
|
||||
void PrintMatrix( void);
|
||||
|
||||
|
@ -120,11 +254,8 @@ void PrintMatrix( void);
|
|||
|
||||
|
||||
// $Log$
|
||||
// Revision 1.7 1999/02/26 22:08:47 curt
|
||||
// Added initial support for native SGI compilers.
|
||||
//
|
||||
// Revision 1.6 1999/02/12 01:46:30 curt
|
||||
// Updates and fixes from Friedemann.
|
||||
// Revision 1.8 1999/03/08 21:56:10 curt
|
||||
// Added panel changes sent in by Friedemann.
|
||||
//
|
||||
// Revision 1.5 1999/01/07 19:25:55 curt
|
||||
// Updates from Friedemann Reinhard.
|
||||
|
|
Loading…
Add table
Reference in a new issue