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