]> git.mxchange.org Git - flightgear.git/blob - Scenery/tilecache.h
Added MetroWorks patches from Carmen Volpe.
[flightgear.git] / Scenery / tilecache.h
1 /**************************************************************************
2  * tilecache.h -- routines to handle scenery tile caching
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 #ifndef _TILECACHE_H
28 #define _TILECACHE_H
29
30
31 #ifdef WIN32
32 #  include <windows.h>
33 #endif
34
35 #include <GL/glut.h>
36 #include <XGL/xgl.h>
37
38 #include <Scenery/bucketutils.h>
39 #include <Include/fg_types.h>
40
41 /* For best results ...
42  *
43  * FG_TILE_CACHE_SIZE >= FG_LOCAL_X_Y + max(FG_LOCAL_X, FG_LOCAL_Y) */
44 #define FG_TILE_CACHE_SIZE 12   
45
46
47 /* Tile cache record */
48 struct fgTILE {
49     struct fgBUCKET tile_bucket;
50     GLint display_list;
51     struct fgCartesianPoint local_ref;
52     double bounding_radius;
53     int used;
54     int priority;
55 };
56
57 /* tile cache */
58 extern struct fgTILE tile_cache[FG_TILE_CACHE_SIZE];
59
60
61 /* Initialize the tile cache subsystem */
62 void fgTileCacheInit( void );
63
64 /* Search for the specified "bucket" in the cache */
65 int fgTileCacheExists( struct fgBUCKET *p );
66
67 /* Return index of next available slot in tile cache */
68 int fgTileCacheNextAvail( void );
69
70 /* Fill in a tile cache entry with real data for the specified bucket */
71 void fgTileCacheEntryFillIn( int index, struct fgBUCKET *p );
72
73 /* Return info for a tile cache entry */
74 void fgTileCacheEntryInfo( int index, GLint *display_list, 
75                            struct fgCartesianPoint *local_ref );
76
77
78 #endif /* _TILECACHE_H */
79
80
81 /* $Log$
82 /* Revision 1.4  1998/01/31 00:43:27  curt
83 /* Added MetroWorks patches from Carmen Volpe.
84 /*
85  * Revision 1.3  1998/01/29 00:51:40  curt
86  * First pass at tile cache, dynamic tile loading and tile unloading now works.
87  *
88  * Revision 1.2  1998/01/27 00:48:04  curt
89  * Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
90  * system and commandline/config file processing code.
91  *
92  * Revision 1.1  1998/01/24 00:03:29  curt
93  * Initial revision.
94  *
95  */
96
97