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>
49 #include "material.hxx"
51 #include "scenery.hxx"
52 #include "tilecache.hxx"
55 #define FG_LOCAL_X_Y 81 // max(o->tile_diameter) ** 2
58 // closest (potentially viewable) tiles, centered on current tile.
59 // This is an array of pointers to cache indexes.
60 int tiles[FG_LOCAL_X_Y];
63 // Initialize the Tile Manager subsystem
64 int fgTileMgrInit( void ) {
65 fgPrintf( FG_TERRAIN, FG_INFO, "Initializing Tile Manager subsystem.\n");
67 // load default material library
68 material_mgr.load_lib();
75 void fgTileMgrLoadTile( fgBUCKET *p, int *index) {
78 c = &global_tile_cache;
80 fgPrintf( FG_TERRAIN, FG_DEBUG, "Updating for bucket %d %d %d %d\n",
81 p->lon, p->lat, p->x, p->y);
83 // if not in cache, load tile into the next available slot
84 if ( (*index = c->Exists(p)) < 0 ) {
85 *index = c->NextAvail();
86 c->EntryFillIn(*index, p);
89 fgPrintf( FG_TERRAIN, FG_DEBUG, "Selected cache index of %d\n", *index);
93 // given the current lon/lat, fill in the array of local chunks. If
94 // the chunk isn't already in the cache, then read it from disk.
95 int fgTileMgrUpdate( void ) {
100 static fgBUCKET p_last = {-1000, 0, 0, 0};
103 c = &global_tile_cache;
104 f = current_aircraft.flight;
105 o = ¤t_options;
107 fgBucketFind(FG_Longitude * RAD_TO_DEG, FG_Latitude * RAD_TO_DEG, &p1);
108 dw = o->tile_diameter / 2;
109 dh = o->tile_diameter / 2;
111 if ( (p1.lon == p_last.lon) && (p1.lat == p_last.lat) &&
112 (p1.x == p_last.x) && (p1.y == p_last.y) ) {
113 // same bucket as last time
114 fgPrintf( FG_TERRAIN, FG_DEBUG, "Same bucket as last time\n");
115 } else if ( p_last.lon == -1000 ) {
116 // First time through, initialize the system and load all
119 fgPrintf( FG_TERRAIN, FG_INFO, " First time through ... ");
120 fgPrintf( FG_TERRAIN, FG_INFO, " Updating Tile list for %d,%d %d,%d\n",
121 p1.lon, p1.lat, p1.x, p1.y);
122 fgPrintf( FG_TERRAIN, FG_INFO, " Loading %d tiles\n",
123 o->tile_diameter * o->tile_diameter);
125 // wipe/initialize tile cache
128 // build the local area list and update cache
129 for ( j = 0; j < o->tile_diameter; j++ ) {
130 for ( i = 0; i < o->tile_diameter; i++ ) {
131 fgBucketOffset(&p1, &p2, i - dw, j - dh);
132 fgTileMgrLoadTile(&p2, &tiles[(j*o->tile_diameter) + i]);
136 // We've moved to a new bucket, we need to scroll our
137 // structures, and load in the new tiles
139 // CURRENTLY THIS ASSUMES WE CAN ONLY MOVE TO ADJACENT TILES.
140 // AT ULTRA HIGH SPEEDS THIS ASSUMPTION MAY NOT BE VALID IF
141 // THE AIRCRAFT CAN SKIP A TILE IN A SINGLE ITERATION.
143 fgPrintf( FG_TERRAIN, FG_INFO, "Updating Tile list for %d,%d %d,%d\n",
144 p1.lon, p1.lat, p1.x, p1.y);
146 if ( (p1.lon > p_last.lon) ||
147 ( (p1.lon == p_last.lon) && (p1.x > p_last.x) ) ) {
148 fgPrintf( FG_TERRAIN, FG_INFO, " Loading %d tiles\n",
150 for ( j = 0; j < o->tile_diameter; j++ ) {
152 for ( i = 0; i < o->tile_diameter - 1; i++ ) {
153 tiles[(j*o->tile_diameter) + i] =
154 tiles[(j*o->tile_diameter) + i + 1];
156 // load in new column
157 fgBucketOffset(&p_last, &p2, dw + 1, j - dh);
158 fgTileMgrLoadTile(&p2, &tiles[(j*o->tile_diameter) +
159 o->tile_diameter - 1]);
161 } else if ( (p1.lon < p_last.lon) ||
162 ( (p1.lon == p_last.lon) && (p1.x < p_last.x) ) ) {
163 fgPrintf( FG_TERRAIN, FG_INFO, " Loading %d tiles\n",
165 for ( j = 0; j < o->tile_diameter; j++ ) {
167 for ( i = o->tile_diameter - 1; i > 0; i-- ) {
168 tiles[(j*o->tile_diameter) + i] =
169 tiles[(j*o->tile_diameter) + i - 1];
171 // load in new column
172 fgBucketOffset(&p_last, &p2, -dw - 1, j - dh);
173 fgTileMgrLoadTile(&p2, &tiles[(j*o->tile_diameter) + 0]);
177 if ( (p1.lat > p_last.lat) ||
178 ( (p1.lat == p_last.lat) && (p1.y > p_last.y) ) ) {
179 fgPrintf( FG_TERRAIN, FG_INFO, " Loading %d tiles\n",
181 for ( i = 0; i < o->tile_diameter; i++ ) {
183 for ( j = 0; j < o->tile_diameter - 1; j++ ) {
184 tiles[(j * o->tile_diameter) + i] =
185 tiles[((j+1) * o->tile_diameter) + i];
187 // load in new column
188 fgBucketOffset(&p_last, &p2, i - dw, dh + 1);
189 fgTileMgrLoadTile(&p2, &tiles[((o->tile_diameter-1) *
190 o->tile_diameter) + i]);
192 } else if ( (p1.lat < p_last.lat) ||
193 ( (p1.lat == p_last.lat) && (p1.y < p_last.y) ) ) {
194 fgPrintf( FG_TERRAIN, FG_INFO, " Loading %d tiles\n",
196 for ( i = 0; i < o->tile_diameter; i++ ) {
198 for ( j = o->tile_diameter - 1; j > 0; j-- ) {
199 tiles[(j * o->tile_diameter) + i] =
200 tiles[((j-1) * o->tile_diameter) + i];
202 // load in new column
203 fgBucketOffset(&p_last, &p2, i - dw, -dh - 1);
204 fgTileMgrLoadTile(&p2, &tiles[0 + i]);
216 // Calculate shortest distance from point to line
217 static double point_line_dist( fgPoint3d *tc, fgPoint3d *vp, MAT3vec d) {
221 p[0] = tc->x; p[1] = tc->y; p[2] = tc->z;
222 p0[0] = vp->x; p0[1] = vp->y; p0[2] = vp->z;
224 dist = fgPointLine(p, p0, d);
226 // printf("dist = %.2f\n", dist);
232 // Calculate if point/radius is inside view frustum
233 static int viewable( fgPoint3d *cp, double radius ) {
236 int viewable = 1; // start by assuming it's viewable
237 double x0, x1, y1, slope;
241 MAT3_SET_HVEC(world, cp->x, cp->y, cp->z, 1.0);
242 MAT3mult_vec(eye, world, v->WORLD_TO_EYE);
243 // printf( "\nworld -> eye = %.2f %.2f %.2f radius = %.2f\n",
244 // eye[0], eye[1], eye[2], radius);
246 // Check near clip plane
247 if ( eye[2] - radius > 0.0 ) {
251 // check right clip plane (from eye perspective)
252 // y = m * (x - x0) = equation of a line intercepting X axis at x0
253 x1 = v->cos_fov_x * radius;
254 y1 = v->sin_fov_x * radius;
256 x0 = x1 - y1 / slope;
258 // printf("(r) x1 = %.2f y1 = %.2f\n", x1, y1);
259 // printf("eye[0] = %.2f eye[2] = %.2f\n", eye[0], eye[2]);
260 // printf("(r) x0 = %.2f slope_x = %.2f radius = %.2f\n",
261 // x0, slope, radius);
263 if ( eye[2] > slope * (eye[0] - x0) ) {
267 // check left clip plane (from eye perspective)
270 x0 = x1 - y1 / slope;
272 // printf("(r) x1 = %.2f y1 = %.2f\n", x1, y1);
273 // printf("eye[0] = %.2f eye[2] = %.2f\n", eye[0], eye[2]);
274 // printf("(r) x0 = %.2f slope_x = %.2f radius = %.2f\n",
275 // x0, slope, radius);
277 if ( eye[2] > slope * (eye[0] - x0) ) {
281 // check bottom clip plane (from eye perspective)
282 x1 = -(v->cos_fov_y) * radius;
283 y1 = v->sin_fov_y * radius;
285 x0 = x1 - y1 / slope;
287 // printf("(r) x1 = %.2f y1 = %.2f\n", x1, y1);
288 // printf("eye[1] = %.2f eye[2] = %.2f\n", eye[1], eye[2]);
289 // printf("(r) x0 = %.2f slope_y = %.2f radius = %.2f\n",
290 // x0, slope, radius);
292 if ( eye[2] > slope * (eye[1] - x0) ) {
296 // check top clip plane (from eye perspective)
299 x0 = x1 - y1 / slope;
301 // printf("(r) x1 = %.2f y1 = %.2f\n", x1, y1);
302 // printf("eye[1] = %.2f eye[2] = %.2f\n", eye[1], eye[2]);
303 // printf("(r) x0 = %.2f slope_y = %.2f radius = %.2f\n",
304 // x0, slope, radius);
306 if ( eye[2] > slope * (eye[1] - x0) ) {
314 // Render the local tiles
315 void fgTileMgrRender( void ) {
322 fgPoint3d frag_offset, fc, pp;
323 fgFRAGMENT *frag_ptr;
325 fgTILE *last_tile_ptr;
327 double dist, min_dist, lat_geod, alt, sea_level_r;
329 list < fgFRAGMENT > :: iterator current;
330 list < fgFRAGMENT > :: iterator last;
336 c = &global_tile_cache;
337 f = current_aircraft.flight;
338 o = ¤t_options;
341 // Find current translation offset
342 fgBucketFind(FG_Longitude * RAD_TO_DEG, FG_Latitude * RAD_TO_DEG, &p);
343 index = c->Exists(&p);
344 t = c->GetTile(index);
346 fgPrintf( FG_TERRAIN, FG_DEBUG,
347 "Pos = (%.2f, %.2f) Current bucket = %d %d %d %d Index = %ld\n",
348 FG_Longitude * RAD_TO_DEG, FG_Latitude * RAD_TO_DEG,
349 p.lon, p.lat, p.x, p.y, fgBucketGenIndex(&p) );
351 // initialize the transient per-material fragment lists
352 material_mgr.init_transient_material_lists();
356 // traverse the potentially viewable tile list
357 for ( i = 0; i < (o->tile_diameter * o->tile_diameter); i++ ) {
359 // fgPrintf( FG_TERRAIN, FG_DEBUG, "Index = %d\n", index);
360 t = c->GetTile(index);
362 // calculate tile offset
363 x = t->offset.x = t->center.x - scenery.center.x;
364 y = t->offset.y = t->center.y - scenery.center.y;
365 z = t->offset.z = t->center.z - scenery.center.z;
368 for ( j = 0; j < 16; j++ ) {
369 m[j] = v->MODEL_VIEW[j];
372 // Calculate the model_view transformation matrix for this tile
373 m[12] = m[0] * x + m[4] * y + m[8] * z + m[12];
374 m[13] = m[1] * x + m[5] * y + m[9] * z + m[13];
375 m[14] = m[2] * x + m[6] * y + m[10] * z + m[14];
376 m[15] = m[3] * x + m[7] * y + m[11] * z + m[15];
378 // temp ... calc current terrain elevation
379 // calculate distance from vertical tangent line at
380 // current position to center of tile.
381 dist = point_line_dist(&(t->offset), &(v->view_pos), v->local_up);
382 if ( dist < t->bounding_radius ) {
384 // traverse fragment list for tile
385 current = t->fragment_list.begin();
386 last = t->fragment_list.end();
388 while ( current != last ) {
389 frag_ptr = &(*current);
391 dist = point_line_dist( &(frag_ptr->center), &(v->view_pos),
393 if ( dist <= frag_ptr->bounding_radius ) {
394 if ( dist < min_dist ) {
396 // compute geocentric coordinates of tile center
397 pp = fgCartToPolar3d(frag_ptr->center);
398 // convert to geodetic coordinates
399 fgGeocToGeod(pp.lat, pp.radius, &lat_geod,
405 if ( min_dist <= t->bounding_radius ) {
406 printf("min_dist = %.2f alt = %.2f\n", min_dist, alt);
410 // Course (tile based) culling
411 if ( viewable(&(t->offset), t->bounding_radius) ) {
412 // at least a portion of this tile could be viewable
415 // xglTranslatef(t->offset.x, t->offset.y, t->offset.z);
417 // traverse fragment list for tile
418 current = t->fragment_list.begin();
419 last = t->fragment_list.end();
421 while ( current != last ) {
422 frag_ptr = &(*current);
425 if ( frag_ptr->display_list >= 0 ) {
426 // Fine (fragment based) culling
427 frag_offset.x = frag_ptr->center.x - scenery.center.x;
428 frag_offset.y = frag_ptr->center.y - scenery.center.y;
429 frag_offset.z = frag_ptr->center.z - scenery.center.z;
431 if ( viewable(&frag_offset, frag_ptr->bounding_radius*2) ) {
432 // add to transient per-material property fragment list
433 // frag_ptr->tile_offset.x = t->offset.x;
434 // frag_ptr->tile_offset.y = t->offset.y;
435 // frag_ptr->tile_offset.z = t->offset.z;
437 mtl_ptr = (fgMATERIAL *)(frag_ptr->material_ptr);
438 // printf(" lookup = %s\n", mtl_ptr->texture_name);
439 if ( mtl_ptr->list_size < FG_MAX_MATERIAL_FRAGS ) {
440 mtl_ptr->list[mtl_ptr->list_size] = frag_ptr;
441 (mtl_ptr->list_size)++;
443 fgPrintf( FG_TERRAIN, FG_ALERT,
444 "Overran material sorting array\n" );
447 // xglCallList(frag_ptr->display_list);
450 // printf("Culled a fragment %.2f %.2f %.2f %.2f\n",
451 // frag_ptr->center.x, frag_ptr->center.y,
452 // frag_ptr->center.z, frag_ptr->bounding_radius);
460 culled += t->fragment_list.size();
464 if ( (drawn + culled) > 0 ) {
465 v->vfc_ratio = (double)culled / (double)(drawn + culled);
469 // printf("drawn = %d culled = %d saved = %.2f\n", drawn, culled,
473 // traverse the transient per-material fragment lists and render
474 // out all fragments for each material property.
475 map < string, fgMATERIAL, less<string> > :: iterator mapcurrent =
476 material_mgr.material_map.begin();
477 map < string, fgMATERIAL, less<string> > :: iterator maplast =
478 material_mgr.material_map.end();
482 while ( mapcurrent != maplast ) {
483 // (char *)key = (*mapcurrent).first;
484 // (fgMATERIAL)value = (*mapcurrent).second;
485 mtl_ptr = &(*mapcurrent).second;
487 last_tile_ptr = NULL;
489 size = mtl_ptr->list_size;
492 #ifdef GL_VERSION_1_1
493 xglBindTexture(GL_TEXTURE_2D, mtl_ptr->texture_id);
494 #elif GL_EXT_texture_object
495 xglBindTextureEXT(GL_TEXTURE_2D, mtl_ptr->texture_id);
500 xglMaterialfv (GL_FRONT, GL_AMBIENT, mtl_ptr->ambient);
501 xglMaterialfv (GL_FRONT, GL_DIFFUSE, mtl_ptr->diffuse);
504 // printf("traversing = %s, size = %d\n",
505 // mtl_ptr->texture_name, size);
506 for ( i = 0; i < size; i++ ) {
507 frag_ptr = mtl_ptr->list[i];
509 if ( frag_ptr->tile_ptr == last_tile_ptr ) {
510 // same tile as last time, no transform necessary
512 // new tile, new translate
513 // xglLoadMatrixf( frag_ptr->matrix );
514 t = (fgTILE *)(frag_ptr->tile_ptr);
515 xglLoadMatrixd(t->model_view );
518 // Woohoo!!! We finally get to draw something!
519 // printf(" display_list = %d\n", frag_ptr->display_list);
520 xglCallList(frag_ptr->display_list);
522 last_tile_ptr = (fgTILE *)(frag_ptr->tile_ptr);
534 // Revision 1.23 1998/07/08 14:47:23 curt
535 // Fix GL_MODULATE vs. GL_DECAL problem introduced by splash screen.
536 // polare3d.h renamed to polar3d.hxx
537 // fg{Cartesian,Polar}Point3d consolodated.
538 // Added some initial support for calculating local current ground elevation.
540 // Revision 1.22 1998/07/04 00:54:31 curt
541 // Added automatic mipmap generation.
543 // When rendering fragments, use saved model view matrix from associated tile
544 // rather than recalculating it with push() translate() pop().
546 // Revision 1.21 1998/06/27 16:54:59 curt
547 // Check for GL_VERSION_1_1 or GL_EXT_texture_object to decide whether to use
548 // "EXT" versions of texture management routines.
550 // Revision 1.20 1998/06/17 21:36:42 curt
551 // Load and manage multiple textures defined in the Materials library.
552 // Boost max material fagments for each material property to 800.
553 // Multiple texture support when rendering.
555 // Revision 1.19 1998/06/08 17:57:54 curt
556 // Working first pass at material proporty sorting.
558 // Revision 1.18 1998/06/06 01:09:32 curt
559 // I goofed on the log message in the last commit ... now fixed.
561 // Revision 1.17 1998/06/06 01:07:18 curt
562 // Increased per material fragment list size from 100 to 400.
563 // Now correctly draw viewable fragments in per material order.
565 // Revision 1.16 1998/06/05 22:39:55 curt
566 // Working on sorting by, and rendering by material properties.
568 // Revision 1.15 1998/06/03 00:47:51 curt
569 // No .h for STL includes.
570 // Minor view culling optimizations.
572 // Revision 1.14 1998/06/01 17:56:20 curt
573 // Incremental additions to material.cxx (not fully functional)
574 // Tweaked vfc_ratio math to avoid divide by zero.
576 // Revision 1.13 1998/05/24 02:49:10 curt
577 // Implimented fragment level view frustum culling.
579 // Revision 1.12 1998/05/23 14:09:23 curt
580 // Added tile.cxx and tile.hxx.
581 // Working on rewriting the tile management system so a tile is just a list
582 // fragments, and the fragment record contains the display list for that fragment.
584 // Revision 1.11 1998/05/20 20:53:55 curt
585 // Moved global ref point and radius (bounding sphere info, and offset) to
586 // data file rather than calculating it on the fly.
587 // Fixed polygon winding problem in scenery generation stage rather than
588 // compensating for it on the fly.
589 // Made a fgTILECACHE class.
591 // Revision 1.10 1998/05/17 16:59:34 curt
592 // Frist pass at view frustum culling now operational.
594 // Revision 1.9 1998/05/16 13:09:58 curt
595 // Beginning to add support for view frustum culling.
596 // Added some temporary code to calculate bouding radius, until the
597 // scenery generation tools and scenery can be updated.
599 // Revision 1.8 1998/05/07 23:15:21 curt
600 // Fixed a glTexImage2D() usage bug where width and height were mis-swapped.
601 // Added support for --tile-radius=n option.
603 // Revision 1.7 1998/05/06 03:16:42 curt
604 // Added an option to control square tile radius.
606 // Revision 1.6 1998/05/02 01:52:18 curt
607 // Playing around with texture coordinates.
609 // Revision 1.5 1998/04/30 12:35:32 curt
610 // Added a command line rendering option specify smooth/flat shading.
612 // Revision 1.4 1998/04/27 03:30:14 curt
613 // Minor transformation adjustments to try to keep scenery tiles closer to
614 // (0, 0, 0) GLfloats run out of precision at the distances we need to model
615 // the earth, but we can do a bunch of pre-transformations using double math
616 // and then cast to GLfloat once everything is close in where we have less
617 // precision problems.
619 // Revision 1.3 1998/04/25 22:06:32 curt
620 // Edited cvs log messages in source files ... bad bad bad!
622 // Revision 1.2 1998/04/24 00:51:09 curt
623 // Wrapped "#include <config.h>" in "#ifdef HAVE_CONFIG_H"
624 // Tweaked the scenery file extentions to be "file.obj" (uncompressed)
625 // or "file.obz" (compressed.)
627 // Revision 1.1 1998/04/22 13:22:48 curt
628 // C++ - ifing the code a bit.
630 // Revision 1.25 1998/04/18 04:14:07 curt
631 // Moved fg_debug.c to it's own library.
633 // Revision 1.24 1998/04/14 02:23:18 curt
634 // Code reorganizations. Added a Lib/ directory for more general libraries.
636 // Revision 1.23 1998/04/08 23:30:08 curt
637 // Adopted Gnu automake/autoconf system.
639 // Revision 1.22 1998/04/03 22:11:38 curt
640 // Converting to Gnu autoconf system.
642 // Revision 1.21 1998/03/23 21:23:05 curt
643 // Debugging output tweaks.
645 // Revision 1.20 1998/03/14 00:30:51 curt
646 // Beginning initial terrain texturing experiments.
648 // Revision 1.19 1998/02/20 00:16:25 curt
649 // Thursday's tweaks.
651 // Revision 1.18 1998/02/19 13:05:54 curt
652 // Incorporated some HUD tweaks from Michelle America.
653 // Tweaked the sky's sunset/rise colors.
654 // Other misc. tweaks.
656 // Revision 1.17 1998/02/16 13:39:46 curt
657 // Miscellaneous weekend tweaks. Fixed? a cache problem that caused whole
658 // tiles to occasionally be missing.
660 // Revision 1.16 1998/02/12 21:59:53 curt
661 // Incorporated code changes contributed by Charlie Hotchkiss
662 // <chotchkiss@namg.us.anritsu.com>
664 // Revision 1.14 1998/02/09 21:30:19 curt
665 // Fixed a nagging problem with terrain tiles not "quite" matching up perfectly.
667 // Revision 1.13 1998/02/07 15:29:46 curt
668 // Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
669 // <chotchkiss@namg.us.anritsu.com>
671 // Revision 1.12 1998/02/01 03:39:55 curt
674 // Revision 1.11 1998/01/31 00:43:27 curt
675 // Added MetroWorks patches from Carmen Volpe.
677 // Revision 1.10 1998/01/29 00:51:40 curt
678 // First pass at tile cache, dynamic tile loading and tile unloading now works.
680 // Revision 1.9 1998/01/27 03:26:44 curt
681 // Playing with new fgPrintf command.
683 // Revision 1.8 1998/01/27 00:48:04 curt
684 // Incorporated Paul Bleisch's <pbleisch@acm.org> new debug message
685 // system and commandline/config file processing code.
687 // Revision 1.7 1998/01/26 15:55:25 curt
688 // Progressing on building dynamic scenery system.
690 // Revision 1.6 1998/01/24 00:03:30 curt
693 // Revision 1.5 1998/01/19 19:27:18 curt
694 // Merged in make system changes from Bob Kuehne <rpk@sgi.com>
695 // This should simplify things tremendously.
697 // Revision 1.4 1998/01/19 18:40:38 curt
698 // Tons of little changes to clean up the code and to remove fatal errors
699 // when building with the c++ compiler.
701 // Revision 1.3 1998/01/13 00:23:11 curt
702 // Initial changes to support loading and management of scenery tiles. Note,
703 // there's still a fair amount of work left to be done.
705 // Revision 1.2 1998/01/08 02:22:27 curt
706 // Continue working on basic features.
708 // Revision 1.1 1998/01/07 23:50:51 curt
709 // "area" renamed to "tile"
711 // Revision 1.2 1998/01/07 03:29:29 curt
712 // Given an arbitrary lat/lon, we can now:
713 // generate a unique index for the chunk containing the lat/lon
714 // generate a path name to the chunk file
715 // build a list of the indexes of all the nearby areas.
717 // Revision 1.1 1998/01/07 02:05:48 curt