Subversion Repositories Games.Chess Giants

Rev

Rev 14 | Rev 25 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  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)
  10. #define PROGRAM_VERSION L"2.3"
  11. #define PROGRAM_COPYRIGHT L"© 2010-2014"
  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"
  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. /////////////////////
  24. #define ACCOUNTCREATION_URL L"http://www.freechess.org/cgi-bin/Register/FICS_register.cgi?Language=%s"
  25. #define MAX_STACKABLE_PARTS 8
  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))
  31. #define FENSTARTUP_STANDARDCHESS L"rnbqkbnr/pppppppp/////PPPPPPPP/RNBQKBNR w KQkq - 0 1"
  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
  88. #define MENUID_HELP_ABOUT 403
  89.  
  90.  
  91. // sound IDs
  92. #define SOUNDTYPE_NONE 0
  93. #define SOUNDTYPE_MOVE 1
  94. #define SOUNDTYPE_ILLEGALMOVE 2
  95. #define SOUNDTYPE_PIECETAKEN 3
  96. #define SOUNDTYPE_CHECK 4
  97. #define SOUNDTYPE_VICTORY 5
  98. #define SOUNDTYPE_DEFEAT 6
  99. #define SOUNDTYPE_CLICK 7
  100.  
  101.  
  102. // text alignments
  103. #define ALIGN_LEFT 0
  104. #define ALIGN_TOP 0
  105. #define ALIGN_RIGHT 1
  106. #define ALIGN_BOTTOM 1
  107. #define ALIGN_CENTER 2
  108.  
  109.  
  110. // in case this ever changes...
  111. #define MATH_PI 3.14159265358979323846f
  112. #define TO_RADIANS (MATH_PI / 180.0f)
  113. #define TO_DEGREES (180.0f / MATH_PI)
  114.  
  115.  
  116. // light types
  117. #define LIGHT_NONE 0
  118. #define LIGHT_DIRECTIONAL 1
  119. #define LIGHT_POINT 2
  120. #define LIGHT_SPOT 3
  121.  
  122.  
  123. // chess colors
  124. #define COLOR_UNSPECIFIED -1 // used in dialog_sendchallenge.cpp and dialog_sendseek.cpp
  125. #define COLOR_BLACK 0
  126. #define COLOR_WHITE 1
  127.  
  128.  
  129. // chess parts
  130. #define PART_NONE 0
  131. #define PART_KING 1
  132. #define PART_QUEEN 2
  133. #define PART_BISHOP 3
  134. #define PART_KNIGHT 4
  135. #define PART_ROOK 5
  136. #define PART_PAWN 6
  137.  
  138.  
  139. // slot flags
  140. #define FLAG_NONE 0
  141. #define FLAG_SELECTED (1 << 0)
  142. #define FLAG_POSSIBLEMOVE (1 << 1)
  143. #define FLAG_TAKEABLE (1 << 2)
  144. #define FLAG_THREAT (1 << 3)
  145. #define FLAG_CHECK (1 << 4)
  146.  
  147.  
  148. // game states
  149. #define STATE_UNKNOWN 0
  150. #define STATE_SETUPPOSITION 1
  151. #define STATE_PLAYING 2
  152. #define STATE_WHITEWIN_CHECKMATE 3
  153. #define STATE_WHITEWIN_RESIGNORFORFEIT 4
  154. #define STATE_BLACKWIN_CHECKMATE 5
  155. #define STATE_BLACKWIN_RESIGNORFORFEIT 6
  156. #define STATE_DRAW_STALEMATE 7
  157. #define STATE_DRAW_AGREEMENT 8
  158. #define STATE_DRAW_OTHER 9
  159. #define STATE_ADJOURNED 10
  160.  
  161.  
  162. // player types
  163. #define PLAYER_HUMAN 0
  164. #define PLAYER_COMPUTER 1
  165. #define PLAYER_INTERNET 2
  166.  
  167.  
  168. // network opponent rating types
  169. #define OPPONENTRATINGTYPE_DEFAULT 0
  170. #define OPPONENTRATINGTYPE_ESTIMATED 1 // E character
  171. #define OPPONENTRATINGTYPE_PROVISIONAL 2 // P character
  172.  
  173.  
  174. // network opponent handle status
  175. #define HANDLESTATUS_UNDEFINED 0
  176. #define HANDLESTATUS_AVAILABLE 1 // (space) character
  177. #define HANDLESTATUS_INGAME 2 // ^ character
  178. #define HANDLESTATUS_INSIMULATION 3 // ~ character
  179. #define HANDLESTATUS_INTOURNAMENT 4 // & character
  180. #define HANDLESTATUS_EXAMININGAGAME 5 // # character
  181. #define HANDLESTATUS_NOTOPENFORAMATCH 6 // : character
  182. #define HANDLESTATUS_INACTIVEORBUSY 7 // . character
  183. #define HANDLESTATUS_OFFLINE 8 // no representation in player list
  184.  
  185.  
  186. // network opponent handle codes
  187. #define HANDLECODE_NONE 0
  188. #define HANDLECODE_ADMINISTRATOR (1 << 0) // (*)
  189. #define HANDLECODE_BLINDFOLD (1 << 1) // (B)
  190. #define HANDLECODE_COMPUTER (1 << 2) // (C)
  191. #define HANDLECODE_TEAM (1 << 3) // (T)
  192. #define HANDLECODE_UNREGISTERED (1 << 4) // (U)
  193. #define HANDLECODE_CHESSADVISOR (1 << 5) // (CA)
  194. #define HANDLECODE_SERVICEREPRESENTATIVE (1 << 6) // (SR)
  195. #define HANDLECODE_TOURNAMENTDIRECTOR (1 << 7) // (TD)
  196. #define HANDLECODE_MAMERMANAGER (1 << 8) // (TM)
  197. #define HANDLECODE_FIDEMASTER (1 << 9) // (FM)
  198. #define HANDLECODE_FIDEINTERNATIONALMASTER (1 << 10) // (IM)
  199. #define HANDLECODE_FIDEGREATMASTER (1 << 11) // (GM)
  200. #define HANDLECODE_FIDEWOMENSINTERNATIONALMASTER (1 << 12) // (WIM)
  201. #define HANDLECODE_FIDEWOMENSGREATMASTER (1 << 13) // (WGM)
  202.  
  203.  
  204. // rating types
  205. #define GAMERATINGTYPE_UNSUPPORTED 0
  206. #define GAMERATINGTYPE_SUPPORTEDRATED 1
  207. #define GAMERATINGTYPE_SUPPORTEDUNRATED 2
  208.  
  209.  
  210. #endif // DEFINES_H
  211.