📄 cards.h
字号:
/*-----------------------------------------------------------------------------
| CARDS.H
|
| cards.dll external .h file
|
| Insert standard MS copyright BS here.
-----------------------------------------------------------------------------*/
/*-----------------------------------------------------------------------------
| cdtDraw and cdtDrawExt mode flags
-----------------------------------------------------------------------------*/
#define mdFace 0 /* Draw card face up, card to draw specified by cd */
#define mdBackground 1 /* Draw card face down, back specified by cd (cdBackgroundFirst..cdBackgroundLast) */
#define mdHilite 2 /* Same as FaceUp except drawn with NOTSRCCOPY mode */
#define mdGhost 3 /* Draw a ghost card -- for ace piles */
#define mdRemove 4 /* draw background specified by rgbBgnd */
#define mdInvisibleGhost 5 /* ? */
#define mdDeckX 6 /* Draw X */
#define mdDeckO 7 /* Draw O */
#define cdAClubs 0
#define cd2Clubs 4
#define cd3Clubs 8
#define cd4Clubs 12
#define cd5Clubs 16
#define cd6Clubs 20
#define cd7Clubs 24
#define cd8Clubs 28
#define cd9Clubs 32
#define cdTClubs 36
#define cdJClubs 40
#define cdQClubs 44
#define cdKClubs 48
#define cdADiamonds 1
#define cd2Diamonds 5
#define cd3Diamonds 9
#define cd4Diamonds 13
#define cd5Diamonds 17
#define cd6Diamonds 21
#define cd7Diamonds 25
#define cd8Diamonds 29
#define cd9Diamonds 33
#define cdTDiamonds 37
#define cdJDiamonds 41
#define cdQDiamonds 45
#define cdKDiamonds 49
#define cdAHearts 2
#define cd2Hearts 6
#define cd3Hearts 10
#define cd4Hearts 14
#define cd5Hearts 18
#define cd6Hearts 22
#define cd7Hearts 26
#define cd8Hearts 30
#define cd9Hearts 34
#define cdTHearts 38
#define cdJHearts 42
#define cdQHearts 46
#define cdKHearts 50
#define cdASpades 3
#define cd2Spades 7
#define cd3Spades 11
#define cd4Spades 15
#define cd5Spades 19
#define cd6Spades 23
#define cd7Spades 27
#define cd8Spades 31
#define cd9Spades 35
#define cdTSpades 39
#define cdJSpades 43
#define cdQSpades 47
#define cdKSpades 51
/*-----------------------------------------------------------------------------
| Face down cds
-----------------------------------------------------------------------------*/
#define cdBackground1 54
#define cdBackground2 55
#define cdBackground3 56
#define cdBackground4 57
#define cdBackground5 58
#define cdBackground6 59
#define cdBackground7 60
#define cdBackground8 61
#define cdBackground9 62
#define cdBackground10 63
#define cdBackground11 64
#define cdBackground12 65
#define cdBackgroundFirst cdBackground1
#define cdBackgroundLast cdBackground12
/*-----------------------------------------------------------------------------
| cdtInit
|
| Initialize cards.dll -- called once at app boot time.
|
| Arguments:
| int FAR *pdxCard: returns card width
| int FAR *pdyCard: returns card height
|
| Returns:
| TRUE if successful.
-------------------------------------------------------------------------------*/
BOOL WINAPI cdtInit(int FAR *pdxCard, int FAR *pdyCard);
/*-----------------------------------------------------------------------------
| cdtDraw
|
| Draw a card
|
| Arguments:
| HDC hdc
| int x: upper left corner of the card
| int y: upper left corner of the card
| int cd: card to draw (depends on md)
| int md: mode
| mdFaceUp: draw face up card (cd in cdAClubs..cdKSpades)
| mdBackground: draw face down card (cd in cdBackground1..cdBackground12)
| mdHilite: draw face up card inversely
| mdGhost: draw a ghost card, cd ignored
| mdRemove: draw rectangle of background color at x,y
| mdDeckX: draw an X
| mdDeckO: draw an O
| DWORD rgbBgnd: table background color (only required for mdGhost and mdRemove)
|
| Returns:
| TRUE if successful
-----------------------------------------------------------------------------*/
BOOL WINAPI cdtDraw(HDC hdc, int x, int y, int cd, int md, DWORD rgbBgnd);
/*-----------------------------------------------------------------------------
| cdtDrawExt
|
| Same as cdtDraw except will stretch the cards to an arbitray extent
|
| Arguments:
| HDC hdc
| int x
| int y
| int dx
| int dy
| int cd
| int md
| DWORD rgbBgnd:
|
| Returns:
| TRUE if successful
-----------------------------------------------------------------------------*/
BOOL WINAPI cdtDrawExt(HDC hdc, int x, int y, int dx, int dy,
int cd, int md, DWORD rgbBgnd);
/*-----------------------------------------------------------------------------
| cdtAnimate
|
| Draws the animation on a card. Four cards support animation:
|
| cd #frames description
| cdBackground3 4 robot meters
| cdBackground10 2 bats flapping
| cdBackground11 4 sun sticks tongue out
| cdBackground12 4 cards running up and down sleave
|
| Call cdtAnimate every 250 ms for proper animation speed.
|
| Arguments:
| HDC hdc
| int cd cdBackground3, cdBackground10, cdBackground11 or cdBackground12
| int x: upper left corner of card
| int y
| int ispr sprite to draw (0..1 for cdBackground10, 0..3 for others)
|
| Returns:
| TRUE if successful
-----------------------------------------------------------------------------*/
BOOL WINAPI cdtAnimate(HDC hdc, int cd, int x, int y, int ispr);
/*-----------------------------------------------------------------------------
| cdtTerm
|
| Call once at app termination
-----------------------------------------------------------------------------*/
VOID WINAPI cdtTerm(VOID);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -