Logo Search packages:      
Sourcecode: vdr-plugin-spider version File versions

void SpiderGame::paintPile ( unsigned int  p  )  [private]

Paint a pile

Definition at line 336 of file game.c.

References paintBack(), paintCard(), paintCursor(), paintFrame(), and Tableau::piles.

Referenced by paint().

{
  int pileX = xPos + 1 + p * (cardWidth + xDist);
  int pileY = yPos + 1 + cardHeight + 1;
  paintFrame(pileX, pileY);

  int count = tableau->piles[p]->count();
  int closed = count - tableau->piles[p]->open();
  int unselected = count - tableau->piles[p]->selected();
  int dist = yDist;
  if (pileY + (count + 1) * dist > yPos + height)
    dist = (yPos + height - pileY) / (count + 1);

  for (int c = 0; c < count; ++c, pileY += dist)
  {
    if (c == unselected)
      pileY += dist;
    if (c < closed)
      paintBack(pileX, pileY);
    else
      paintCard(pileX, pileY, tableau->piles[p]->card(c));
  }
  if (count > 0)
    pileY -= dist;
  if ((status == cursorOnPile || status == selectedPile) && p == currentPile)
    paintCursor(pileX, pileY);
}


Generated by  Doxygen 1.6.0   Back to index