home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d1xx / d186 / cards'o'rama.lha / Cards'O'Rama / Sources / sources.zoo / displaycards.c < prev    next >
C/C++ Source or Header  |  1989-02-25  |  2KB  |  70 lines

  1. /*                              displaycards.c                          */
  2. /*                                                                      */
  3. /* This function displays the cards contained in mycardsposition[]...   */
  4.  
  5. displaycards(opt)
  6.    int opt;
  7.    {
  8.    extern UWORD mycardsposition[];
  9.    extern struct RastPort *rp;
  10.    extern struct Image mycardsimage[];
  11.  
  12.    int times = 1;
  13.    int top = 13;
  14.    int left = 2;
  15.    int card;
  16.  
  17.    while(top <= 136)
  18.       {
  19.       while(left <= 219)
  20.          {
  21.          if (opt)
  22.             {
  23.             card = mycardsposition[times++];
  24.             if (card == 1000)
  25.                {
  26.                left += 31;
  27.                continue;
  28.                }
  29.             }
  30.          else
  31.             {
  32.             card = mycardsposition[times++];
  33.             if (card == 1000)
  34.                {
  35.                left += 31;
  36.                continue;
  37.                }
  38.             card = 0;
  39.             }
  40.  
  41.          placecard(rp, &mycardsimage[card], left, top);  /* Draw a card */
  42.  
  43.          SetAPen(rp, 7);
  44.  
  45.          Move(rp, left + 29, top + 2);          /* Draw right shadow */
  46.          Draw(rp, left + 29, top + 2 + 38);
  47.          Move(rp, left + 30, top + 3);
  48.          Draw(rp, left + 30, top + 3 + 36);
  49.  
  50.          Move(rp, left + 2, top + 39);          /* Draw bottom shadow */
  51.          Draw(rp, left + 2 + 28, top + 39);
  52.          Move(rp, left + 3, top + 40);
  53.          Draw(rp, left + 3 + 26, top + 40);
  54.          left += 31;
  55.          }
  56.       left = 2;
  57.       top += 41;
  58.       }
  59.    return(0);
  60.    }
  61.  
  62. placecard(rp, mycardsimage, left, top)
  63.    struct RastPort *rp;
  64.    struct Image *mycardsimage[];
  65.    int left, top;
  66.    {
  67.    DrawImage(rp, mycardsimage, left, top);
  68.    return(0);
  69.    }
  70.