1 /**************************************************************************
2 * tilemgr.c -- routines to handle dynamic management of scenery tiles
4 * Written by Curtis Olson, started January 1998.
6 * Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
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 **************************************************************************/
32 #include "../XGL/xgl.h"
34 #include "tileutils.h"
36 #include "../Aircraft/aircraft.h"
39 /* here's where we keep the array of closest (potentially viewable) tiles */
40 static long int tile[49];
43 /* Initialize the Tile Manager subsystem */
44 void fgTileMgrInit() {
45 printf("Initializing Tile Manager subsystem.\n");
46 /* fgTileCacheInit(); */
50 /* given the current lon/lat, fill in the array of local chunks. If
51 * the chunk isn't already in the cache, then read it from disk. */
52 void fgTileMgrUpdate() {
56 f = ¤t_aircraft.flight;
58 find_bucket(FG_Longitude, FG_Latitude, &p);
59 gen_idx_array(&p, tile, 7, 7);
64 /* Revision 1.1 1998/01/07 23:50:51 curt
65 /* "area" renamed to "tile"
67 * Revision 1.2 1998/01/07 03:29:29 curt
68 * Given an arbitrary lat/lon, we can now:
69 * generate a unique index for the chunk containing the lat/lon
70 * generate a path name to the chunk file
71 * build a list of the indexes of all the nearby areas.
73 * Revision 1.1 1998/01/07 02:05:48 curt