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.
// 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 =
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);
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);
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;
// 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];