]> git.mxchange.org Git - simgear.git/blobdiff - Scenery/moon.c
Tweaks to help building with MSVC++
[simgear.git] / Scenery / moon.c
index fcf038f2b91519f7c953bc6a4baf8c61db36b9d7..dd39f072229f77cd1bbfaaa6fb953ece6dd37a6d 100644 (file)
@@ -29,6 +29,7 @@
 #include "moon.h"
 
 #include "../Aircraft/aircraft.h"
+#include "../Include/constants.h"
 #include "../Include/general.h"
 #include "../Main/views.h"
 #include "../Time/fg_time.h"
@@ -242,7 +243,7 @@ struct CelestialCoord fgCalculateMoon(struct OrbElements params,
   rho = 0.99883 + 0.00167 * cos(2 * fgDegToRad(FG_Latitude));
 
   if (geocCoord.RightAscension < 0)
-    geocCoord.RightAscension += (2*M_PI);
+    geocCoord.RightAscension += (2*FG_PI);
 
   HA = t.lst - (3.8197186 * geocCoord.RightAscension);
 
@@ -260,6 +261,8 @@ void fgMoonInit() {
     struct fgLIGHT *l;
     static int dl_exists = 0;
 
+    printf("Initializing the Moon\n");
+
     l = &cur_light_params;
 
     /* position the moon */
@@ -271,6 +274,10 @@ void fgMoonInit() {
           moonPos.Declination);
 #endif
 
+    xMoon = 60000.0 * cos(moonPos.RightAscension) * cos(moonPos.Declination);
+    yMoon = 60000.0 * sin(moonPos.RightAscension) * cos(moonPos.Declination);
+    zMoon = 60000.0 * sin(moonPos.Declination);
+
     if ( !dl_exists ) {
        dl_exists = 1;
 
@@ -283,12 +290,6 @@ void fgMoonInit() {
           xglMaterialfv(GL_FRONT, GL_DIFFUSE, moon_color); */
 
 
-       xMoon = 60000.0 * cos(moonPos.RightAscension) * 
-           cos(moonPos.Declination);
-       yMoon = 60000.0 * sin(moonPos.RightAscension) * 
-           cos(moonPos.Declination);
-       zMoon = 60000.0 * sin(moonPos.Declination);
-
        glutSolidSphere(1.0, 10, 10);
 
        xglEndList();
@@ -301,6 +302,8 @@ void fgMoonRender() {
     struct fgLIGHT *l;
     GLfloat white[4] = { 1.0, 1.0, 1.0, 1.0 };
 
+    /* printf("Rendering moon\n"); */
+
     l = &cur_light_params;
 
     xglMaterialfv(GL_FRONT, GL_AMBIENT, l->sky_color );
@@ -317,7 +320,16 @@ void fgMoonRender() {
 
 
 /* $Log$
-/* Revision 1.13  1997/12/30 16:41:00  curt
-/* Added log at end of file.
+/* Revision 1.16  1998/01/06 01:20:24  curt
+/* Tweaks to help building with MSVC++
 /*
+ * Revision 1.15  1998/01/05 18:44:35  curt
+ * Add an option to advance/decrease time from keyboard.
+ *
+ * Revision 1.14  1997/12/30 20:47:50  curt
+ * Integrated new event manager with subsystem initializations.
+ *
+ * Revision 1.13  1997/12/30 16:41:00  curt
+ * Added log at end of file.
+ *
  */