Fixed bug in dc::blit()
Redid fix in fileconf FortyThieves works now.. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1006 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -288,11 +288,12 @@ void Game::Redraw(wxDC& dc)
|
|||||||
|
|
||||||
// Initialise the card bitmap to the background colour
|
// Initialise the card bitmap to the background colour
|
||||||
wxMemoryDC memoryDC;
|
wxMemoryDC memoryDC;
|
||||||
memoryDC.SelectObject(m_bmapCard);
|
memoryDC.SelectObject(*m_bmapCard);
|
||||||
memoryDC.SetBrush(FortyApp::BackgroundBrush());
|
memoryDC.SetBrush(FortyApp::BackgroundBrush());
|
||||||
memoryDC.DrawRectangle(0, 0, CardWidth, CardHeight);
|
memoryDC.DrawRectangle(0, 0, CardWidth, CardHeight);
|
||||||
memoryDC.SelectObject(m_bmap);
|
memoryDC.SelectObject(*m_bmap);
|
||||||
memoryDC.DrawRectangle(0, 0, CardWidth, CardHeight);
|
memoryDC.DrawRectangle(0, 0, CardWidth, CardHeight);
|
||||||
|
memoryDC.SelectObject(wxNullBitmap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -113,9 +113,12 @@ wxString wxFileConfig::GetLocalDir()
|
|||||||
wxString strDir;
|
wxString strDir;
|
||||||
|
|
||||||
wxGetHomeDir(&strDir);
|
wxGetHomeDir(&strDir);
|
||||||
|
|
||||||
if (strDir.Last() != '/' && strDir.Last() != '\\')
|
#ifdef __UNIX__
|
||||||
strDir += "/";
|
if (strDir.Last() != '/') strDir << '/';
|
||||||
|
#else
|
||||||
|
if (strDir.Last() != '\\') strDir << '\\';
|
||||||
|
#endif
|
||||||
|
|
||||||
return strDir;
|
return strDir;
|
||||||
}
|
}
|
||||||
@@ -149,7 +152,7 @@ wxString wxFileConfig::GetLocalFileName(const char *szFile)
|
|||||||
if ( strchr(szFile, '.') == NULL )
|
if ( strchr(szFile, '.') == NULL )
|
||||||
str << ".ini";
|
str << ".ini";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -532,7 +532,7 @@ bool wxPaintDC::Blit( long xdest, long ydest, long width, long height,
|
|||||||
wxDC *source, long xsrc, long ysrc, int WXUNUSED(logical_func), bool useMask )
|
wxDC *source, long xsrc, long ysrc, int WXUNUSED(logical_func), bool useMask )
|
||||||
{
|
{
|
||||||
if (!Ok()) return FALSE;
|
if (!Ok()) return FALSE;
|
||||||
|
|
||||||
CalcBoundingBox( xdest, ydest );
|
CalcBoundingBox( xdest, ydest );
|
||||||
CalcBoundingBox( xdest + width, ydest + height );
|
CalcBoundingBox( xdest + width, ydest + height );
|
||||||
|
|
||||||
@@ -541,7 +541,39 @@ bool wxPaintDC::Blit( long xdest, long ydest, long width, long height,
|
|||||||
if (csrc->m_isMemDC)
|
if (csrc->m_isMemDC)
|
||||||
{
|
{
|
||||||
wxMemoryDC* srcDC = (wxMemoryDC*)source;
|
wxMemoryDC* srcDC = (wxMemoryDC*)source;
|
||||||
GdkPixmap* bmap = srcDC->m_selected.GetPixmap();
|
GdkPixmap* pmap = srcDC->m_selected.GetPixmap();
|
||||||
|
if (pmap)
|
||||||
|
{
|
||||||
|
long xx = XLOG2DEV(xdest);
|
||||||
|
long yy = YLOG2DEV(ydest);
|
||||||
|
|
||||||
|
GdkBitmap *mask = (GdkBitmap *) NULL;
|
||||||
|
if (srcDC->m_selected.GetMask()) mask = srcDC->m_selected.GetMask()->GetBitmap();
|
||||||
|
|
||||||
|
if (useMask && mask)
|
||||||
|
{
|
||||||
|
gdk_gc_set_clip_mask( m_penGC, mask );
|
||||||
|
gdk_gc_set_clip_origin( m_penGC, xx, yy );
|
||||||
|
}
|
||||||
|
|
||||||
|
gdk_draw_pixmap( m_window, m_penGC, pmap,
|
||||||
|
source->DeviceToLogicalX(xsrc),
|
||||||
|
source->DeviceToLogicalY(ysrc),
|
||||||
|
xx,
|
||||||
|
yy,
|
||||||
|
source->DeviceToLogicalXRel(width),
|
||||||
|
source->DeviceToLogicalYRel(height) );
|
||||||
|
|
||||||
|
if (useMask && mask)
|
||||||
|
{
|
||||||
|
gdk_gc_set_clip_mask( m_penGC, (GdkBitmap *) NULL );
|
||||||
|
gdk_gc_set_clip_origin( m_penGC, 0, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
GdkBitmap* bmap = srcDC->m_selected.GetBitmap();
|
||||||
if (bmap)
|
if (bmap)
|
||||||
{
|
{
|
||||||
long xx = XLOG2DEV(xdest);
|
long xx = XLOG2DEV(xdest);
|
||||||
@@ -556,7 +588,7 @@ bool wxPaintDC::Blit( long xdest, long ydest, long width, long height,
|
|||||||
gdk_gc_set_clip_origin( m_penGC, xx, yy );
|
gdk_gc_set_clip_origin( m_penGC, xx, yy );
|
||||||
}
|
}
|
||||||
|
|
||||||
gdk_draw_pixmap( m_window, m_penGC, bmap,
|
gdk_draw_bitmap( m_window, m_penGC, bmap,
|
||||||
source->DeviceToLogicalX(xsrc),
|
source->DeviceToLogicalX(xsrc),
|
||||||
source->DeviceToLogicalY(ysrc),
|
source->DeviceToLogicalY(ysrc),
|
||||||
xx,
|
xx,
|
||||||
|
@@ -532,7 +532,7 @@ bool wxPaintDC::Blit( long xdest, long ydest, long width, long height,
|
|||||||
wxDC *source, long xsrc, long ysrc, int WXUNUSED(logical_func), bool useMask )
|
wxDC *source, long xsrc, long ysrc, int WXUNUSED(logical_func), bool useMask )
|
||||||
{
|
{
|
||||||
if (!Ok()) return FALSE;
|
if (!Ok()) return FALSE;
|
||||||
|
|
||||||
CalcBoundingBox( xdest, ydest );
|
CalcBoundingBox( xdest, ydest );
|
||||||
CalcBoundingBox( xdest + width, ydest + height );
|
CalcBoundingBox( xdest + width, ydest + height );
|
||||||
|
|
||||||
@@ -541,7 +541,39 @@ bool wxPaintDC::Blit( long xdest, long ydest, long width, long height,
|
|||||||
if (csrc->m_isMemDC)
|
if (csrc->m_isMemDC)
|
||||||
{
|
{
|
||||||
wxMemoryDC* srcDC = (wxMemoryDC*)source;
|
wxMemoryDC* srcDC = (wxMemoryDC*)source;
|
||||||
GdkPixmap* bmap = srcDC->m_selected.GetPixmap();
|
GdkPixmap* pmap = srcDC->m_selected.GetPixmap();
|
||||||
|
if (pmap)
|
||||||
|
{
|
||||||
|
long xx = XLOG2DEV(xdest);
|
||||||
|
long yy = YLOG2DEV(ydest);
|
||||||
|
|
||||||
|
GdkBitmap *mask = (GdkBitmap *) NULL;
|
||||||
|
if (srcDC->m_selected.GetMask()) mask = srcDC->m_selected.GetMask()->GetBitmap();
|
||||||
|
|
||||||
|
if (useMask && mask)
|
||||||
|
{
|
||||||
|
gdk_gc_set_clip_mask( m_penGC, mask );
|
||||||
|
gdk_gc_set_clip_origin( m_penGC, xx, yy );
|
||||||
|
}
|
||||||
|
|
||||||
|
gdk_draw_pixmap( m_window, m_penGC, pmap,
|
||||||
|
source->DeviceToLogicalX(xsrc),
|
||||||
|
source->DeviceToLogicalY(ysrc),
|
||||||
|
xx,
|
||||||
|
yy,
|
||||||
|
source->DeviceToLogicalXRel(width),
|
||||||
|
source->DeviceToLogicalYRel(height) );
|
||||||
|
|
||||||
|
if (useMask && mask)
|
||||||
|
{
|
||||||
|
gdk_gc_set_clip_mask( m_penGC, (GdkBitmap *) NULL );
|
||||||
|
gdk_gc_set_clip_origin( m_penGC, 0, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
GdkBitmap* bmap = srcDC->m_selected.GetBitmap();
|
||||||
if (bmap)
|
if (bmap)
|
||||||
{
|
{
|
||||||
long xx = XLOG2DEV(xdest);
|
long xx = XLOG2DEV(xdest);
|
||||||
@@ -556,7 +588,7 @@ bool wxPaintDC::Blit( long xdest, long ydest, long width, long height,
|
|||||||
gdk_gc_set_clip_origin( m_penGC, xx, yy );
|
gdk_gc_set_clip_origin( m_penGC, xx, yy );
|
||||||
}
|
}
|
||||||
|
|
||||||
gdk_draw_pixmap( m_window, m_penGC, bmap,
|
gdk_draw_bitmap( m_window, m_penGC, bmap,
|
||||||
source->DeviceToLogicalX(xsrc),
|
source->DeviceToLogicalX(xsrc),
|
||||||
source->DeviceToLogicalY(ysrc),
|
source->DeviceToLogicalY(ysrc),
|
||||||
xx,
|
xx,
|
||||||
|
Reference in New Issue
Block a user