Leaked source code of windows server 2003
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.

135 lines
3.0 KiB

  1. /****************/
  2. /* file: rtns.h */
  3. /****************/
  4. /*** Bitmaps ***/
  5. /* Blocks */
  6. #define iBlkBlank 0
  7. #define iBlk1 1
  8. #define iBlk2 2
  9. #define iBlk8 8
  10. #define iBlkGuessDn 9
  11. #define iBlkBombDn 10
  12. #define iBlkWrong 11
  13. #define iBlkExplode 12
  14. #define iBlkGuessUp 13
  15. #define iBlkBombUp 14
  16. #define iBlkBlankUp 15
  17. #define iBlkMax 16
  18. #define MaskBomb 0x80
  19. #define MaskVisit 0x40
  20. #define MaskFlags 0xE0
  21. #define MaskData 0x1F
  22. #define NOTMaskBomb 0x7F
  23. #define cBlkMax (27*32)
  24. /* Leds */
  25. #define iLed0 0
  26. #define iLed1 1
  27. #define iLed9 9
  28. #define iLedBlank 10
  29. #define iLedNegative 11
  30. #define iLedMax 12
  31. /* Buttons */
  32. #define iButtonHappy 0
  33. #define iButtonCaution 1
  34. #define iButtonLose 2
  35. #define iButtonWin 3
  36. #define iButtonDown 4
  37. #define iButtonMax 5
  38. #define wGameBegin 0
  39. #define wGameInter 1
  40. #define wGameExpert 2
  41. #define wGameOther 3
  42. /*** Macros ***/
  43. #define fInRange(x,y) (((x)>0) && ((y)>0) && ((x)<=xBoxMac) && ((y)<=yBoxMac))
  44. #define IBLK(x,y) (rgBlk[ ((y)<<5) + (x)])
  45. #define iBLK(x,y) ( (IBLK(x,y) & MaskData) )
  46. #define SetBorder(x,y) (IBLK(x,y) = iBlkMax)
  47. #define fBORDER(x,y) (IBLK(x,y) == iBlkMax)
  48. #define SetBomb(x,y) (IBLK(x,y) |= MaskBomb)
  49. #define ClearBomb(x,y) (IBLK(x,y) &= NOTMaskBomb)
  50. #define fISBOMB(x,y) ((IBLK(x,y) & MaskBomb) != 0)
  51. #define SetVisit(x,y) (IBLK(x,y) |= MaskVisit)
  52. #define fVISIT(x,y) ((IBLK(x,y) & MaskVisit) != 0)
  53. #define fGUESSBOMB(x,y) (iBLK(x,y) == iBlkBombUp)
  54. #define fGUESSMARK(x,y) (iBLK(x,y) == iBlkGuessUp)
  55. #define SetBlk(x,y,blk) (IBLK(x,y) = (char) ((IBLK(x,y) & MaskFlags) | blk))
  56. /*** Status Stuff ***/
  57. #define fPlay 0x01 /* ON if playing game, OFF if game over */
  58. #define fPause 0x02 /* ON if paused */
  59. #define fPanic 0x04 /* ON if panic */
  60. #define fIcon 0x08 /* ON if iconic */
  61. #define fDemo 0x10 /* ON if demo */
  62. #define fStatusIcon (fStatus & fIcon)
  63. #define fStatusPlay (fStatus & fPlay)
  64. #define fStatusPanic (fStatus & fPanic)
  65. #define fStatusPause (fStatus & fPause)
  66. #define fStatusDemo (fStatus & fDemo)
  67. #define SetStatusPlay (fStatus = fPlay)
  68. #define SetStatusPause (fStatus |= fPause)
  69. #define SetStatusPanic (fStatus |= fPanic)
  70. #define SetStatusIcon (fStatus |= fIcon)
  71. #define SetStatusDemo (fStatus = fDemo)
  72. #define ClrStatusPlay (fStatus &= 0xFE)
  73. #define ClrStatusPause (fStatus &= 0xFD)
  74. #define ClrStatusPanic (fStatus &= 0xFB)
  75. #define ClrStatusIcon (fStatus &= 0xF7)
  76. #define ClrStatusDemo (fStatus &= 0xEF)
  77. #define fLose fFalse
  78. #define fWin fTrue
  79. typedef INT BLK;
  80. /*** Routines ***/
  81. VOID StartGame(VOID);
  82. VOID StopGame(VOID);
  83. VOID DoTimer(VOID);
  84. VOID TrackMouse(INT, INT);
  85. VOID DoButton1Up(VOID);
  86. VOID MakeGuess(INT, INT);
  87. VOID PauseGame(VOID);
  88. VOID ResumeGame(VOID);
  89. VOID ClearField(VOID);
  90. VOID CalcFrameRect(VOID);
  91. VOID UpdateBombCount(INT);