Rev 171 | 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) |
||
185 | pmbaty | 10 | #define PROGRAM_URL L"https://www.pmbaty.com/chess" |
1 | pmbaty | 11 | #define AUTHOR_EMAIL L"pm@pmbaty.com" |
185 | pmbaty | 12 | ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
13 | // PayPal stuff - BEGIN <-button ID-> <--------notify URL-------> <---------return URL--------> <-user UUID-> |
||
14 | #define PAYPAL_URL_FR L"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=DC5JKRXQQFNKQ¬ify_url=" PROGRAM_URL L"/notify.php&return=" PROGRAM_URL L"/thankyou.php&custom=" // french |
||
15 | #define PAYPAL_URL_XX L"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=XEQFUPRM5WN68¬ify_url=" PROGRAM_URL L"/notify.php&return=" PROGRAM_URL L"/thankyou.php&custom=" // rest of the world |
||
14 | pmbaty | 16 | // PayPal stuff - END |
185 | pmbaty | 17 | ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
1 | pmbaty | 18 | #define ACCOUNTCREATION_URL L"http://www.freechess.org/cgi-bin/Register/FICS_register.cgi?Language=%s" |
25 | pmbaty | 19 | #define MAX_STACKABLE_PARTS 7 |
1 | pmbaty | 20 | #define MAX_PITCH_FOR_FLAT_ICONS 75.0f |
124 | pmbaty | 21 | #define CLOSEUP_VIEW_DISTANCE 40.0f |
22 | #define CLOSEUP_VIEW_PITCH 6.0f |
||
23 | #define MIN_VIEW_PITCH 10.0f |
||
24 | #define MIN_VIEW_DISTANCE 48.0f |
||
25 | #define MAX_VIEW_PITCH 89.99f |
||
26 | #define MAX_VIEW_DISTANCE 100.0f |
||
1 | pmbaty | 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) |
||
140 | pmbaty | 34 | #define NOCHANGE (-1) |
35 | #define DURATION_INFINITE (999999999.0f) |
||
1 | pmbaty | 36 | |
37 | |||
38 | // color handling macros |
||
39 | #define RGB_TO_RGBACOLOR(r,g,b) ((((unsigned long) (r)) << 24) | (((unsigned long) (g)) << 16) | (((unsigned long) (b)) << 8) | 0x000000FF) |
||
40 | #define RGBA_TO_RGBACOLOR(r,g,b,a) ((((unsigned long) (r)) << 24) | (((unsigned long) (g)) << 16) | (((unsigned long) (b)) << 8) | ((unsigned long) (a))) |
||
41 | #define RGBACOLOR_RED(rgba) ((unsigned char) (((rgba) & 0xFF000000) >> 24)) |
||
42 | #define RGBACOLOR_GREEN(rgba) ((unsigned char) (((rgba) & 0x00FF0000) >> 16)) |
||
43 | #define RGBACOLOR_BLUE(rgba) ((unsigned char) (((rgba) & 0x0000FF00) >> 8)) |
||
44 | #define RGBACOLOR_ALPHA(rgba) ((unsigned char) ((rgba) & 0x000000FF)) |
||
45 | #define RGBACOLOR_SETRED(rgba,red) (((rgba) & 0x00FFFFFF) | (((unsigned long) (red)) << 24)) |
||
46 | #define RGBACOLOR_SETGREEN(rgba,green) (((rgba) & 0xFF00FFFF) | (((unsigned long) (green)) << 16)) |
||
47 | #define RGBACOLOR_SETBLUE(rgba,blue) (((rgba) & 0xFFFF00FF) | (((unsigned long) (blue)) << 8)) |
||
48 | #define RGBACOLOR_SETALPHA(rgba,alpha) (((rgba) & 0xFFFFFF00) | ((unsigned long) (alpha))) |
||
49 | #define RGBACOLOR_FULLALPHA(rgba) ((rgba) | 0x000000FF) |
||
124 | pmbaty | 50 | #define RGBACOLOR_TO_ARGBCOLOR(rgba) ((((rgba) & 0xFFFFFF00) >> 8) | (((rgba) & 0x00FFFFFF) << 24)) |
1 | pmbaty | 51 | |
52 | |||
124 | pmbaty | 53 | // handy macros |
54 | #define GUIBUTTON_ENABLE(button) { if ((button).state == 0) { (button).state = 1; /*the_board.reevaluate =*/ the_scene.update = true; } } |
||
55 | #define GUIBUTTON_DISABLE(button) { if ((button).state > 0) { (button).state = 0; /*the_board.reevaluate =*/ the_scene.update = true; } } |
||
56 | |||
57 | |||
1 | pmbaty | 58 | // menu item IDs |
136 | pmbaty | 59 | #define MENUID_RESOURCEBASE 20000 |
60 | #define MENUID_GAME_NEWGAME (MENUID_RESOURCEBASE + 101) |
||
61 | #define MENUID_GAME_SETUPPOSITION (MENUID_RESOURCEBASE + 102) |
||
62 | #define MENUID_GAME_LOAD (MENUID_RESOURCEBASE + 103) |
||
63 | #define MENUID_GAME_SAVE (MENUID_RESOURCEBASE + 104) |
||
64 | #define MENUID_GAME_SAVEAS (MENUID_RESOURCEBASE + 105) |
||
65 | #define MENUID_GAME_SAVEPOSITIONAS (MENUID_RESOURCEBASE + 106) |
||
66 | #define MENUID_GAME_PAUSE (MENUID_RESOURCEBASE + 107) |
||
67 | #define MENUID_GAME_RESIGN (MENUID_RESOURCEBASE + 108) |
||
68 | #define MENUID_GAME_STATISTICS (MENUID_RESOURCEBASE + 109) |
||
69 | #define MENUID_GAME_OPTIONS (MENUID_RESOURCEBASE + 110) |
||
70 | #define MENUID_GAME_QUIT (MENUID_RESOURCEBASE + 111) |
||
71 | #define MENUID_MOVE_CANCELLASTMOVE (MENUID_RESOURCEBASE + 201) |
||
72 | #define MENUID_MOVE_SUGGESTMOVE (MENUID_RESOURCEBASE + 202) |
||
73 | #define MENUID_MOVE_COMMENTMOVE (MENUID_RESOURCEBASE + 203) |
||
74 | #define MENUID_MOVE_GOTOMOVE (MENUID_RESOURCEBASE + 204) |
||
75 | #define MENUID_CHESSBOARD_SWAPSIDES (MENUID_RESOURCEBASE + 205) |
||
76 | #define MENUID_CHESSBOARD_RENAMESIDES (MENUID_RESOURCEBASE + 206) |
||
77 | #define MENUID_CHESSBOARD_BEGINNINGOFGAME (MENUID_RESOURCEBASE + 207) |
||
78 | #define MENUID_CHESSBOARD_PREVIOUSMOVE (MENUID_RESOURCEBASE + 208) |
||
79 | #define MENUID_CHESSBOARD_NEXTMOVE (MENUID_RESOURCEBASE + 209) |
||
80 | #define MENUID_CHESSBOARD_CURRENTSTATEOFGAME (MENUID_RESOURCEBASE + 210) |
||
81 | #define MENUID_CHESSBOARD_TOPVIEW (MENUID_RESOURCEBASE + 211) |
||
82 | #define MENUID_CHESSBOARD_DEFAULTVIEW (MENUID_RESOURCEBASE + 212) |
||
83 | #define MENUID_CHESSBOARD_RESETVIEW (MENUID_RESOURCEBASE + 213) |
||
84 | #define MENUID_CHESSBOARD_ZOOMIN (MENUID_RESOURCEBASE + 214) |
||
85 | #define MENUID_CHESSBOARD_ZOOMOUT (MENUID_RESOURCEBASE + 215) |
||
86 | #define MENUID_CHESSBOARD_CHANGEAPPEARANCE (MENUID_RESOURCEBASE + 216) |
||
87 | #define MENUID_CHESSBOARD_DISPLAYWINDOWSDESKTOP (MENUID_RESOURCEBASE + 217) |
||
88 | #define MENUID_INTERNET_SHOWONLINEPLAYERS (MENUID_RESOURCEBASE + 301) |
||
89 | #define MENUID_INTERNET_SHOWSOUGHTGAMES (MENUID_RESOURCEBASE + 302) |
||
90 | #define MENUID_INTERNET_SEEKGAME (MENUID_RESOURCEBASE + 303) |
||
91 | #define MENUID_INTERNET_CHATTERCHANNELS (MENUID_RESOURCEBASE + 304) |
||
92 | #define MENUID_INTERNET_ENTERCHATTEXT (MENUID_RESOURCEBASE + 305) |
||
93 | #define MENUID_INTERNET_DISPLAYPLAYERCARD (MENUID_RESOURCEBASE + 306) |
||
94 | #define MENUID_INTERNET_DISPLAYYOURCARD (MENUID_RESOURCEBASE + 307) |
||
95 | #define MENUID_INTERNET_MOTD (MENUID_RESOURCEBASE + 308) |
||
96 | #define MENUID_HELP_HELP (MENUID_RESOURCEBASE + 401) |
||
97 | #define MENUID_HELP_GETCHESSGAMES (MENUID_RESOURCEBASE + 402) |
||
98 | #define MENUID_HELP_ADDMODIFYVISUALTHEMES (MENUID_RESOURCEBASE + 403) |
||
99 | #define MENUID_HELP_ADDMODIFYENGINES (MENUID_RESOURCEBASE + 404) |
||
100 | #define MENUID_HELP_ADDMODIFYTRANSLATIONS (MENUID_RESOURCEBASE + 405) |
||
154 | pmbaty | 101 | #define MENUID_HELP_REPORTAPROBLEM (MENUID_RESOURCEBASE + 406) |
102 | #define MENUID_HELP_ABOUT (MENUID_RESOURCEBASE + 407) |
||
1 | pmbaty | 103 | |
104 | |||
105 | // sound IDs |
||
106 | #define SOUNDTYPE_NONE 0 |
||
107 | #define SOUNDTYPE_MOVE 1 |
||
108 | #define SOUNDTYPE_ILLEGALMOVE 2 |
||
109 | #define SOUNDTYPE_PIECETAKEN 3 |
||
110 | #define SOUNDTYPE_CHECK 4 |
||
111 | #define SOUNDTYPE_VICTORY 5 |
||
112 | #define SOUNDTYPE_DEFEAT 6 |
||
113 | #define SOUNDTYPE_CLICK 7 |
||
130 | pmbaty | 114 | #define SOUNDTYPE_SLIDE 8 |
171 | pmbaty | 115 | #define SOUNDTYPE_HINTWINDOW 9 |
116 | #define SOUNDTYPE_IMPORTANT 10 |
||
1 | pmbaty | 117 | |
118 | |||
119 | // text alignments |
||
120 | #define ALIGN_LEFT 0 |
||
121 | #define ALIGN_TOP 0 |
||
122 | #define ALIGN_RIGHT 1 |
||
123 | #define ALIGN_BOTTOM 1 |
||
124 | #define ALIGN_CENTER 2 |
||
125 | |||
126 | |||
127 | // in case this ever changes... |
||
128 | #define MATH_PI 3.14159265358979323846f |
||
129 | #define TO_RADIANS (MATH_PI / 180.0f) |
||
130 | #define TO_DEGREES (180.0f / MATH_PI) |
||
131 | |||
132 | |||
133 | // light types |
||
134 | #define LIGHT_NONE 0 |
||
135 | #define LIGHT_DIRECTIONAL 1 |
||
136 | #define LIGHT_POINT 2 |
||
137 | #define LIGHT_SPOT 3 |
||
138 | |||
139 | |||
140 | // chess colors |
||
141 | #define COLOR_UNSPECIFIED -1 // used in dialog_sendchallenge.cpp and dialog_sendseek.cpp |
||
142 | #define COLOR_BLACK 0 |
||
143 | #define COLOR_WHITE 1 |
||
144 | |||
145 | |||
146 | // chess parts |
||
147 | #define PART_NONE 0 |
||
148 | #define PART_KING 1 |
||
149 | #define PART_QUEEN 2 |
||
150 | #define PART_BISHOP 3 |
||
151 | #define PART_KNIGHT 4 |
||
152 | #define PART_ROOK 5 |
||
153 | #define PART_PAWN 6 |
||
154 | |||
155 | |||
156 | // slot flags |
||
157 | #define FLAG_NONE 0 |
||
158 | #define FLAG_SELECTED (1 << 0) |
||
159 | #define FLAG_POSSIBLEMOVE (1 << 1) |
||
160 | #define FLAG_TAKEABLE (1 << 2) |
||
161 | #define FLAG_THREAT (1 << 3) |
||
162 | #define FLAG_CHECK (1 << 4) |
||
163 | |||
164 | |||
165 | // game states |
||
166 | #define STATE_UNKNOWN 0 |
||
167 | #define STATE_SETUPPOSITION 1 |
||
168 | #define STATE_PLAYING 2 |
||
169 | #define STATE_WHITEWIN_CHECKMATE 3 |
||
170 | #define STATE_WHITEWIN_RESIGNORFORFEIT 4 |
||
171 | #define STATE_BLACKWIN_CHECKMATE 5 |
||
172 | #define STATE_BLACKWIN_RESIGNORFORFEIT 6 |
||
173 | #define STATE_DRAW_STALEMATE 7 |
||
174 | #define STATE_DRAW_AGREEMENT 8 |
||
175 | #define STATE_DRAW_OTHER 9 |
||
176 | #define STATE_ADJOURNED 10 |
||
177 | |||
178 | |||
136 | pmbaty | 179 | // resign types |
180 | #define RESIGNTYPE_UNDEFINED 0 |
||
181 | #define RESIGNTYPE_NEWGAME 1 |
||
182 | #define RESIGNTYPE_LOADGAME 2 |
||
183 | |||
184 | |||
1 | pmbaty | 185 | // player types |
186 | #define PLAYER_HUMAN 0 |
||
187 | #define PLAYER_COMPUTER 1 |
||
188 | #define PLAYER_INTERNET 2 |
||
189 | |||
190 | |||
191 | // network opponent rating types |
||
192 | #define OPPONENTRATINGTYPE_DEFAULT 0 |
||
193 | #define OPPONENTRATINGTYPE_ESTIMATED 1 // E character |
||
194 | #define OPPONENTRATINGTYPE_PROVISIONAL 2 // P character |
||
195 | |||
196 | |||
197 | // network opponent handle status |
||
198 | #define HANDLESTATUS_UNDEFINED 0 |
||
199 | #define HANDLESTATUS_AVAILABLE 1 // (space) character |
||
200 | #define HANDLESTATUS_INGAME 2 // ^ character |
||
201 | #define HANDLESTATUS_INSIMULATION 3 // ~ character |
||
202 | #define HANDLESTATUS_INTOURNAMENT 4 // & character |
||
203 | #define HANDLESTATUS_EXAMININGAGAME 5 // # character |
||
204 | #define HANDLESTATUS_NOTOPENFORAMATCH 6 // : character |
||
205 | #define HANDLESTATUS_INACTIVEORBUSY 7 // . character |
||
206 | #define HANDLESTATUS_OFFLINE 8 // no representation in player list |
||
207 | |||
208 | |||
209 | // network opponent handle codes |
||
210 | #define HANDLECODE_NONE 0 |
||
211 | #define HANDLECODE_ADMINISTRATOR (1 << 0) // (*) |
||
212 | #define HANDLECODE_BLINDFOLD (1 << 1) // (B) |
||
213 | #define HANDLECODE_COMPUTER (1 << 2) // (C) |
||
214 | #define HANDLECODE_TEAM (1 << 3) // (T) |
||
215 | #define HANDLECODE_UNREGISTERED (1 << 4) // (U) |
||
216 | #define HANDLECODE_CHESSADVISOR (1 << 5) // (CA) |
||
217 | #define HANDLECODE_SERVICEREPRESENTATIVE (1 << 6) // (SR) |
||
218 | #define HANDLECODE_TOURNAMENTDIRECTOR (1 << 7) // (TD) |
||
219 | #define HANDLECODE_MAMERMANAGER (1 << 8) // (TM) |
||
220 | #define HANDLECODE_FIDEMASTER (1 << 9) // (FM) |
||
221 | #define HANDLECODE_FIDEINTERNATIONALMASTER (1 << 10) // (IM) |
||
222 | #define HANDLECODE_FIDEGREATMASTER (1 << 11) // (GM) |
||
223 | #define HANDLECODE_FIDEWOMENSINTERNATIONALMASTER (1 << 12) // (WIM) |
||
224 | #define HANDLECODE_FIDEWOMENSGREATMASTER (1 << 13) // (WGM) |
||
225 | |||
226 | |||
227 | // rating types |
||
228 | #define GAMERATINGTYPE_UNSUPPORTED 0 |
||
229 | #define GAMERATINGTYPE_SUPPORTEDRATED 1 |
||
230 | #define GAMERATINGTYPE_SUPPORTEDUNRATED 2 |
||
231 | |||
232 | |||
233 | #endif // DEFINES_H |