]> icculus.org git repositories - taylor/freespace2.git/blob - include/missiongrid.h
Initial revision
[taylor/freespace2.git] / include / missiongrid.h
1 /*
2  * $Logfile: /Freespace2/code/Mission/MissionGrid.h $
3  * $Revision$
4  * $Date$
5  * $Author$
6  *
7  * Type and defines for grids
8  *
9  * $Log$
10  * Revision 1.1  2002/05/03 03:28:12  root
11  * Initial revision
12  *
13  * 
14  * 2     10/07/98 10:53a Dave
15  * Initial checkin.
16  * 
17  * 1     10/07/98 10:49a Dave
18  * 
19  * 6     10/03/97 8:55a John
20  * moved Fred's grid_render code out of MissionGrid and into Fred.   Added
21  * code to turn background under overlays grey.
22  * 
23  * 5     7/14/97 12:04a Lawrance
24  * added function that navmap calls to draw elevation lines
25  * 
26  * 4     6/18/97 11:36p Lawrance
27  * move grid rendering code to MissionGrid.cpp
28  * 
29  * 3     6/12/97 11:25a Lawrance
30  * added grid_read_camera_controls()
31  * 
32  * 2     6/12/97 9:58a Lawrance
33  * holds grid specific types and #defines
34  * 
35  * 1     6/12/97 9:51a Lawrance
36  *
37  * $NoKeywords: $
38  */
39
40
41 #ifndef __MISSIONGRID_H__
42 #define __MISSIONGRID_H__
43
44 #define MAX_GRIDLINE_POINTS     201
45 #define L_MAX_LINES                             128
46
47 typedef struct grid {
48         int             nrows, ncols;
49         vector  center;
50         matrix  gmatrix;
51         physics_info    physics;
52         float   square_size;
53         float   planeD;         //      D component of plane equation (A, B, C are uvec in gmatrix)
54         vector  gpoints1[MAX_GRIDLINE_POINTS];  // 1 -4 are edge gridpoints for small grid.
55         vector  gpoints2[MAX_GRIDLINE_POINTS];
56         vector  gpoints3[MAX_GRIDLINE_POINTS];
57         vector  gpoints4[MAX_GRIDLINE_POINTS];
58         vector  gpoints5[MAX_GRIDLINE_POINTS];  // 5-8 are edge gridpoints for large grid.
59         vector  gpoints6[MAX_GRIDLINE_POINTS];
60         vector  gpoints7[MAX_GRIDLINE_POINTS];
61         vector  gpoints8[MAX_GRIDLINE_POINTS];
62 } grid;
63
64 typedef struct tline {
65         int     istart, iend, color;
66 } tline;
67
68 extern grid Global_grid;
69 extern grid     *The_grid;
70 extern int      double_fine_gridlines;
71
72 void grid_read_camera_controls( control_info * ci, float frametime );
73 void maybe_create_new_grid(grid *gridp, vector *pos, matrix *orient, int force = 0);
74 grid *create_grid(grid *gridp, vector *forward, vector *right, vector *center, int nrows, int ncols, float square_size);
75 grid *create_default_grid(void);
76 void render_grid(grid *gridp);
77 void modify_grid(grid *gridp);
78 void rpd_line(vector *v0, vector *v1);
79 void grid_render_elevation_line(vector *pos, grid* gridp);
80
81 #endif
82