1 /**************************************************************************
2 * cockpit.c -- routines to draw a cockpit (initial draft)
4 * Written by Michele America, started September 1997.
6 * Copyright (C) 1997 Michele F. America - nomimarketing@mail.telepac.pt
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of the
11 * License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 * (Log is kept at end of this file)
24 **************************************************************************/
30 #include <Cockpit/cockpit.h>
32 #include <Include/fg_constants.h>
34 #include <Aircraft/aircraft.h>
35 #include <Scenery/mesh.h>
36 #include <Scenery/scenery.h>
37 #include <Math/mat3.h>
38 #include <Math/polar.h>
39 #include <Time/fg_timer.h>
40 #include <Math/fg_random.h>
41 #include <Weather/weather.h>
43 #include <Main/fg_debug.h>
47 /* This is a structure that contains all data related to cockpit/panel/hud system */
48 static struct fgCOCKPIT *aircraft_cockpit;
50 struct fgCOCKPIT *fgCockpitInit( struct fgAIRCRAFT cur_aircraft )
52 struct fgCOCKPIT *cockpit;
55 fgPrintf( FG_COCKPIT, FG_INFO, "Initializing cockpit subsystem\n");
57 cockpit = (struct fgCOCKPIT *)calloc(sizeof(struct fgCOCKPIT),1);
64 /* If aircraft has HUD */
65 hud = fgHUDInit( cur_aircraft, 3 );
71 aircraft_cockpit = cockpit;
73 fgPrintf( FG_COCKPIT, FG_INFO,
74 " Code %d Status %d\n", cockpit->hud->code, cockpit->hud->status );
79 struct fgCOCKPIT *fgCockpitAddHUD( struct fgCOCKPIT *cockpit, struct HUD *hud )
85 void fgCockpitUpdate( void )
88 fgPrintf( FG_COCKPIT, FG_INFO,
89 "Cockpit: code %d status %d\n",
90 aircraft_cockpit->code, aircraft_cockpit->status );
91 if( aircraft_cockpit->hud != NULL ) // That is, if the aircraft has a HUD,
92 fgUpdateHUD( aircraft_cockpit->hud ); // then draw it.
98 /* Revision 1.7 1998/01/27 00:47:51 curt
99 /* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
100 /* system and commandline/config file processing code.
102 * Revision 1.6 1998/01/19 19:27:01 curt
103 * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
104 * This should simplify things tremendously.
106 * Revision 1.5 1998/01/19 18:40:19 curt
107 * Tons of little changes to clean up the code and to remove fatal errors
108 * when building with the c++ compiler.
110 * Revision 1.4 1997/12/30 20:47:34 curt
111 * Integrated new event manager with subsystem initializations.
113 * Revision 1.3 1997/12/15 23:54:33 curt
114 * Add xgl wrappers for debugging.
115 * Generate terrain normals on the fly.
117 * Revision 1.2 1997/12/10 22:37:38 curt
118 * Prepended "fg" on the name of all global structures that didn't have it yet.
119 * i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
121 * Revision 1.1 1997/08/29 18:03:20 curt