]> git.mxchange.org Git - flightgear.git/blobdiff - Scenery/scenery.c
Integrated new event manager with subsystem initializations.
[flightgear.git] / Scenery / scenery.c
index 003920123091a3cf87350352c693f6044c17c758..2b710998fe815746d697e5b367517336b0fee501 100644 (file)
 #endif
 
 #include <GL/glut.h>
+#include "../XGL/xgl.h"
+
 #include <stdio.h>
 #include <string.h>
 
-#include "../general.h"
+#include "../Include/general.h"
 
 #include "astro.h"
 #include "obj.h"
@@ -50,6 +52,8 @@ struct fgSCENERY scenery;
 
 /* Initialize the Scenery Management system */
 void fgSceneryInit() {
+    printf("Initializing scenery subsystem\n");
+
     /* set the default terrain detail level */
     scenery.terrain_skip = 6;
 }
@@ -72,7 +76,7 @@ void fgSceneryUpdate(double lon, double lat, double elev) {
     strcat(path, "/Scenery/");
     strcat(path, "mesa-e.obj");
 
-    printf("Loading Scenery: %s\n", path);
+    printf("  Loading Scenery: %s\n", path);
 
     area_terrain = fgObjLoad(path);
 }
@@ -80,27 +84,34 @@ void fgSceneryUpdate(double lon, double lat, double elev) {
 
 /* Render out the current scene */
 void fgSceneryRender() {
-    static GLfloat terrain_color[4] = { 0.4, 0.8, 0.3, 1.0 };
+    static GLfloat terrain_color[4] = { 0.6, 0.8, 0.4, 1.0 };
     static GLfloat terrain_ambient[4];
     static GLfloat terrain_diffuse[4];
     int i;
 
     for ( i = 0; i < 4; i++ ) {
-       terrain_ambient[i] = terrain_color[i];
+       terrain_ambient[i] = terrain_color[i] * 0.5;
        terrain_diffuse[i] = terrain_color[i];
     }
 
-    glMaterialfv(GL_FRONT, GL_AMBIENT, terrain_ambient);
-    glMaterialfv(GL_FRONT, GL_DIFFUSE, terrain_diffuse);
+    xglMaterialfv(GL_FRONT, GL_AMBIENT, terrain_ambient);
+    xglMaterialfv(GL_FRONT, GL_DIFFUSE, terrain_diffuse);
 
-    glCallList(area_terrain);
+    xglCallList(area_terrain);
 }
 
 
 /* $Log$
-/* Revision 1.27  1997/12/12 21:41:30  curt
-/* More light/material property tweaking ... still a ways off.
+/* Revision 1.29  1997/12/30 20:47:52  curt
+/* Integrated new event manager with subsystem initializations.
 /*
+ * Revision 1.28  1997/12/15 23:55:02  curt
+ * Add xgl wrappers for debugging.
+ * Generate terrain normals on the fly.
+ *
+ * Revision 1.27  1997/12/12 21:41:30  curt
+ * More light/material property tweaking ... still a ways off.
+ *
  * Revision 1.26  1997/12/12 19:52:58  curt
  * Working on lightling and material properties.
  *