]> git.mxchange.org Git - flightgear.git/commitdiff
fix #142: initial window position
authorThorstenB <brehmt@gmail.com>
Sun, 29 May 2011 16:46:11 +0000 (18:46 +0200)
committerThorstenB <brehmt@gmail.com>
Sun, 29 May 2011 16:46:11 +0000 (18:46 +0200)
Be (at least a bit) smarter with initial x/y position
Also some minor type/comment issues.

src/Main/WindowBuilder.cxx
src/Main/options.cxx
src/Main/viewmgr.cxx
src/MultiPlayer/mpmessages.hxx
src/Sound/sample_queue.cxx
src/Time/light.cxx

index 740671cd56884ec00eceeca3238ded3ddca801aa..52f09011db137abea4e4f6a962fe000a616cb345 100644 (file)
@@ -69,9 +69,9 @@ WindowBuilder::makeDefaultTraits(bool stencil)
     traits->red = traits->green = traits->blue = cbits;
     traits->depth = zbits;
     if (alpha)
-       traits->alpha = 8;
+        traits->alpha = 8;
     if (stencil)
-       traits->stencil = 8;
+        traits->stencil = 8;
     traits->doubleBuffer = true;
     traits->mipMapGeneration = true;
     traits->windowName = "FlightGear";
@@ -83,20 +83,21 @@ WindowBuilder::makeDefaultTraits(bool stencil)
         unsigned width = 0;
         unsigned height = 0;
         wsi->getScreenResolution(*traits, width, height);
-       traits->windowDecoration = false;
+        traits->windowDecoration = false;
         traits->width = width;
         traits->height = height;
         traits->supportsResize = false;
     } else {
-       traits->windowDecoration = true;
+        traits->windowDecoration = true;
         traits->width = w;
         traits->height = h;
-#if defined(WIN32) || defined(__APPLE__)
+        unsigned screenwidth = 0;
+        unsigned screenheight = 0;
+        wsi->getScreenResolution(*traits, screenwidth, screenheight);
         // Ugly Hack, why does CW_USEDEFAULT works like phase of the moon?
         // Mac also needs this to show window frame, menubar and Docks
-        traits->x = 100;
-        traits->y = 100;
-#endif
+        traits->x = (w>screenwidth) ? 0 : (screenwidth-w)/3;
+        traits->y = (h>screenheight) ? 0 : (screenheight-h)/3;
         traits->supportsResize = true;
     }
     return traits;
index df50b344ce9c328a6a5148b166656168f924fac5..01f1e4438ca859981758b04a24f60bc293d9c876 100644 (file)
@@ -1838,7 +1838,7 @@ fgUsage (bool verbose)
 
                          while ( t_str.size() > 47 ) {
 
-                            unsigned int m = t_str.rfind(' ', 47);
+                            string::size_type m = t_str.rfind(' ', 47);
                             msg += t_str.substr(0, m) + '\n';
                             msg.append( 32, ' ');
 
index 9555291897a5fd17b11d602de7cbc5b7ff4a4cf2..ea9fcd7a61d6eb09c4dcbba10238ac6912d3018a 100644 (file)
@@ -356,7 +356,7 @@ FGViewMgr::update (double dt)
   abs_viewer_position = loop_view->getViewPosition();
 
   // update audio listener values
-  // set the viewer posotion in Cartesian coordinates in meters
+  // set the viewer position in Cartesian coordinates in meters
   smgr->set_position( abs_viewer_position, loop_view->getPosition() );
   smgr->set_orientation( current_view_orientation );
 
index f5b89eb8269933726ca4da8438fe1efe1c32d5f0..38e7fea58a524e096e262a875b18d176af111ce0 100644 (file)
@@ -164,7 +164,7 @@ struct FGExternalMotionData {
   // the earth centered frame
   SGVec3f angularAccel;
   
-  // The set of properties recieved for this timeslot
+  // The set of properties received for this timeslot
   std::vector<FGPropertyData*> properties;
 
   ~FGExternalMotionData()
index e5c2293a6037fe3b8ffa3f2d346d6b59fa89b32b..ac56c9b25320698c47cf12fe85e6f04b691d5c11 100644 (file)
@@ -80,7 +80,7 @@ FGSampleQueue::update (double dt)
             last_volume = volume;
         }
 
-        // process mesage queue
+        // process message queue
         const string msgid = "Sequential Audio Message";
         bool now_playing = false;
         if ( exists( msgid ) ) {
index 348bd524daa3c8ee399b254cc2517e0fad0bbd40..79259c03c18da886bfdeffd56dab34009e1c6f37 100644 (file)
@@ -345,7 +345,7 @@ void FGLight::update_adj_fog_color () {
     else
        hor_rotation = fmod(hor_rotation, SGD_2PI);
 
-    // revert to unmodified values before usign them.
+    // revert to unmodified values before using them.
     //
     SGVec4f color = thesky->get_scene_color();
 
@@ -359,7 +359,7 @@ void FGLight::update_adj_fog_color () {
     float s_green = color[1]*color[1]*color[1];
     float s_blue =  color[2]*color[2];
 
-    // interpolate beween the sunrise/sunset color and the color
+    // interpolate between the sunrise/sunset color and the color
     // at the opposite direction of this effect. Take in account
     // the current visibility.
     //