ReactOS  0.4.14-dev-77-gd9e7c48
cardlib.cpp
Go to the documentation of this file.
1 //
2 // CardLib - not much of interest in here
3 //
4 // Freeware
5 // Copyright J Brown 2001
6 //
7 
8 #include "cardlib.h"
9 
10 void LoadCardBitmaps(void);
11 
12 //static bool __CARDLIB_ACES_HIGH = false;
13 extern double __CARDZOOMSPEED;
14 
15 //
16 // Global variables!
17 //
20 
23 HPALETTE __holdplacepal;
24 
27 
28 HPALETTE __hPalette;
29 
30 
31 //
32 // Cardlib global functions!
33 //
34 void CardLib_SetZoomSpeed(int speed)
35 {
36  __CARDZOOMSPEED = (double)speed;
37 }
38 
39 /*
40 
41  It's dangerous to use these operators, because of all
42  the implicit conversions that could take place, which
43  would have unpredicted side-effects.
44 
45  e.g. Card card(Hearts, 4);
46  if(card == 4) - how does 4 get converted??
47  It uses the Card(int uval) constructor,
48  which results in a 2 of clubs...
49  not what was expected
50 */
51 /*
52 void CardLib_SetAcesHigh(bool fHigh);
53 bool operator != (const Card &lhs, const Card &rhs);
54 bool operator == (const Card &lhs, const Card &rhs);
55 bool operator < (const Card &lhs, const Card &rhs);
56 bool operator <= (const Card &lhs, const Card &rhs);
57 bool operator > (const Card &lhs, const Card &rhs);
58 bool operator >= (const Card &lhs, const Card &rhs);
59 */
60 
61 /*
62 void CardLib_SetAcesHigh(bool fHigh)
63 {
64  __CARDLIB_ACES_HIGH = fHigh;
65 }
66 
67 bool operator == (const Card &lhs, const Card &rhs)
68 {
69  if(__CARDLIB_ACES_HIGH)
70  return lhs.HiVal() == rhs.HiVal();
71  else
72  return lhs.LoVal() == rhs.LoVal();
73 }
74 
75 bool operator != (const Card &lhs, const Card &rhs)
76 {
77  if(__CARDLIB_ACES_HIGH)
78  return lhs.HiVal() != rhs.HiVal();
79  else
80  return lhs.LoVal() != rhs.LoVal();
81 }
82 
83 bool operator > (const Card &lhs, const Card &rhs)
84 {
85  if(__CARDLIB_ACES_HIGH)
86  return lhs.HiVal() > rhs.HiVal();
87  else
88  return lhs.LoVal() > rhs.LoVal();
89 }
90 
91 bool operator >= (const Card &lhs, const Card &rhs)
92 {
93  if(__CARDLIB_ACES_HIGH)
94  return lhs.HiVal() >= rhs.HiVal();
95  else
96  return lhs.LoVal() >= rhs.LoVal();
97 }
98 
99 bool operator < (const Card &lhs, const Card &rhs)
100 {
101  if(__CARDLIB_ACES_HIGH)
102  return lhs.HiVal() < rhs.HiVal();
103  else
104  return lhs.LoVal() < rhs.LoVal();
105 }
106 
107 bool operator <= (const Card &lhs, const Card &rhs)
108 {
109  if(__CARDLIB_ACES_HIGH)
110  return lhs.HiVal() <= rhs.HiVal();
111  else
112  return lhs.LoVal() <= rhs.LoVal();
113 }
114 */
115 
117 {
118  COLORREF oldcr = SetBkColor(hdc, colour);
119  ExtTextOut(hdc, 0, 0, ETO_OPAQUE, rect, TEXT(""), 0, 0);
120  SetBkColor(hdc, oldcr);
121 }
HBITMAP __hbmCardBitmaps
Definition: cardlib.cpp:19
static HDC
Definition: imagelist.c:92
void LoadCardBitmaps(void)
Definition: cardbitmaps.cpp:82
HBITMAP __hbmPlaceHolder
Definition: cardlib.cpp:22
double __CARDZOOMSPEED
HDC __hdcPlaceHolder
Definition: cardlib.cpp:21
& rect
Definition: startmenu.cpp:1413
HDC __hdcCardBitmaps
Definition: cardlib.cpp:18
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
Definition: dc.c:975
#define ETO_OPAQUE
Definition: wingdi.h:646
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
Definition: string.c:80
DWORD COLORREF
Definition: windef.h:285
HPALETTE __hPalette
Definition: cardlib.cpp:28
#define ExtTextOut
Definition: wingdi.h:4449
HDC hdc
Definition: main.c:9
void CardLib_SetZoomSpeed(int speed)
Definition: cardlib.cpp:34
int __cardwidth
Definition: cardlib.cpp:25
void PaintRect(HDC hdc, RECT *rect, COLORREF colour)
Definition: cardlib.cpp:116
#define TEXT(s)
Definition: k32.h:26
int __cardheight
Definition: cardlib.cpp:26
static HBITMAP
Definition: button.c:44
HPALETTE __holdplacepal
Definition: cardlib.cpp:23