1 // tilemgr.cxx -- routines to handle dynamic management of scenery tiles
3 // Written by Curtis Olson, started January 1998.
5 // Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
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.
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.
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.
22 // (Log is kept at end of this file)
36 #include <Aircraft/aircraft.h>
38 #include <Bucket/bucketutils.h>
39 #include <Debug/fg_debug.h>
40 #include <Include/fg_constants.h>
41 #include <Include/fg_types.h>
42 #include <Main/options.hxx>
43 #include <Main/views.hxx>
44 #include <Math/fg_geodesy.h>
45 #include <Math/mat3.h>
46 #include <Math/polar3d.hxx>
47 #include <Math/vector.hxx>
48 #include <Weather/weather.h>
50 #include "material.hxx"
52 #include "scenery.hxx"
53 #include "tilecache.hxx"
56 #define FG_LOCAL_X_Y 81 // max(o->tile_diameter) ** 2
58 #define FG_SQUARE( X ) ( (X) * (X) )
61 // closest (potentially viewable) tiles, centered on current tile.
62 // This is an array of pointers to cache indexes.
63 int tiles[FG_LOCAL_X_Y];
66 // Initialize the Tile Manager subsystem
67 int fgTileMgrInit( void ) {
68 fgPrintf( FG_TERRAIN, FG_INFO, "Initializing Tile Manager subsystem.\n");
70 // load default material library
71 material_mgr.load_lib();
78 void fgTileMgrLoadTile( fgBUCKET *p, int *index) {
81 c = &global_tile_cache;
83 fgPrintf( FG_TERRAIN, FG_DEBUG, "Updating for bucket %d %d %d %d\n",
84 p->lon, p->lat, p->x, p->y);
86 // if not in cache, load tile into the next available slot
87 if ( (*index = c->Exists(p)) < 0 ) {
88 *index = c->NextAvail();
89 c->EntryFillIn(*index, p);
92 fgPrintf( FG_TERRAIN, FG_DEBUG, "Selected cache index of %d\n", *index);
96 // given the current lon/lat, fill in the array of local chunks. If
97 // the chunk isn't already in the cache, then read it from disk.
98 int fgTileMgrUpdate( void ) {
102 static fgBUCKET p_last = {-1000, 0, 0, 0};
106 c = &global_tile_cache;
107 f = current_aircraft.flight;
109 tile_diameter = current_options.get_tile_diameter();
111 fgBucketFind(FG_Longitude * RAD_TO_DEG, FG_Latitude * RAD_TO_DEG, &p1);
112 dw = tile_diameter / 2;
113 dh = tile_diameter / 2;
115 if ( (p1.lon == p_last.lon) && (p1.lat == p_last.lat) &&
116 (p1.x == p_last.x) && (p1.y == p_last.y) ) {
117 // same bucket as last time
118 fgPrintf( FG_TERRAIN, FG_DEBUG, "Same bucket as last time\n");
119 } else if ( p_last.lon == -1000 ) {
120 // First time through, initialize the system and load all
123 fgPrintf( FG_TERRAIN, FG_INFO, " First time through ... ");
124 fgPrintf( FG_TERRAIN, FG_INFO, " Updating Tile list for %d,%d %d,%d\n",
125 p1.lon, p1.lat, p1.x, p1.y);
126 fgPrintf( FG_TERRAIN, FG_INFO, " Loading %d tiles\n",
127 tile_diameter * tile_diameter);
129 // wipe/initialize tile cache
132 // build the local area list and update cache
133 for ( j = 0; j < tile_diameter; j++ ) {
134 for ( i = 0; i < tile_diameter; i++ ) {
135 fgBucketOffset(&p1, &p2, i - dw, j - dh);
136 fgTileMgrLoadTile(&p2, &tiles[(j*tile_diameter) + i]);
140 // We've moved to a new bucket, we need to scroll our
141 // structures, and load in the new tiles
143 // CURRENTLY THIS ASSUMES WE CAN ONLY MOVE TO ADJACENT TILES.
144 // AT ULTRA HIGH SPEEDS THIS ASSUMPTION MAY NOT BE VALID IF
145 // THE AIRCRAFT CAN SKIP A TILE IN A SINGLE ITERATION.
147 fgPrintf( FG_TERRAIN, FG_INFO, "Updating Tile list for %d,%d %d,%d\n",
148 p1.lon, p1.lat, p1.x, p1.y);
150 if ( (p1.lon > p_last.lon) ||
151 ( (p1.lon == p_last.lon) && (p1.x > p_last.x) ) ) {
152 fgPrintf( FG_TERRAIN, FG_INFO, " Loading %d tiles\n",
154 for ( j = 0; j < tile_diameter; j++ ) {
156 for ( i = 0; i < tile_diameter - 1; i++ ) {
157 tiles[(j*tile_diameter) + i] =
158 tiles[(j*tile_diameter) + i + 1];
160 // load in new column
161 fgBucketOffset(&p_last, &p2, dw + 1, j - dh);
162 fgTileMgrLoadTile(&p2, &tiles[(j*tile_diameter) +
165 } else if ( (p1.lon < p_last.lon) ||
166 ( (p1.lon == p_last.lon) && (p1.x < p_last.x) ) ) {
167 fgPrintf( FG_TERRAIN, FG_INFO, " Loading %d tiles\n",
169 for ( j = 0; j < tile_diameter; j++ ) {
171 for ( i = tile_diameter - 1; i > 0; i-- ) {
172 tiles[(j*tile_diameter) + i] =
173 tiles[(j*tile_diameter) + i - 1];
175 // load in new column
176 fgBucketOffset(&p_last, &p2, -dw - 1, j - dh);
177 fgTileMgrLoadTile(&p2, &tiles[(j*tile_diameter) + 0]);
181 if ( (p1.lat > p_last.lat) ||
182 ( (p1.lat == p_last.lat) && (p1.y > p_last.y) ) ) {
183 fgPrintf( FG_TERRAIN, FG_INFO, " Loading %d tiles\n",
185 for ( i = 0; i < tile_diameter; i++ ) {
187 for ( j = 0; j < tile_diameter - 1; j++ ) {
188 tiles[(j * tile_diameter) + i] =
189 tiles[((j+1) * tile_diameter) + i];
191 // load in new column
192 fgBucketOffset(&p_last, &p2, i - dw, dh + 1);
193 fgTileMgrLoadTile(&p2, &tiles[((tile_diameter-1) *
194 tile_diameter) + i]);
196 } else if ( (p1.lat < p_last.lat) ||
197 ( (p1.lat == p_last.lat) && (p1.y < p_last.y) ) ) {
198 fgPrintf( FG_TERRAIN, FG_INFO, " Loading %d tiles\n",
200 for ( i = 0; i < tile_diameter; i++ ) {
202 for ( j = tile_diameter - 1; j > 0; j-- ) {
203 tiles[(j * tile_diameter) + i] =
204 tiles[((j-1) * tile_diameter) + i];
206 // load in new column
207 fgBucketOffset(&p_last, &p2, i - dw, -dh - 1);
208 fgTileMgrLoadTile(&p2, &tiles[0 + i]);
220 // Calculate shortest distance from point to line
221 static double point_line_dist_squared( fgPoint3d *tc, fgPoint3d *vp,
227 p[0] = tc->x; p[1] = tc->y; p[2] = tc->z;
228 p0[0] = vp->x; p0[1] = vp->y; p0[2] = vp->z;
230 dist = fgPointLineSquared(p, p0, d);
232 // printf("dist = %.2f\n", dist);
238 // Calculate if point/radius is inside view frustum
239 static int viewable( fgPoint3d *cp, double radius ) {
242 int viewable = 1; // start by assuming it's viewable
243 double x0, x1, y1, slope;
247 MAT3_SET_HVEC(world, cp->x, cp->y, cp->z, 1.0);
248 MAT3mult_vec(eye, world, v->WORLD_TO_EYE);
249 // printf( "\nworld -> eye = %.2f %.2f %.2f radius = %.2f\n",
250 // eye[0], eye[1], eye[2], radius);
252 // Check near clip plane
253 if ( eye[2] - radius > 0.0 ) {
257 // Check far clip plane
258 if ( eye[2] + radius < -current_weather.visibility ) {
262 // check right clip plane (from eye perspective)
263 // y = m * (x - x0) = equation of a line intercepting X axis at x0
264 x1 = v->cos_fov_x * radius;
265 y1 = v->sin_fov_x * radius;
267 x0 = x1 - y1 / slope;
269 // printf("(r) x1 = %.2f y1 = %.2f\n", x1, y1);
270 // printf("eye[0] = %.2f eye[2] = %.2f\n", eye[0], eye[2]);
271 // printf("(r) x0 = %.2f slope_x = %.2f radius = %.2f\n",
272 // x0, slope, radius);
274 if ( eye[2] > slope * (eye[0] - x0) ) {
278 // check left clip plane (from eye perspective)
281 x0 = x1 - y1 / slope;
283 // printf("(r) x1 = %.2f y1 = %.2f\n", x1, y1);
284 // printf("eye[0] = %.2f eye[2] = %.2f\n", eye[0], eye[2]);
285 // printf("(r) x0 = %.2f slope_x = %.2f radius = %.2f\n",
286 // x0, slope, radius);
288 if ( eye[2] > slope * (eye[0] - x0) ) {
292 // check bottom clip plane (from eye perspective)
293 x1 = -(v->cos_fov_y) * radius;
294 y1 = v->sin_fov_y * radius;
296 x0 = x1 - y1 / slope;
298 // printf("(r) x1 = %.2f y1 = %.2f\n", x1, y1);
299 // printf("eye[1] = %.2f eye[2] = %.2f\n", eye[1], eye[2]);
300 // printf("(r) x0 = %.2f slope_y = %.2f radius = %.2f\n",
301 // x0, slope, radius);
303 if ( eye[2] > slope * (eye[1] - x0) ) {
307 // check top clip plane (from eye perspective)
310 x0 = x1 - y1 / slope;
312 // printf("(r) x1 = %.2f y1 = %.2f\n", x1, y1);
313 // printf("eye[1] = %.2f eye[2] = %.2f\n", eye[1], eye[2]);
314 // printf("(r) x0 = %.2f slope_y = %.2f radius = %.2f\n",
315 // x0, slope, radius);
317 if ( eye[2] > slope * (eye[1] - x0) ) {
325 // Render the local tiles
326 void fgTileMgrRender( void ) {
329 fgTILE *t, *last_tile_ptr;
332 fgPoint3d frag_offset, pp;
333 fgPoint3d earth_center, result;
334 fgFRAGMENT *frag_ptr;
337 double dist, min_dist, lat_geod, alt, sea_level_r;
339 list < fgFRAGMENT > :: iterator current;
340 list < fgFRAGMENT > :: iterator last;
342 int tile_diameter, textures;
348 c = &global_tile_cache;
349 f = current_aircraft.flight;
352 tile_diameter = current_options.get_tile_diameter();
353 textures = current_options.get_textures();
355 // Find current translation offset
356 fgBucketFind(FG_Longitude * RAD_TO_DEG, FG_Latitude * RAD_TO_DEG, &p);
357 index = c->Exists(&p);
358 t = c->GetTile(index);
360 scenery.next_center.x = t->center.x;
361 scenery.next_center.y = t->center.y;
362 scenery.next_center.z = t->center.z;
364 earth_center.x = 0.0;
365 earth_center.y = 0.0;
366 earth_center.z = 0.0;
368 fgPrintf( FG_TERRAIN, FG_DEBUG,
369 "Pos = (%.2f, %.2f) Current bucket = %d %d %d %d Index = %ld\n",
370 FG_Longitude * RAD_TO_DEG, FG_Latitude * RAD_TO_DEG,
371 p.lon, p.lat, p.x, p.y, fgBucketGenIndex(&p) );
373 // initialize the transient per-material fragment lists
374 material_mgr.init_transient_material_lists();
378 // traverse the potentially viewable tile list
379 for ( i = 0; i < (tile_diameter * tile_diameter); i++ ) {
381 // fgPrintf( FG_TERRAIN, FG_DEBUG, "Index = %d\n", index);
382 t = c->GetTile(index);
384 // calculate tile offset
385 x = (t->offset.x = t->center.x - scenery.center.x);
386 y = (t->offset.y = t->center.y - scenery.center.y);
387 z = (t->offset.z = t->center.z - scenery.center.z);
390 for ( j = 0; j < 16; j++ ) {
391 m[j] = v->MODEL_VIEW[j];
394 // Calculate the model_view transformation matrix for this tile
395 // This is equivalent to doing a glTranslatef(x, y, z);
396 m[12] = m[0] * x + m[4] * y + m[8] * z + m[12];
397 m[13] = m[1] * x + m[5] * y + m[9] * z + m[13];
398 m[14] = m[2] * x + m[6] * y + m[10] * z + m[14];
399 m[15] = m[3] * x + m[7] * y + m[11] * z + m[15];
401 // temp ... calc current terrain elevation
402 // calculate distance from vertical tangent line at
403 // current position to center of tile.
405 /* printf("distance squared = %.2f, bounding radius = %.2f\n",
406 point_line_dist_squared(&(t->offset), &(v->view_pos),
407 v->local_up), t->bounding_radius); */
409 dist = point_line_dist_squared( &(t->center), &(v->abs_view_pos),
411 if ( dist < FG_SQUARE(t->bounding_radius) ) {
413 // traverse fragment list for tile
414 current = t->fragment_list.begin();
415 last = t->fragment_list.end();
417 while ( current != last ) {
418 frag_ptr = &(*current);
420 /* printf("distance squared = %.2f, bounding radius = %.2f\n",
421 point_line_dist_squared( &(frag_ptr->center),
422 &(v->abs_view_pos), v->local_up),
423 frag_ptr->bounding_radius); */
425 dist = point_line_dist_squared( &(frag_ptr->center),
426 &(v->abs_view_pos), v->local_up);
427 if ( dist <= FG_SQUARE(frag_ptr->bounding_radius) ) {
428 if ( frag_ptr->intersect( &(v->abs_view_pos),
429 &earth_center, 0, &result ) ) {
430 // compute geocentric coordinates of tile center
431 pp = fgCartToPolar3d(result);
432 // convert to geodetic coordinates
433 fgGeocToGeod(pp.lat, pp.radius, &lat_geod,
435 // printf("alt = %.2f\n", alt);
436 scenery.cur_elev = alt;
437 // exit this loop since we found an intersection
444 // Course (tile based) culling
445 if ( viewable(&(t->offset), t->bounding_radius) ) {
446 // at least a portion of this tile could be viewable
449 // xglTranslatef(t->offset.x, t->offset.y, t->offset.z);
451 // traverse fragment list for tile
452 current = t->fragment_list.begin();
453 last = t->fragment_list.end();
455 while ( current != last ) {
456 frag_ptr = &(*current);
459 if ( frag_ptr->display_list >= 0 ) {
460 // Fine (fragment based) culling
461 frag_offset.x = frag_ptr->center.x - scenery.center.x;
462 frag_offset.y = frag_ptr->center.y - scenery.center.y;
463 frag_offset.z = frag_ptr->center.z - scenery.center.z;
465 if ( viewable(&frag_offset, frag_ptr->bounding_radius*2) ) {
466 // add to transient per-material property fragment list
467 // frag_ptr->tile_offset.x = t->offset.x;
468 // frag_ptr->tile_offset.y = t->offset.y;
469 // frag_ptr->tile_offset.z = t->offset.z;
471 mtl_ptr = frag_ptr->material_ptr;
472 // printf(" lookup = %s\n", mtl_ptr->texture_name);
473 if ( mtl_ptr->list_size < FG_MAX_MATERIAL_FRAGS ) {
474 mtl_ptr->list[mtl_ptr->list_size] = frag_ptr;
475 (mtl_ptr->list_size)++;
477 fgPrintf( FG_TERRAIN, FG_ALERT,
478 "Overran material sorting array\n" );
481 // xglCallList(frag_ptr->display_list);
484 // printf("Culled a fragment %.2f %.2f %.2f %.2f\n",
485 // frag_ptr->center.x, frag_ptr->center.y,
486 // frag_ptr->center.z, frag_ptr->bounding_radius);
494 culled += t->fragment_list.size();
498 if ( (drawn + culled) > 0 ) {
499 v->vfc_ratio = (double)culled / (double)(drawn + culled);
503 // printf("drawn = %d culled = %d saved = %.2f\n", drawn, culled,
507 // traverse the transient per-material fragment lists and render
508 // out all fragments for each material property.
509 map < string, fgMATERIAL, less<string> > :: iterator mapcurrent =
510 material_mgr.material_map.begin();
511 map < string, fgMATERIAL, less<string> > :: iterator maplast =
512 material_mgr.material_map.end();
516 while ( mapcurrent != maplast ) {
517 // (char *)key = (*mapcurrent).first;
518 // (fgMATERIAL)value = (*mapcurrent).second;
519 mtl_ptr = &(*mapcurrent).second;
521 last_tile_ptr = NULL;
523 size = mtl_ptr->list_size;
526 #ifdef GL_VERSION_1_1
527 xglBindTexture(GL_TEXTURE_2D, mtl_ptr->texture_id);
528 #elif GL_EXT_texture_object
529 xglBindTextureEXT(GL_TEXTURE_2D, mtl_ptr->texture_id);
534 xglMaterialfv (GL_FRONT, GL_AMBIENT, mtl_ptr->ambient);
535 xglMaterialfv (GL_FRONT, GL_DIFFUSE, mtl_ptr->diffuse);
538 // printf("traversing = %s, size = %d\n",
539 // mtl_ptr->texture_name, size);
540 for ( i = 0; i < size; i++ ) {
541 frag_ptr = mtl_ptr->list[i];
543 // count up the number of polygons we are drawing in
544 // case someone is interested.
545 total_faces += frag_ptr->num_faces;
547 if ( frag_ptr->tile_ptr == last_tile_ptr ) {
548 // same tile as last time, no transform necessary
550 // new tile, new translate
551 // xglLoadMatrixf( frag_ptr->matrix );
552 t = frag_ptr->tile_ptr;
553 xglLoadMatrixd(t->model_view );
556 // Woohoo!!! We finally get to draw something!
557 // printf(" display_list = %d\n", frag_ptr->display_list);
558 xglCallList(frag_ptr->display_list);
560 last_tile_ptr = frag_ptr->tile_ptr;
569 fgPrintf( FG_TERRAIN, FG_DEBUG, "Rendered %d polygons this frame.\n",
575 // Revision 1.29 1998/08/20 15:12:06 curt
576 // Used a forward declaration of classes fgTILE and fgMATERIAL to eliminate
577 // the need for "void" pointers and casts.
578 // Quick hack to count the number of scenery polygons that are being drawn.
580 // Revision 1.28 1998/08/12 21:13:06 curt
581 // material.cxx: don't load textures if they are disabled
582 // obj.cxx: optimizations from Norman Vine
583 // tile.cxx: minor tweaks
584 // tile.hxx: addition of num_faces
585 // tilemgr.cxx: minor tweaks
587 // Revision 1.27 1998/07/24 21:42:09 curt
588 // material.cxx: whups, double method declaration with no definition.
589 // obj.cxx: tweaks to avoid errors in SGI's CC.
590 // tile.cxx: optimizations by Norman Vine.
591 // tilemgr.cxx: optimizations by Norman Vine.
593 // Revision 1.26 1998/07/20 12:51:26 curt
594 // Added far clip plane to fragment clipping calculations and tie this to
595 // weather->visibility. This way you can increase framerates by increasing
596 // for and lowering visibility.
598 // Revision 1.25 1998/07/13 21:02:01 curt
599 // Wrote access functions for current fgOPTIONS.
601 // Revision 1.24 1998/07/12 03:18:29 curt
602 // Added ground collision detection. This involved:
603 // - saving the entire vertex list for each tile with the tile records.
604 // - saving the face list for each fragment with the fragment records.
605 // - code to intersect the current vertical line with the proper face in
606 // an efficient manner as possible.
607 // Fixed a bug where the tiles weren't being shifted to "near" (0,0,0)
609 // Revision 1.23 1998/07/08 14:47:23 curt
610 // Fix GL_MODULATE vs. GL_DECAL problem introduced by splash screen.
611 // polare3d.h renamed to polar3d.hxx
612 // fg{Cartesian,Polar}Point3d consolodated.
613 // Added some initial support for calculating local current ground elevation.
615 // Revision 1.22 1998/07/04 00:54:31 curt
616 // Added automatic mipmap generation.
618 // When rendering fragments, use saved model view matrix from associated tile
619 // rather than recalculating it with push() translate() pop().
621 // Revision 1.21 1998/06/27 16:54:59 curt
622 // Check for GL_VERSION_1_1 or GL_EXT_texture_object to decide whether to use
623 // "EXT" versions of texture management routines.
625 // Revision 1.20 1998/06/17 21:36:42 curt
626 // Load and manage multiple textures defined in the Materials library.
627 // Boost max material fagments for each material property to 800.
628 // Multiple texture support when rendering.
630 // Revision 1.19 1998/06/08 17:57:54 curt
631 // Working first pass at material proporty sorting.
633 // Revision 1.18 1998/06/06 01:09:32 curt
634 // I goofed on the log message in the last commit ... now fixed.
636 // Revision 1.17 1998/06/06 01:07:18 curt
637 // Increased per material fragment list size from 100 to 400.
638 // Now correctly draw viewable fragments in per material order.
640 // Revision 1.16 1998/06/05 22:39:55 curt
641 // Working on sorting by, and rendering by material properties.
643 // Revision 1.15 1998/06/03 00:47:51 curt
644 // No .h for STL includes.
645 // Minor view culling optimizations.
647 // Revision 1.14 1998/06/01 17:56:20 curt
648 // Incremental additions to material.cxx (not fully functional)
649 // Tweaked vfc_ratio math to avoid divide by zero.
651 // Revision 1.13 1998/05/24 02:49:10 curt
652 // Implimented fragment level view frustum culling.
654 // Revision 1.12 1998/05/23 14:09:23 curt
655 // Added tile.cxx and tile.hxx.
656 // Working on rewriting the tile management system so a tile is just a list
657 // fragments, and the fragment record contains the display list for that fragment.
659 // Revision 1.11 1998/05/20 20:53:55 curt
660 // Moved global ref point and radius (bounding sphere info, and offset) to
661 // data file rather than calculating it on the fly.
662 // Fixed polygon winding problem in scenery generation stage rather than
663 // compensating for it on the fly.
664 // Made a fgTILECACHE class.
666 // Revision 1.10 1998/05/17 16:59:34 curt
667 // Frist pass at view frustum culling now operational.
669 // Revision 1.9 1998/05/16 13:09:58 curt
670 // Beginning to add support for view frustum culling.
671 // Added some temporary code to calculate bouding radius, until the
672 // scenery generation tools and scenery can be updated.
674 // Revision 1.8 1998/05/07 23:15:21 curt
675 // Fixed a glTexImage2D() usage bug where width and height were mis-swapped.
676 // Added support for --tile-radius=n option.
678 // Revision 1.7 1998/05/06 03:16:42 curt
679 // Added an option to control square tile radius.
681 // Revision 1.6 1998/05/02 01:52:18 curt
682 // Playing around with texture coordinates.
684 // Revision 1.5 1998/04/30 12:35:32 curt
685 // Added a command line rendering option specify smooth/flat shading.
687 // Revision 1.4 1998/04/27 03:30:14 curt
688 // Minor transformation adjustments to try to keep scenery tiles closer to
689 // (0, 0, 0) GLfloats run out of precision at the distances we need to model
690 // the earth, but we can do a bunch of pre-transformations using double math
691 // and then cast to GLfloat once everything is close in where we have less
692 // precision problems.
694 // Revision 1.3 1998/04/25 22:06:32 curt
695 // Edited cvs log messages in source files ... bad bad bad!
697 // Revision 1.2 1998/04/24 00:51:09 curt
698 // Wrapped "#include <config.h>" in "#ifdef HAVE_CONFIG_H"
699 // Tweaked the scenery file extentions to be "file.obj" (uncompressed)
700 // or "file.obz" (compressed.)
702 // Revision 1.1 1998/04/22 13:22:48 curt
703 // C++ - ifing the code a bit.
705 // Revision 1.25 1998/04/18 04:14:07 curt
706 // Moved fg_debug.c to it's own library.
708 // Revision 1.24 1998/04/14 02:23:18 curt
709 // Code reorganizations. Added a Lib/ directory for more general libraries.
711 // Revision 1.23 1998/04/08 23:30:08 curt
712 // Adopted Gnu automake/autoconf system.
714 // Revision 1.22 1998/04/03 22:11:38 curt
715 // Converting to Gnu autoconf system.
717 // Revision 1.21 1998/03/23 21:23:05 curt
718 // Debugging output tweaks.
720 // Revision 1.20 1998/03/14 00:30:51 curt
721 // Beginning initial terrain texturing experiments.
723 // Revision 1.19 1998/02/20 00:16:25 curt
724 // Thursday's tweaks.
726 // Revision 1.18 1998/02/19 13:05:54 curt
727 // Incorporated some HUD tweaks from Michelle America.
728 // Tweaked the sky's sunset/rise colors.
729 // Other misc. tweaks.
731 // Revision 1.17 1998/02/16 13:39:46 curt
732 // Miscellaneous weekend tweaks. Fixed? a cache problem that caused whole
733 // tiles to occasionally be missing.
735 // Revision 1.16 1998/02/12 21:59:53 curt
736 // Incorporated code changes contributed by Charlie Hotchkiss
737 // <chotchkiss@namg.us.anritsu.com>
739 // Revision 1.14 1998/02/09 21:30:19 curt
740 // Fixed a nagging problem with terrain tiles not "quite" matching up perfectly.
742 // Revision 1.13 1998/02/07 15:29:46 curt
743 // Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
744 // <chotchkiss@namg.us.anritsu.com>
746 // Revision 1.12 1998/02/01 03:39:55 curt
749 // Revision 1.11 1998/01/31 00:43:27 curt
750 // Added MetroWorks patches from Carmen Volpe.
752 // Revision 1.10 1998/01/29 00:51:40 curt
753 // First pass at tile cache, dynamic tile loading and tile unloading now works.
755 // Revision 1.9 1998/01/27 03:26:44 curt
756 // Playing with new fgPrintf command.
758 // Revision 1.8 1998/01/27 00:48:04 curt
759 // Incorporated Paul Bleisch's <pbleisch@acm.org> new debug message
760 // system and commandline/config file processing code.
762 // Revision 1.7 1998/01/26 15:55:25 curt
763 // Progressing on building dynamic scenery system.
765 // Revision 1.6 1998/01/24 00:03:30 curt
768 // Revision 1.5 1998/01/19 19:27:18 curt
769 // Merged in make system changes from Bob Kuehne <rpk@sgi.com>
770 // This should simplify things tremendously.
772 // Revision 1.4 1998/01/19 18:40:38 curt
773 // Tons of little changes to clean up the code and to remove fatal errors
774 // when building with the c++ compiler.
776 // Revision 1.3 1998/01/13 00:23:11 curt
777 // Initial changes to support loading and management of scenery tiles. Note,
778 // there's still a fair amount of work left to be done.
780 // Revision 1.2 1998/01/08 02:22:27 curt
781 // Continue working on basic features.
783 // Revision 1.1 1998/01/07 23:50:51 curt
784 // "area" renamed to "tile"
786 // Revision 1.2 1998/01/07 03:29:29 curt
787 // Given an arbitrary lat/lon, we can now:
788 // generate a unique index for the chunk containing the lat/lon
789 // generate a path name to the chunk file
790 // build a list of the indexes of all the nearby areas.
792 // Revision 1.1 1998/01/07 02:05:48 curt