X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1fc25a89ac1e6c5208db24bfc0abc8666b791dc6..1721a8c028d3b6a553634c632117fbfac102a30e:/contrib/src/ogl/bmpshape.cpp?ds=sidebyside diff --git a/contrib/src/ogl/bmpshape.cpp b/contrib/src/ogl/bmpshape.cpp index fc6218e234..e2967d0436 100644 --- a/contrib/src/ogl/bmpshape.cpp +++ b/contrib/src/ogl/bmpshape.cpp @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -14,7 +14,7 @@ #endif // For compilers that support precompilation, includes "wx.h". -#include +#include "wx/wxprec.h" #ifdef __BORLANDC__ #pragma hdrstop @@ -24,24 +24,23 @@ #include #endif -#include +#if wxUSE_PROLOGIO +#include +#endif + +#include "wx/ogl/ogl.h" -#include -#include -#include -#include -#include /* * Bitmap object * */ -IMPLEMENT_DYNAMIC_CLASS(wxBitmapShape, wxShape) +IMPLEMENT_DYNAMIC_CLASS(wxBitmapShape, wxRectangleShape) wxBitmapShape::wxBitmapShape():wxRectangleShape(100.0, 50.0) { - m_filename = ""; + m_filename = wxEmptyString; } wxBitmapShape::~wxBitmapShape() @@ -52,16 +51,14 @@ void wxBitmapShape::OnDraw(wxDC& dc) { if (!m_bitmap.Ok()) return; - - wxMemoryDC tempDC; - tempDC.SelectObject(m_bitmap); - double x, y; + + int x, y; x = WXROUND(m_xpos - m_bitmap.GetWidth() / 2.0); y = WXROUND(m_ypos - m_bitmap.GetHeight() / 2.0); - dc.Blit((long) x, (long) y, m_bitmap.GetWidth(), m_bitmap.GetHeight(), &tempDC, 0, 0); + dc.DrawBitmap(m_bitmap, x, y, true); } -void wxBitmapShape::SetSize(double w, double h, bool recursive) +void wxBitmapShape::SetSize(double w, double h, bool WXUNUSED(recursive)) { if (m_bitmap.Ok()) { @@ -76,19 +73,19 @@ void wxBitmapShape::SetSize(double w, double h, bool recursive) SetDefaultRegionSize(); } -#ifdef PROLOGIO +#if wxUSE_PROLOGIO void wxBitmapShape::WriteAttributes(wxExpr *clause) { // Can't really save the bitmap; so instantiate the bitmap // at a higher level in the application, from a symbol library. wxRectangleShape::WriteAttributes(clause); - clause->AddAttributeValueString("filename", m_filename); + clause->AddAttributeValueString(_T("filename"), m_filename); } void wxBitmapShape::ReadAttributes(wxExpr *clause) { wxRectangleShape::ReadAttributes(clause); - clause->GetAttributeValue("filename", m_filename); + clause->GetAttributeValue(_T("filename"), m_filename); } #endif