From 6ef9ecdda03f66612ce10124572d02fdb9317595 Mon Sep 17 00:00:00 2001 From: curt Date: Fri, 6 Nov 1998 21:17:31 +0000 Subject: [PATCH] Converted to new logstream debugging facility. This allows release builds with no messages at all (and no performance impact) by using the -DFG_NDEBUG flag. --- Astro/celestialBody.cxx | 6 +++--- Astro/moon.cxx | 17 +++++++++-------- Astro/moon.hxx | 1 - Astro/sky.cxx | 15 ++++++++++----- Astro/solarsystem.cxx | 5 +++-- Astro/stars.cxx | 27 +++++++++++++++++---------- 6 files changed, 42 insertions(+), 29 deletions(-) diff --git a/Astro/celestialBody.cxx b/Astro/celestialBody.cxx index ede620fe..baa0646c 100644 --- a/Astro/celestialBody.cxx +++ b/Astro/celestialBody.cxx @@ -25,7 +25,7 @@ #include "celestialBody.hxx" #include "star.hxx" -#include +#include /************************************************************************** * void CelestialBody::updatePosition(fgTIME *t, Star *ourSun) @@ -78,8 +78,8 @@ void CelestialBody::updatePosition(fgTIME *t, Star *ourSun) ze = yg * sin(ecl) + zg * cos(ecl); rightAscension = atan2(ye, xe); declination = atan2(ze, sqrt(xe*xe + ye*ye)); - fgPrintf(FG_GENERAL, FG_INFO, "Planet found at : %f (ra), %f (dec)\n", - rightAscension, declination); + FG_LOG(FG_GENERAL, FG_INFO, "Planet found at : " + << rightAscension << " (ra), " << declination << " (dec)" ); //calculate some variables specific to calculating the magnitude //of the planet diff --git a/Astro/moon.cxx b/Astro/moon.cxx index bc7425ce..445774cd 100644 --- a/Astro/moon.cxx +++ b/Astro/moon.cxx @@ -26,7 +26,7 @@ #include #include "moon.hxx" -#include +#include #include static GLuint moon_texid; @@ -51,7 +51,7 @@ Moon::Moon(fgTIME *t) : string tpath, fg_tpath; int width, height; - fgPrintf( FG_GENERAL, FG_INFO, "Initializing Moon Texture\n"); + FG_LOG( FG_GENERAL, FG_INFO, "Initializing Moon Texture"); #ifdef GL_VERSION_1_1 xglGenTextures(1, &moon_texid); xglBindTexture(GL_TEXTURE_2D, moon_texid); @@ -77,9 +77,9 @@ Moon::Moon(fgTIME *t) : if ( (moon_texbuf = read_rgb_texture(fg_tpath.c_str(), &width, &height)) == NULL ) { - fgPrintf( FG_GENERAL, FG_EXIT, - "Error in loading moon texture %s\n", tpath.c_str() ); - exit(1); + FG_LOG( FG_GENERAL, FG_ALERT, + "Error in loading moon texture " << tpath ); + exit(-1); } } @@ -162,7 +162,7 @@ void Moon::updatePosition(fgTIME *t, Star *ourSun) r += (-0.58 * cos(M - 2*D) -0.46 * cos(2*D) ); - fgPrintf(FG_GENERAL, FG_INFO, "Running moon update\n"); + FG_LOG(FG_GENERAL, FG_INFO, "Running moon update"); xg = r * cos(lonecl) * cos(latecl); yg = r * sin(lonecl) * cos(latecl); zg = r * sin(latecl); @@ -213,8 +213,9 @@ void Moon::newImage(float ra, float dec) xglRotatef(((RAD_TO_DEG * ra)- 90.0), 0.0, 0.0, 1.0); xglRotatef((RAD_TO_DEG * dec), 1.0, 0.0, 0.0); - fgPrintf( FG_GENERAL, FG_INFO, - "Ra = (%f), Dec= (%f)", (RAD_TO_DEG *ra), (RAD_TO_DEG *dec) ); + FG_LOG( FG_GENERAL, FG_INFO, + "Ra = (" << (RAD_TO_DEG *ra) + << "), Dec= (" << (RAD_TO_DEG *dec) << ")" ); xglTranslatef(0.0, 58600.0, 0.0); Object = gluNewQuadric(); gluQuadricTexture( Object, GL_TRUE ); diff --git a/Astro/moon.hxx b/Astro/moon.hxx index 677dcfca..ac1fb2f2 100644 --- a/Astro/moon.hxx +++ b/Astro/moon.hxx @@ -26,7 +26,6 @@ #define _MOON_HXX_ #include -#include #include #include #include
diff --git a/Astro/sky.cxx b/Astro/sky.cxx index 83001c85..f2c8c58c 100644 --- a/Astro/sky.cxx +++ b/Astro/sky.cxx @@ -36,7 +36,7 @@ #include #include -#include +#include #include #include #include
@@ -78,7 +78,7 @@ void fgSkyVerticesInit( void ) { float theta; int i; - fgPrintf(FG_ASTRO, FG_INFO, " Generating the sky dome vertices.\n"); + FG_LOG(FG_ASTRO, FG_INFO, " Generating the sky dome vertices."); for ( i = 0; i < 12; i++ ) { theta = (i * 30.0) * DEG_TO_RAD; @@ -115,8 +115,8 @@ void fgSkyColorsInit( void ) { l = &cur_light_params; - fgPrintf( FG_ASTRO, FG_INFO, - " Generating the sky colors for each vertex.\n" ); + FG_LOG( FG_ASTRO, FG_INFO, + " Generating the sky colors for each vertex." ); // setup for the possibility of sunset effects sun_angle = l->sun_angle * RAD_TO_DEG; @@ -243,7 +243,7 @@ void fgSkyColorsInit( void ) { // Initialize the sky structure and colors void fgSkyInit( void ) { - fgPrintf(FG_ASTRO, FG_INFO, "Initializing the sky\n"); + FG_LOG( FG_ASTRO, FG_INFO, "Initializing the sky" ); fgSkyVerticesInit(); @@ -365,6 +365,11 @@ void fgSkyRender( void ) { // $Log$ +// Revision 1.14 1998/11/06 21:17:39 curt +// Converted to new logstream debugging facility. This allows release +// builds with no messages at all (and no performance impact) by using +// the -DFG_NDEBUG flag. +// // Revision 1.13 1998/10/20 18:28:30 curt // Tweaked sunset/sunrise colors. // diff --git a/Astro/solarsystem.cxx b/Astro/solarsystem.cxx index c059cf3a..c3995f48 100644 --- a/Astro/solarsystem.cxx +++ b/Astro/solarsystem.cxx @@ -33,7 +33,7 @@ #include #include -#include +#include #include