You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

73 lines
1.5 KiB

#ifndef GAUGE_H
#define GAUGE_H
#include <FTGL/ftgl.h>
struct colour
{
float r, g, b, a;
};
#define OG_SHIFT 1 // key
#define OG_CTRL 2 // key
#define OG_TURBO 8192 // show turbo gauge
#define OG_KM 16384 // if not set - user prefers MILES
#define OG_BAR 32768 // if not set - user prefers PSI
// DL_x - bits for OutGaugePack DashLights and ShowLights
enum
{
DL_SHIFT, // bit 0 - shift light
DL_FULLBEAM, // bit 1 - full beam
DL_HANDBRAKE, // bit 2 - handbrake
DL_PITSPEED, // bit 3 - pit speed limiter
DL_TC, // bit 4 - TC active or switched off
DL_SIGNAL_L, // bit 5 - left turn signal
DL_SIGNAL_R, // bit 6 - right turn signal
DL_SIGNAL_ANY, // bit 7 - shared turn signal
DL_OILWARN, // bit 8 - oil pressure warning
DL_BATTERY, // bit 9 - battery warning
DL_ABS, // bit 10 - ABS active or switched off
DL_SPARE, // bit 11
DL_NUM
};
struct gauge
{
char name[16];
float radius;
float anglemin;
float anglemax;
float rangemin;
float rangemax;
float majorstep;
float majorwidth;
float majorstart;
float majorend;
struct colour major;
float minorstep;
float minorwidth;
float minorstart;
float minorend;
struct colour minor;
struct colour dial;
};
enum {
GT_NONE,
GT_NEEDLE,
GT_LINE,
GT_LINE2,
GT_BAR,
};
void init_gauges(void);
void drawDial(const struct gauge *gauge, float value, int style);
void draw_gauge(const struct gauge *gauge, float value, float red, FTGLfont *font, int gaugetype);
#endif /* GAUGE_H */