コード例 #1
0
ファイル: game.cpp プロジェクト: crankycoder/wxPython-2.9.2.4
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;
}
コード例 #2
0
ファイル: game.cpp プロジェクト: vdm113/wxWidgets-ICC-patch
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;
}
コード例 #3
0
ファイル: pile.cpp プロジェクト: gitrider/wxsj2
//+-------------------------------------------------------------+
//| 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;
}