]> git.mxchange.org Git - simgear.git/blobdiff - PUI/puInterface.cxx
Added an FG_SERIAL type to the FG_LOG macro.
[simgear.git] / PUI / puInterface.cxx
index cac02c3963a72287782c01f4baae8eae836f2494..500f829713423d1dc830cb508894c3889067d176 100644 (file)
@@ -200,9 +200,26 @@ int puInterface::checkHit ( int button, int updown, int x, int y )
 
 void puInterface::draw ( int dx, int dy )
 {
-  if ( isVisible () )
-    for ( puObject *bo = dlist ; bo != NULL ; bo = bo->next )
-      bo -> draw ( dx + abox.min[0], dy + abox.min[1] ) ;
+  if ( ! isVisible () )
+    return ;
+
+  for ( puObject *bo = dlist ; bo != NULL ; bo = bo->next )
+  {
+    /* June 16th, 98, Shammi :
+     * The next if statement checks if the object is
+     * a menu bar and makes sure it is repositioned
+     * correctly.
+     */
+
+    if ( bo->getType() & PUCLASS_MENUBAR )
+    {
+      int obWidth, obHeight ;
+      bo -> getSize ( &obWidth, &obHeight ) ;
+      bo -> setPosition ( 0, puGetWindowHeight() - obHeight ) ;
+    }
+
+    bo -> draw ( dx + abox.min[0], dy + abox.min[1] ) ;
+  }
 }
 
 
@@ -236,10 +253,16 @@ void puInterface::doHit ( int, int, int, int )
 
 puInterface::~puInterface ()
 {
-  puPopLiveInterface () ;
+    puPopLiveInterface () ;
 
-  for ( puObject *bo = dlist ; bo != NULL ; bo = bo->next )
-    delete bo ;
+    puObject *bo = dlist ;
+
+    while ( bo != NULL ) {
+       puObject *tmp_bo = bo->next ;
+       delete bo ;
+       bo = tmp_bo ;
+    }
 }
 
 
+