File: gldisplay.h

package info (click to toggle)
conquest 8.1-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 7,984 kB
  • ctags: 3,086
  • sloc: ansic: 39,393; sh: 8,540; yacc: 446; makefile: 296; lex: 146
file content (238 lines) | stat: -rw-r--r-- 4,834 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
/************************************************************************
 *
 * $Id: gldisplay.h,v 1.6 2004/09/04 20:21:59 jon Exp $
 *
 * Copyright 2003 Jon Trulson under the ARTISTIC LICENSE. (See LICENSE).
 ***********************************************************************/

#ifndef _GLDISPLAY_H
#define _GLDISPLAY_H

#include <GL/glut.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glx.h>

typedef struct _dspConfig {
  Bool inited;
  /* glut win ids */
  int mainw;                    /* main window */

  /* main window */
  GLfloat wX, wY;               /* x/y origin */
  GLfloat wW, wH;               /* width/height  */
  GLfloat mAspect;

  /* viewer window */
  GLfloat vX, vY;               /* viewer X/Y */
  GLfloat vW, vH;               /* viewer width/height */
  GLfloat vAspect;

  GLfloat ppCol, ppRow;         /* pixels per [Row|Col] */

  GLfloat borderW;              /* width of outside mainw border */

  GLfloat hmat[16];             /* hud proj matrix */
  GLfloat vmat[16];             /* viewer proj matrix */

  unsigned int flags; 

} dspConfig_t;

#ifdef NOEXTERN_DCONF
dspConfig_t dConf;
#else
extern dspConfig_t dConf;
#endif

/* cockpit display items */
struct _warp {
  char warp[16];
  int color;
  char label[16];
  int lcolor;
};

struct _heading {
  char heading[16];
  int color;
  char label[16];
  int lcolor;
};

struct _kills {
  char kills[16];
  int color;
  char label[16];
  int lcolor;
};

struct _alertStatus {
  char alertStatus[64];
  int color;
};

struct _alertBorder {
  int alertColor;
};

struct _shields {
  int shields;
  int color;
  char label[32];
  int lcolor;
};

struct _damage {
  int damage;
  int color;
  char label[16];
  int lcolor;
};

struct _fuel {
  int fuel;
  int color;
  char label[16];
  int lcolor;
};

struct _alloc {
  char allocstr[16];
  int walloc, ealloc;
  int color;
  char label[32];
  int lcolor;
};

struct _etemp {
  int etemp;
  int color;
  char label[32];
  int lcolor;
  int overl;
};

struct _wtemp {
  int wtemp;
  int color;
  char label[32];
  int lcolor;
  int overl;
};

struct _tow {
  char str[32];
  int color;
};

struct _armies {
  char str[16];
  char label[32];
  int color;
};

struct _cloakdest {             /* cloak OR destruct msg */
  char str[32];
  int color;
  int bgcolor;
};

/* prompt areas */

struct _prompt_lin {
  char str[1024];
};

struct _xtrainfo {
  char str[256];
};

struct _recId {
  char str[256];
};

struct _recTime {
  char str[256];
};




/* This holds all of the info for the cockpit display. */
typedef struct _dspData {
  struct _warp warp;
  struct _heading heading;
  struct _kills kills;
  struct _alertStatus aStat;
  struct _alertBorder aBorder;
  struct _shields sh;
  struct _damage dam;
  struct _fuel fuel;
  struct _alloc alloc;
  struct _etemp etemp;
  struct _wtemp wtemp;
  struct _tow tow;
  struct _armies armies;
  struct _cloakdest cloakdest;
  struct _prompt_lin p1;
  struct _prompt_lin p2;
  struct _prompt_lin msg;
  struct _xtrainfo xtrainfo;
  struct _recId recId;
  struct _recTime recTime;
} dspData_t;


void display( int snum, int display_info );

int uiCStrlen(char *buf);
void uiPrintFixed(GLfloat x, GLfloat y, GLfloat w, GLfloat h, char *str);
int uiGLInit(int *argc, char **argv);
void uiDrawPlanet( GLfloat x, GLfloat y, int pnum, int scale,
                   int textcolor, int scanned );
void setXtraInfo(void);

int GLcvtcoords(real cenx, real ceny, real x, real y, real scale,
		 GLfloat *rx, GLfloat *ry );

void drawTorp(GLfloat x, GLfloat y, char torpchar, int color, int scale);
void drawShip(GLfloat x, GLfloat y, GLfloat angle, char ch, int i, 
	      int color, GLfloat scale);
void drawDoomsday(GLfloat x, GLfloat y, GLfloat angle, GLfloat scale);
void drawViewerBG();

void clrPrompt(int line);
void setPrompt(int line, char *prompt, int pcolor,
               char *buf, int color);
void setHeading(char *);
void setWarp(char *);
void setKills(char *);
void setFuel(int, int);
void setShields(int, int);
void setAlloc(int w, int e, char *alloc);
void setTemp(int etemp, int ecolor, int wtemp, int wcolor, 
	      int efuse, int wfuse);
void setDamage(int dam, int color);
void setDamageLabel(char *buf, int color);
void setArmies(char *labelbuf, char *buf);
void setCloakDestruct(char *buf, int color);
void setTow(char *buf);
void setAlertBorder(int color);
void setAlertLabel(char *buf, int color);
void setRecTime(char *str);
void setRecId(char *str);


void setPrompt(int line, char *prompt, int pcolor,
               char *buf, int color);
float getFPS(void);

void drawLineBox(GLfloat x, GLfloat y, 
                 GLfloat w, GLfloat h, int color, 
                 GLfloat lw);
void drawQuad(GLfloat x, GLfloat y, GLfloat w, GLfloat h, GLfloat z);
void drawExplosion(GLfloat x, GLfloat y);


#endif /* _GLDISPLAY_H */