Subversion Repositories Games.Chess Giants

Rev

Rev 59 | Rev 74 | 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)
68 pmbaty 10
#define PROGRAM_VERSION L"2.8"
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"&notify_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
58
#define MENUID_GAME_RESIGN 107
59
#define MENUID_GAME_STATISTICS 108
60
#define MENUID_GAME_OPTIONS 109
61
#define MENUID_GAME_QUIT 110
62
#define MENUID_CHESSBOARD_SUGGESTMOVE 201
63
#define MENUID_CHESSBOARD_CANCELLASTMOVE 202
64
#define MENUID_CHESSBOARD_COMMENTMOVE 203
65
#define MENUID_CHESSBOARD_GOTOMOVE 204
66
#define MENUID_CHESSBOARD_SWAPSIDES 205
67
#define MENUID_CHESSBOARD_BEGINNINGOFGAME 206
68
#define MENUID_CHESSBOARD_PREVIOUSMOVE 207
69
#define MENUID_CHESSBOARD_NEXTMOVE 208
70
#define MENUID_CHESSBOARD_CURRENTSTATEOFGAME 209
71
#define MENUID_CHESSBOARD_TOPVIEW 210
72
#define MENUID_CHESSBOARD_DEFAULTVIEW 211
73
#define MENUID_CHESSBOARD_RESETVIEW 212
74
#define MENUID_CHESSBOARD_ZOOMIN 213
75
#define MENUID_CHESSBOARD_ZOOMOUT 214
76
#define MENUID_CHESSBOARD_CHANGEAPPEARANCE 215
77
#define MENUID_CHESSBOARD_DISPLAYWINDOWSDESKTOP 216
78
#define MENUID_INTERNET_SHOWONLINEPLAYERS 301
79
#define MENUID_INTERNET_SHOWSOUGHTGAMES 302
80
#define MENUID_INTERNET_SEEKGAME 303
81
#define MENUID_INTERNET_CHATTERCHANNELS 304
82
#define MENUID_INTERNET_ENTERCHATTEXT 305
83
#define MENUID_INTERNET_DISPLAYPLAYERCARD 306
84
#define MENUID_INTERNET_DISPLAYYOURCARD 307
85
#define MENUID_INTERNET_MOTD 308
86
#define MENUID_HELP_HELP 401
87
#define MENUID_HELP_GETCHESSGAMES 402
21 pmbaty 88
#define MENUID_HELP_ADDMODIFYVISUALTHEMES 403
50 pmbaty 89
#define MENUID_HELP_ADDMODIFYENGINES 404
90
#define MENUID_HELP_ADDMODIFYTRANSLATIONS 405
91
#define MENUID_HELP_ABOUT 406
1 pmbaty 92
 
93
 
94
// sound IDs
95
#define SOUNDTYPE_NONE 0
96
#define SOUNDTYPE_MOVE 1
97
#define SOUNDTYPE_ILLEGALMOVE 2
98
#define SOUNDTYPE_PIECETAKEN 3
99
#define SOUNDTYPE_CHECK 4
100
#define SOUNDTYPE_VICTORY 5
101
#define SOUNDTYPE_DEFEAT 6
102
#define SOUNDTYPE_CLICK 7
103
 
104
 
105
// text alignments
106
#define ALIGN_LEFT 0
107
#define ALIGN_TOP 0
108
#define ALIGN_RIGHT 1
109
#define ALIGN_BOTTOM 1
110
#define ALIGN_CENTER 2
111
 
112
 
113
// in case this ever changes...
114
#define MATH_PI 3.14159265358979323846f
115
#define TO_RADIANS (MATH_PI / 180.0f)
116
#define TO_DEGREES (180.0f / MATH_PI)
117
 
118
 
119
// light types
120
#define LIGHT_NONE 0
121
#define LIGHT_DIRECTIONAL 1
122
#define LIGHT_POINT 2
123
#define LIGHT_SPOT 3
124
 
125
 
126
// chess colors
127
#define COLOR_UNSPECIFIED -1 // used in dialog_sendchallenge.cpp and dialog_sendseek.cpp
128
#define COLOR_BLACK 0
129
#define COLOR_WHITE 1
130
 
131
 
132
// chess parts
133
#define PART_NONE 0
134
#define PART_KING 1
135
#define PART_QUEEN 2
136
#define PART_BISHOP 3
137
#define PART_KNIGHT 4
138
#define PART_ROOK 5
139
#define PART_PAWN 6
140
 
141
 
142
// slot flags
143
#define FLAG_NONE 0
144
#define FLAG_SELECTED (1 << 0)
145
#define FLAG_POSSIBLEMOVE (1 << 1)
146
#define FLAG_TAKEABLE (1 << 2)
147
#define FLAG_THREAT (1 << 3)
148
#define FLAG_CHECK (1 << 4)
149
 
150
 
151
// game states
152
#define STATE_UNKNOWN 0
153
#define STATE_SETUPPOSITION 1
154
#define STATE_PLAYING 2
155
#define STATE_WHITEWIN_CHECKMATE 3
156
#define STATE_WHITEWIN_RESIGNORFORFEIT 4
157
#define STATE_BLACKWIN_CHECKMATE 5
158
#define STATE_BLACKWIN_RESIGNORFORFEIT 6
159
#define STATE_DRAW_STALEMATE 7
160
#define STATE_DRAW_AGREEMENT 8
161
#define STATE_DRAW_OTHER 9
162
#define STATE_ADJOURNED 10
163
 
164
 
165
// player types
166
#define PLAYER_HUMAN 0
167
#define PLAYER_COMPUTER 1
168
#define PLAYER_INTERNET 2
169
 
170
 
171
// network opponent rating types
172
#define OPPONENTRATINGTYPE_DEFAULT 0
173
#define OPPONENTRATINGTYPE_ESTIMATED 1 // E character
174
#define OPPONENTRATINGTYPE_PROVISIONAL 2 // P character
175
 
176
 
177
// network opponent handle status
178
#define HANDLESTATUS_UNDEFINED 0
179
#define HANDLESTATUS_AVAILABLE 1 // (space) character
180
#define HANDLESTATUS_INGAME 2 // ^ character
181
#define HANDLESTATUS_INSIMULATION 3 // ~ character
182
#define HANDLESTATUS_INTOURNAMENT 4 // & character
183
#define HANDLESTATUS_EXAMININGAGAME 5 // # character
184
#define HANDLESTATUS_NOTOPENFORAMATCH 6 // : character
185
#define HANDLESTATUS_INACTIVEORBUSY 7 // . character
186
#define HANDLESTATUS_OFFLINE 8 // no representation in player list
187
 
188
 
189
// network opponent handle codes
190
#define HANDLECODE_NONE 0
191
#define HANDLECODE_ADMINISTRATOR (1 << 0) // (*)
192
#define HANDLECODE_BLINDFOLD (1 << 1) // (B)
193
#define HANDLECODE_COMPUTER (1 << 2) // (C)
194
#define HANDLECODE_TEAM (1 << 3) // (T)
195
#define HANDLECODE_UNREGISTERED (1 << 4) // (U)
196
#define HANDLECODE_CHESSADVISOR (1 << 5) // (CA)
197
#define HANDLECODE_SERVICEREPRESENTATIVE (1 << 6) // (SR)
198
#define HANDLECODE_TOURNAMENTDIRECTOR (1 << 7) // (TD)
199
#define HANDLECODE_MAMERMANAGER (1 << 8) // (TM)
200
#define HANDLECODE_FIDEMASTER (1 << 9) // (FM)
201
#define HANDLECODE_FIDEINTERNATIONALMASTER (1 << 10) // (IM)
202
#define HANDLECODE_FIDEGREATMASTER (1 << 11) // (GM)
203
#define HANDLECODE_FIDEWOMENSINTERNATIONALMASTER (1 << 12) // (WIM)
204
#define HANDLECODE_FIDEWOMENSGREATMASTER (1 << 13) // (WGM)
205
 
206
 
207
// rating types
208
#define GAMERATINGTYPE_UNSUPPORTED 0
209
#define GAMERATINGTYPE_SUPPORTEDRATED 1
210
#define GAMERATINGTYPE_SUPPORTEDUNRATED 2
211
 
212
 
213
#endif // DEFINES_H