]> git.mxchange.org Git - flightgear.git/blobdiff - Main/splash.cxx
Converted to new logstream debugging facility. This allows release
[flightgear.git] / Main / splash.cxx
index 46770010f26cc086d868de647e95ed61f9242524..9c87cd1664f346c4031671badb9081fee427b774 100644 (file)
 
 #include <string.h>
 
-#include <Aircraft/aircraft.h>
-#include <Debug/fg_debug.h>
+#include <Debug/logstream.hxx>
 #include <Main/options.hxx>
-#include <Scenery/texload.h>
+#include <Objects/texload.h>
 
 #include "splash.hxx"
 
@@ -50,13 +49,10 @@ static GLubyte *splash_texbuf;
 
 // Initialize the splash screen
 void fgSplashInit ( void ) {
-    fgOPTIONS *o;
-    char tpath[256], fg_tpath[256];
+    string tpath, fg_tpath;
     int width, height;
 
-    o = &current_options;
-
-    fgPrintf( FG_GENERAL, FG_INFO, "Initializing splash screen\n");
+    FG_LOG( FG_GENERAL, FG_INFO, "Initializing splash screen" );
 #ifdef GL_VERSION_1_1
     xglGenTextures(1, &splash_texid);
     xglBindTexture(GL_TEXTURE_2D, splash_texid);
@@ -73,19 +69,19 @@ void fgSplashInit ( void ) {
     xglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
 
     // load in the texture data
-    tpath[0] = '\0';
-    strcat(tpath, o->fg_root);
-    strcat(tpath, "/Textures/");
-    strcat(tpath, "Splash2.rgb");
+    tpath = current_options.get_fg_root() + "/Textures/Splash2.rgb";
 
-    if ( (splash_texbuf = read_rgb_texture(tpath, &width, &height)) == NULL ) {
+    if ( (splash_texbuf = 
+         read_rgb_texture(tpath.c_str(), &width, &height)) == NULL )
+    {
        // Try compressed
-       strcpy(fg_tpath, tpath);
-       strcat(fg_tpath, ".gz");
-       if ( (splash_texbuf = read_rgb_texture(fg_tpath, &width, &height)) 
-            == NULL ) {
-           fgPrintf( FG_GENERAL, FG_EXIT, 
-                     "Error in loading splash screen texture %s\n", tpath );
+       fg_tpath = tpath + ".gz";
+       if ( (splash_texbuf = 
+             read_rgb_texture(fg_tpath.c_str(), &width, &height)) == NULL )
+       {
+           FG_LOG( FG_GENERAL, FG_ALERT, 
+                   "Error in loading splash screen texture " << tpath );
+           exit(-1);
        } 
     } 
 
@@ -106,6 +102,11 @@ void fgSplashUpdate ( double progress ) {
     ymin = (480 - ysize) / 2;
     ymax = ymin + ysize;
 
+    // first clear the screen;
+    xglClearColor(0.0, 0.0, 0.0, 1.0);
+    xglClear( GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT );
+
+    // now draw the logo
     xglMatrixMode(GL_PROJECTION);
     xglPushMatrix();
     xglLoadIdentity();
@@ -147,6 +148,32 @@ void fgSplashUpdate ( double progress ) {
 
 
 // $Log$
+// Revision 1.7  1998/11/06 21:18:14  curt
+// Converted to new logstream debugging facility.  This allows release
+// builds with no messages at all (and no performance impact) by using
+// the -DFG_NDEBUG flag.
+//
+// Revision 1.6  1998/10/17 01:34:25  curt
+// C++ ifying ...
+//
+// Revision 1.5  1998/09/26 13:17:29  curt
+// Clear screen to "black" before drawing splash screen.
+//
+// Revision 1.4  1998/08/27 17:02:08  curt
+// Contributions from Bernie Bright <bbright@c031.aone.net.au>
+// - use strings for fg_root and airport_id and added methods to return
+//   them as strings,
+// - inlined all access methods,
+// - made the parsing functions private methods,
+// - deleted some unused functions.
+// - propogated some of these changes out a bit further.
+//
+// Revision 1.3  1998/08/25 16:59:10  curt
+// Directory reshuffling.
+//
+// Revision 1.2  1998/07/13 21:01:40  curt
+// Wrote access functions for current fgOPTIONS.
+//
 // Revision 1.1  1998/07/06 02:42:36  curt
 // Initial revision.
 //