ReactOS 0.4.15-dev-7907-g95bf896
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{
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
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
131
132void CheckLevel( BOARD *p_board );
133
135
137
139
140#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:49
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:120
unsigned NumMines
Definition: main.h:121
unsigned IsPressed
Definition: main.h:119
unsigned IsMine
Definition: main.h:118
Definition: main.h:72
HWND hWnd
Definition: main.h:76
HBITMAP hMinesBMP
Definition: main.h:77
unsigned mb
Definition: main.h:112
DIFFICULTY difficulty
Definition: main.h:100
GAME_STATUS status
Definition: main.h:115
unsigned width
Definition: main.h:85
unsigned boxes_left
Definition: main.h:91
RECT timer_rect
Definition: main.h:82
RECT mines_rect
Definition: main.h:80
unsigned cols
Definition: main.h:96
unsigned height
Definition: main.h:86
DWORD best_time[3]
Definition: main.h:99
unsigned mines
Definition: main.h:97
HBITMAP hLedsBMP
Definition: main.h:79
HDC hdc
Definition: main.h:74
HBITMAP hFacesBMP
Definition: main.h:78
RECT counter_rect
Definition: main.h:83
unsigned time
Definition: main.h:89
unsigned rows
Definition: main.h:95
unsigned num_mines
Definition: main.h:92
unsigned num_flags
Definition: main.h:90
FACE_BMP face_bmp
Definition: main.h:114
RECT face_rect
Definition: main.h:81
WCHAR best_name[3][MAX_PLAYER_NAME_SIZE+1]
Definition: main.h:98
struct tagBOARD::BOX_STRUCT MAX_ROWS[MAX_COLS+2]
POINT pos
Definition: main.h:87
BOOL IsMarkQ
Definition: main.h:73
POINT press
Definition: main.h:102
HINSTANCE hInst
Definition: main.h:75
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