home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 13 Bitmap / 13-Bitmap.zip / cardbmps.zip / ReadMe < prev    next >
Text File  |  1994-11-28  |  6KB  |  139 lines

  1. A couple of people have asked me for the bitmaps of the cards that I used
  2. when making SeaHaven Towers for OS/2.  Knowing that a good set of cards 
  3. can easily take more than 30 hours to make, not having bitmaps available
  4. can be a serious discouragement for a programmer.  Afterall, sitting for 
  5. a week in a bitmap editor is not most peoples ideas of fun.  Therefor, I
  6. have decide to make my bitmaps available for all to use.  The only thing
  7. that I ask is that if you do use these bitmaps, please send me a copy of 
  8. the finished product.  I spent a lot of time making these cards and I'd 
  9. like to see how there being used.  
  10.  
  11. There are two sizes of cardbitmaps in this archive.  The smaller ones are
  12. 58x79, which is perfect for displaying 10 columns on a 640x480 display.  
  13. The other set is 82x112, perfect for 12 columns on a 1024x768 display.
  14. The naming convention is pretty simple.  The first 1-2 letters is the 
  15. value of the card as follows:
  16. A  Ace
  17. 2..10 two through 10
  18. J  Jack
  19. Q  Queen
  20. K  King
  21. The next letter descibes the suit of the card as follows:
  22. D  diamond
  23. S  Spade
  24. C  Club
  25. H  Heart
  26. The larger card set also has a b on the end to specify "big." Thus, the king 
  27. of spades is KS.BMP in the small set and KSB.BMP in the big set.
  28.  
  29. Other cards that are included are:
  30. CLUB.BMP and CLUBB.BMP        These are the cards used for the empty ace stacks
  31. SPADE.BMP and SPADEB.BMP                        "
  32. HEART.BMP and HEARTB.BMP                        "
  33. DIAMOND.BMP and DIAMONDB.BMP                    "
  34.  
  35. MASK.BMP and MASKB.BMP        The mask for punching a whole in the display
  36.  
  37. TOWERBMP.BMP and TOWERBMB.BMP The empty tower cards. Could be used for a 
  38.                               card back, if desired.
  39.  
  40. BLANK.BMP and BLANKB.BMP      Basically just a blank card to create the empty 
  41.                               column marker.
  42.  
  43.  
  44. Now, if you're planning to use these cards, you're probably wondering 
  45. how to display them.  Well, here is the code taken directly from
  46. SeaHaven Towers for OS/2.  It is all commented pretty well, but if you 
  47. need help understanding it, contact me at dkulp@ccs.neu.edu or at my
  48. mail address of 
  49.  
  50. J. Daniel Kulp  
  51. 2257 Fillmore Avenue
  52. Deltona, FL  32725
  53.  
  54. Note, displaying the blank card is a special case and thus has it's own procedure.
  55.  
  56. VOID DisplayCard(HBM hbm,POINTL aptl[],HPS hps1, HPS hps2)
  57. /* hbm is the handle to the bitmap of the card to be displayed          */
  58. /* aptl[] is the coordinates for the copy as follows:                   */
  59. /*    aptl[0] lower left hand corner of the target hps's                */
  60. /*    aptl[1] upper right hand corner on the target hps                 */
  61. /*    aptl[2] lower corner of card bitmap.  usually set to {0,0}        */
  62. /*    aptl[3] upper corner of card bitmap.  usually set to {cardsizex,cardsizey} */
  63. /* hps1 and hps2 are the target presentation spaces.  In my application */
  64. /* hps1 usually refers to the memory presentaion space that just holds  */
  65. /* a copy of client presentation space.  hps2 is usually the Client     */
  66. /* presentation space.  By doing the intial draw on the memory hps and  */
  67. /* then copying it to the screen, this reduces a lot of flicker         */
  68. /* if hps2 is NULLHANDLE, it will draw to the memory hps, but not to    */
  69. /* the screen                                                           */
  70.  
  71. /* In the below code, hpsMemory is the hps which is being used at a     */
  72. /* bitmap buffer, storeing the bitmaps of the cards.  hbmMask is the    */
  73. /* handle of the bitmap on that presentation space that refers to the   */
  74. /* mask that is used to "punch a hole" in the screen before putting the */
  75. /* card on the screen.  This allows the cards to have rounded corners   */
  76. {
  77. POINTL aptl2[3]={0,0, 0,0, 0,0};  
  78.       /* I happen to like intializing things to zero */
  79.  
  80.  
  81.       /* Set the source bitmap to the Mask */
  82.      if(GpiSetBitmap(hpsMemory,hbmMask) == (HBITMAP)BMB_ERROR)
  83.           DispError(habMain,hwndClient);
  84.  
  85.      /* Copy the mask to the first presentation space */
  86.      if(GpiBitBlt(hps1,hpsMemory,3L,aptl,ROP_SRCAND,BBO_IGNORE)
  87.                      == GPI_ERROR)  DispError(habMain,hwndClient);
  88.  
  89.       /* Set the source bimtap to the card */
  90.      if(GpiSetBitmap(hpsMemory,hbm) == (HBITMAP)BMB_ERROR)
  91.           DispError(habMain,hwndClient);
  92.  
  93.       /* Copy that to the first presentation space */
  94.      if(GpiBitBlt(hps1,hpsMemory,3L,aptl,ROP_SRCPAINT,BBO_IGNORE)
  95.                      == GPI_ERROR)  DispError(habMain,hwndClient);
  96.  
  97.       /* If there is a second hps, copy the result from the first */
  98.       /* to the second presentation space                         */
  99.      if (hps2 != NULLHANDLE) {
  100.              aptl2[0]=aptl[0];
  101.              aptl2[1]=aptl[1];
  102.              aptl2[2]=aptl[0];
  103.              GpiBitBlt(hps2,hps1,3L,aptl2,ROP_SRCCOPY,BBO_IGNORE);
  104.              }
  105. }
  106.  
  107.  
  108. VOID DisplayBlank(PPOINTL aptl,HPS hps1,HPS hps2)
  109. /* This is very similar to Display Card, but it doesn't need to punch a */
  110. /* hole first.  Also, if the blank isn't supposed to be displayed, it   */
  111. /* just erases the area                                                 */
  112.  
  113. /* EmptyColCard is a Bool variable that determines whether the blank    */
  114. /*    should be displayed or not                                        */
  115. /* BackColor stores the background color                                */
  116. {
  117. POINTL aptl2[3]={0,0, 0,0, 0,0};
  118.  
  119.      if (EmptyColCard) {
  120.         if(GpiSetBitmap(hpsMemory,hbmBlank) == (HBITMAP)BMB_ERROR)
  121.               DispError(habMain,hwndClient);
  122.         if(GpiBitBlt(hps1,hpsMemory,4L,aptl,ROP_SRCAND,BBO_IGNORE)
  123.                      == GPI_ERROR)  DispError(habMain,hwndClient);
  124.      } else {
  125.           GpiSetBackColor(hps1,BackColor);
  126.           GpiSetColor(hps1,BackColor);
  127.           GpiSetCurrentPosition(hps1,aptl);
  128.           GpiBox(hps1,DRO_FILL,&aptl[1],0,0);
  129.      }
  130.      if (hps2 != NULLHANDLE) {
  131.           aptl2[0]=aptl[0];
  132.           aptl2[1]=aptl[1];
  133.           aptl2[2]=aptl[0];
  134.           GpiBitBlt(hps2,hps1,3L,aptl2,ROP_SRCCOPY,BBO_IGNORE);
  135.      }
  136. }
  137.  
  138.  
  139.