-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdata.c
86 lines (64 loc) · 1.34 KB
/
data.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#include <windows.h>
// Block frames are encoded as 16-bit unsigned integers representing 4x4 arrays with
// the MSB at [0,0] and the LSB at [3,3].
/*
0000
0110
0110
0000
*/
static const WORD wBlockO[] = { 0x0660 };
/*
0000 0010
1111 0010
0000 0010
0000 0010
*/
static const WORD wBlockI[] = { 0x0f00, 0x2222 };
/*
0000 0010
0011 0011
0110 0001
0000 0000
*/
static const WORD wBlockS[] = { 0x0360, 0x2310 };
/*
0000 0001
0110 0011
0011 0010
0000 0000
*/
static const WORD wBlockZ[] = { 0x0630, 0x2640 };
/*
0000 0010 0001 0110
0111 0010 0111 0010
0100 0011 0000 0010
0000 0000 0000 0000
*/
static const WORD wBlockL[] = { 0x0740, 0x2230, 0x1700, 0x6220 };
/*
0000 0011 0100 0010
0111 0010 0111 0010
0001 0010 0000 0110
0000 0000 0000 0000
*/
static const WORD wBlockJ[] = { 0x0710, 0x3220, 0x4700, 0x2260 };
/*
0000 0010 0010 0010
0111 0011 0111 0110
0010 0010 0000 0010
0000 0000 0000 0000
*/
static const WORD wBlockT[] = { 0x0720, 0x2320, 0x2700, 0x2620 };
// g_pBlocks can be indexed with the BLOCKTYPE enumerator.
const WORD *g_pBlocks[7] = {
wBlockO,
wBlockI,
wBlockS,
wBlockZ,
wBlockL,
wBlockJ,
wBlockT
};
// g_pFrameCounts can be indexed with the BLOCKTYPE enumerator.
const int g_pFrameCounts[7] = { 1, 2, 2, 2, 4, 4, 4 };