]> git.mxchange.org Git - flightgear.git/blobdiff - Scenery/mesh.c
Tons of little changes to clean up the code and to remove fatal errors
[flightgear.git] / Scenery / mesh.c
index 6ff71031ef14a5656789339668e0970a40154263..4cbd2f53dc5bbbbc85eb586e72f013f7df6da758 100644 (file)
@@ -38,8 +38,8 @@
 
 #include <GL/glut.h>
 
-#include "../constants.h"
-#include "../types.h"
+#include "../Include/constants.h"
+#include "../Include/types.h"
 #include "../Math/fg_geodesy.h"
 #include "../Math/fg_random.h"
 #include "../Math/mat3.h"
@@ -51,7 +51,7 @@
 
 
 /* Temporary hack until we get the scenery management system running */
-extern GLint mesh_hack;
+extern GLint area_terrain;
 extern struct MESH eg;
 
 /* initialize the non-array mesh values */
@@ -72,7 +72,7 @@ void mesh_init(struct MESH *m) {
 
 
 /* return a pointer to a new mesh structure (no data array allocated yet) */
-struct MESH *(new_mesh)() {
+struct MESH *(new_mesh)( void ) {
     struct MESH *mesh_ptr;
 
     mesh_ptr = (struct MESH *)malloc(sizeof(struct MESH));
@@ -161,7 +161,7 @@ void mesh_set_option_value(struct MESH *m, char *value) {
 /* do whatever needs to be done with the mesh now that it's been
    loaded, such as generating the OpenGL call list. */
 void mesh_do_it(struct MESH *m) {
-    mesh_hack = mesh_to_OpenGL(m);
+    area_terrain = mesh_to_OpenGL(m);
 }
 
 
@@ -227,7 +227,7 @@ double mesh_altitude(double lon, double lat) {
        
        /* printf("  zA = %.2f  zB = %.2f\n", zA, zB); */
 
-       if ( dx > EPSILON ) {
+       if ( dx > FG_EPSILON ) {
            elev = dy * (zB - zA) / dx + zA;
        } else {
            elev = zA;
@@ -259,7 +259,7 @@ double mesh_altitude(double lon, double lat) {
        /* printf("  zA = %.2f  zB = %.2f\n", zA, zB );
        printf("  xB - xA = %.2f\n", eg.col_step * dy / eg.row_step); */
 
-       if ( dy > EPSILON ) {
+       if ( dy > FG_EPSILON ) {
            elev = dx * (zB - zA) / dy    + zA;
        } else {
            elev = zA;
@@ -274,7 +274,8 @@ double mesh_altitude(double lon, double lat) {
 GLint mesh_to_OpenGL(struct MESH *m) {
     GLint mesh;
     /* static GLfloat color[4] = { 0.5, 0.4, 0.25, 1.0 }; */ /* dark desert */
-    static GLfloat color[4] = { 0.5, 0.5, 0.25, 1.0 };
+    /* static GLfloat color[4] = { 0.5, 0.5, 0.25, 1.0 }; */
+    static GLfloat color[4] = { 1.0, 0.0, 0.0, 1.0 };
     double centerx, centery;
     double randx, randy;
 
@@ -395,9 +396,26 @@ GLint mesh_to_OpenGL(struct MESH *m) {
 
 
 /* $Log$
-/* Revision 1.21  1997/08/27 03:30:27  curt
-/* Changed naming scheme of basic shared structures.
+/* Revision 1.26  1998/01/19 18:40:36  curt
+/* Tons of little changes to clean up the code and to remove fatal errors
+/* when building with the c++ compiler.
 /*
+ * Revision 1.25  1998/01/07 03:31:27  curt
+ * Miscellaneous tweaks.
+ *
+ * Revision 1.24  1997/12/15 23:54:59  curt
+ * Add xgl wrappers for debugging.
+ * Generate terrain normals on the fly.
+ *
+ * Revision 1.23  1997/10/30 12:38:44  curt
+ * Working on new scenery subsystem.
+ *
+ * Revision 1.22  1997/10/28 21:00:21  curt
+ * Changing to new terrain format.
+ *
+ * Revision 1.21  1997/08/27 03:30:27  curt
+ * Changed naming scheme of basic shared structures.
+ *
  * Revision 1.20  1997/08/19 23:55:08  curt
  * Worked on better simulating real lighting.
  *