]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/bitmap.cpp
Remove the busy-wait loops in wxAMMediaBackend::Play as they didn't
[wxWidgets.git] / src / msw / bitmap.cpp
index c77d7af44cbc48423105b0ed00668f641505cd40..fb6d081fb6c957e9be8f086eed18c700cfe3082c 100644 (file)
 // headers
 // ----------------------------------------------------------------------------
 
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-    #pragma implementation "bitmap.h"
-#endif
-
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
@@ -830,7 +826,8 @@ bool wxBitmap::CreateFromImage(const wxImage& image, int depth, WXHDC hdc)
     wxDIB dib(image);
     if ( !dib.IsOk() )
         return false;
-
+       if (depth == -1)
+               depth = dib.GetDepth(); // Get depth from image if none specified
 
     // store the bitmap parameters
     wxBitmapRefData *refData = new wxBitmapRefData;
@@ -853,14 +850,14 @@ bool wxBitmap::CreateFromImage(const wxImage& image, int depth, WXHDC hdc)
         hbitmap = dib.Detach();
 
         refData->m_isDIB = true;
-        refData->m_depth = dib.GetDepth();
+        refData->m_depth = depth;
     }
 #ifndef ALWAYS_USE_DIB
     else // we need to convert DIB to DDB
     {
         hbitmap = dib.CreateDDB((HDC)hdc);
 
-        refData->m_depth = depth == -1 ? dib.GetDepth() : depth;
+        refData->m_depth = depth;
     }
 #endif // !ALWAYS_USE_DIB