]> git.mxchange.org Git - flightgear.git/blobdiff - Scenery/geometry.c
Merged in make system changes from Bob Kuehne <rpk@sgi.com>
[flightgear.git] / Scenery / geometry.c
index f2ec13016f1f515685dca083d786a46f57e0f6eb..b4cc0ae83dd283fd3b4791a81c9fbdd3a6daf1db 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 
-#include "geometry.h"
-#include "mesh.h"
+#include <Scenery/geometry.h>
+#include <Scenery/mesh.h>
 
 
 static vrmlGeometryType;
-static struct mesh eg;
+struct MESH eg;
 
 
 /* Begin a new vrml geometry statement */
@@ -58,7 +58,11 @@ void vrmlGeomOptionName(char *name) {
 
     switch(vrmlGeometryType) {
     case VRML_ELEV_GRID:
-       if ( strcmp(name, "xDimension") == 0 ) {
+       if ( strcmp(name, "xOrigin") == 0 ) {
+           mesh_set_option_name(&eg, "origin_lon");
+       } else if ( strcmp(name, "zOrigin") == 0 ) {
+           mesh_set_option_name(&eg, "origin_lat");
+       } else if ( strcmp(name, "xDimension") == 0 ) {
            mesh_set_option_name(&eg, "rows");
        } else if ( strcmp(name, "zDimension") == 0 ) {
            mesh_set_option_name(&eg, "cols");
@@ -91,7 +95,7 @@ void vrmlGeomOptionsValue(char *value) {
 /* We've finished parsing the current geometry.  Now do whatever needs
  * to be done with it (like generating the OpenGL call list for
  * instance */
-void vrmlHandleGeometry() {
+void vrmlHandleGeometry( void ) {
     switch(vrmlGeometryType) {
     case VRML_ELEV_GRID:
        mesh_do_it(&eg);
@@ -100,21 +104,46 @@ void vrmlHandleGeometry() {
 
 
 /* Finish up the current vrml geometry statement */
-int vrmlFreeGeometry() {
+int vrmlFreeGeometry( void ) {
     printf("Freeing geometry type = %d\n", vrmlGeometryType);
 
     switch(vrmlGeometryType) {
     case VRML_ELEV_GRID:
-       free(eg.mesh_data);
+       /* We need to rethink this here, we can't just free the data,
+         * because we need it to calculate current ground elevation
+         * ... */
+       /* free(eg.mesh_data); */
+       ;
     }
     return(vrmlGeometryType);
 }
 
 
 /* $Log$
-/* Revision 1.1  1997/06/29 21:16:48  curt
-/* More twiddling with the Scenery Management system.
+/* Revision 1.7  1998/01/19 19:27:15  curt
+/* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
+/* This should simplify things tremendously.
 /*
+ * Revision 1.6  1998/01/19 18:40:35  curt
+ * Tons of little changes to clean up the code and to remove fatal errors
+ * when building with the c++ compiler.
+ *
+ * Revision 1.5  1998/01/06 01:20:23  curt
+ * Tweaks to help building with MSVC++
+ *
+ * Revision 1.4  1997/08/27 03:30:26  curt
+ * Changed naming scheme of basic shared structures.
+ *
+ * Revision 1.3  1997/07/08 18:20:13  curt
+ * Working on establishing a hard ground.
+ *
+ * Revision 1.2  1997/07/07 20:59:51  curt
+ * Working on scenery transformations to enable us to fly fluidly over the
+ * poles with no discontinuity/distortion in scenery.
+ *
+ * Revision 1.1  1997/06/29 21:16:48  curt
+ * More twiddling with the Scenery Management system.
+ *
  * Revision 1.1  1997/06/22 21:42:35  curt
  * Initial revision of VRML (subset) parser.
  *