I was trying to create a card solitaire in C with Allegro 5.
void deck_printout(deck*d)
{
int i;
al_clear_to_color(stdcolor);
for(i=0;i<40;i++){
al_draw_scaled_bitmap(d->cards[i].img,
d->cards[i].xpos,
d->cards[i].ypos,
SWID,
SHEI,
d->cards[i].xpos,
d->cards[i].ypos,
DWID, DHEI, 0);
//printf("%f %f\n",d->cards[i].xpos,d->cards[i].ypos);
//al_draw_scaled_bitmap(d->cards[i].img,0,0,SWID,SHEI,0,0,DWID,DHEI,0);
//al_draw_bitmap(d->cards[i].img,d->cards[i].xpos,d->cards[i].ypos,0);
}
}
This function shuld draw all cards to the display. xpos and ypos are set correctly for each card, SWID and SHEI are 225x315 and DWID and DHEI are 80x112.
The printf()
suggests me that the position of cards is ok, al_draw_bitmap suggests me that this problem may be caused by the scaling.
Here's what it looks like: