]> git.mxchange.org Git - flightgear.git/blobdiff - Scenery/tilemgr.c
Code reorganizations. Added a Lib/ directory for more general libraries.
[flightgear.git] / Scenery / tilemgr.c
index da9cb9f56d6c66bd15ccd7691c546085c0b09ff6..aa68fd90f42b2b1d9a383b785a1a60edf36d3e65 100644 (file)
@@ -1,4 +1,5 @@
-/**************************************************************************
+/* -*- Mode: C++ -*-
+ *
  * tilemgr.c -- routines to handle dynamic management of scenery tiles
  *
  * Written by Curtis Olson, started January 1998.
@@ -24,7 +25,9 @@
  **************************************************************************/
 
 
-#ifdef WIN32
+#include <config.h>
+
+#ifdef HAVE_WINDOWS_H
 #  include <windows.h>
 #endif
 
 #include <XGL/xgl.h>
 
 #include <Scenery/scenery.h>
-#include <Scenery/bucketutils.h>
 #include <Scenery/obj.h>
 #include <Scenery/tilecache.h>
 
 #include <Aircraft/aircraft.h>
+#include <Bucket/bucketutils.h>
 #include <Include/fg_constants.h>
 #include <Include/fg_types.h>
 #include <Main/fg_debug.h>
@@ -180,9 +183,6 @@ int fgTileMgrUpdate( void ) {
 void fgTileMgrRender( void ) {
     fgFLIGHT *f;
     struct fgBUCKET p;
-    static GLfloat terrain_color[4] = { 0.6, 0.8, 0.4, 1.0 };
-    static GLfloat terrain_ambient[4];
-    static GLfloat terrain_diffuse[4];
     struct fgCartesianPoint local_ref;
     GLint display_list;
     int i;
@@ -190,20 +190,14 @@ void fgTileMgrRender( void ) {
 
     f = current_aircraft.flight;
 
-    for ( i = 0; i < 4; i++ ) {
-       terrain_ambient[i] = terrain_color[i] * 0.5;
-       terrain_diffuse[i] = terrain_color[i];
-    }
-
-    xglMaterialfv(GL_FRONT, GL_AMBIENT, terrain_ambient);
-    xglMaterialfv(GL_FRONT, GL_DIFFUSE, terrain_diffuse);
-
     /* Find current translation offset */
     fgBucketFind(FG_Longitude * RAD_TO_DEG, FG_Latitude * RAD_TO_DEG, &p);
     index = fgTileCacheExists(&p);
     fgTileCacheEntryInfo(index, &display_list, &scenery.next_center );
 
-    printf("Current bucket = %d %d %d %d\n", p.lon, p.lat, p.x, p.y );
+    printf("Pos = (%.2f, %.2f) Current bucket = %d %d %d %d  Index = %ld\n", 
+          FG_Longitude * RAD_TO_DEG, FG_Latitude * RAD_TO_DEG,
+          p.lon, p.lat, p.x, p.y, fgBucketGenIndex(&p) );
 
     for ( i = 0; i < FG_LOCAL_X_Y; i++ ) {
        index = tiles[i];
@@ -225,9 +219,24 @@ void fgTileMgrRender( void ) {
 
 
 /* $Log$
-/* Revision 1.19  1998/02/20 00:16:25  curt
-/* Thursday's tweaks.
+/* Revision 1.24  1998/04/14 02:23:18  curt
+/* Code reorganizations.  Added a Lib/ directory for more general libraries.
 /*
+ * Revision 1.23  1998/04/08 23:30:08  curt
+ * Adopted Gnu automake/autoconf system.
+ *
+ * Revision 1.22  1998/04/03 22:11:38  curt
+ * Converting to Gnu autoconf system.
+ *
+ * Revision 1.21  1998/03/23 21:23:05  curt
+ * Debugging output tweaks.
+ *
+ * Revision 1.20  1998/03/14 00:30:51  curt
+ * Beginning initial terrain texturing experiments.
+ *
+ * Revision 1.19  1998/02/20 00:16:25  curt
+ * Thursday's tweaks.
+ *
  * Revision 1.18  1998/02/19 13:05:54  curt
  * Incorporated some HUD tweaks from Michelle America.
  * Tweaked the sky's sunset/rise colors.