From f6f21702ced4888d04018f6ab4edc74125e16ff9 Mon Sep 17 00:00:00 2001 From: curt Date: Fri, 24 Jul 1998 21:39:08 +0000 Subject: [PATCH] Debugging output tweaks. Cast glGetString to (char *) to avoid compiler errors. Optimizations to fgGluLookAt() by Norman Vine. --- Main/GLUTmain.cxx | 11 ++++++++--- Main/airports.hxx | 10 ++++++++-- Main/fg_init.cxx | 11 ++++++++--- Main/views.cxx | 22 +++++++++++++++++----- 4 files changed, 41 insertions(+), 13 deletions(-) diff --git a/Main/GLUTmain.cxx b/Main/GLUTmain.cxx index ee61bb56b..a840efd7a 100644 --- a/Main/GLUTmain.cxx +++ b/Main/GLUTmain.cxx @@ -243,7 +243,7 @@ static void fgUpdateViewParams( void ) { } -#ifdef 0 +#ifdef IS_THIS_BETTER_THAN_A_ZERO_CHARLIE // Draw a basic instrument panel static void fgUpdateInstrViewParams( void ) { @@ -502,9 +502,9 @@ void fgUpdateTimeDepCalcs(int multi_loop) { while ( tmp > FG_2PI ) { tmp -= FG_2PI; } - printf("Psi = %.2f, viewoffset = %.2f sunrot = %.2f rottosun = %.2f\n", + /* printf("Psi = %.2f, viewoffset = %.2f sunrot = %.2f rottosun = %.2f\n", FG_Psi * RAD_TO_DEG, v->view_offset * RAD_TO_DEG, - -(l->sun_rotation+FG_PI) * RAD_TO_DEG, tmp * RAD_TO_DEG); + -(l->sun_rotation+FG_PI) * RAD_TO_DEG, tmp * RAD_TO_DEG); */ l->UpdateAdjFog(); } @@ -924,6 +924,11 @@ int main( int argc, char **argv ) { // $Log$ +// Revision 1.39 1998/07/24 21:39:08 curt +// Debugging output tweaks. +// Cast glGetString to (char *) to avoid compiler errors. +// Optimizations to fgGluLookAt() by Norman Vine. +// // Revision 1.38 1998/07/22 21:40:43 curt // Clear to adjusted fog color (for sunrise/sunset effects) // Make call to fog sunrise/sunset adjustment method. diff --git a/Main/airports.hxx b/Main/airports.hxx index f34ed6221..fb854e08a 100644 --- a/Main/airports.hxx +++ b/Main/airports.hxx @@ -34,8 +34,9 @@ #endif -#include // Standard C++ string library -#include // STL associative "array" +#include // Standard C++ string library +#include // STL associative "array" + #ifdef NEEDNAMESPACESTD using namespace std; #endif @@ -73,6 +74,11 @@ public: // $Log$ +// Revision 1.7 1998/07/24 21:39:09 curt +// Debugging output tweaks. +// Cast glGetString to (char *) to avoid compiler errors. +// Optimizations to fgGluLookAt() by Norman Vine. +// // Revision 1.6 1998/07/06 21:34:19 curt // Added an enable/disable splash screen option. // Added an enable/disable intro music option. diff --git a/Main/fg_init.cxx b/Main/fg_init.cxx index 3576a0b1c..88689046d 100644 --- a/Main/fg_init.cxx +++ b/Main/fg_init.cxx @@ -186,9 +186,9 @@ int fgInitGeneral( void ) { fgPrintf( FG_GENERAL, FG_INFO, "General Initialization\n" ); fgPrintf( FG_GENERAL, FG_INFO, "======= ==============\n" ); - g->glVendor = glGetString ( GL_VENDOR ); - g->glRenderer = glGetString ( GL_RENDERER ); - g->glVersion = glGetString ( GL_VERSION ); + g->glVendor = (char *)glGetString ( GL_VENDOR ); + g->glRenderer = (char *)glGetString ( GL_RENDERER ); + g->glVersion = (char *)glGetString ( GL_VERSION ); current_options.get_fg_root(root); if ( !strlen(root) ) { @@ -401,6 +401,11 @@ int fgInitSubsystems( void ) { // $Log$ +// Revision 1.27 1998/07/24 21:39:10 curt +// Debugging output tweaks. +// Cast glGetString to (char *) to avoid compiler errors. +// Optimizations to fgGluLookAt() by Norman Vine. +// // Revision 1.26 1998/07/22 21:40:44 curt // Clear to adjusted fog color (for sunrise/sunset effects) // Make call to fog sunrise/sunset adjustment method. diff --git a/Main/views.cxx b/Main/views.cxx index bd9c4b99c..7fc96f1c5 100644 --- a/Main/views.cxx +++ b/Main/views.cxx @@ -447,15 +447,22 @@ void fg_gluLookAt( GLdouble eyex, GLdouble eyey, GLdouble eyez, M(0,0) = x[0]; M(0,1) = x[1]; M(0,2) = x[2]; M(0,3) = 0.0; M(1,0) = y[0]; M(1,1) = y[1]; M(1,2) = y[2]; M(1,3) = 0.0; M(2,0) = z[0]; M(2,1) = z[1]; M(2,2) = z[2]; M(2,3) = 0.0; - M(3,0) = 0.0; M(3,1) = 0.0; M(3,2) = 0.0; M(3,3) = 1.0; + // the following is part of the original gluLookAt(), but we are + // commenting it out because we know we are going to be doing a + // translation below which will set these values anyways + // M(3,0) = 0.0; M(3,1) = 0.0; M(3,2) = 0.0; M(3,3) = 1.0; #undef M // Translate Eye to Origin // replaces: glTranslated( -eyex, -eyey, -eyez ); - m[12] = m[0] * -eyex + m[4] * -eyey + m[8] * -eyez + m[12]; - m[13] = m[1] * -eyex + m[5] * -eyey + m[9] * -eyez + m[13]; - m[14] = m[2] * -eyex + m[6] * -eyey + m[10] * -eyez + m[14]; - m[15] = m[3] * -eyex + m[7] * -eyey + m[11] * -eyez + m[15]; + + // this has been slightly modified from the original glTranslate() + // code because we know that coming into this m[12] = m[13] = + // m[14] = 0.0, and m[15] = 1.0; + m[12] = m[0] * -eyex + m[4] * -eyey + m[8] * -eyez /* + m[12] */; + m[13] = m[1] * -eyex + m[5] * -eyey + m[9] * -eyez /* + m[13] */; + m[14] = m[2] * -eyex + m[6] * -eyey + m[10] * -eyez /* + m[14] */; + m[15] = 1.0 /* m[3] * -eyex + m[7] * -eyey + m[11] * -eyez + m[15] */; // xglMultMatrixd( m ); xglLoadMatrixd( m ); @@ -463,6 +470,11 @@ void fg_gluLookAt( GLdouble eyex, GLdouble eyey, GLdouble eyez, // $Log$ +// Revision 1.17 1998/07/24 21:39:12 curt +// Debugging output tweaks. +// Cast glGetString to (char *) to avoid compiler errors. +// Optimizations to fgGluLookAt() by Norman Vine. +// // Revision 1.16 1998/07/13 21:01:41 curt // Wrote access functions for current fgOPTIONS. // -- 2.39.2