]> git.mxchange.org Git - flightgear.git/blob - Scenery/tilemgr.c
Continue working on basic features.
[flightgear.git] / Scenery / tilemgr.c
1 /**************************************************************************
2  * tilemgr.c -- routines to handle dynamic management of scenery tiles
3  *
4  * Written by Curtis Olson, started January 1998.
5  *
6  * Copyright (C) 1997  Curtis L. Olson  - curt@infoplane.com
7  *
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.
12  *
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.
17  *
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.
21  *
22  * $Id$
23  * (Log is kept at end of this file)
24  **************************************************************************/
25
26
27 #ifdef WIN32
28 #  include <windows.h>
29 #endif
30
31 #include <GL/glut.h>
32 #include "../XGL/xgl.h"
33
34 #include "tileutils.h"
35
36 #include "../Aircraft/aircraft.h"
37 #include "../Include/constants.h"
38
39
40 /* here's where we keep the array of closest (potentially viewable) tiles */
41 static long int tile[49];
42
43
44 /* Initialize the Tile Manager subsystem */
45 void fgTileMgrInit() {
46     printf("Initializing Tile Manager subsystem.\n");
47     /* fgTileCacheInit(); */
48 }
49
50
51 /* given the current lon/lat, fill in the array of local chunks.  If
52  * the chunk isn't already in the cache, then read it from disk. */
53 void fgTileMgrUpdate() {
54     struct fgFLIGHT *f;
55     struct bucket p;
56
57     f = &current_aircraft.flight;
58
59     find_bucket(FG_Longitude * RAD_TO_DEG, FG_Latitude * RAD_TO_DEG, &p);
60     printf("Updating Tile list for %d,%d %d,%d\n", p.lon, p.lat, p.x, p.y);
61
62     gen_idx_array(&p, tile, 7, 7);
63 }
64
65
66 /* $Log$
67 /* Revision 1.2  1998/01/08 02:22:27  curt
68 /* Continue working on basic features.
69 /*
70  * Revision 1.1  1998/01/07 23:50:51  curt
71  * "area" renamed to "tile"
72  *
73  * Revision 1.2  1998/01/07 03:29:29  curt
74  * Given an arbitrary lat/lon, we can now:
75  *   generate a unique index for the chunk containing the lat/lon
76  *   generate a path name to the chunk file
77  *   build a list of the indexes of all the nearby areas.
78  *
79  * Revision 1.1  1998/01/07 02:05:48  curt
80  * Initial revision.
81  * */
82
83