C++ - ifing the code a bit.

This commit is contained in:
curt
2009-09-15 18:31:29 +02:00
committed by Tim Moore
parent b6b93c74ea
commit 2dd9bcbd50
14 changed files with 166 additions and 132 deletions
+6 -6
View File
@@ -2,11 +2,11 @@ libdir = ${exec_prefix}/lib
lib_LTLIBRARIES = libAstro.la lib_LTLIBRARIES = libAstro.la
libAstro_la_SOURCES = \ libAstro_la_SOURCES = \
moon.c moon.h \ moon.cxx moon.hxx \
orbits.c orbits.h \ orbits.cxx orbits.hxx \
planets.c planets.h \ planets.cxx planets.hxx \
sky.c sky.h \ sky.cxx sky.hxx \
stars.c stars.h \ stars.cxx stars.hxx \
sun.c sun.h sun.cxx sun.hxx
INCLUDES += -I$(top_builddir) -I$(top_builddir)/Lib -I$(top_builddir)/Simulator INCLUDES += -I$(top_builddir) -I$(top_builddir)/Lib -I$(top_builddir)/Simulator
+28 -12
View File
@@ -74,12 +74,12 @@ libdir = ${exec_prefix}/lib
lib_LTLIBRARIES = libAstro.la lib_LTLIBRARIES = libAstro.la
libAstro_la_SOURCES = \ libAstro_la_SOURCES = \
moon.c moon.h \ moon.cxx moon.hxx \
orbits.c orbits.h \ orbits.cxx orbits.hxx \
planets.c planets.h \ planets.cxx planets.hxx \
sky.c sky.h \ sky.cxx sky.hxx \
stars.c stars.h \ stars.cxx stars.hxx \
sun.c sun.h sun.cxx sun.hxx
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../../Include/config.h CONFIG_HEADER = ../../Include/config.h
CONFIG_CLEAN_FILES = CONFIG_CLEAN_FILES =
@@ -98,10 +98,10 @@ libAstro_la_LDFLAGS =
libAstro_la_LIBADD = libAstro_la_LIBADD =
libAstro_la_OBJECTS = moon.lo orbits.lo planets.lo sky.lo stars.lo \ libAstro_la_OBJECTS = moon.lo orbits.lo planets.lo sky.lo stars.lo \
sun.lo sun.lo
CFLAGS = @CFLAGS@ CXXFLAGS = @CXXFLAGS@
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CXXFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CXXFLAGS)
LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@ CXXLINK = $(LIBTOOL) --mode=link $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@
DIST_COMMON = Makefile.am Makefile.in DIST_COMMON = Makefile.am Makefile.in
@@ -111,13 +111,14 @@ TAR = tar
GZIP = --best GZIP = --best
DEP_FILES = .deps/moon.P .deps/orbits.P .deps/planets.P .deps/sky.P \ DEP_FILES = .deps/moon.P .deps/orbits.P .deps/planets.P .deps/sky.P \
.deps/stars.P .deps/sun.P .deps/stars.P .deps/sun.P
CXXMKDEP = $(CXX) -M $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CXXFLAGS)
SOURCES = $(libAstro_la_SOURCES) SOURCES = $(libAstro_la_SOURCES)
OBJECTS = $(libAstro_la_OBJECTS) OBJECTS = $(libAstro_la_OBJECTS)
all: Makefile $(LTLIBRARIES) all: Makefile $(LTLIBRARIES)
.SUFFIXES: .SUFFIXES:
.SUFFIXES: .S .c .lo .o .s .SUFFIXES: .S .c .cxx .lo .o .s
$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) $(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu Simulator/Astro/Makefile cd $(top_srcdir) && $(AUTOMAKE) --gnu Simulator/Astro/Makefile
@@ -184,7 +185,11 @@ distclean-libtool:
maintainer-clean-libtool: maintainer-clean-libtool:
libAstro.la: $(libAstro_la_OBJECTS) $(libAstro_la_DEPENDENCIES) libAstro.la: $(libAstro_la_OBJECTS) $(libAstro_la_DEPENDENCIES)
$(LINK) -rpath $(libdir) $(libAstro_la_LDFLAGS) $(libAstro_la_OBJECTS) $(libAstro_la_LIBADD) $(LIBS) $(CXXLINK) -rpath $(libdir) $(libAstro_la_LDFLAGS) $(libAstro_la_OBJECTS) $(libAstro_la_LIBADD) $(LIBS)
.cxx.o:
$(CXXCOMPILE) -c $<
.cxx.lo:
$(LTCXXCOMPILE) -c $<
tags: TAGS tags: TAGS
@@ -251,6 +256,17 @@ maintainer-clean-depend:
@-sed -e 's/^\([^:]*\)\.o:/\1.lo \1.o:/' \ @-sed -e 's/^\([^:]*\)\.o:/\1.lo \1.o:/' \
< .deps/$(*F).p > .deps/$(*F).P < .deps/$(*F).p > .deps/$(*F).P
@-rm -f .deps/$(*F).p @-rm -f .deps/$(*F).p
%.o: %.cxx
@echo '$(CXXCOMPILE) -c $<'; \
$(CXXCOMPILE) -Wp,-MD,.deps/$(*F).P -c $<
%.lo: %.cxx
@echo '$(LTCXXCOMPILE) -c $<'; \
$(LTCXXCOMPILE) -Wp,-MD,.deps/$(*F).p -c $<
@-sed -e 's/^\([^:]*\)\.o:/\1.lo \1.o:/' \
< .deps/$(*F).p > .deps/$(*F).P
@-rm -f .deps/$(*F).p
info: info:
dvi: dvi:
check: all check: all
+10 -6
View File
@@ -31,16 +31,17 @@
#include <GL/glut.h> #include <GL/glut.h>
#include <XGL/xgl.h> #include <XGL/xgl.h>
#include <Astro/orbits.h>
#include <Astro/moon.h>
#include <Aircraft/aircraft.h> #include <Aircraft/aircraft.h>
#include <Debug/fg_debug.h> #include <Debug/fg_debug.h>
#include <Include/fg_constants.h> #include <Include/fg_constants.h>
#include <Include/general.h> #include <Include/general.h>
#include <Main/views.h> #include <Main/views.hxx>
#include <Time/fg_time.h> #include <Time/fg_time.h>
#include "orbits.hxx"
#include "moon.hxx"
struct CelestialCoord moonPos; struct CelestialCoord moonPos;
static float xMoon, yMoon, zMoon; static float xMoon, yMoon, zMoon;
@@ -213,9 +214,12 @@ void fgMoonRender( void ) {
/* $Log$ /* $Log$
/* Revision 1.9 1998/04/18 04:13:56 curt /* Revision 1.1 1998/04/22 13:21:28 curt
/* Moved fg_debug.c to it's own library. /* C++ - ifing the code a bit.
/* /*
* Revision 1.9 1998/04/18 04:13:56 curt
* Moved fg_debug.c to it's own library.
*
* Revision 1.8 1998/04/03 21:52:49 curt * Revision 1.8 1998/04/03 21:52:49 curt
* Converting to Gnu autoconf system. * Converting to Gnu autoconf system.
* *
+13 -14
View File
@@ -22,19 +22,20 @@
**************************************************************************/ **************************************************************************/
#ifndef _MOON_H #ifndef _MOON_HXX
#define _MOON_H #define _MOON_HXX
#ifdef __cplusplus #ifndef __cplusplus
extern "C" { # error This library requires C++
#endif #endif
#include <Astro/orbits.h> #include <math.h>
#include <Time/fg_time.h> #include <Time/fg_time.h>
#include <math.h>
#include "orbits.hxx"
/* Initialize the Moon Display management Subsystem */ /* Initialize the Moon Display management Subsystem */
@@ -50,18 +51,16 @@ struct CelestialCoord fgCalculateMoon(struct OrbElements Params,
extern struct OrbElements pltOrbElements[9]; extern struct OrbElements pltOrbElements[9];
#ifdef __cplusplus #endif /* _MOON_HXX */
}
#endif
#endif /* _MOON_H */
/* $Log$ /* $Log$
/* Revision 1.7 1998/04/21 17:02:30 curt /* Revision 1.1 1998/04/22 13:21:28 curt
/* Prepairing for C++ integration. /* C++ - ifing the code a bit.
/* /*
* Revision 1.7 1998/04/21 17:02:30 curt
* Prepairing for C++ integration.
*
* Revision 1.6 1998/02/23 19:07:54 curt * Revision 1.6 1998/02/23 19:07:54 curt
* Incorporated Durk's Astro/ tweaks. Includes unifying the sun position * Incorporated Durk's Astro/ tweaks. Includes unifying the sun position
* calculation code between sun display, and other FG sections that use this * calculation code between sun display, and other FG sections that use this
+10 -4
View File
@@ -23,16 +23,19 @@
**************************************************************************/ **************************************************************************/
#include <config.h>
#include <math.h> #include <math.h>
#include <string.h> #include <string.h>
#include <Astro/orbits.h>
#include <Debug/fg_debug.h> #include <Debug/fg_debug.h>
#include <Include/fg_constants.h> #include <Include/fg_constants.h>
#include <Include/general.h> #include <Include/general.h>
#include <Time/fg_time.h> #include <Time/fg_time.h>
#include "orbits.hxx"
struct OrbElements pltOrbElements[9]; struct OrbElements pltOrbElements[9];
@@ -165,9 +168,12 @@ void fgSolarSystemUpdate(struct OrbElements *planet, struct fgTIME t)
/* $Log$ /* $Log$
/* Revision 1.10 1998/04/18 04:13:57 curt /* Revision 1.1 1998/04/22 13:21:29 curt
/* Moved fg_debug.c to it's own library. /* C++ - ifing the code a bit.
/* /*
* Revision 1.10 1998/04/18 04:13:57 curt
* Moved fg_debug.c to it's own library.
*
* Revision 1.9 1998/03/14 00:27:12 curt * Revision 1.9 1998/03/14 00:27:12 curt
* Updated fgGENERAL to a "type" of struct. * Updated fgGENERAL to a "type" of struct.
* *
+10 -12
View File
@@ -23,12 +23,12 @@
**************************************************************************/ **************************************************************************/
#ifndef _ORBITS_H #ifndef _ORBITS_HXX
#define _ORBITS_H #define _ORBITS_HXX
#ifdef __cplusplus #ifndef __cplusplus
extern "C" { # error This library requires C++
#endif #endif
@@ -84,18 +84,16 @@ int fgSolarSystemInit(struct fgTIME t);
void fgSolarSystemUpdate(struct OrbElements *planets, struct fgTIME t); void fgSolarSystemUpdate(struct OrbElements *planets, struct fgTIME t);
#ifdef __cplusplus #endif /* _ORBITS_HXX */
}
#endif
#endif /* _ORBITS_H */
/* $Log$ /* $Log$
/* Revision 1.7 1998/04/21 17:02:31 curt /* Revision 1.1 1998/04/22 13:21:30 curt
/* Prepairing for C++ integration. /* C++ - ifing the code a bit.
/* /*
* Revision 1.7 1998/04/21 17:02:31 curt
* Prepairing for C++ integration.
*
* Revision 1.6 1998/02/23 19:07:55 curt * Revision 1.6 1998/02/23 19:07:55 curt
* Incorporated Durk's Astro/ tweaks. Includes unifying the sun position * Incorporated Durk's Astro/ tweaks. Includes unifying the sun position
* calculation code between sun display, and other FG sections that use this * calculation code between sun display, and other FG sections that use this
+10 -5
View File
@@ -32,12 +32,14 @@
#include <GL/glut.h> #include <GL/glut.h>
#include <XGL/xgl.h> #include <XGL/xgl.h>
#include <Astro/orbits.h>
#include <Astro/planets.h>
#include <Astro/sun.h>
#include <Debug/fg_debug.h> #include <Debug/fg_debug.h>
#include <Include/fg_constants.h> #include <Include/fg_constants.h>
#include <Time/fg_time.h> #include <Time/fg_time.h>
#include <Time/light.hxx>
#include "orbits.hxx"
#include "planets.hxx"
#include "sun.hxx"
GLint planets = 0; GLint planets = 0;
@@ -206,9 +208,12 @@ void fgPlanetsRender( void ) {
/* $Log$ /* $Log$
/* Revision 1.9 1998/04/18 04:13:57 curt /* Revision 1.1 1998/04/22 13:21:31 curt
/* Moved fg_debug.c to it's own library. /* C++ - ifing the code a bit.
/* /*
* Revision 1.9 1998/04/18 04:13:57 curt
* Moved fg_debug.c to it's own library.
*
* Revision 1.8 1998/04/03 21:52:50 curt * Revision 1.8 1998/04/03 21:52:50 curt
* Converting to Gnu autoconf system. * Converting to Gnu autoconf system.
* *
+11 -13
View File
@@ -1,5 +1,5 @@
/************************************************************************** /**************************************************************************
* planets.h * planets.hxx
* *
* Written 1997 by Durk Talsma, started October, 1997. For the flight gear * Written 1997 by Durk Talsma, started October, 1997. For the flight gear
* project. * project.
@@ -23,12 +23,12 @@
**************************************************************************/ **************************************************************************/
#ifndef _PLANETS_H #ifndef _PLANETS_HXX
#define _PLANETS_H #define _PLANETS_HXX
#ifdef __cplusplus #ifndef __cplusplus
extern "C" { # error This library requires C++
#endif #endif
@@ -41,18 +41,16 @@ void fgPlanetsInit( void );
void fgPlanetsRender( void ); void fgPlanetsRender( void );
#ifdef __cplusplus #endif /* PLANETS_HXX */
}
#endif
#endif /* PLANETS_H */
/* $Log$ /* $Log$
/* Revision 1.5 1998/04/21 17:02:31 curt /* Revision 1.1 1998/04/22 13:21:32 curt
/* Prepairing for C++ integration. /* C++ - ifing the code a bit.
/* /*
* Revision 1.5 1998/04/21 17:02:31 curt
* Prepairing for C++ integration.
*
* Revision 1.4 1998/02/12 21:59:38 curt * Revision 1.4 1998/02/12 21:59:38 curt
* Incorporated code changes contributed by Charlie Hotchkiss * Incorporated code changes contributed by Charlie Hotchkiss
* <chotchkiss@namg.us.anritsu.com> * <chotchkiss@namg.us.anritsu.com>
+11 -8
View File
@@ -35,16 +35,16 @@
#include <GL/glut.h> #include <GL/glut.h>
#include <XGL/xgl.h> #include <XGL/xgl.h>
#include <Astro/sky.h>
#include <Time/event.h>
#include <Time/fg_time.h>
#include <Aircraft/aircraft.h> #include <Aircraft/aircraft.h>
#include <Flight/flight.h> #include <Flight/flight.h>
#include <Include/fg_constants.h> #include <Include/fg_constants.h>
#include <Main/views.h> #include <Main/views.hxx>
#include <Math/fg_random.h> #include <Math/fg_random.h>
#include <Time/event.h>
#include <Time/fg_time.h>
#include "sky.hxx"
/* /*
#include <Include/general.h> #include <Include/general.h>
@@ -351,9 +351,12 @@ void fgSkyRender( void ) {
/* $Log$ /* $Log$
/* Revision 1.9 1998/04/03 21:52:50 curt /* Revision 1.1 1998/04/22 13:21:32 curt
/* Converting to Gnu autoconf system. /* C++ - ifing the code a bit.
/* /*
* Revision 1.9 1998/04/03 21:52:50 curt
* Converting to Gnu autoconf system.
*
* Revision 1.8 1998/03/09 22:47:25 curt * Revision 1.8 1998/03/09 22:47:25 curt
* Incorporated Durk's updates. * Incorporated Durk's updates.
* *
+11 -13
View File
@@ -1,5 +1,5 @@
/************************************************************************** /**************************************************************************
* sky.h -- model sky with an upside down "bowl" * sky.hxx -- model sky with an upside down "bowl"
* *
* Written by Curtis Olson, started December 1997. * Written by Curtis Olson, started December 1997.
* *
@@ -24,12 +24,12 @@
**************************************************************************/ **************************************************************************/
#ifndef _SKY_H #ifndef _SKY_HXX
#define _SKY_H #define _SKY_HXX
#ifdef __cplusplus #ifndef __cplusplus
extern "C" { # error This library requires C++
#endif #endif
@@ -43,18 +43,16 @@ void fgSkyColorsInit( void );
void fgSkyRender( void ); void fgSkyRender( void );
#ifdef __cplusplus #endif /* _SKY_HXX */
}
#endif
#endif /* _SKY_H */
/* $Log$ /* $Log$
/* Revision 1.4 1998/04/21 17:02:32 curt /* Revision 1.1 1998/04/22 13:21:33 curt
/* Prepairing for C++ integration. /* C++ - ifing the code a bit.
/* /*
* Revision 1.4 1998/04/21 17:02:32 curt
* Prepairing for C++ integration.
*
* Revision 1.3 1998/01/22 02:59:28 curt * Revision 1.3 1998/01/22 02:59:28 curt
* Changed #ifdef FILE_H to #ifdef _FILE_H * Changed #ifdef FILE_H to #ifdef _FILE_H
* *
+11 -7
View File
@@ -38,17 +38,18 @@
#include <GL/glut.h> #include <GL/glut.h>
#include <XGL/xgl.h> #include <XGL/xgl.h>
#include <Astro/orbits.h>
#include <Astro/planets.h>
#include <Astro/stars.h>
#include <Aircraft/aircraft.h> #include <Aircraft/aircraft.h>
#include <Debug/fg_debug.h> #include <Debug/fg_debug.h>
#include <Include/fg_constants.h> #include <Include/fg_constants.h>
#include <Include/general.h> #include <Include/general.h>
#include <Main/views.h> #include <Main/views.hxx>
#include <Time/fg_time.h> #include <Time/fg_time.h>
#include "orbits.hxx"
#include "planets.hxx"
#include "stars.hxx"
#define EpochStart (631065600) #define EpochStart (631065600)
#define DaysSinceEpoch(secs) (((secs)-EpochStart)*(1.0/(24*3600))) #define DaysSinceEpoch(secs) (((secs)-EpochStart)*(1.0/(24*3600)))
@@ -257,9 +258,12 @@ void fgStarsRender( void ) {
/* $Log$ /* $Log$
/* 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.11 1998/04/18 04:13:58 curt
* Moved fg_debug.c to it's own library.
*
* Revision 1.10 1998/04/03 21:52:51 curt * Revision 1.10 1998/04/03 21:52:51 curt
* Converting to Gnu autoconf system. * Converting to Gnu autoconf system.
* *
+11 -13
View File
@@ -1,5 +1,5 @@
/************************************************************************** /**************************************************************************
* stars.h -- 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.
* *
@@ -24,12 +24,12 @@
**************************************************************************/ **************************************************************************/
#ifndef _STARS_H #ifndef _STARS_HXX
#define _STARS_H #define _STARS_HXX
#ifdef __cplusplus #ifndef __cplusplus
extern "C" { # error This library requires C++
#endif #endif
@@ -46,18 +46,16 @@ extern struct OrbElements pltOrbElements[9];
extern struct fgTIME cur_time_params; extern struct fgTIME cur_time_params;
#ifdef __cplusplus #endif /* _STARS_HXX */
}
#endif
#endif /* _STARS_H */
/* $Log$ /* $Log$
/* 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.5 1998/04/21 17:02:33 curt
* Prepairing for C++ integration.
*
* Revision 1.4 1998/02/12 21:59:39 curt * Revision 1.4 1998/02/12 21:59:39 curt
* Incorporated code changes contributed by Charlie Hotchkiss * Incorporated code changes contributed by Charlie Hotchkiss
* <chotchkiss@namg.us.anritsu.com> * <chotchkiss@namg.us.anritsu.com>
+11 -6
View File
@@ -32,13 +32,15 @@
#include <GL/glut.h> #include <GL/glut.h>
#include <XGL/xgl.h> #include <XGL/xgl.h>
#include <Astro/orbits.h>
#include <Astro/sun.h>
#include <Debug/fg_debug.h> #include <Debug/fg_debug.h>
#include <Include/fg_constants.h> #include <Include/fg_constants.h>
#include <Main/views.h> #include <Main/views.hxx>
#include <Time/fg_time.h> #include <Time/fg_time.h>
#include <Time/sunpos.h> #include <Time/sunpos.hxx>
#include "orbits.hxx"
#include "sun.hxx"
GLint sun_obj = 0; GLint sun_obj = 0;
@@ -188,9 +190,12 @@ void fgSunRender( void ) {
/* $Log$ /* $Log$
/* Revision 1.10 1998/04/18 04:13:58 curt /* Revision 1.1 1998/04/22 13:21:36 curt
/* Moved fg_debug.c to it's own library. /* C++ - ifing the code a bit.
/* /*
* Revision 1.10 1998/04/18 04:13:58 curt
* Moved fg_debug.c to it's own library.
*
* Revision 1.9 1998/04/03 21:52:51 curt * Revision 1.9 1998/04/03 21:52:51 curt
* Converting to Gnu autoconf system. * Converting to Gnu autoconf system.
* *
+13 -13
View File
@@ -1,5 +1,5 @@
/************************************************************************** /**************************************************************************
* sun.h * sun.hxx
* *
* Written 1997 by Durk Talsma, started October, 1997. For the flight gear * Written 1997 by Durk Talsma, started October, 1997. For the flight gear
* project. * project.
@@ -23,12 +23,12 @@
**************************************************************************/ **************************************************************************/
#ifndef _SUN_H #ifndef _SUN_HXX
#define _SUN_H #define _SUN_HXX
#ifdef __cplusplus #ifndef __cplusplus
extern "C" { # error This library requires C++
#endif #endif
@@ -38,25 +38,25 @@ extern fgSUNPOS solarPosition;
void fgCalcSunPos (struct OrbElements sunParams); void fgCalcSunPos (struct OrbElements sunParams);
extern struct OrbElements pltOrbElements[9]; extern struct OrbElements pltOrbElements[9];
/* Initialize the Sun */ /* Initialize the Sun */
void fgSunInit( void ); void fgSunInit( void );
/* Draw the Sun */ /* Draw the Sun */
void fgSunRender( void ); void fgSunRender( void );
#ifdef __cplusplus #endif /* _SUN_HXX */
}
#endif
#endif /* _SUN_H */
/* $Log$ /* $Log$
/* Revision 1.6 1998/04/21 17:02:33 curt /* Revision 1.1 1998/04/22 13:21:37 curt
/* Prepairing for C++ integration. /* C++ - ifing the code a bit.
/* /*
* Revision 1.6 1998/04/21 17:02:33 curt
* Prepairing for C++ integration.
*
* Revision 1.5 1998/03/09 22:47:26 curt * Revision 1.5 1998/03/09 22:47:26 curt
* Incorporated Durk's updates. * Incorporated Durk's updates.
* *