ReactOS  0.4.11-dev-946-g431643b
main.h
Go to the documentation of this file.
1 /*
2  * Copyright 2000 Joshua Thielen
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17  */
18 
19 #ifndef _WINMINE_H_
20 #define _WINMINE_H_
21 
22 #include <stdarg.h>
23 
24 #define WIN32_NO_STATUS
25 #include <windef.h>
26 #include <winuser.h>
27 
28 #include "resource.h"
29 
30 #define BEGINNER_MINES 10
31 #define BEGINNER_COLS 9
32 #define BEGINNER_ROWS 9
33 
34 #define ADVANCED_MINES 40
35 #define ADVANCED_COLS 16
36 #define ADVANCED_ROWS 16
37 
38 #define EXPERT_MINES 99
39 #define EXPERT_COLS 30
40 #define EXPERT_ROWS 16
41 
42 #define MAX_COLS 30
43 #define MAX_ROWS 24
44 
45 #define BOTTOM_MARGIN 20
46 #define BOARD_WMARGIN 5
47 #define BOARD_HMARGIN 5
48 
49 /* mine defines */
50 #define MINE_WIDTH 16
51 #define MINE_HEIGHT 16
52 #define LED_WIDTH 12
53 #define LED_HEIGHT 23
54 #define FACE_WIDTH 24
55 #define FACE_HEIGHT 24
56 
57 #define MAX_PLAYER_NAME_SIZE 31
58 
60 
61 typedef enum { WAITING, PLAYING, GAMEOVER, WON } GAME_STATUS;
62 
63 typedef enum {
68 
70 
71 typedef struct tagBOARD
72 {
84 
85  unsigned width;
86  unsigned height;
88 
89  unsigned time;
90  unsigned num_flags;
91  unsigned boxes_left;
92  unsigned num_mines;
93 
94  /* difficulty info */
95  unsigned rows;
96  unsigned cols;
97  unsigned mines;
101 
103 
104  /* defines for mb */
105 #define MB_NONE 0
106 #define MB_LEFTDOWN 1
107 #define MB_LEFTUP 2
108 #define MB_RIGHTDOWN 3
109 #define MB_RIGHTUP 4
110 #define MB_BOTHDOWN 5
111 #define MB_BOTHUP 6
112  unsigned mb;
113 
116  struct BOX_STRUCT
117  {
118  unsigned IsMine : 1;
119  unsigned IsPressed : 1;
120  unsigned FlagType : 2;
121  unsigned NumMines : 4;
122  } box [MAX_COLS + 2] [MAX_ROWS + 2];
123 
124  /* defines for FlagType */
125 #define NORMAL 0
126 #define QUESTION 1
127 #define FLAG 2
128 #define COMPLETE 3
129 
130 } BOARD;
131 
132 void CheckLevel( BOARD *p_board );
133 
135 
137 
139 
140 #endif /* _WINMINE_H_ */
INT_PTR CALLBACK CongratsDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:55
Definition: main.h:64
#define HDC
Definition: msvc.h:22
Definition: main.h:69
DIFFICULTY
Definition: main.h:69
#define MAX_COLS
Definition: main.h:42
Definition: main.h:61
#define HBITMAP
Definition: msvc.h:28
#define MAX_PLAYER_NAME_SIZE
Definition: main.h:57
__wchar_t WCHAR
Definition: xmlstorage.h:180
Definition: main.h:69
Definition: main.h:65
#define CALLBACK
Definition: compat.h:27
POINT pos
Definition: main.h:87
unsigned num_mines
Definition: main.h:92
Definition: main.h:69
unsigned NumMines
Definition: main.h:121
unsigned mines
Definition: main.h:97
BOOL IsMarkQ
Definition: main.h:73
struct tagBOARD BOARD
int32_t INT_PTR
Definition: typedefs.h:62
unsigned time
Definition: main.h:89
WCHAR best_name[3][MAX_PLAYER_NAME_SIZE+1]
Definition: main.h:98
RECT counter_rect
Definition: main.h:83
WPARAM wParam
Definition: combotst.c:138
Definition: main.h:64
FACE_BMP face_bmp
Definition: main.h:114
unsigned IsMine
Definition: main.h:118
UINT_PTR WPARAM
Definition: windef.h:207
Definition: main.h:66
Definition: main.h:66
Definition: main.h:59
void CheckLevel(BOARD *p_board)
Definition: main.c:49
Definition: main.h:61
unsigned mb
Definition: main.h:112
LONG_PTR LPARAM
Definition: windef.h:208
Definition: main.h:71
unsigned FlagType
Definition: main.h:120
GAME_STATUS status
Definition: main.h:115
MINEBMP_OFFSET
Definition: main.h:63
RECT timer_rect
Definition: main.h:82
Definition: main.h:65
INT_PTR CALLBACK CustomDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:23
GAME_STATUS
Definition: main.h:61
DWORD best_time[3]
Definition: main.h:99
Definition: main.h:64
Definition: main.h:69
unsigned int BOOL
Definition: ntddk_ex.h:94
Definition: main.h:59
unsigned int UINT
Definition: ndis.h:50
DIFFICULTY difficulty
Definition: main.h:100
Definition: main.h:61
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned rows
Definition: main.h:95
RECT mines_rect
Definition: main.h:80
RECT face_rect
Definition: main.h:81
unsigned cols
Definition: main.h:96
unsigned boxes_left
Definition: main.h:91
INT_PTR CALLBACK TimesDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:83
Definition: main.h:64
Definition: main.h:59
HINSTANCE hInst
Definition: main.h:75
Definition: main.h:64
Definition: main.h:61
unsigned num_flags
Definition: main.h:90
Definition: main.h:65
FACE_BMP
Definition: main.h:59
unsigned width
Definition: main.h:85
unsigned height
Definition: main.h:86
HBITMAP hMinesBMP
Definition: main.h:77
HBITMAP hFacesBMP
Definition: main.h:78
unsigned IsPressed
Definition: main.h:119
POINT press
Definition: main.h:102
HBITMAP hLedsBMP
Definition: main.h:79
LPARAM lParam
Definition: combotst.c:139
Definition: main.h:64
struct tagBOARD::BOX_STRUCT MAX_ROWS[MAX_COLS+2]
Definition: main.h:59
Definition: palette.c:467
HWND hWnd
Definition: main.h:76
HDC hdc
Definition: main.h:74
Definition: main.h:65