ReactOS 0.4.15-dev-7924-g5949c20
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
10void LoadCardBitmaps(void);
11
12//static bool __CARDLIB_ACES_HIGH = false;
13extern double __CARDZOOMSPEED;
14
15//
16// Global variables!
17//
20
24
27
28HPALETTE __hPalette;
29
30
31//
32// Cardlib global functions!
33//
34void 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/*
52void CardLib_SetAcesHigh(bool fHigh);
53bool operator != (const Card &lhs, const Card &rhs);
54bool operator == (const Card &lhs, const Card &rhs);
55bool operator < (const Card &lhs, const Card &rhs);
56bool operator <= (const Card &lhs, const Card &rhs);
57bool operator > (const Card &lhs, const Card &rhs);
58bool operator >= (const Card &lhs, const Card &rhs);
59*/
60
61/*
62void CardLib_SetAcesHigh(bool fHigh)
63{
64 __CARDLIB_ACES_HIGH = fHigh;
65}
66
67bool 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
75bool 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
83bool 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
91bool 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
99bool 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
107bool 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}
int __cardwidth
Definition: cardlib.cpp:25
void CardLib_SetZoomSpeed(int speed)
Definition: cardlib.cpp:34
HPALETTE __hPalette
Definition: cardlib.cpp:28
HPALETTE __holdplacepal
Definition: cardlib.cpp:23
HBITMAP __hbmCardBitmaps
Definition: cardlib.cpp:19
void PaintRect(HDC hdc, RECT *rect, COLORREF colour)
Definition: cardlib.cpp:116
void LoadCardBitmaps(void)
Definition: cardbitmaps.cpp:82
HBITMAP __hbmPlaceHolder
Definition: cardlib.cpp:22
HDC __hdcPlaceHolder
Definition: cardlib.cpp:21
int __cardheight
Definition: cardlib.cpp:26
double __CARDZOOMSPEED
HDC __hdcCardBitmaps
Definition: cardlib.cpp:18
#define TEXT(s)
Definition: k32.h:26
HDC hdc
Definition: main.c:9
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:92
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
Definition: string.c:80
& rect
Definition: startmenu.cpp:1413
DWORD COLORREF
Definition: windef.h:300
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
Definition: dc.c:999
#define ExtTextOut
Definition: wingdi.h:4454
#define ETO_OPAQUE
Definition: wingdi.h:647