Converted to c++ style comments.
This commit is contained in:
parent
aa60beb13d
commit
cc0d582e26
2 changed files with 367 additions and 366 deletions
558
Astro/stars.cxx
558
Astro/stars.cxx
|
@ -1,27 +1,26 @@
|
||||||
/**************************************************************************
|
// stars.cxx -- data structures and routines for managing and rendering stars.
|
||||||
* stars.c -- data structures and routines for managing and rendering stars.
|
//
|
||||||
*
|
// Written by Curtis Olson, started August 1997.
|
||||||
* Written by Curtis Olson, started August 1997.
|
//
|
||||||
*
|
// Copyright (C) 1997 Curtis L. Olson - curt@me.umn.edu
|
||||||
* Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
|
//
|
||||||
*
|
// This program is free software; you can redistribute it and/or
|
||||||
* This program is free software; you can redistribute it and/or
|
// modify it under the terms of the GNU General Public License as
|
||||||
* modify it under the terms of the GNU General Public License as
|
// published by the Free Software Foundation; either version 2 of the
|
||||||
* published by the Free Software Foundation; either version 2 of the
|
// License, or (at your option) any later version.
|
||||||
* License, or (at your option) any later version.
|
//
|
||||||
*
|
// This program is distributed in the hope that it will be useful, but
|
||||||
* This program is distributed in the hope that it will be useful, but
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
// General Public License for more details.
|
||||||
* General Public License for more details.
|
//
|
||||||
*
|
// You should have received a copy of the GNU General Public License
|
||||||
* You should have received a copy of the GNU General Public License
|
// along with this program; if not, write to the Free Software
|
||||||
* along with this program; if not, write to the Free Software
|
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
//
|
||||||
*
|
// $Id$
|
||||||
* $Id$
|
// (Log is kept at end of this file)
|
||||||
* (Log is kept at end of this file)
|
//*************************************************************************/
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
|
@ -45,14 +44,12 @@
|
||||||
#include <Debug/fg_debug.h>
|
#include <Debug/fg_debug.h>
|
||||||
#include <Include/fg_constants.h>
|
#include <Include/fg_constants.h>
|
||||||
#include <Include/fg_types.h>
|
#include <Include/fg_types.h>
|
||||||
#include "Misc/fgstream.hxx"
|
#include <Misc/fgstream.hxx>
|
||||||
#include <Main/options.hxx>
|
#include <Main/options.hxx>
|
||||||
#include <Main/views.hxx>
|
#include <Main/views.hxx>
|
||||||
#include <Misc/stopwatch.hxx>
|
#include <Misc/stopwatch.hxx>
|
||||||
#include <Time/fg_time.hxx>
|
#include <Time/fg_time.hxx>
|
||||||
|
|
||||||
// #include "orbits.hxx"
|
|
||||||
// #include "planets.hxx"
|
|
||||||
#include "stars.hxx"
|
#include "stars.hxx"
|
||||||
|
|
||||||
|
|
||||||
|
@ -60,18 +57,18 @@
|
||||||
#define DaysSinceEpoch(secs) (((secs)-EpochStart)*(1.0/(24*3600)))
|
#define DaysSinceEpoch(secs) (((secs)-EpochStart)*(1.0/(24*3600)))
|
||||||
#define FG_MAX_STARS 3500
|
#define FG_MAX_STARS 3500
|
||||||
|
|
||||||
/* Define four structures, each with varying amounts of stars */
|
// Define four structures, each with varying amounts of stars
|
||||||
static GLint stars[FG_STAR_LEVELS];
|
static GLint stars[FG_STAR_LEVELS];
|
||||||
|
|
||||||
|
|
||||||
/* Initialize the Star Management Subsystem */
|
// Initialize the Star Management Subsystem
|
||||||
int fgStarsInit( void ) {
|
int fgStarsInit( void ) {
|
||||||
fgPoint3d starlist[FG_MAX_STARS];
|
fgPoint3d starlist[FG_MAX_STARS];
|
||||||
/* struct CelestialCoord pltPos; */
|
// struct CelestialCoord pltPos;
|
||||||
double right_ascension, declination, magnitude;
|
double right_ascension, declination, magnitude;
|
||||||
double min_magnitude[FG_STAR_LEVELS];
|
double min_magnitude[FG_STAR_LEVELS];
|
||||||
/* double ra_save, decl_save; */
|
// double ra_save, decl_save;
|
||||||
/* double ra_save1, decl_save1; */
|
// double ra_save1, decl_save1;
|
||||||
int i, j, starcount, count;
|
int i, j, starcount, count;
|
||||||
|
|
||||||
fgPrintf( FG_ASTRO, FG_INFO, "Initializing stars\n");
|
fgPrintf( FG_ASTRO, FG_INFO, "Initializing stars\n");
|
||||||
|
@ -104,8 +101,8 @@ int fgStarsInit( void ) {
|
||||||
getline( in.stream(), name, ',' );
|
getline( in.stream(), name, ',' );
|
||||||
in.stream() >> starlist[starcount].x >> c;
|
in.stream() >> starlist[starcount].x >> c;
|
||||||
in.stream() >> starlist[starcount].y >> c;
|
in.stream() >> starlist[starcount].y >> c;
|
||||||
// in.stream() >> starlist[starcount].x; in.get(c);
|
// in.stream() >> starlist[starcount].x; in.get(c);
|
||||||
// in.stream() >> starlist[starcount].y; in.get(c);
|
// in.stream() >> starlist[starcount].y; in.get(c);
|
||||||
in.stream() >> starlist[starcount].z;
|
in.stream() >> starlist[starcount].z;
|
||||||
++starcount;
|
++starcount;
|
||||||
}
|
}
|
||||||
|
@ -142,27 +139,27 @@ int fgStarsInit( void ) {
|
||||||
|
|
||||||
count++;
|
count++;
|
||||||
|
|
||||||
/* scale magnitudes to (0.0 - 1.0) */
|
// scale magnitudes to (0.0 - 1.0)
|
||||||
magnitude = (0.0 - magnitude) / 5.0 + 1.0;
|
magnitude = (0.0 - magnitude) / 5.0 + 1.0;
|
||||||
|
|
||||||
/* scale magnitudes again so they look ok */
|
// scale magnitudes again so they look ok
|
||||||
if ( magnitude > 1.0 ) { magnitude = 1.0; }
|
if ( magnitude > 1.0 ) { magnitude = 1.0; }
|
||||||
if ( magnitude < 0.0 ) { magnitude = 0.0; }
|
if ( magnitude < 0.0 ) { magnitude = 0.0; }
|
||||||
/* magnitude =
|
// magnitude =
|
||||||
magnitude * 0.7 + (((FG_STAR_LEVELS - 1) - i) * 0.042);
|
// magnitude * 0.7 + (((FG_STAR_LEVELS - 1) - i) * 0.042);
|
||||||
*/
|
|
||||||
magnitude = magnitude * 0.9 +
|
magnitude = magnitude * 0.9 +
|
||||||
(((FG_STAR_LEVELS - 1) - i) * 0.014);
|
(((FG_STAR_LEVELS - 1) - i) * 0.014);
|
||||||
/* printf(" Found star: %d %s, %.3f %.3f %.3f\n", count,
|
// printf(" Found star: %d %s, %.3f %.3f %.3f\n", count,
|
||||||
name, right_ascension, declination, magnitude); */
|
// name, right_ascension, declination, magnitude);
|
||||||
|
|
||||||
xglColor3f( magnitude, magnitude, magnitude );
|
xglColor3f( magnitude, magnitude, magnitude );
|
||||||
/*xglColor3f(0,0,0);*/
|
//xglColor3f(0,0,0);*/
|
||||||
xglVertex3f( 50000.0*cos(right_ascension)*cos(declination),
|
xglVertex3f( 50000.0*cos(right_ascension)*cos(declination),
|
||||||
50000.0*sin(right_ascension)*cos(declination),
|
50000.0*sin(right_ascension)*cos(declination),
|
||||||
50000.0*sin(declination) );
|
50000.0*sin(declination) );
|
||||||
}
|
}
|
||||||
} /* while */
|
} // while
|
||||||
|
|
||||||
xglEnd();
|
xglEnd();
|
||||||
|
|
||||||
|
@ -213,7 +210,7 @@ int fgStarsInit( void ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Draw the Stars */
|
// Draw the Stars
|
||||||
void fgStarsRender( void ) {
|
void fgStarsRender( void ) {
|
||||||
fgFLIGHT *f;
|
fgFLIGHT *f;
|
||||||
fgVIEW *v;
|
fgVIEW *v;
|
||||||
|
@ -226,13 +223,13 @@ void fgStarsRender( void ) {
|
||||||
t = &cur_time_params;
|
t = &cur_time_params;
|
||||||
v = ¤t_view;
|
v = ¤t_view;
|
||||||
|
|
||||||
/* FG_PI_2 + 0.1 is about 6 degrees after sundown and before sunrise */
|
// FG_PI_2 + 0.1 is about 6 degrees after sundown and before sunrise
|
||||||
|
|
||||||
/* t->sun_angle = 3.0; */ /* to force stars to be drawn (for testing) */
|
// t->sun_angle = 3.0; // to force stars to be drawn (for testing)
|
||||||
|
|
||||||
/* render the stars */
|
// render the stars
|
||||||
if ( l->sun_angle > (FG_PI_2 + 5 * DEG_TO_RAD ) ) {
|
if ( l->sun_angle > (FG_PI_2 + 5 * DEG_TO_RAD ) ) {
|
||||||
/* determine which star structure to draw */
|
// determine which star structure to draw
|
||||||
if ( l->sun_angle > (FG_PI_2 + 10.0 * DEG_TO_RAD ) ) {
|
if ( l->sun_angle > (FG_PI_2 + 10.0 * DEG_TO_RAD ) ) {
|
||||||
i = 0;
|
i = 0;
|
||||||
} else if ( l->sun_angle > (FG_PI_2 + 8.8 * DEG_TO_RAD ) ) {
|
} else if ( l->sun_angle > (FG_PI_2 + 8.8 * DEG_TO_RAD ) ) {
|
||||||
|
@ -251,241 +248,244 @@ void fgStarsRender( void ) {
|
||||||
i = 7;
|
i = 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* printf("RENDERING STARS = %d (night)\n", i); */
|
// printf("RENDERING STARS = %d (night)\n", i);
|
||||||
|
|
||||||
xglCallList(stars[i]);
|
xglCallList(stars[i]);
|
||||||
} else {
|
} else {
|
||||||
/* printf("not RENDERING STARS (day)\n"); */
|
// printf("not RENDERING STARS (day)\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
// $Log$
|
||||||
/* Revision 1.16 1998/09/24 15:25:24 curt
|
// Revision 1.17 1998/09/24 15:36:19 curt
|
||||||
/* Miscellaneous tweaks.
|
// Converted to c++ style comments.
|
||||||
/*
|
//
|
||||||
*
|
// Revision 1.16 1998/09/24 15:25:24 curt
|
||||||
* Revision 1.15 1998/09/17 18:25:12 curt
|
// Miscellaneous tweaks.
|
||||||
* Fixed output message.
|
//
|
||||||
*
|
//
|
||||||
* Revision 1.14 1998/09/15 04:26:22 curt
|
// Revision 1.15 1998/09/17 18:25:12 curt
|
||||||
* New textured moon and rewritten/restructured Astro code contributed by Durk
|
// Fixed output message.
|
||||||
* Talsma.
|
//
|
||||||
*
|
// Revision 1.14 1998/09/15 04:26:22 curt
|
||||||
* Revision 1.13 1998/09/01 19:03:04 curt
|
// New textured moon and rewritten/restructured Astro code contributed by Durk
|
||||||
* Changes contributed by Bernie Bright <bbright@c031.aone.net.au>
|
// Talsma.
|
||||||
* - The new classes in libmisc.tgz define a stream interface into zlib.
|
//
|
||||||
* I've put these in a new directory, Lib/Misc. Feel free to rename it
|
// Revision 1.13 1998/09/01 19:03:04 curt
|
||||||
* to something more appropriate. However you'll have to change the
|
// Changes contributed by Bernie Bright <bbright@c031.aone.net.au>
|
||||||
* include directives in all the other files. Additionally you'll have
|
// - The new classes in libmisc.tgz define a stream interface into zlib.
|
||||||
* add the library to Lib/Makefile.am and Simulator/Main/Makefile.am.
|
// I've put these in a new directory, Lib/Misc. Feel free to rename it
|
||||||
*
|
// to something more appropriate. However you'll have to change the
|
||||||
* The StopWatch class in Lib/Misc requires a HAVE_GETRUSAGE autoconf
|
// include directives in all the other files. Additionally you'll have
|
||||||
* test so I've included the required changes in config.tgz.
|
// add the library to Lib/Makefile.am and Simulator/Main/Makefile.am.
|
||||||
*
|
//
|
||||||
* There are a fair few changes to Simulator/Objects as I've moved
|
// The StopWatch class in Lib/Misc requires a HAVE_GETRUSAGE autoconf
|
||||||
* things around. Loading tiles is quicker but thats not where the delay
|
// test so I've included the required changes in config.tgz.
|
||||||
* is. Tile loading takes a few tenths of a second per file on a P200
|
//
|
||||||
* but it seems to be the post-processing that leads to a noticeable
|
// There are a fair few changes to Simulator/Objects as I've moved
|
||||||
* blip in framerate. I suppose its time to start profiling to see where
|
// things around. Loading tiles is quicker but thats not where the delay
|
||||||
* the delays are.
|
// is. Tile loading takes a few tenths of a second per file on a P200
|
||||||
*
|
// but it seems to be the post-processing that leads to a noticeable
|
||||||
* I've included a brief description of each archives contents.
|
// blip in framerate. I suppose its time to start profiling to see where
|
||||||
*
|
// the delays are.
|
||||||
* Lib/Misc/
|
//
|
||||||
* zfstream.cxx
|
// I've included a brief description of each archives contents.
|
||||||
* zfstream.hxx
|
//
|
||||||
* C++ stream interface into zlib.
|
// Lib/Misc/
|
||||||
* Taken from zlib-1.1.3/contrib/iostream/.
|
// zfstream.cxx
|
||||||
* Minor mods for STL compatibility.
|
// zfstream.hxx
|
||||||
* There's no copyright associated with these so I assume they're
|
// C++ stream interface into zlib.
|
||||||
* covered by zlib's.
|
// Taken from zlib-1.1.3/contrib/iostream/.
|
||||||
*
|
// Minor mods for STL compatibility.
|
||||||
* fgstream.cxx
|
// There's no copyright associated with these so I assume they're
|
||||||
* fgstream.hxx
|
// covered by zlib's.
|
||||||
* FlightGear input stream using gz_ifstream. Tries to open the
|
//
|
||||||
* given filename. If that fails then filename is examined and a
|
// fgstream.cxx
|
||||||
* ".gz" suffix is removed or appended and that file is opened.
|
// fgstream.hxx
|
||||||
*
|
// FlightGear input stream using gz_ifstream. Tries to open the
|
||||||
* stopwatch.hxx
|
// given filename. If that fails then filename is examined and a
|
||||||
* A simple timer for benchmarking. Not used in production code.
|
// ".gz" suffix is removed or appended and that file is opened.
|
||||||
* Taken from the Blitz++ project. Covered by GPL.
|
//
|
||||||
*
|
// stopwatch.hxx
|
||||||
* strutils.cxx
|
// A simple timer for benchmarking. Not used in production code.
|
||||||
* strutils.hxx
|
// Taken from the Blitz++ project. Covered by GPL.
|
||||||
* Some simple string manipulation routines.
|
//
|
||||||
*
|
// strutils.cxx
|
||||||
* Simulator/Airports/
|
// strutils.hxx
|
||||||
* Load airports database using fgstream.
|
// Some simple string manipulation routines.
|
||||||
* Changed fgAIRPORTS to use set<> instead of map<>.
|
//
|
||||||
* Added bool fgAIRPORTS::search() as a neater way doing the lookup.
|
// Simulator/Airports/
|
||||||
* Returns true if found.
|
// Load airports database using fgstream.
|
||||||
*
|
// Changed fgAIRPORTS to use set<> instead of map<>.
|
||||||
* Simulator/Astro/
|
// Added bool fgAIRPORTS::search() as a neater way doing the lookup.
|
||||||
* Modified fgStarsInit() to load stars database using fgstream.
|
// Returns true if found.
|
||||||
*
|
//
|
||||||
* Simulator/Objects/
|
// Simulator/Astro/
|
||||||
* Modified fgObjLoad() to use fgstream.
|
// Modified fgStarsInit() to load stars database using fgstream.
|
||||||
* Modified fgMATERIAL_MGR::load_lib() to use fgstream.
|
//
|
||||||
* Many changes to fgMATERIAL.
|
// Simulator/Objects/
|
||||||
* Some changes to fgFRAGMENT but I forget what!
|
// Modified fgObjLoad() to use fgstream.
|
||||||
*
|
// Modified fgMATERIAL_MGR::load_lib() to use fgstream.
|
||||||
* Revision 1.12 1998/08/27 17:02:01 curt
|
// Many changes to fgMATERIAL.
|
||||||
* Contributions from Bernie Bright <bbright@c031.aone.net.au>
|
// Some changes to fgFRAGMENT but I forget what!
|
||||||
* - use strings for fg_root and airport_id and added methods to return
|
//
|
||||||
* them as strings,
|
// Revision 1.12 1998/08/27 17:02:01 curt
|
||||||
* - inlined all access methods,
|
// Contributions from Bernie Bright <bbright@c031.aone.net.au>
|
||||||
* - made the parsing functions private methods,
|
// - use strings for fg_root and airport_id and added methods to return
|
||||||
* - deleted some unused functions.
|
// them as strings,
|
||||||
* - propogated some of these changes out a bit further.
|
// - inlined all access methods,
|
||||||
*
|
// - made the parsing functions private methods,
|
||||||
* Revision 1.11 1998/08/25 20:53:29 curt
|
// - deleted some unused functions.
|
||||||
* Shuffled $FG_ROOT file layout.
|
// - propogated some of these changes out a bit further.
|
||||||
*
|
//
|
||||||
* Revision 1.10 1998/08/10 20:33:09 curt
|
// Revision 1.11 1998/08/25 20:53:29 curt
|
||||||
* Rewrote star loading and rendering to:
|
// Shuffled $FG_ROOT file layout.
|
||||||
* 1. significantly improve load speed
|
//
|
||||||
* 2. transition from no stars to stars through eight stages.
|
// Revision 1.10 1998/08/10 20:33:09 curt
|
||||||
*
|
// Rewrote star loading and rendering to:
|
||||||
* Revision 1.9 1998/08/06 12:45:20 curt
|
// 1. significantly improve load speed
|
||||||
* Modified to bring in stars in 8 increments based on magnitude, not number
|
// 2. transition from no stars to stars through eight stages.
|
||||||
* of stars.
|
//
|
||||||
*
|
// Revision 1.9 1998/08/06 12:45:20 curt
|
||||||
* Revision 1.8 1998/07/13 21:00:10 curt
|
// Modified to bring in stars in 8 increments based on magnitude, not number
|
||||||
* Wrote access functions for current fgOPTIONS.
|
// of stars.
|
||||||
*
|
//
|
||||||
* Revision 1.7 1998/05/29 20:35:42 curt
|
// Revision 1.8 1998/07/13 21:00:10 curt
|
||||||
* Added zlib support for reading in compressed data files.
|
// Wrote access functions for current fgOPTIONS.
|
||||||
*
|
//
|
||||||
* Revision 1.6 1998/05/13 18:25:35 curt
|
// Revision 1.7 1998/05/29 20:35:42 curt
|
||||||
* Root path info moved to fgOPTIONS.
|
// Added zlib support for reading in compressed data files.
|
||||||
*
|
//
|
||||||
* Revision 1.5 1998/04/28 01:19:03 curt
|
// Revision 1.6 1998/05/13 18:25:35 curt
|
||||||
* Type-ified fgTIME and fgVIEW
|
// Root path info moved to fgOPTIONS.
|
||||||
*
|
//
|
||||||
* Revision 1.4 1998/04/26 05:10:02 curt
|
// Revision 1.5 1998/04/28 01:19:03 curt
|
||||||
* "struct fgLIGHT" -> "fgLIGHT" because fgLIGHT is typedef'd.
|
// Type-ified fgTIME and fgVIEW
|
||||||
*
|
//
|
||||||
* Revision 1.3 1998/04/25 22:06:26 curt
|
// Revision 1.4 1998/04/26 05:10:02 curt
|
||||||
* Edited cvs log messages in source files ... bad bad bad!
|
// "struct fgLIGHT" -> "fgLIGHT" because fgLIGHT is typedef'd.
|
||||||
*
|
//
|
||||||
* Revision 1.2 1998/04/24 00:45:03 curt
|
// Revision 1.3 1998/04/25 22:06:26 curt
|
||||||
* Wrapped "#include <config.h>" in "#ifdef HAVE_CONFIG_H"
|
// Edited cvs log messages in source files ... bad bad bad!
|
||||||
* Fixed a bug when generating sky colors.
|
//
|
||||||
*
|
// Revision 1.2 1998/04/24 00:45:03 curt
|
||||||
* Revision 1.1 1998/04/22 13:21:34 curt
|
// Wrapped "#include <config.h>" in "#ifdef HAVE_CONFIG_H"
|
||||||
* C++ - ifing the code a bit.
|
// Fixed a bug when generating sky colors.
|
||||||
*
|
//
|
||||||
* Revision 1.11 1998/04/18 04:13:58 curt
|
// Revision 1.1 1998/04/22 13:21:34 curt
|
||||||
* Moved fg_debug.c to it's own library.
|
// C++ - ifing the code a bit.
|
||||||
*
|
//
|
||||||
* Revision 1.10 1998/04/03 21:52:51 curt
|
// Revision 1.11 1998/04/18 04:13:58 curt
|
||||||
* Converting to Gnu autoconf system.
|
// Moved fg_debug.c to it's own library.
|
||||||
*
|
//
|
||||||
* Revision 1.9 1998/03/14 00:27:12 curt
|
// Revision 1.10 1998/04/03 21:52:51 curt
|
||||||
* Updated fgGENERAL to a "type" of struct.
|
// Converting to Gnu autoconf system.
|
||||||
*
|
//
|
||||||
* Revision 1.8 1998/02/12 21:59:38 curt
|
// Revision 1.9 1998/03/14 00:27:12 curt
|
||||||
* Incorporated code changes contributed by Charlie Hotchkiss
|
// Updated fgGENERAL to a "type" of struct.
|
||||||
* <chotchkiss@namg.us.anritsu.com>
|
//
|
||||||
*
|
// Revision 1.8 1998/02/12 21:59:38 curt
|
||||||
* Revision 1.7 1998/02/09 15:07:48 curt
|
// Incorporated code changes contributed by Charlie Hotchkiss
|
||||||
* Minor tweaks.
|
// <chotchkiss@namg.us.anritsu.com>
|
||||||
*
|
//
|
||||||
* Revision 1.6 1998/02/02 20:53:23 curt
|
// Revision 1.7 1998/02/09 15:07:48 curt
|
||||||
* To version 0.29
|
// Minor tweaks.
|
||||||
*
|
//
|
||||||
* Revision 1.5 1998/01/27 18:35:53 curt
|
// Revision 1.6 1998/02/02 20:53:23 curt
|
||||||
* Minor tweaks.
|
// To version 0.29
|
||||||
*
|
//
|
||||||
* Revision 1.4 1998/01/27 00:47:49 curt
|
// Revision 1.5 1998/01/27 18:35:53 curt
|
||||||
* Incorporated Paul Bleisch's <pbleisch@acm.org> new debug message
|
// Minor tweaks.
|
||||||
* system and commandline/config file processing code.
|
//
|
||||||
*
|
// Revision 1.4 1998/01/27 00:47:49 curt
|
||||||
* Revision 1.3 1998/01/19 19:26:59 curt
|
// Incorporated Paul Bleisch's <pbleisch@acm.org> new debug message
|
||||||
* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
|
// system and commandline/config file processing code.
|
||||||
* This should simplify things tremendously.
|
//
|
||||||
*
|
// Revision 1.3 1998/01/19 19:26:59 curt
|
||||||
* Revision 1.2 1998/01/19 18:40:18 curt
|
// Merged in make system changes from Bob Kuehne <rpk@sgi.com>
|
||||||
* Tons of little changes to clean up the code and to remove fatal errors
|
// This should simplify things tremendously.
|
||||||
* when building with the c++ compiler.
|
//
|
||||||
*
|
// Revision 1.2 1998/01/19 18:40:18 curt
|
||||||
* Revision 1.1 1998/01/07 03:16:20 curt
|
// Tons of little changes to clean up the code and to remove fatal errors
|
||||||
* Moved from .../Src/Scenery/ to .../Src/Astro/
|
// when building with the c++ compiler.
|
||||||
*
|
//
|
||||||
* Revision 1.24 1997/12/30 22:22:39 curt
|
// Revision 1.1 1998/01/07 03:16:20 curt
|
||||||
* Further integration of event manager.
|
// Moved from .../Src/Scenery/ to .../Src/Astro/
|
||||||
*
|
//
|
||||||
* Revision 1.23 1997/12/30 20:47:53 curt
|
// Revision 1.24 1997/12/30 22:22:39 curt
|
||||||
* Integrated new event manager with subsystem initializations.
|
// Further integration of event manager.
|
||||||
*
|
//
|
||||||
* Revision 1.22 1997/12/30 16:36:53 curt
|
// Revision 1.23 1997/12/30 20:47:53 curt
|
||||||
* Merged in Durk's changes ...
|
// Integrated new event manager with subsystem initializations.
|
||||||
*
|
//
|
||||||
* Revision 1.21 1997/12/19 23:35:00 curt
|
// Revision 1.22 1997/12/30 16:36:53 curt
|
||||||
* Lot's of tweaking with sky rendering and lighting.
|
// Merged in Durk's changes ...
|
||||||
*
|
//
|
||||||
* Revision 1.20 1997/12/15 23:55:03 curt
|
// Revision 1.21 1997/12/19 23:35:00 curt
|
||||||
* Add xgl wrappers for debugging.
|
// Lot's of tweaking with sky rendering and lighting.
|
||||||
* Generate terrain normals on the fly.
|
//
|
||||||
*
|
// Revision 1.20 1997/12/15 23:55:03 curt
|
||||||
* Revision 1.19 1997/12/12 19:53:00 curt
|
// Add xgl wrappers for debugging.
|
||||||
* Working on lightling and material properties.
|
// Generate terrain normals on the fly.
|
||||||
*
|
//
|
||||||
* Revision 1.18 1997/12/10 22:37:52 curt
|
// Revision 1.19 1997/12/12 19:53:00 curt
|
||||||
* Prepended "fg" on the name of all global structures that didn't have it yet.
|
// Working on lightling and material properties.
|
||||||
* i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
|
//
|
||||||
*
|
// Revision 1.18 1997/12/10 22:37:52 curt
|
||||||
* Revision 1.17 1997/12/09 04:25:33 curt
|
// Prepended "fg" on the name of all global structures that didn't have it yet.
|
||||||
* Working on adding a global lighting params structure.
|
// i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
|
||||||
*
|
//
|
||||||
* Revision 1.16 1997/11/25 19:25:38 curt
|
// Revision 1.17 1997/12/09 04:25:33 curt
|
||||||
* Changes to integrate Durk's moon/sun code updates + clean up.
|
// Working on adding a global lighting params structure.
|
||||||
*
|
//
|
||||||
* Revision 1.15 1997/10/30 12:38:45 curt
|
// Revision 1.16 1997/11/25 19:25:38 curt
|
||||||
* Working on new scenery subsystem.
|
// Changes to integrate Durk's moon/sun code updates + clean up.
|
||||||
*
|
//
|
||||||
* Revision 1.14 1997/10/28 21:00:22 curt
|
// Revision 1.15 1997/10/30 12:38:45 curt
|
||||||
* Changing to new terrain format.
|
// Working on new scenery subsystem.
|
||||||
*
|
//
|
||||||
* Revision 1.13 1997/10/25 03:18:28 curt
|
// Revision 1.14 1997/10/28 21:00:22 curt
|
||||||
* Incorporated sun, moon, and planet position and rendering code contributed
|
// Changing to new terrain format.
|
||||||
* by Durk Talsma.
|
//
|
||||||
*
|
// Revision 1.13 1997/10/25 03:18:28 curt
|
||||||
* Revision 1.12 1997/09/23 00:29:43 curt
|
// Incorporated sun, moon, and planet position and rendering code contributed
|
||||||
* Tweaks to get things to compile with gcc-win32.
|
// by Durk Talsma.
|
||||||
*
|
//
|
||||||
* Revision 1.11 1997/09/22 14:44:21 curt
|
// Revision 1.12 1997/09/23 00:29:43 curt
|
||||||
* Continuing to try to align stars correctly.
|
// Tweaks to get things to compile with gcc-win32.
|
||||||
*
|
//
|
||||||
* Revision 1.10 1997/09/20 03:34:32 curt
|
// Revision 1.11 1997/09/22 14:44:21 curt
|
||||||
* Still trying to get those durned stars aligned properly.
|
// Continuing to try to align stars correctly.
|
||||||
*
|
//
|
||||||
* Revision 1.9 1997/09/18 16:20:09 curt
|
// Revision 1.10 1997/09/20 03:34:32 curt
|
||||||
* At dusk/dawn add/remove stars in stages.
|
// Still trying to get those durned stars aligned properly.
|
||||||
*
|
//
|
||||||
* Revision 1.8 1997/09/16 22:14:52 curt
|
// Revision 1.9 1997/09/18 16:20:09 curt
|
||||||
* Tweaked time of day lighting equations. Don't draw stars during the day.
|
// At dusk/dawn add/remove stars in stages.
|
||||||
*
|
//
|
||||||
* Revision 1.7 1997/09/16 15:50:31 curt
|
// Revision 1.8 1997/09/16 22:14:52 curt
|
||||||
* Working on star alignment and time issues.
|
// Tweaked time of day lighting equations. Don't draw stars during the day.
|
||||||
*
|
//
|
||||||
* Revision 1.6 1997/09/05 14:17:31 curt
|
// Revision 1.7 1997/09/16 15:50:31 curt
|
||||||
* More tweaking with stars.
|
// Working on star alignment and time issues.
|
||||||
*
|
//
|
||||||
* Revision 1.5 1997/09/05 01:35:59 curt
|
// Revision 1.6 1997/09/05 14:17:31 curt
|
||||||
* Working on getting stars right.
|
// More tweaking with stars.
|
||||||
*
|
//
|
||||||
* Revision 1.4 1997/09/04 02:17:38 curt
|
// Revision 1.5 1997/09/05 01:35:59 curt
|
||||||
* Shufflin' stuff.
|
// Working on getting stars right.
|
||||||
*
|
//
|
||||||
* Revision 1.3 1997/08/29 17:55:28 curt
|
// Revision 1.4 1997/09/04 02:17:38 curt
|
||||||
* Worked on properly aligning the stars.
|
// Shufflin' stuff.
|
||||||
*
|
//
|
||||||
* Revision 1.2 1997/08/27 21:32:30 curt
|
// Revision 1.3 1997/08/29 17:55:28 curt
|
||||||
* Restructured view calculation code. Added stars.
|
// Worked on properly aligning the stars.
|
||||||
*
|
//
|
||||||
* Revision 1.1 1997/08/27 03:34:48 curt
|
// Revision 1.2 1997/08/27 21:32:30 curt
|
||||||
* Initial revision.
|
// Restructured view calculation code. Added stars.
|
||||||
*
|
//
|
||||||
*/
|
// Revision 1.1 1997/08/27 03:34:48 curt
|
||||||
|
// Initial revision.
|
||||||
|
|
||||||
|
|
||||||
|
|
175
Astro/stars.hxx
175
Astro/stars.hxx
|
@ -1,27 +1,25 @@
|
||||||
/**************************************************************************
|
// stars.hxx -- data structures and routines for managing and rendering stars.
|
||||||
* stars.hxx -- data structures and routines for managing and rendering stars.
|
//
|
||||||
*
|
// Written by Curtis Olson, started August 1997.
|
||||||
* Written by Curtis Olson, started August 1997.
|
//
|
||||||
*
|
// Copyright (C) 1997 Curtis L. Olson - curt@me.umn.edu
|
||||||
* Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
|
//
|
||||||
*
|
// This program is free software; you can redistribute it and/or
|
||||||
* This program is free software; you can redistribute it and/or
|
// modify it under the terms of the GNU General Public License as
|
||||||
* modify it under the terms of the GNU General Public License as
|
// published by the Free Software Foundation; either version 2 of the
|
||||||
* published by the Free Software Foundation; either version 2 of the
|
// License, or (at your option) any later version.
|
||||||
* License, or (at your option) any later version.
|
//
|
||||||
*
|
// This program is distributed in the hope that it will be useful, but
|
||||||
* This program is distributed in the hope that it will be useful, but
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
// General Public License for more details.
|
||||||
* General Public License for more details.
|
//
|
||||||
*
|
// You should have received a copy of the GNU General Public License
|
||||||
* You should have received a copy of the GNU General Public License
|
// along with this program; if not, write to the Free Software
|
||||||
* along with this program; if not, write to the Free Software
|
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
//
|
||||||
*
|
// $Id$
|
||||||
* $Id$
|
// (Log is kept at end of this file)
|
||||||
* (Log is kept at end of this file)
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef _STARS_HXX
|
#ifndef _STARS_HXX
|
||||||
|
@ -34,77 +32,80 @@
|
||||||
|
|
||||||
#include <Time/fg_time.hxx>
|
#include <Time/fg_time.hxx>
|
||||||
|
|
||||||
#define FG_STAR_LEVELS 8 /* how many star transitions */
|
#define FG_STAR_LEVELS 8 // how many star transitions
|
||||||
|
|
||||||
/* Initialize the Star Management Subsystem */
|
// Initialize the Star Management Subsystem
|
||||||
int fgStarsInit( void );
|
int fgStarsInit( void );
|
||||||
|
|
||||||
/* Draw the Stars */
|
// Draw the Stars
|
||||||
void fgStarsRender( void );
|
void fgStarsRender( void );
|
||||||
|
|
||||||
extern struct OrbElements pltOrbElements[9];
|
extern struct OrbElements pltOrbElements[9];
|
||||||
extern fgTIME cur_time_params;
|
extern fgTIME cur_time_params;
|
||||||
|
|
||||||
|
|
||||||
#endif /* _STARS_HXX */
|
#endif // _STARS_HXX
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
// $Log$
|
||||||
/* Revision 1.6 1998/09/24 15:25:26 curt
|
// Revision 1.7 1998/09/24 15:36:20 curt
|
||||||
/* Miscellaneous tweaks.
|
// Converted to c++ style comments.
|
||||||
/*
|
//
|
||||||
*
|
// Revision 1.6 1998/09/24 15:25:26 curt
|
||||||
* Revision 1.5 1998/09/17 18:25:13 curt
|
// Miscellaneous tweaks.
|
||||||
* Fixed output message.
|
//
|
||||||
*
|
//
|
||||||
* Revision 1.4 1998/09/15 04:26:23 curt
|
// Revision 1.5 1998/09/17 18:25:13 curt
|
||||||
* New textured moon and rewritten/restructured Astro code contributed by Durk
|
// Fixed output message.
|
||||||
* Talsma.
|
//
|
||||||
*
|
// Revision 1.4 1998/09/15 04:26:23 curt
|
||||||
* Revision 1.3 1998/08/06 12:45:20 curt
|
// New textured moon and rewritten/restructured Astro code contributed by Durk
|
||||||
* Modified to bring in stars in 8 increments based on magnitude, not number
|
// Talsma.
|
||||||
* of stars.
|
//
|
||||||
*
|
// Revision 1.3 1998/08/06 12:45:20 curt
|
||||||
* Revision 1.2 1998/04/28 01:19:03 curt
|
// Modified to bring in stars in 8 increments based on magnitude, not number
|
||||||
* Type-ified fgTIME and fgVIEW
|
// of stars.
|
||||||
*
|
//
|
||||||
* Revision 1.1 1998/04/22 13:21:35 curt
|
// Revision 1.2 1998/04/28 01:19:03 curt
|
||||||
* C++ - ifing the code a bit.
|
// Type-ified fgTIME and fgVIEW
|
||||||
*
|
//
|
||||||
* Revision 1.5 1998/04/21 17:02:33 curt
|
// Revision 1.1 1998/04/22 13:21:35 curt
|
||||||
* Prepairing for C++ integration.
|
// C++ - ifing the code a bit.
|
||||||
*
|
//
|
||||||
* Revision 1.4 1998/02/12 21:59:39 curt
|
// Revision 1.5 1998/04/21 17:02:33 curt
|
||||||
* Incorporated code changes contributed by Charlie Hotchkiss
|
// Prepairing for C++ integration.
|
||||||
* <chotchkiss@namg.us.anritsu.com>
|
//
|
||||||
*
|
// Revision 1.4 1998/02/12 21:59:39 curt
|
||||||
* Revision 1.3 1998/01/22 02:59:28 curt
|
// Incorporated code changes contributed by Charlie Hotchkiss
|
||||||
* Changed #ifdef FILE_H to #ifdef _FILE_H
|
// <chotchkiss@namg.us.anritsu.com>
|
||||||
*
|
//
|
||||||
* Revision 1.2 1998/01/19 18:40:18 curt
|
// Revision 1.3 1998/01/22 02:59:28 curt
|
||||||
* Tons of little changes to clean up the code and to remove fatal errors
|
// Changed #ifdef FILE_H to #ifdef _FILE_H
|
||||||
* when building with the c++ compiler.
|
//
|
||||||
*
|
// Revision 1.2 1998/01/19 18:40:18 curt
|
||||||
* Revision 1.1 1998/01/07 03:16:20 curt
|
// Tons of little changes to clean up the code and to remove fatal errors
|
||||||
* Moved from .../Src/Scenery/ to .../Src/Astro/
|
// when building with the c++ compiler.
|
||||||
*
|
//
|
||||||
* Revision 1.6 1997/10/25 03:18:29 curt
|
// Revision 1.1 1998/01/07 03:16:20 curt
|
||||||
* Incorporated sun, moon, and planet position and rendering code contributed
|
// Moved from .../Src/Scenery/ to .../Src/Astro/
|
||||||
* by Durk Talsma.
|
//
|
||||||
*
|
// Revision 1.6 1997/10/25 03:18:29 curt
|
||||||
* Revision 1.5 1997/09/18 16:20:09 curt
|
// Incorporated sun, moon, and planet position and rendering code contributed
|
||||||
* At dusk/dawn add/remove stars in stages.
|
// by Durk Talsma.
|
||||||
*
|
//
|
||||||
* Revision 1.4 1997/09/05 01:36:00 curt
|
// Revision 1.5 1997/09/18 16:20:09 curt
|
||||||
* Working on getting stars right.
|
// At dusk/dawn add/remove stars in stages.
|
||||||
*
|
//
|
||||||
* Revision 1.3 1997/08/29 17:55:28 curt
|
// Revision 1.4 1997/09/05 01:36:00 curt
|
||||||
* Worked on properly aligning the stars.
|
// Working on getting stars right.
|
||||||
*
|
//
|
||||||
* Revision 1.2 1997/08/27 21:32:30 curt
|
// Revision 1.3 1997/08/29 17:55:28 curt
|
||||||
* Restructured view calculation code. Added stars.
|
// Worked on properly aligning the stars.
|
||||||
*
|
//
|
||||||
* Revision 1.1 1997/08/27 03:34:50 curt
|
// Revision 1.2 1997/08/27 21:32:30 curt
|
||||||
* Initial revision.
|
// Restructured view calculation code. Added stars.
|
||||||
*
|
//
|
||||||
*/
|
// Revision 1.1 1997/08/27 03:34:50 curt
|
||||||
|
// Initial revision.
|
||||||
|
//
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue