]> git.mxchange.org Git - flightgear.git/blob - Scenery/scenery.cxx
Wrote access functions for current fgOPTIONS.
[flightgear.git] / Scenery / scenery.cxx
1 /* -*- Mode: C++ -*-
2  *
3  * scenery.c -- data structures and routines for managing scenery.
4  *
5  * Written by Curtis Olson, started May 1997.
6  *
7  * Copyright (C) 1997  Curtis L. Olson  - curt@infoplane.com
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License as
11  * published by the Free Software Foundation; either version 2 of the
12  * License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful, but
15  * WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22  *
23  * $Id$
24  * (Log is kept at end of this file)
25  **************************************************************************/
26
27
28 #ifdef HAVE_CONFIG_H
29 #  include <config.h>
30 #endif
31
32 #ifdef HAVE_WINDOWS_H
33 #  include <windows.h>
34 #endif
35
36 #include <GL/glut.h>
37 #include <XGL/xgl.h>
38
39 #include <stdio.h>
40 #include <string.h>
41
42 #include <Debug/fg_debug.h>
43 #include <Main/options.hxx>
44
45 #include "obj.hxx"
46 #include "scenery.hxx"
47 // #include "texload.h"
48
49
50 /* Temporary hack until we get a better texture management system running */
51 GLint area_texture;
52
53
54 /* Shared structure to hold current scenery parameters */
55 struct fgSCENERY scenery;
56
57
58 /* Initialize the Scenery Management system */
59 int fgSceneryInit( void ) {
60     fgOPTIONS *o;
61     // char path[1024], fgpath[1024];
62     // GLubyte *texbuf;
63     // int width, height;
64
65     o = &current_options;
66
67     fgPrintf(FG_TERRAIN, FG_INFO, "Initializing scenery subsystem\n");
68
69     scenery.cur_elev = -9999;
70
71     return(1);
72 }
73
74
75 /* Tell the scenery manager where we are so it can load the proper data, and
76  * build the proper structures. */
77 void fgSceneryUpdate(double lon, double lat, double elev) {
78     // does nothing;
79 }
80
81
82 /* Render out the current scene */
83 void fgSceneryRender( void ) {
84 }
85
86
87 /* $Log$
88 /* Revision 1.7  1998/07/13 21:01:59  curt
89 /* Wrote access functions for current fgOPTIONS.
90 /*
91  * Revision 1.6  1998/07/12 03:18:27  curt
92  * Added ground collision detection.  This involved:
93  * - saving the entire vertex list for each tile with the tile records.
94  * - saving the face list for each fragment with the fragment records.
95  * - code to intersect the current vertical line with the proper face in
96  *   an efficient manner as possible.
97  * Fixed a bug where the tiles weren't being shifted to "near" (0,0,0)
98  *
99  * Revision 1.5  1998/06/17 21:36:41  curt
100  * Load and manage multiple textures defined in the Materials library.
101  * Boost max material fagments for each material property to 800.
102  * Multiple texture support when rendering.
103  *
104  * Revision 1.4  1998/05/13 18:26:40  curt
105  * Root path info moved to fgOPTIONS.
106  *
107  * Revision 1.3  1998/05/07 23:15:20  curt
108  * Fixed a glTexImage2D() usage bug where width and height were mis-swapped.
109  * Added support for --tile-radius=n option.
110  *
111  * Revision 1.2  1998/05/02 01:52:16  curt
112  * Playing around with texture coordinates.
113  *
114  * Revision 1.1  1998/04/30 12:35:30  curt
115  * Added a command line rendering option specify smooth/flat shading.
116  *
117  * Revision 1.42  1998/04/28 21:43:27  curt
118  * Wrapped zlib calls up so we can conditionally comment out zlib support.
119  *
120  * Revision 1.41  1998/04/24 00:51:08  curt
121  * Wrapped "#include <config.h>" in "#ifdef HAVE_CONFIG_H"
122  * Tweaked the scenery file extentions to be "file.obj" (uncompressed)
123  * or "file.obz" (compressed.)
124  *
125  * Revision 1.40  1998/04/18 04:14:06  curt
126  * Moved fg_debug.c to it's own library.
127  *
128  * Revision 1.39  1998/04/08 23:30:07  curt
129  * Adopted Gnu automake/autoconf system.
130  *
131  * Revision 1.38  1998/04/03 22:11:37  curt
132  * Converting to Gnu autoconf system.
133  *
134  * Revision 1.37  1998/03/23 21:23:05  curt
135  * Debugging output tweaks.
136  *
137  * Revision 1.36  1998/03/14 00:30:50  curt
138  * Beginning initial terrain texturing experiments.
139  *
140  * Revision 1.35  1998/01/31 00:43:26  curt
141  * Added MetroWorks patches from Carmen Volpe.
142  *
143  * Revision 1.34  1998/01/27 03:26:43  curt
144  * Playing with new fgPrintf command.
145  *
146  * Revision 1.33  1998/01/19 19:27:17  curt
147  * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
148  * This should simplify things tremendously.
149  *
150  * Revision 1.32  1998/01/19 18:40:37  curt
151  * Tons of little changes to clean up the code and to remove fatal errors
152  * when building with the c++ compiler.
153  *
154  * Revision 1.31  1998/01/13 00:23:11  curt
155  * Initial changes to support loading and management of scenery tiles.  Note,
156  * there's still a fair amount of work left to be done.
157  *
158  * Revision 1.30  1998/01/07 03:22:29  curt
159  * Moved astro stuff to .../Src/Astro/
160  *
161  * Revision 1.29  1997/12/30 20:47:52  curt
162  * Integrated new event manager with subsystem initializations.
163  *
164  * Revision 1.28  1997/12/15 23:55:02  curt
165  * Add xgl wrappers for debugging.
166  * Generate terrain normals on the fly.
167  *
168  * Revision 1.27  1997/12/12 21:41:30  curt
169  * More light/material property tweaking ... still a ways off.
170  *
171  * Revision 1.26  1997/12/12 19:52:58  curt
172  * Working on lightling and material properties.
173  *
174  * Revision 1.25  1997/12/10 22:37:51  curt
175  * Prepended "fg" on the name of all global structures that didn't have it yet.
176  * i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
177  *
178  * Revision 1.24  1997/12/08 22:51:18  curt
179  * Enhanced to handle ccw and cw tri-stripe winding.  This is a temporary
180  * admission of defeat.  I will eventually go back and get all the stripes
181  * wound the same way (ccw).
182  *
183  * Revision 1.23  1997/11/25 19:25:37  curt
184  * Changes to integrate Durk's moon/sun code updates + clean up.
185  *
186  * Revision 1.22  1997/10/28 21:00:22  curt
187  * Changing to new terrain format.
188  *
189  * Revision 1.21  1997/10/25 03:24:24  curt
190  * Incorporated sun, moon, and star positioning code contributed by Durk Talsma.
191  *
192  * Revision 1.20  1997/10/25 03:18:27  curt
193  * Incorporated sun, moon, and planet position and rendering code contributed
194  * by Durk Talsma.
195  *
196  * Revision 1.19  1997/09/05 14:17:30  curt
197  * More tweaking with stars.
198  *
199  * Revision 1.18  1997/09/05 01:35:59  curt
200  * Working on getting stars right.
201  *
202  * Revision 1.17  1997/08/29 17:55:27  curt
203  * Worked on properly aligning the stars.
204  *
205  * Revision 1.16  1997/08/27 21:32:29  curt
206  * Restructured view calculation code.  Added stars.
207  *
208  * Revision 1.15  1997/08/27 03:30:32  curt
209  * Changed naming scheme of basic shared structures.
210  *
211  * Revision 1.14  1997/08/25 20:27:24  curt
212  * Merged in initial HUD and Joystick code.
213  *
214  * Revision 1.13  1997/08/22 21:34:41  curt
215  * Doing a bit of reorganizing and house cleaning.
216  *
217  * Revision 1.12  1997/08/19 23:55:08  curt
218  * Worked on better simulating real lighting.
219  *
220  * Revision 1.11  1997/08/13 20:24:22  curt
221  * Changed default detail level.
222  *
223  * Revision 1.10  1997/08/06 00:24:30  curt
224  * Working on correct real time sun lighting.
225  *
226  * Revision 1.9  1997/08/04 17:08:11  curt
227  * Testing cvs on IRIX 6.x
228  *
229  * Revision 1.8  1997/07/18 23:41:27  curt
230  * Tweaks for building with Cygnus Win32 compiler.
231  *
232  * Revision 1.7  1997/07/16 20:04:52  curt
233  * Minor tweaks to aid Win32 port.
234  *
235  * Revision 1.6  1997/07/14 16:26:05  curt
236  * Testing/playing -- placed objects randomly across the entire terrain.
237  *
238  * Revision 1.5  1997/07/11 03:23:19  curt
239  * Solved some scenery display/orientation problems.  Still have a positioning
240  * (or transformation?) problem.
241  *
242  * Revision 1.4  1997/07/11 01:30:03  curt
243  * More tweaking of terrian floor.
244  *
245  * Revision 1.3  1997/06/29 21:16:50  curt
246  * More twiddling with the Scenery Management system.
247  *
248  * Revision 1.2  1997/06/27 20:03:37  curt
249  * Working on Makefile structure.
250  *
251  * Revision 1.1  1997/06/27 02:26:30  curt
252  * Initial revision.
253  *
254  */