Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

cardlib.cpp

Go to the documentation of this file.
00001 //
00002 //    CardLib - not much of interest in here
00003 //
00004 //    Freeware
00005 //    Copyright J Brown 2001
00006 //
00007 #include <windows.h>
00008 #include "cardlib.h"
00009 #include "globals.h"
00010 
00011 void LoadCardBitmaps(void);
00012 
00013 //static bool __CARDLIB_ACES_HIGH = false;
00014 extern double __CARDZOOMSPEED;
00015 
00016 //
00017 //    Global variables!
00018 //
00019 HDC     __hdcCardBitmaps;
00020 HBITMAP __hbmCardBitmaps;
00021 
00022 HDC        __hdcPlaceHolder;
00023 HBITMAP    __hbmPlaceHolder;
00024 HPALETTE __holdplacepal;
00025 
00026 int        __cardwidth;
00027 int        __cardheight;
00028 
00029 HPALETTE __hPalette;
00030 
00031 
00032 //
00033 //    Cardlib global functions!
00034 //
00035 void CardLib_SetZoomSpeed(int speed)
00036 {
00037     __CARDZOOMSPEED = (double)speed;
00038 }
00039 
00040 /*
00041 
00042   It's dangerous to use these operators, because of all
00043   the implicit conversions that could take place, which
00044   would have unpredicted side-effects.
00045 
00046   e.g. Card card(Hearts, 4);
00047        if(card == 4)    - how does 4 get converted??
00048                           It uses the Card(int uval) constructor,
00049                           which results in a 2 of clubs...
00050                           not what was expected
00051 */
00052 /*
00053 void CardLib_SetAcesHigh(bool fHigh);
00054 bool operator != (const Card &lhs, const Card &rhs);
00055 bool operator == (const Card &lhs, const Card &rhs);
00056 bool operator <  (const Card &lhs, const Card &rhs);
00057 bool operator <= (const Card &lhs, const Card &rhs);
00058 bool operator >  (const Card &lhs, const Card &rhs);
00059 bool operator >= (const Card &lhs, const Card &rhs);
00060 */
00061 
00062 /*
00063 void CardLib_SetAcesHigh(bool fHigh)
00064 {
00065     __CARDLIB_ACES_HIGH = fHigh;
00066 }
00067 
00068 bool operator == (const Card &lhs, const Card &rhs)
00069 {
00070     if(__CARDLIB_ACES_HIGH)
00071         return lhs.HiVal() == rhs.HiVal();
00072     else
00073         return lhs.LoVal() == rhs.LoVal();
00074 }
00075 
00076 bool operator != (const Card &lhs, const Card &rhs)
00077 {
00078     if(__CARDLIB_ACES_HIGH)
00079         return lhs.HiVal() != rhs.HiVal();
00080     else
00081         return lhs.LoVal() != rhs.LoVal();
00082 }
00083 
00084 bool operator > (const Card &lhs, const Card &rhs)
00085 {
00086     if(__CARDLIB_ACES_HIGH)
00087         return lhs.HiVal() > rhs.HiVal();
00088     else
00089         return lhs.LoVal() > rhs.LoVal();
00090 }
00091 
00092 bool operator >= (const Card &lhs, const Card &rhs)
00093 {
00094     if(__CARDLIB_ACES_HIGH)
00095         return lhs.HiVal() >= rhs.HiVal();
00096     else
00097         return lhs.LoVal() >= rhs.LoVal();
00098 }
00099 
00100 bool operator < (const Card &lhs, const Card &rhs)
00101 {
00102     if(__CARDLIB_ACES_HIGH)
00103         return lhs.HiVal() < rhs.HiVal();
00104     else
00105         return lhs.LoVal() < rhs.LoVal();
00106 }
00107 
00108 bool operator <= (const Card &lhs, const Card &rhs)
00109 {
00110     if(__CARDLIB_ACES_HIGH)
00111         return lhs.HiVal() <= rhs.HiVal();
00112     else
00113         return lhs.LoVal() <= rhs.LoVal();
00114 }
00115 */
00116 
00117 void PaintRect(HDC hdc, RECT *rect, COLORREF colour)
00118 {
00119     COLORREF oldcr = SetBkColor(hdc, colour);
00120     ExtTextOut(hdc, 0, 0, ETO_OPAQUE, rect, TEXT(""), 0, 0);
00121     SetBkColor(hdc, oldcr);
00122 }

Generated on Thu Feb 9 04:59:25 2012 for ReactOS by doxygen 1.6.3

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.