]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/dcmemory.cpp
Chianti, Pinot noir, WINE..
[wxWidgets.git] / src / msw / dcmemory.cpp
index b0e6a77f18ed07f5d52458247172d39d283098a7..60bbb50735c0f9ddee71baed659b8da2870ad71b 100644 (file)
@@ -21,6 +21,7 @@
 #endif
 
 #ifndef WX_PRECOMP
+#include "wx/utils.h"
 #endif
 
 #include "wx/dcmemory.h"
@@ -38,7 +39,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC, wxDC)
 
 wxMemoryDC::wxMemoryDC(void)
 {
-  m_hDC = (WXHDC) ::CreateCompatibleDC(NULL);
+  m_hDC = (WXHDC) ::CreateCompatibleDC((HDC) NULL);
   m_ok = (m_hDC != 0);
   m_bOwnsDC = TRUE;
 
@@ -85,25 +86,26 @@ void wxMemoryDC::SelectObject(const wxBitmap& bitmap)
   }
 
   // Check if the bitmap has the correct depth for this device context
-  if (bitmap.Ok() && (bitmap.GetDepth() != GetDepth()))
-  {
-      // Make a new bitmap that has the correct depth.
-      wxBitmap newBitmap = bitmap.GetBitmapForDC(* this);
-
-      m_selectedBitmap = newBitmap ;
-  }
-  else
-  {
+//  if (bitmap.Ok() && (bitmap.GetDepth() != GetDepth()))
+  // JACS 11/12/98: disabling this since the Forty Thieves sample
+  // shows this not working properly. In fact, if loading from a resource,
+  // the depth should become the screen depth, so why was it being called?
+//  if (0)
+//  {
+//      // Make a new bitmap that has the correct depth.
+//      wxBitmap newBitmap = bitmap.GetBitmapForDC(* this);
+//
+//      m_selectedBitmap = newBitmap ;
+//  }
+//  else
+//  {
       m_selectedBitmap = bitmap;
-  }
+//  }
 
   if (!m_selectedBitmap.Ok())
     return;
 
   m_selectedBitmap.SetSelectedInto(this);
-#if WXDEBUG > 1
-  wxDebugMsg("wxMemoryDC::SelectObject: Selecting HBITMAP %X\n", m_selectedBitmap.GetHBITMAP());
-#endif
   HBITMAP bm = (HBITMAP) ::SelectObject((HDC) m_hDC, (HBITMAP) m_selectedBitmap.GetHBITMAP());
 
   if (bm == ERROR)
@@ -114,7 +116,7 @@ void wxMemoryDC::SelectObject(const wxBitmap& bitmap)
     m_oldBitmap = (WXHBITMAP) bm;
 }
 
-void wxMemoryDC::GetSize(int *width, int *height) const
+void wxMemoryDC::DoGetSize(int *width, int *height) const
 {
   if (!m_selectedBitmap.Ok())
   {