ReactOS 0.4.15-dev-8191-gbc6c731
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
62
63typedef enum {
68
70
71typedef struct tagBOARD
72{
74#ifdef __REACTOS__
75 BOOL IsSoundEnabled;
76#endif
87
88 unsigned width;
89 unsigned height;
91
92 unsigned time;
93 unsigned num_flags;
94 unsigned boxes_left;
95 unsigned num_mines;
96
97 /* difficulty info */
98 unsigned rows;
99 unsigned cols;
100 unsigned mines;
104
106
107 /* defines for mb */
108#define MB_NONE 0
109#define MB_LEFTDOWN 1
110#define MB_LEFTUP 2
111#define MB_RIGHTDOWN 3
112#define MB_RIGHTUP 4
113#define MB_BOTHDOWN 5
114#define MB_BOTHUP 6
115 unsigned mb;
116
120 {
121 unsigned IsMine : 1;
122 unsigned IsPressed : 1;
123 unsigned FlagType : 2;
124 unsigned NumMines : 4;
125 } box [MAX_COLS + 2] [MAX_ROWS + 2];
126
127 /* defines for FlagType */
128#define NORMAL 0
129#define QUESTION 1
130#define FLAG 2
131#define COMPLETE 3
132
134
135void CheckLevel( BOARD *p_board );
136
138
140
142
143#endif /* _WINMINE_H_ */
struct tagBOARD BOARD
#define MAX_PLAYER_NAME_SIZE
Definition: main.h:57
GAME_STATUS
Definition: main.h:61
@ GAMEOVER
Definition: main.h:61
@ WON
Definition: main.h:61
@ WAITING
Definition: main.h:61
@ PLAYING
Definition: main.h:61
MINEBMP_OFFSET
Definition: main.h:63
@ TWO_BMP
Definition: main.h:64
@ SEVEN_BMP
Definition: main.h:65
@ MPRESS_BMP
Definition: main.h:64
@ EIGHT_BMP
Definition: main.h:65
@ QUESTION_BMP
Definition: main.h:65
@ BOX_BMP
Definition: main.h:65
@ THREE_BMP
Definition: main.h:64
@ MINE_BMP
Definition: main.h:66
@ FOUR_BMP
Definition: main.h:64
@ WRONG_BMP
Definition: main.h:66
@ FIVE_BMP
Definition: main.h:64
@ EXPLODE_BMP
Definition: main.h:65
@ ONE_BMP
Definition: main.h:64
@ SIX_BMP
Definition: main.h:64
@ QPRESS_BMP
Definition: main.h:66
@ FLAG_BMP
Definition: main.h:65
#define MAX_COLS
Definition: main.h:42
FACE_BMP
Definition: main.h:59
@ DEAD_BMP
Definition: main.h:59
@ SPRESS_BMP
Definition: main.h:59
@ OOH_BMP
Definition: main.h:59
@ SMILE_BMP
Definition: main.h:59
@ COOL_BMP
Definition: main.h:59
INT_PTR CALLBACK CustomDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:23
DIFFICULTY
Definition: main.h:69
@ ADVANCED
Definition: main.h:69
@ EXPERT
Definition: main.h:69
@ BEGINNER
Definition: main.h:69
@ CUSTOM
Definition: main.h:69
void CheckLevel(BOARD *p_board)
Definition: main.c:52
INT_PTR CALLBACK CongratsDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:55
INT_PTR CALLBACK TimesDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:83
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define CALLBACK
Definition: compat.h:35
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:92
unsigned int UINT
Definition: ndis.h:50
Definition: palette.c:468
unsigned FlagType
Definition: main.h:123
unsigned NumMines
Definition: main.h:124
unsigned IsPressed
Definition: main.h:122
unsigned IsMine
Definition: main.h:121
Definition: main.h:72
HWND hWnd
Definition: main.h:79
HBITMAP hMinesBMP
Definition: main.h:80
unsigned mb
Definition: main.h:115
DIFFICULTY difficulty
Definition: main.h:103
GAME_STATUS status
Definition: main.h:118
unsigned width
Definition: main.h:88
unsigned boxes_left
Definition: main.h:94
RECT timer_rect
Definition: main.h:85
RECT mines_rect
Definition: main.h:83
unsigned cols
Definition: main.h:99
unsigned height
Definition: main.h:89
DWORD best_time[3]
Definition: main.h:102
unsigned mines
Definition: main.h:100
HBITMAP hLedsBMP
Definition: main.h:82
HDC hdc
Definition: main.h:77
HBITMAP hFacesBMP
Definition: main.h:81
RECT counter_rect
Definition: main.h:86
unsigned time
Definition: main.h:92
unsigned rows
Definition: main.h:98
unsigned num_mines
Definition: main.h:95
unsigned num_flags
Definition: main.h:93
FACE_BMP face_bmp
Definition: main.h:117
RECT face_rect
Definition: main.h:84
WCHAR best_name[3][MAX_PLAYER_NAME_SIZE+1]
Definition: main.h:101
struct tagBOARD::BOX_STRUCT MAX_ROWS[MAX_COLS+2]
POINT pos
Definition: main.h:90
BOOL IsMarkQ
Definition: main.h:73
POINT press
Definition: main.h:105
HINSTANCE hInst
Definition: main.h:78
int32_t INT_PTR
Definition: typedefs.h:64
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
__wchar_t WCHAR
Definition: xmlstorage.h:180