#include <GL/glut.h>
-#include "../constants.h"
-#include "../types.h"
-#include "../Math/fg_geodesy.h"
-#include "../Math/fg_random.h"
-#include "../Math/mat3.h"
-#include "../Math/polar.h"
+#include <Include/fg_constants.h>
+#include <Include/fg_types.h>
+#include <Math/fg_geodesy.h>
+#include <Math/fg_random.h>
+#include <Math/mat3.h>
+#include <Math/polar.h>
-#include "mesh.h"
-#include "common.h"
-#include "scenery.h"
+#include <Scenery/mesh.h>
+#include <Scenery/common.h>
+#include <Scenery/scenery.h>
/* Temporary hack until we get the scenery management system running */
-extern GLint mesh_hack;
-extern struct mesh eg;
+extern GLint area_terrain;
+extern struct MESH eg;
/* initialize the non-array mesh values */
-void mesh_init(struct mesh *m) {
+void mesh_init(struct MESH *m) {
m->originx = 0.0;
m->originy = 0.0;
/* return a pointer to a new mesh structure (no data array allocated yet) */
-struct mesh *(new_mesh)() {
- struct mesh *mesh_ptr;
+struct MESH *(new_mesh)( void ) {
+ struct MESH *mesh_ptr;
- mesh_ptr = (struct mesh *)malloc(sizeof(struct mesh));
+ mesh_ptr = (struct MESH *)malloc(sizeof(struct MESH));
if ( mesh_ptr == 0 ) {
printf("Virtual memory exceeded\n");
/* set the option name in the mesh data structure */
-void mesh_set_option_name(struct mesh *m, char *name) {
+void mesh_set_option_name(struct MESH *m, char *name) {
if ( strlen(name) < MAX_IDENT_LEN ) {
strcpy(m->option_name, name);
} else {
/* set an option value in the mesh data structure */
-void mesh_set_option_value(struct mesh *m, char *value) {
+void mesh_set_option_value(struct MESH *m, char *value) {
/* printf("Setting %s to %s\n", m->option_name, value); */
if ( m->do_data ) {
/* 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);
+void mesh_do_it(struct MESH *m) {
+ area_terrain = mesh_to_OpenGL(m);
}
/* printf(" zA = %.2f zB = %.2f\n", zA, zB); */
- if ( dx > EPSILON ) {
+ if ( dx > FG_EPSILON ) {
elev = dy * (zB - zA) / dx + zA;
} else {
elev = zA;
/* 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;
/* walk through mesh and make opengl calls */
-GLint mesh_to_OpenGL(struct mesh *m) {
+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;
mesh = glGenLists(1);
glNewList(mesh, GL_COMPILE);
- glMaterialfv( GL_FRONT, GL_AMBIENT_AND_DIFFUSE, color );
+ /* glMaterialfv( GL_FRONT, GL_AMBIENT_AND_DIFFUSE, color ); */
+ glColor3fv(color);
iend = m->cols - 1;
jend = m->rows - 1;
/* $Log$
-/* Revision 1.19 1997/08/06 00:24:28 curt
-/* Working on correct real time sun lighting.
+/* Revision 1.28 1998/01/27 00:48:02 curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
/*
+ * Revision 1.27 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.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.
+ *
+ * Revision 1.19 1997/08/06 00:24:28 curt
+ * Working on correct real time sun lighting.
+ *
* Revision 1.18 1997/08/02 19:10:14 curt
* Incorporated mesh2GL.c into mesh.c
*