Card* Discard::RemoveTopCard(wxDC& dc, int m_xOffset, int m_yOffset) { Card* card; if (m_topCard <= 31) { card = Pile::RemoveTopCard(dc, m_xOffset, m_yOffset); } else { int topX, topY, x, y; GetTopCardPos(topX, topY); card = Pile::RemoveTopCard(); card->Erase(dc, topX - m_xOffset, topY - m_yOffset); GetTopCardPos(x, y); dc.SetClippingRegion(topX - m_xOffset, topY - m_yOffset, CardWidth, CardHeight); for (int i = m_topCard - 31; i <= m_topCard - 31 + CardWidth / m_dx; i++) { m_cards[i]->Draw(dc, m_x - m_xOffset + i * m_dx, m_y - m_yOffset); } if (m_topCard > 31) { m_cards[m_topCard]->Draw(dc, topX - m_xOffset - m_dx, topY - m_yOffset); } dc.DestroyClippingRegion(); } return card; }
Card* Discard::RemoveTopCard(wxDC& dc, int m_xOffset, int m_yOffset) { Card* card; if (m_topCard <= 31) { card = Pile::RemoveTopCard(dc, m_xOffset, m_yOffset); } else { int topX, topY, x, y; GetTopCardPos(topX, topY); card = Pile::RemoveTopCard(); card->Erase(dc, topX - m_xOffset, topY - m_yOffset); GetTopCardPos(x, y); dc.SetClippingRegion(topX - m_xOffset, topY - m_yOffset, CardWidth, CardHeight); #if defined(__INTEL_COMPILER) && 1 /* VDM auto patch */ # pragma ivdep # pragma swp # pragma unroll # pragma prefetch # if 0 # pragma simd noassert # endif #endif /* VDM auto patch */ for (int i = m_topCard - 31; i <= m_topCard - 31 + CardWidth / m_dx; i++) { m_cards[i]->Draw(dc, m_x - m_xOffset + i * m_dx, m_y - m_yOffset); } if (m_topCard > 31) { m_cards[m_topCard]->Draw(dc, topX - m_xOffset - m_dx, topY - m_yOffset); } dc.DestroyClippingRegion(); } return card; }
//+-------------------------------------------------------------+ //| Pile::RemoveTopCard() | //+-------------------------------------------------------------+ //| Description: | //| As RemoveTopCard() but also redraw the top of the pile | //| after the card has been removed. | //| NB: the offset allows for the redrawn area to be in a | //| bitmap ready for 'dragging' cards acrosss the screen. | //+-------------------------------------------------------------+ Card* Pile::RemoveTopCard(wxDC& dc, int xOffset, int yOffset) { int topX, topY, x, y; GetTopCardPos(topX, topY); Card* card = RemoveTopCard(); if (card) { card->Erase(dc, topX - xOffset, topY - yOffset); GetTopCardPos(x, y); if (m_topCard < 0) { Card::DrawNullCard(dc, x - xOffset, y - yOffset); } else { m_cards[m_topCard]->Draw(dc, x - xOffset, y - yOffset); } } return card; }