Logo Search packages:      
Sourcecode: mathwar version File versions  Download package

void draw_card ( GdkPixmap *  pix,
GdkGC *  def_gc,
GdkGC *  shadow_gc,
gint  card,
gint  x,
gint  y 
)

Draw the requested card at position x, y on the pixmap.

Parameters:
pix The pixmap to draw the cards on.
def_gc The default graphic context used when drawing on the pixmap.
shadow_gc The graphic context to use when drawing the card's shadow.
card The face value of the card. To draw a card back, use CARD_BACK_ONE or CARD_BACK_TWO.
x The x coordinate where the upper left corner of the card should be.
y The y coordinate where the upper left corner of the card should be.
Returns:
Nothing.

Definition at line 129 of file cards.c.

References CARD_BACK_TWO, CARD_HEIGHT, and CARD_WIDTH.

{
   g_return_if_fail (card <= MAX_CARD);
   g_return_if_fail (card >= CARD_BACK_TWO);

   gdk_draw_rectangle (pix, shadow_gc, TRUE,
                       x + SHADOW_SIZE, y + SHADOW_SIZE,
                       CARD_WIDTH, CARD_HEIGHT); 
   gdk_draw_pixmap (pix, def_gc, deck[card + IDX_OFFSET],
                    0, 0, x, y, -1, -1);
   return;
}


Generated by  Doxygen 1.6.0   Back to index