#include "celestialBody.hxx"
#include "star.hxx"
-#include <Debug/fg_debug.h>
+#include <Debug/logstream.hxx>
/**************************************************************************
* 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
#include <string.h>
#include "moon.hxx"
-#include <Debug/fg_debug.h>
+#include <Debug/logstream.hxx>
#include <Objects/texload.h>
static GLuint moon_texid;
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);
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);
}
}
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);
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 );
#define _MOON_HXX_
#include <Aircraft/aircraft.hxx>
-#include <Debug/fg_debug.h>
#include <Include/fg_constants.h>
#include <Include/general.h>
#include <Main/views.hxx>
#include <XGL/xgl.h>
#include <Aircraft/aircraft.hxx>
-#include <Debug/fg_debug.h>
+#include <Debug/logstream.hxx>
#include <Flight/flight.hxx>
#include <Include/fg_constants.h>
#include <Main/views.hxx>
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;
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;
// 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();
// $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.
//
#include <GL/glut.h>
#include <XGL/xgl.h>
-#include <Debug/fg_debug.h>
+#include <Debug/logstream.hxx>
#include <Time/sunpos.hxx>
#include "solarsystem.hxx"
{
if (theSolarSystem)
{
- fgPrintf(FG_GENERAL, FG_EXIT, "Error: only one solarsystem allowed\n");
+ FG_LOG( FG_GENERAL, FG_ALERT, "Error: only one solarsystem allowed" );
+ exit(-1);
}
theSolarSystem = this;
ourSun = new Star(t);
#include <XGL/xgl.h>
#include <Aircraft/aircraft.hxx>
-#include <Debug/fg_debug.h>
+#include <Debug/logstream.hxx>
#include <Include/fg_constants.h>
#include <Misc/fgstream.hxx>
#include <Main/options.hxx>
// double ra_save1, decl_save1;
int i, j, starcount, count;
- fgPrintf( FG_ASTRO, FG_INFO, "Initializing stars\n");
+ FG_LOG( FG_ASTRO, FG_INFO, "Initializing stars" );
if ( FG_STAR_LEVELS < 4 ) {
- fgPrintf( FG_ASTRO, FG_EXIT, "Big whups in stars.cxx\n");
+ FG_LOG( FG_ASTRO, FG_ALERT, "Big whups in stars.cxx" );
+ exit(-1);
}
// build the full path name to the stars data base file
string path = current_options.get_fg_root() + "/Astro/stars" + ".gz";
- fgPrintf( FG_ASTRO, FG_INFO, " Loading stars from %s\n", path.c_str() );
+ FG_LOG( FG_ASTRO, FG_INFO, " Loading stars from " << path );
fg_gzifstream in( path );
- if ( ! in )
- fgPrintf( FG_ASTRO, FG_EXIT,
- "Cannot open star file: '%s'\n", path.c_str() );
+ if ( ! in ) {
+ FG_LOG( FG_ASTRO, FG_ALERT, "Cannot open star file: " << path );
+ exit(-1);
+ }
starcount = 0;
xglEndList();
- fgPrintf( FG_ASTRO, FG_INFO,
- " Loading %d stars brighter than %.2f\n",
- count, min_magnitude[i]);
+ FG_LOG( FG_ASTRO, FG_INFO,
+ " Loading " << count << " stars brighter than "
+ << min_magnitude[i] );
}
return 1; // OK, we got here because initialization worked.
// $Log$
+// Revision 1.21 1998/11/06 21:17:42 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.20 1998/11/06 14:47:02 curt
// Changes to track Bernie's updates to fgstream.
//