home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-386-Vol-2of3.iso / x / xhearts.zip / GFX.H < prev    next >
C/C++ Source or Header  |  1992-01-07  |  2KB  |  102 lines

  1. /*
  2.  *    Spider card bitmap drawing routines, modified for external use
  3.  *      by Mike Yang, Silicon Graphics, mikey@sgi.com.
  4.  *
  5.  */
  6.  
  7. #include    <X11/Xlib.h>
  8.  
  9. #ifndef _ARGUMENTS
  10. #if defined(FUNCPROTO) || defined(__STD__) || defined(__cplusplus) || defined(c_plusplus)
  11. #define _ARGUMENTS(arglist) arglist
  12. #else
  13. #define _ARGUMENTS(arglist) ()
  14. #endif
  15. #endif
  16.  
  17. /* gfx defs */
  18.  
  19. typedef    char    Suit;
  20. typedef    char    Rank;
  21. typedef    char    Type;
  22.  
  23. #define    Spade    0
  24. #define    Heart    1
  25. #define    Diamond    2
  26. #define    Club    3
  27.  
  28. #define    Ace    0
  29. #define    Deuce    1
  30. #define    Three    2
  31. #define    Four    3
  32. #define    Five    4
  33. #define    Six    5
  34. #define    Seven    6
  35. #define    Eight    7
  36. #define    Nine    8
  37. #define    Ten    9
  38. #define    Jack    10
  39. #define    Queen    11
  40. #define    King    12
  41.  
  42. #define    NUM_RANKS    13
  43. #define    NUM_SUITS    4
  44. #define    CARDS_PER_DECK    (NUM_RANKS * NUM_SUITS)
  45.  
  46. /* card info*/
  47. #define    CARD_DELTA    30    
  48.  
  49. #define    CARD_HEIGHT    123
  50. #define    CARD_WIDTH    79
  51.  
  52. #define    FACECARD_WIDTH    47
  53. #define    FACECARD_HEIGHT    92
  54.  
  55. #define    RANK_WIDTH    9
  56. #define    RANK_HEIGHT    14
  57.  
  58. #define    RANK_LOC_X    4
  59. #define    RANK_LOC_Y    7
  60.  
  61. #define    SMALL_LOC_X    4
  62. #define    SMALL_LOC_Y    (RANK_HEIGHT + RANK_LOC_Y + 3)
  63.  
  64. #define    MID_CARD_X    (CARD_WIDTH/2)
  65. #define    MID_CARD_Y    (CARD_HEIGHT/2)
  66.  
  67. #define    CARD_COL1_X    (3 * CARD_WIDTH/10)
  68. #define    CARD_COL2_X    (CARD_WIDTH/2)
  69. #define    CARD_COL3_X    (7 * CARD_WIDTH/10)
  70.  
  71. /* 5 diff rows for the two main columns */
  72. /* 1 and 5 are top and bottom, 3 is the middle */
  73. /* 2 & 4 are for the 10 & 9 */
  74. #define    CARD_ROW1_Y    (CARD_HEIGHT/5)
  75. #define    CARD_ROW2_Y    (2 * CARD_HEIGHT/5)
  76. #define    CARD_ROW3_Y    (CARD_HEIGHT/2)
  77. #define    CARD_ROW4_Y    (CARD_HEIGHT - 2 * CARD_HEIGHT/5)
  78. #define    CARD_ROW5_Y    (CARD_HEIGHT - CARD_HEIGHT/5)
  79.  
  80. /* between 1 & 3, 3 & 5 */
  81. #define    CARD_SEVEN_Y    (7 * CARD_HEIGHT/20)
  82. #define    CARD_EIGHT_Y    (CARD_HEIGHT - 7 * CARD_HEIGHT/20)
  83.  
  84. /* between rows 1 & 2, 4 & 5 */
  85. #define    CARD_TEN_Y1    (3 * CARD_HEIGHT/10)
  86. #define    CARD_TEN_Y2    (CARD_HEIGHT - 3 * CARD_HEIGHT/10)
  87.  
  88. /* card positioning */
  89. #define    CARD_INSET_X    10
  90. #define    CARD_INSET_Y    (CARD_HEIGHT/8)
  91.  
  92. #define STACK_SPACING    10
  93. #define    STACK_WIDTH    (CARD_WIDTH + STACK_SPACING)
  94.  
  95. #ifdef NOTDEF
  96. extern gfx_init _ARGUMENTS((Display *, int));
  97. extern paint_card _ARGUMENTS((Window, int, int, Rank, Suit, int));
  98. #else
  99. extern gfx_init();
  100. extern paint_card();
  101. #endif
  102.