From: curt Date: Thu, 8 Jan 1998 02:22:26 +0000 (+0000) Subject: Continue working on basic features. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b6710903109e0d9dd7497b9a90f4b70639ab0d07;p=flightgear.git Continue working on basic features. --- diff --git a/Scenery/Makefile b/Scenery/Makefile index b5ca96bfe..84681fb78 100644 --- a/Scenery/Makefile +++ b/Scenery/Makefile @@ -26,7 +26,7 @@ TARGET = libScenery.a -CFILES = common.c geometry.c mesh.c obj.c scenery.c +CFILES = common.c geometry.c mesh.c obj.c scenery.c tilemgr.c tileutils.c OFILES = $(CFILES:.c=.o) @@ -59,45 +59,33 @@ realclean: clean include depend -astro.o: - $(CC) $(CFLAGS) -c astro.c -o $@ - common.o: $(CC) $(CFLAGS) -c common.c -o $@ +geometry.o: + $(CC) $(CFLAGS) -c geometry.c -o $@ + mesh.o: $(CC) $(CFLAGS) -c mesh.c -o $@ -mesh2GL.o: - $(CC) $(CFLAGS) -c mesh2GL.c -o $@ - -moon.o: - $(CC) $(CFLAGS) -c moon.c -o $@ - obj.o: $(CC) $(CFLAGS) -c obj.c -o $@ -orbits.o: - $(CC) $(CFLAGS) -c orbits.c -o $@ - -planets.o: - $(CC) $(CFLAGS) -c planets.c -o $@ - scenery.o: $(CC) $(CFLAGS) -c scenery.c -o $@ -stars.c: - $(CC) $(CFLAGS) -c stars.c -o $@ - -sun.o: - $(CC) $(CFLAGS) -c sun.c -o $@ +tilemgr.o: + $(CC) $(CFLAGS) -c tilemgr.c -o $@ -geometry.o: - $(CC) $(CFLAGS) -c geometry.c -o $@ +tileutils.o: + $(CC) $(CFLAGS) -c tileutils.c -o $@ #--------------------------------------------------------------------------- # $Log$ +# Revision 1.28 1998/01/08 02:22:26 curt +# Continue working on basic features. +# # Revision 1.27 1998/01/07 03:22:28 curt # Moved astro stuff to .../Src/Astro/ # diff --git a/Scenery/depend b/Scenery/depend index f07a0043f..8a3a00bb7 100644 --- a/Scenery/depend +++ b/Scenery/depend @@ -1,5 +1,3 @@ -areamgr.o: areamgr.c ../XGL/xgl.h ../Include/constants.h \ - ../Math/fg_random.h common.o: common.c common.h geometry.o: geometry.c geometry.h mesh.h mesh.o: mesh.c ../Include/constants.h ../Include/types.h \ @@ -9,3 +7,10 @@ obj.o: obj.c ../XGL/xgl.h obj.h scenery.h ../Include/types.h \ ../Math/mat3.h scenery.o: scenery.c ../XGL/xgl.h ../Include/general.h obj.h scenery.h \ ../Include/types.h +tilemgr.o: tilemgr.c ../XGL/xgl.h tileutils.h ../Aircraft/aircraft.h \ + ../Aircraft/../Flight/flight.h ../Aircraft/../Flight/Slew/slew.h \ + ../Aircraft/../Flight/LaRCsim/ls_interface.h \ + ../Aircraft/../Flight/LaRCsim/../flight.h \ + ../Aircraft/../Controls/controls.h \ + ../Aircraft/../Controls/../Include/limits.h +tileutils.o: tileutils.c tileutils.h ../Include/constants.h diff --git a/Scenery/tilemgr.c b/Scenery/tilemgr.c index d2ce0b359..ab5ce1fb9 100644 --- a/Scenery/tilemgr.c +++ b/Scenery/tilemgr.c @@ -34,6 +34,7 @@ #include "tileutils.h" #include "../Aircraft/aircraft.h" +#include "../Include/constants.h" /* here's where we keep the array of closest (potentially viewable) tiles */ @@ -55,15 +56,20 @@ void fgTileMgrUpdate() { f = ¤t_aircraft.flight; - find_bucket(FG_Longitude, FG_Latitude, &p); + find_bucket(FG_Longitude * RAD_TO_DEG, FG_Latitude * RAD_TO_DEG, &p); + printf("Updating Tile list for %d,%d %d,%d\n", p.lon, p.lat, p.x, p.y); + gen_idx_array(&p, tile, 7, 7); } /* $Log$ -/* Revision 1.1 1998/01/07 23:50:51 curt -/* "area" renamed to "tile" +/* Revision 1.2 1998/01/08 02:22:27 curt +/* Continue working on basic features. /* + * Revision 1.1 1998/01/07 23:50:51 curt + * "area" renamed to "tile" + * * Revision 1.2 1998/01/07 03:29:29 curt * Given an arbitrary lat/lon, we can now: * generate a unique index for the chunk containing the lat/lon diff --git a/Scenery/tileutils.c b/Scenery/tileutils.c index c4ac1eee1..358f48c29 100644 --- a/Scenery/tileutils.c +++ b/Scenery/tileutils.c @@ -208,7 +208,7 @@ void find_bucket(double lon, double lat, struct bucket *p) { /* Given a lat/lon, fill in the local tile index array */ -void gen_idx_array(struct bucket *p1, long int *tile, +void gen_idx_array(struct bucket *p1, long int *tiles, int width, int height) { struct bucket p2; int dw, dh, i, j; @@ -218,9 +218,9 @@ void gen_idx_array(struct bucket *p1, long int *tile, for ( j = 0; j < height; j++ ) { for ( i = 0; i < width; i++ ) { offset_bucket(p1, &p2, i - dw, j - dh); - tile[(j*width)+i] = gen_index(&p2); + tiles[(j*width)+i] = gen_index(&p2); printf(" bucket = %d %d %d %d index = %ld\n", - p2.lon, p2.lat, p2.x, p2.y, tile[(j*width)+i]); + p2.lon, p2.lat, p2.x, p2.y, tiles[(j*width)+i]); } } } @@ -268,9 +268,12 @@ int main() { /* $Log$ -/* Revision 1.1 1998/01/07 23:50:52 curt -/* "area" renamed to "tile" +/* Revision 1.2 1998/01/08 02:22:28 curt +/* Continue working on basic features. /* + * Revision 1.1 1998/01/07 23:50:52 curt + * "area" renamed to "tile" + * * Revision 1.1 1998/01/07 23:23:40 curt * Initial revision. * diff --git a/Scenery/tileutils.h b/Scenery/tileutils.h index 14374c5a3..d78fbace1 100644 --- a/Scenery/tileutils.h +++ b/Scenery/tileutils.h @@ -65,14 +65,17 @@ void find_bucket(double lon, double lat, struct bucket *p); /* Given a lat/lon, fill in the local tile index array */ -void gen_idx_array(struct bucket *p1, long int *tile, +void gen_idx_array(struct bucket *p1, long int *tiles, int width, int height); /* $Log$ -/* Revision 1.1 1998/01/07 23:50:52 curt -/* "area" renamed to "tile" +/* Revision 1.2 1998/01/08 02:22:28 curt +/* Continue working on basic features. /* + * Revision 1.1 1998/01/07 23:50:52 curt + * "area" renamed to "tile" + * * Revision 1.1 1998/01/07 23:23:40 curt * Initial revision. *