Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

97 lines
2.9 KiB

  1. /* game stuff */
  2. /* GaMe struct */
  3. typedef struct _gm
  4. {
  5. LRESULT (FAR *lpfnGmProc)(GM, INT, WPARAM, LPARAM); /* our illustrious gameproc */
  6. UDR udr; /* undo record */
  7. BOOL fDealt; /* TRUE if cards have been dealt */
  8. BOOL fInput; /* TRUE if input has been recieved after dealing */
  9. BOOL fWon; /* TRUE if game is won (and in win sequence) */
  10. INT sco; /* da sco */
  11. INT iqsecScore; /* # of quarter seconds since first input */
  12. INT dqsecScore; /* # of quarter seconds betweeen decrementing score */
  13. INT ccrdDeal; /* # of cards to deal from deck */
  14. INT irep; /* # of times thru the deck */
  15. PT ptMousePrev; /* cache of previous mouse position */
  16. BOOL fButtonDown; /* TRUE if mouse button down or kbd sel */
  17. INT icolKbd; /* Current cursor position via kbd */
  18. INT icrdKbd;
  19. INT icolSel; /* Current selection */
  20. INT icolHilight; /* Column currently hilighted (while draggin) */
  21. DY dyDragMax; /* maximum height of column (for dragging) */
  22. INT icolMac;
  23. INT icolMax;
  24. COL *rgpcol[1];
  25. } GM;
  26. // Constants - earlier they were generated in the game.msg file.
  27. #define icolNil -1
  28. #define msggInit 0
  29. #define msggEnd 1
  30. #define msggKeyHit 2
  31. #define msggMouseDown 3
  32. #define msggMouseUp 4
  33. #define msggMouseMove 5
  34. #define msggMouseDblClk 6
  35. #define msggPaint 7
  36. #define msggDeal 8
  37. #define msggUndo 9
  38. #define msggSaveUndo 10
  39. #define msggKillUndo 11
  40. #define msggIsWinner 12
  41. #define msggWinner 13
  42. #define msggScore 14
  43. #define msggChangeScore 15
  44. #define msggDrawStatus 16
  45. #define msggTimer 17
  46. #define msggForceWin 18
  47. #define msggMouseRightClk 19
  48. #define ID_ICON_MAIN 500
  49. HICON hIconMain; // the main freecell icon.
  50. HICON hImageMain; // the main freecell image.
  51. /* Score MoDe */
  52. typedef INT SMD;
  53. #define smdStandard ideScoreStandard
  54. #define smdVegas ideScoreVegas
  55. #define smdNone ideScoreNone
  56. #define FSelOfGm(pgm) ((pgm)->icolSel != icolNil)
  57. #define FHilightOfGm(pgm) ((pgm)->icolHilight != icolNil)
  58. BOOL FInitKlondGm( VOID );
  59. VOID FreeGm(GM *pgm);
  60. #ifdef DEBUG
  61. LRESULT SendGmMsg(GM *pgm, INT msgg, WPARAM wp1, LPARAM wp2);
  62. #else
  63. #define SendGmMsg(pgm, msgg, wp1, wp2) \
  64. (*((pgm)->lpfnGmProc))((pgm), (msgg), (wp1), (wp2))
  65. #endif
  66. INT DefGmProc(GM *pgm, INT msgg, WPARAM wp1, LPARAM wp2);
  67. /* standard change score notification codes */
  68. /* instance specific codes should be positive */
  69. #define csNil -1 /* no score change */
  70. #define csAbs -2 /* change score to an absolute # */
  71. #define csDel -3 /* change score by an absolute # */
  72. #define csDelPos -4 /* change score by an absolute #, but don't let it get negative */
  73. // define the virtual key constant for key a
  74. #define VK_A (INT) 'A'