Rev 74 | Rev 89 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1 | pmbaty | 1 | // defines.h |
2 | |||
3 | #ifndef DEFINES_H |
||
4 | #define DEFINES_H |
||
5 | |||
6 | |||
7 | // common definitions |
||
8 | #define PROGRAM_NAME L"Chess Giants" |
||
9 | #define DEMO_TIMEOUT (6.0f * 60.0f) |
||
74 | pmbaty | 10 | //#define PROGRAM_VERSION L"2.8" // no longer used. Version comes in the form YYYYMMDD and is built in dialog_about.cpp |
59 | pmbaty | 11 | #define PROGRAM_COPYRIGHT L"© 2010-2015" |
1 | pmbaty | 12 | #define PROGRAM_URL L"http://www.pmbaty.com/chess" |
13 | #define AUTHOR_NAME L"Pierre-Marie Baty" |
||
14 | #define AUTHOR_EMAIL L"pm@pmbaty.com" |
||
14 | pmbaty | 15 | /////////////////////// |
16 | // PayPal stuff - BEGIN |
||
17 | #define PAYPAL_BUTTONID L"DC5JKRXQQFNKQ" |
||
18 | #define PAYPAL_NOTIFYURL PROGRAM_URL L"/notify.php" |
||
19 | #define PAYPAL_RETURNURL PROGRAM_URL L"/thankyou.php" |
||
20 | #define PAYPAL_URL L"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=" PAYPAL_BUTTONID L"¬ify_url=" PAYPAL_NOTIFYURL L"&return=" PAYPAL_RETURNURL |
||
21 | #define NOPAYPAL_URL PROGRAM_URL L"/nopaypal.php" |
||
22 | // PayPal stuff - END |
||
23 | ///////////////////// |
||
1 | pmbaty | 24 | #define ACCOUNTCREATION_URL L"http://www.freechess.org/cgi-bin/Register/FICS_register.cgi?Language=%s" |
25 | pmbaty | 25 | #define MAX_STACKABLE_PARTS 7 |
1 | pmbaty | 26 | #define MAX_PITCH_FOR_FLAT_ICONS 75.0f |
27 | #define ANIMATION_DURATION 1.0f |
||
28 | #define WCHAR_SIZEOF(a) (sizeof (a) / sizeof (wchar_t)) |
||
29 | #define LOCALIZE(a) LocalizedTexts_GetLocalizedTextFor (a) |
||
30 | #define IS_VALID_POSITION(pos) (((pos)[0] >= 0) && ((pos)[0] < 8) && ((pos)[1] >= 0) && ((pos)[1] < 8)) |
||
44 | pmbaty | 31 | #define FENSTARTUP_STANDARDCHESS L"rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1" |
1 | pmbaty | 32 | #define PGNMOVENUMBER_TO_MOVEINDEX(move,color) (2 * ((move) - 1) + ((color) == COLOR_BLACK ? 1 : 0)) |
33 | #define MOVEINDEX_TO_PGNMOVENUMBER(moveindex) (1 + ((moveindex) - ((moveindex) % 2)) / 2) |
||
34 | |||
35 | |||
36 | // color handling macros |
||
37 | #define RGB_TO_RGBACOLOR(r,g,b) ((((unsigned long) (r)) << 24) | (((unsigned long) (g)) << 16) | (((unsigned long) (b)) << 8) | 0x000000FF) |
||
38 | #define RGBA_TO_RGBACOLOR(r,g,b,a) ((((unsigned long) (r)) << 24) | (((unsigned long) (g)) << 16) | (((unsigned long) (b)) << 8) | ((unsigned long) (a))) |
||
39 | #define RGBACOLOR_RED(rgba) ((unsigned char) (((rgba) & 0xFF000000) >> 24)) |
||
40 | #define RGBACOLOR_GREEN(rgba) ((unsigned char) (((rgba) & 0x00FF0000) >> 16)) |
||
41 | #define RGBACOLOR_BLUE(rgba) ((unsigned char) (((rgba) & 0x0000FF00) >> 8)) |
||
42 | #define RGBACOLOR_ALPHA(rgba) ((unsigned char) ((rgba) & 0x000000FF)) |
||
43 | #define RGBACOLOR_SETRED(rgba,red) (((rgba) & 0x00FFFFFF) | (((unsigned long) (red)) << 24)) |
||
44 | #define RGBACOLOR_SETGREEN(rgba,green) (((rgba) & 0xFF00FFFF) | (((unsigned long) (green)) << 16)) |
||
45 | #define RGBACOLOR_SETBLUE(rgba,blue) (((rgba) & 0xFFFF00FF) | (((unsigned long) (blue)) << 8)) |
||
46 | #define RGBACOLOR_SETALPHA(rgba,alpha) (((rgba) & 0xFFFFFF00) | ((unsigned long) (alpha))) |
||
47 | #define RGBACOLOR_FULLALPHA(rgba) ((rgba) | 0x000000FF) |
||
48 | #define RGBACOLOR_TO_ARGBCOLOR(rgba) (((rgba) >> 8) | ((rgba) << 24)) |
||
49 | |||
50 | |||
51 | // menu item IDs |
||
52 | #define MENUID_GAME_NEWGAME 101 |
||
53 | #define MENUID_GAME_SETUPPOSITION 102 |
||
54 | #define MENUID_GAME_LOAD 103 |
||
55 | #define MENUID_GAME_SAVE 104 |
||
56 | #define MENUID_GAME_SAVEAS 105 |
||
57 | #define MENUID_GAME_SAVEPOSITIONAS 106 |
||
75 | pmbaty | 58 | #define MENUID_GAME_PAUSE 107 |
59 | #define MENUID_GAME_RESIGN 108 |
||
60 | #define MENUID_GAME_STATISTICS 109 |
||
61 | #define MENUID_GAME_OPTIONS 110 |
||
62 | #define MENUID_GAME_QUIT 111 |
||
1 | pmbaty | 63 | #define MENUID_CHESSBOARD_SUGGESTMOVE 201 |
64 | #define MENUID_CHESSBOARD_CANCELLASTMOVE 202 |
||
65 | #define MENUID_CHESSBOARD_COMMENTMOVE 203 |
||
66 | #define MENUID_CHESSBOARD_GOTOMOVE 204 |
||
67 | #define MENUID_CHESSBOARD_SWAPSIDES 205 |
||
75 | pmbaty | 68 | #define MENUID_CHESSBOARD_RENAMESIDES 206 |
69 | #define MENUID_CHESSBOARD_BEGINNINGOFGAME 207 |
||
70 | #define MENUID_CHESSBOARD_PREVIOUSMOVE 208 |
||
71 | #define MENUID_CHESSBOARD_NEXTMOVE 209 |
||
72 | #define MENUID_CHESSBOARD_CURRENTSTATEOFGAME 210 |
||
73 | #define MENUID_CHESSBOARD_TOPVIEW 211 |
||
74 | #define MENUID_CHESSBOARD_DEFAULTVIEW 212 |
||
75 | #define MENUID_CHESSBOARD_RESETVIEW 213 |
||
76 | #define MENUID_CHESSBOARD_ZOOMIN 214 |
||
77 | #define MENUID_CHESSBOARD_ZOOMOUT 215 |
||
78 | #define MENUID_CHESSBOARD_CHANGEAPPEARANCE 216 |
||
79 | #define MENUID_CHESSBOARD_DISPLAYWINDOWSDESKTOP 217 |
||
1 | pmbaty | 80 | #define MENUID_INTERNET_SHOWONLINEPLAYERS 301 |
81 | #define MENUID_INTERNET_SHOWSOUGHTGAMES 302 |
||
82 | #define MENUID_INTERNET_SEEKGAME 303 |
||
83 | #define MENUID_INTERNET_CHATTERCHANNELS 304 |
||
84 | #define MENUID_INTERNET_ENTERCHATTEXT 305 |
||
85 | #define MENUID_INTERNET_DISPLAYPLAYERCARD 306 |
||
86 | #define MENUID_INTERNET_DISPLAYYOURCARD 307 |
||
87 | #define MENUID_INTERNET_MOTD 308 |
||
88 | #define MENUID_HELP_HELP 401 |
||
89 | #define MENUID_HELP_GETCHESSGAMES 402 |
||
21 | pmbaty | 90 | #define MENUID_HELP_ADDMODIFYVISUALTHEMES 403 |
50 | pmbaty | 91 | #define MENUID_HELP_ADDMODIFYENGINES 404 |
92 | #define MENUID_HELP_ADDMODIFYTRANSLATIONS 405 |
||
93 | #define MENUID_HELP_ABOUT 406 |
||
1 | pmbaty | 94 | |
95 | |||
96 | // sound IDs |
||
97 | #define SOUNDTYPE_NONE 0 |
||
98 | #define SOUNDTYPE_MOVE 1 |
||
99 | #define SOUNDTYPE_ILLEGALMOVE 2 |
||
100 | #define SOUNDTYPE_PIECETAKEN 3 |
||
101 | #define SOUNDTYPE_CHECK 4 |
||
102 | #define SOUNDTYPE_VICTORY 5 |
||
103 | #define SOUNDTYPE_DEFEAT 6 |
||
104 | #define SOUNDTYPE_CLICK 7 |
||
105 | |||
106 | |||
107 | // text alignments |
||
108 | #define ALIGN_LEFT 0 |
||
109 | #define ALIGN_TOP 0 |
||
110 | #define ALIGN_RIGHT 1 |
||
111 | #define ALIGN_BOTTOM 1 |
||
112 | #define ALIGN_CENTER 2 |
||
113 | |||
114 | |||
115 | // in case this ever changes... |
||
116 | #define MATH_PI 3.14159265358979323846f |
||
117 | #define TO_RADIANS (MATH_PI / 180.0f) |
||
118 | #define TO_DEGREES (180.0f / MATH_PI) |
||
119 | |||
120 | |||
121 | // light types |
||
122 | #define LIGHT_NONE 0 |
||
123 | #define LIGHT_DIRECTIONAL 1 |
||
124 | #define LIGHT_POINT 2 |
||
125 | #define LIGHT_SPOT 3 |
||
126 | |||
127 | |||
128 | // chess colors |
||
129 | #define COLOR_UNSPECIFIED -1 // used in dialog_sendchallenge.cpp and dialog_sendseek.cpp |
||
130 | #define COLOR_BLACK 0 |
||
131 | #define COLOR_WHITE 1 |
||
132 | |||
133 | |||
134 | // chess parts |
||
135 | #define PART_NONE 0 |
||
136 | #define PART_KING 1 |
||
137 | #define PART_QUEEN 2 |
||
138 | #define PART_BISHOP 3 |
||
139 | #define PART_KNIGHT 4 |
||
140 | #define PART_ROOK 5 |
||
141 | #define PART_PAWN 6 |
||
142 | |||
143 | |||
144 | // slot flags |
||
145 | #define FLAG_NONE 0 |
||
146 | #define FLAG_SELECTED (1 << 0) |
||
147 | #define FLAG_POSSIBLEMOVE (1 << 1) |
||
148 | #define FLAG_TAKEABLE (1 << 2) |
||
149 | #define FLAG_THREAT (1 << 3) |
||
150 | #define FLAG_CHECK (1 << 4) |
||
151 | |||
152 | |||
153 | // game states |
||
154 | #define STATE_UNKNOWN 0 |
||
155 | #define STATE_SETUPPOSITION 1 |
||
156 | #define STATE_PLAYING 2 |
||
157 | #define STATE_WHITEWIN_CHECKMATE 3 |
||
158 | #define STATE_WHITEWIN_RESIGNORFORFEIT 4 |
||
159 | #define STATE_BLACKWIN_CHECKMATE 5 |
||
160 | #define STATE_BLACKWIN_RESIGNORFORFEIT 6 |
||
161 | #define STATE_DRAW_STALEMATE 7 |
||
162 | #define STATE_DRAW_AGREEMENT 8 |
||
163 | #define STATE_DRAW_OTHER 9 |
||
164 | #define STATE_ADJOURNED 10 |
||
165 | |||
166 | |||
167 | // player types |
||
168 | #define PLAYER_HUMAN 0 |
||
169 | #define PLAYER_COMPUTER 1 |
||
170 | #define PLAYER_INTERNET 2 |
||
171 | |||
172 | |||
173 | // network opponent rating types |
||
174 | #define OPPONENTRATINGTYPE_DEFAULT 0 |
||
175 | #define OPPONENTRATINGTYPE_ESTIMATED 1 // E character |
||
176 | #define OPPONENTRATINGTYPE_PROVISIONAL 2 // P character |
||
177 | |||
178 | |||
179 | // network opponent handle status |
||
180 | #define HANDLESTATUS_UNDEFINED 0 |
||
181 | #define HANDLESTATUS_AVAILABLE 1 // (space) character |
||
182 | #define HANDLESTATUS_INGAME 2 // ^ character |
||
183 | #define HANDLESTATUS_INSIMULATION 3 // ~ character |
||
184 | #define HANDLESTATUS_INTOURNAMENT 4 // & character |
||
185 | #define HANDLESTATUS_EXAMININGAGAME 5 // # character |
||
186 | #define HANDLESTATUS_NOTOPENFORAMATCH 6 // : character |
||
187 | #define HANDLESTATUS_INACTIVEORBUSY 7 // . character |
||
188 | #define HANDLESTATUS_OFFLINE 8 // no representation in player list |
||
189 | |||
190 | |||
191 | // network opponent handle codes |
||
192 | #define HANDLECODE_NONE 0 |
||
193 | #define HANDLECODE_ADMINISTRATOR (1 << 0) // (*) |
||
194 | #define HANDLECODE_BLINDFOLD (1 << 1) // (B) |
||
195 | #define HANDLECODE_COMPUTER (1 << 2) // (C) |
||
196 | #define HANDLECODE_TEAM (1 << 3) // (T) |
||
197 | #define HANDLECODE_UNREGISTERED (1 << 4) // (U) |
||
198 | #define HANDLECODE_CHESSADVISOR (1 << 5) // (CA) |
||
199 | #define HANDLECODE_SERVICEREPRESENTATIVE (1 << 6) // (SR) |
||
200 | #define HANDLECODE_TOURNAMENTDIRECTOR (1 << 7) // (TD) |
||
201 | #define HANDLECODE_MAMERMANAGER (1 << 8) // (TM) |
||
202 | #define HANDLECODE_FIDEMASTER (1 << 9) // (FM) |
||
203 | #define HANDLECODE_FIDEINTERNATIONALMASTER (1 << 10) // (IM) |
||
204 | #define HANDLECODE_FIDEGREATMASTER (1 << 11) // (GM) |
||
205 | #define HANDLECODE_FIDEWOMENSINTERNATIONALMASTER (1 << 12) // (WIM) |
||
206 | #define HANDLECODE_FIDEWOMENSGREATMASTER (1 << 13) // (WGM) |
||
207 | |||
208 | |||
209 | // rating types |
||
210 | #define GAMERATINGTYPE_UNSUPPORTED 0 |
||
211 | #define GAMERATINGTYPE_SUPPORTEDRATED 1 |
||
212 | #define GAMERATINGTYPE_SUPPORTEDUNRATED 2 |
||
213 | |||
214 | |||
215 | #endif // DEFINES_H |