]> git.mxchange.org Git - flightgear.git/commitdiff
First quick hack at panel shading.
authorcurt <curt>
Sat, 27 May 2000 06:40:55 +0000 (06:40 +0000)
committercurt <curt>
Sat, 27 May 2000 06:40:55 +0000 (06:40 +0000)
Thanks
src/Airports/simple.cxx
src/Cockpit/panel.cxx
src/FDM/UIUCModel/uiuc_aircraftdir.h
src/Time/light.cxx
src/Time/light.hxx

diff --git a/Thanks b/Thanks
index 13420f7afccd5f2b7d3597311890b480e68fdbfb..80e348818871ba0bf1677d98cac2669e656b659b 100644 (file)
--- a/Thanks
+++ b/Thanks
@@ -107,6 +107,10 @@ Oscar Everitt <bigoc@premier.net>
   them to our little project.
 
 
+Bruce Finney <bfinney@gte.net>
+  MSVC5 compatibility.
+
+
 Jean-loup Gailly and Mark Adler <zlib@gzip.org>
   Authors of the zlib library.  Used for on-the-fly compression and
   decompression routines.
index e9a04b9fb19aa643b028bcdd437f3e16adfa22bf..70c59ba9447e4c2a5649f257e580150e15dbf8d3 100644 (file)
@@ -56,7 +56,10 @@ FGAirports::FGAirports( const string& file ) {
     // open the specified database readonly
     storage = new c4_Storage( file.c_str(), false );
 
-    // need to do something about error handling here!
+    if ( !storage->Strategy().IsValid() ) {
+       FG_LOG( FG_GENERAL, FG_ALERT, "Cannot open file: " << file );
+       exit(-1);
+    }
 
     vAirport = new c4_View;
     *vAirport = 
index 96e2b90f1d3e3071c0dd7f6bb13d531c0fddbf54..4bdc291e2f6e52839c9cfaa41723573fe79a236d 100644 (file)
@@ -132,7 +132,12 @@ FGPanel::update () const
   glEnable(GL_BLEND);
   glEnable(GL_ALPHA_TEST);
   glEnable(GL_COLOR_MATERIAL);
-  glColor4f(1.0, 1.0, 1.0, 1.0);
+  // glColor4f(1.0, 1.0, 1.0, 1.0);
+  if ( cur_light_params.sun_angle * RAD_TO_DEG < 95.0 ) {
+      glColor4fv( cur_light_params.scene_diffuse );
+  } else {
+      glColor4f(0.7, 0.2, 0.2, 1.0);
+  }
   glBindTexture(GL_TEXTURE_2D, _bg->getHandle());
   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
@@ -558,7 +563,11 @@ FGTexturedLayer::draw () const
   transform();
   glBindTexture(GL_TEXTURE_2D, _texture->getHandle());
   glBegin(GL_POLYGON);
-
+  if ( cur_light_params.sun_angle * RAD_TO_DEG < 95.0 ) {
+      glColor4fv( cur_light_params.scene_diffuse );
+  } else {
+      glColor4f(0.7, 0.2, 0.2, 1.0);
+  }
   glTexCoord2f(_texX1, _texY1); glVertex2f(-w2, -h2);
   glTexCoord2f(_texX2, _texY1); glVertex2f(w2, -h2);
   glTexCoord2f(_texX2, _texY2); glVertex2f(w2, h2);
index 940aedd213fbb0ddacb86d945244a34b3de43d17..ad55d3f3cdb84fb4ccbfe23a329426934bfd0469 100644 (file)
@@ -70,8 +70,8 @@
 
 typedef struct 
 {
-    string aircraft_dir;
-    #define aircraft_dir aircraftdir_->aircraft_dir
+    string real_aircraft_dir;
+    #define aircraft_dir aircraftdir_->real_aircraft_dir
   
 } AIRCRAFTDIR;
 
index 06c40ccb3e86006d157cd1748faa50fd39281763..b7c4a6b819f91e90b0336a923777c43041f7f3d3 100644 (file)
@@ -137,10 +137,12 @@ void fgLIGHT::Update( void ) {
     scene_ambient[0] = white[0] * ambient;
     scene_ambient[1] = white[1] * ambient;
     scene_ambient[2] = white[2] * ambient;
+    scene_ambient[3] = 1.0;
 
     scene_diffuse[0] = white[0] * diffuse;
     scene_diffuse[1] = white[1] * diffuse;
     scene_diffuse[2] = white[2] * diffuse;
+    scene_diffuse[3] = 1.0;
 
     // set sky color
     sky_color[0] = base_sky_color[0] * sky_brightness;
index 0466f033e8e8dbb0b8b8cd6ff95b3c644a15a746..ab8e93bc85dd773003ecea07476283030e7b8e29 100644 (file)
@@ -113,10 +113,10 @@ public:
     // Derived lighting values
 
     // ambient component
-    GLfloat scene_ambient[3];
+    GLfloat scene_ambient[4];
 
     // diffuse component
-    GLfloat scene_diffuse[3];
+    GLfloat scene_diffuse[4];
 
     // fog color
     GLfloat fog_color[4];