Continue working on basic features.
This commit is contained in:
parent
b712d46418
commit
b671090310
5 changed files with 49 additions and 44 deletions
|
@ -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 $@
|
||||
|
||||
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 $@
|
||||
|
||||
geometry.o:
|
||||
$(CC) $(CFLAGS) -c geometry.c -o $@
|
||||
|
||||
mesh.o:
|
||||
$(CC) $(CFLAGS) -c mesh.c -o $@
|
||||
|
||||
obj.o:
|
||||
$(CC) $(CFLAGS) -c obj.c -o $@
|
||||
|
||||
scenery.o:
|
||||
$(CC) $(CFLAGS) -c scenery.c -o $@
|
||||
|
||||
tilemgr.o:
|
||||
$(CC) $(CFLAGS) -c tilemgr.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/
|
||||
#
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
|
|
Loading…
Add table
Reference in a new issue