-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
149 lines (146 loc) · 10.2 KB
/
main.cpp
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
#include "Game.hpp"
#include "DEFINITIONS.hpp"
#include "files_check.hpp"
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
int main()
{
imageCheck ch;
if(ch.check_image_exist() == false){
sf::RenderWindow ErrorWindow(sf::VideoMode(300,100), "ERROR,Files not Found!", sf::Style::None);
const unsigned char data[1646] =
{
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, // 0
0, 0, 1, 45, 0, 0, 0, 100, 8, 2, 0, 0, 0, 92, 161, 241, // 1
169, 0, 0, 0, 1, 115, 82, 71, 66, 0, 174, 206, 28, 233, 0, 0, // 2
0, 4, 103, 65, 77, 65, 0, 0, 177, 143, 11, 252, 97, 5, 0, 0, // 3
0, 9, 112, 72, 89, 115, 0, 0, 14, 195, 0, 0, 14, 195, 1, 199, // 4
111, 168, 100, 0, 0, 6, 3, 73, 68, 65, 84, 120, 94, 237, 156, 77, // 5
110, 227, 56, 16, 70, 231, 32, 179, 156, 211, 100, 149, 179, 100, 145, 179, // 6
100, 144, 163, 52, 114, 144, 94, 116, 14, 208, 64, 47, 140, 94, 4, 1, // 7
26, 72, 235, 135, 164, 196, 210, 39, 89, 146, 21, 179, 24, 191, 135, 218, // 8
68, 178, 105, 150, 241, 189, 80, 82, 164, 252, 243, 1, 0, 165, 193, 67, // 9
128, 242, 224, 33, 64, 121, 240, 16, 160, 60, 120, 8, 80, 30, 60, 4, // 10
40, 15, 30, 2, 148, 7, 15, 1, 202, 131, 135, 0, 229, 193, 67, 128, // 11
242, 88, 15, 255, 60, 221, 255, 250, 247, 63, 83, 191, 191, 133, 189, 159, // 12
203, 183, 199, 171, 126, 28, 128, 27, 240, 16, 160, 60, 115, 30, 62, 190, // 13
135, 13, 87, 228, 199, 243, 169, 253, 232, 251, 183, 31, 97, 3, 192, 141, // 14
176, 193, 195, 247, 135, 118, 177, 250, 117, 247, 252, 222, 191, 230, 238, 249, // 15
207, 204, 198, 142, 151, 223, 237, 56, 169, 178, 1, 245, 187, 240, 16, 110, // 16
149, 237, 30, 166, 26, 123, 152, 111, 76, 71, 152, 166, 210, 1, 167, 126, // 17
23, 30, 194, 173, 178, 230, 252, 48, 56, 153, 228, 57, 61, 189, 118, 27, // 18
90, 212, 198, 180, 18, 38, 153, 237, 22, 57, 20, 30, 194, 205, 178, 221, // 19
195, 225, 200, 179, 69, 108, 140, 139, 225, 216, 177, 52, 108, 191, 36, 202, // 20
161, 240, 16, 110, 150, 61, 231, 135, 43, 61, 204, 46, 123, 230, 27, 181, // 21
135, 97, 217, 20, 31, 13, 240, 181, 185, 146, 135, 113, 216, 176, 214, 205, // 22
120, 8, 112, 163, 124, 130, 135, 11, 231, 135, 241, 101, 218, 67, 142, 75, // 23
225, 86, 89, 115, 126, 24, 206, 244, 86, 123, 184, 250, 122, 105, 254, 174, // 24
244, 209, 217, 197, 27, 128, 27, 224, 115, 60, 108, 73, 171, 226, 234, 119, // 25
177, 30, 194, 173, 98, 61, 4, 128, 235, 131, 135, 0, 229, 193, 67, 128, // 26
242, 224, 33, 64, 121, 240, 16, 160, 60, 120, 8, 80, 30, 60, 4, 40, // 27
15, 30, 2, 148, 7, 15, 1, 202, 179, 193, 195, 112, 19, 204, 195, 75, // 28
247, 211, 235, 219, 157, 186, 39, 166, 2, 226, 204, 135, 94, 174, 70, 189, // 29
95, 26, 124, 46, 214, 67, 121, 95, 91, 119, 95, 168, 185, 123, 219, 101, // 30
164, 186, 59, 227, 22, 111, 79, 29, 73, 216, 20, 30, 130, 15, 214, 123, // 31
24, 119, 249, 93, 15, 195, 111, 138, 37, 15, 195, 45, 172, 165, 110, 37, // 32
199, 67, 208, 204, 121, 120, 246, 97, 220, 186, 61, 28, 63, 27, 121, 69, // 33
240, 16, 52, 27, 60, 204, 31, 146, 80, 145, 138, 41, 159, 70, 45, 188, // 34
55, 148, 124, 162, 34, 14, 216, 172, 183, 195, 99, 83, 102, 26, 249, 51, // 35
28, 163, 189, 211, 101, 124, 106, 99, 62, 135, 182, 162, 141, 179, 195, 78, // 36
221, 206, 191, 159, 21, 115, 30, 61, 2, 118, 122, 122, 193, 67, 144, 28, // 37
230, 225, 212, 132, 52, 200, 68, 128, 69, 15, 77, 165, 200, 46, 62, 211, // 38
184, 223, 195, 51, 143, 74, 174, 243, 208, 212, 210, 119, 210, 21, 30, 66, // 39
206, 154, 243, 195, 92, 39, 237, 97, 200, 107, 140, 111, 216, 219, 197, 215, // 40
70, 121, 134, 148, 233, 222, 210, 244, 99, 255, 233, 105, 201, 74, 191, 32, // 41
102, 183, 44, 125, 144, 61, 46, 61, 59, 172, 29, 115, 198, 195, 117, 115, // 42
78, 206, 227, 225, 65, 252, 255, 253, 167, 255, 10, 115, 93, 228, 32, 15, // 43
103, 86, 149, 238, 162, 78, 138, 99, 87, 179, 17, 140, 3, 198, 107, 152, // 44
113, 38, 93, 196, 227, 248, 99, 199, 210, 84, 231, 214, 46, 129, 241, 240, // 45
252, 176, 235, 60, 92, 156, 115, 156, 94, 67, 254, 165, 193, 94, 76, 208, // 46
43, 170, 208, 192, 132, 99, 142, 75, 83, 118, 109, 245, 1, 181, 150, 46, // 47
30, 151, 198, 76, 199, 119, 205, 101, 122, 186, 113, 191, 135, 243, 195, 110, // 48
243, 240, 220, 156, 241, 240, 34, 76, 166, 235, 173, 208, 207, 136, 131, 206, // 49
15, 199, 249, 155, 33, 115, 53, 5, 119, 96, 179, 135, 113, 192, 244, 161, // 50
199, 120, 152, 15, 139, 135, 94, 48, 81, 174, 189, 66, 87, 145, 131, 60, // 51
76, 87, 74, 7, 193, 94, 223, 30, 166, 105, 155, 4, 119, 96, 49, 211, // 52
209, 135, 209, 196, 226, 150, 33, 211, 113, 139, 24, 60, 178, 254, 252, 48, // 53
12, 59, 243, 227, 26, 15, 211, 119, 18, 103, 56, 252, 38, 26, 230, 12, // 54
171, 48, 33, 254, 26, 21, 122, 235, 56, 200, 195, 180, 119, 92, 54, 187, // 55
169, 210, 10, 54, 102, 217, 195, 97, 121, 49, 37, 86, 155, 174, 244, 170, // 56
104, 61, 60, 63, 172, 233, 235, 116, 183, 122, 61, 148, 223, 73, 95, 120, // 57
184, 5, 19, 223, 113, 133, 87, 248, 198, 204, 121, 92, 225, 21, 7, 122, // 58
216, 48, 252, 190, 239, 106, 178, 230, 244, 37, 70, 238, 56, 231, 97, 75, // 59
62, 212, 52, 205, 105, 9, 90, 239, 97, 203, 242, 176, 131, 222, 205, 152, // 60
249, 247, 115, 126, 206, 163, 239, 164, 217, 40, 190, 52, 56, 139, 201, 110, // 61
95, 97, 95, 85, 152, 22, 250, 234, 119, 89, 15, 1, 92, 97, 82, 219, // 62
84, 216, 81, 39, 166, 151, 166, 250, 237, 120, 8, 174, 145, 169, 173, 26, // 63
217, 17, 30, 130, 107, 100, 106, 171, 70, 118, 132, 135, 224, 26, 153, 218, // 64
170, 145, 29, 225, 33, 184, 70, 166, 182, 106, 100, 71, 120, 8, 174, 145, // 65
169, 173, 26, 217, 17, 30, 130, 107, 100, 106, 171, 70, 118, 132, 135, 224, // 66
26, 153, 218, 170, 145, 29, 225, 33, 184, 70, 166, 182, 106, 100, 71, 120, // 67
8, 174, 145, 169, 173, 26, 217, 17, 30, 130, 107, 100, 106, 47, 198, 220, // 68
107, 57, 190, 119, 178, 101, 122, 119, 231, 112, 127, 98, 186, 135, 113, 47, // 69
178, 35, 60, 4, 215, 200, 212, 94, 130, 185, 11, 122, 168, 145, 96, 214, // 70
195, 116, 223, 242, 197, 18, 54, 200, 142, 240, 16, 92, 35, 83, 187, 159, // 71
244, 120, 205, 232, 86, 251, 244, 88, 204, 204, 83, 166, 105, 241, 156, 123, // 72
68, 97, 27, 178, 35, 60, 4, 215, 200, 212, 238, 37, 61, 58, 99, 140, // 73
178, 219, 199, 30, 70, 75, 237, 177, 235, 110, 100, 71, 120, 8, 174, 145, // 74
169, 221, 73, 60, 188, 20, 207, 196, 197, 117, 178, 127, 32, 110, 240, 48, // 75
110, 215, 143, 209, 237, 66, 118, 132, 135, 224, 26, 153, 218, 157, 228, 178, // 76
101, 104, 15, 99, 29, 113, 90, 152, 144, 29, 225, 33, 184, 70, 166, 118, // 77
39, 11, 30, 230, 15, 136, 71, 15, 239, 79, 225, 120, 245, 176, 131, 210, // 78
6, 217, 17, 30, 130, 107, 100, 106, 119, 178, 112, 144, 169, 215, 195, 199, // 79
247, 116, 165, 244, 184, 127, 161, 32, 59, 194, 67, 112, 141, 76, 237, 94, // 80
230, 174, 124, 46, 93, 167, 25, 142, 81, 15, 58, 58, 149, 29, 225, 33, // 81
184, 70, 166, 118, 55, 131, 84, 27, 254, 110, 145, 44, 29, 14, 104, 195, // 82
91, 118, 153, 41, 59, 194, 67, 112, 141, 76, 237, 37, 36, 235, 108, 45, // 83
252, 29, 127, 88, 72, 251, 19, 197, 139, 254, 162, 40, 59, 194, 67, 112, // 84
141, 76, 237, 165, 164, 179, 190, 25, 157, 38, 30, 14, 39, 144, 253, 70, // 85
214, 67, 184, 45, 100, 106, 171, 70, 118, 132, 135, 224, 26, 153, 218, 170, // 86
145, 29, 225, 33, 184, 70, 166, 182, 106, 100, 71, 120, 8, 174, 145, 169, // 87
173, 26, 217, 17, 30, 130, 107, 100, 106, 171, 70, 118, 132, 135, 224, 26, // 88
153, 218, 170, 145, 29, 225, 33, 184, 70, 166, 182, 106, 100, 71, 120, 8, // 89
174, 145, 169, 173, 26, 217, 17, 30, 130, 107, 100, 106, 171, 70, 118, 132, // 90
135, 224, 26, 153, 218, 170, 145, 29, 225, 33, 184, 198, 164, 182, 169, 176, // 91
163, 78, 76, 47, 77, 245, 219, 241, 16, 188, 99, 130, 219, 87, 216, 87, // 92
15, 102, 254, 169, 250, 189, 120, 8, 222, 49, 193, 149, 21, 94, 234, 12, // 93
51, 201, 105, 133, 215, 225, 33, 84, 129, 137, 239, 215, 168, 208, 91, 7, // 94
30, 66, 29, 152, 16, 215, 94, 161, 171, 8, 30, 66, 77, 152, 52, 215, // 95
88, 161, 147, 28, 60, 132, 250, 48, 201, 174, 165, 194, 236, 21, 120, 8, // 96
95, 1, 147, 120, 39, 21, 38, 183, 2, 60, 4, 40, 15, 30, 2, 148, // 97
7, 15, 1, 202, 131, 135, 0, 229, 193, 67, 128, 242, 224, 33, 64, 121, // 98
240, 16, 160, 60, 120, 8, 80, 30, 60, 4, 40, 15, 30, 2, 148, 7, // 99
15, 1, 202, 131, 135, 0, 229, 193, 67, 128, 242, 224, 33, 64, 121, 240, // 100
16, 160, 60, 120, 8, 80, 154, 143, 143, 191, 249, 217, 23, 4, 209, 30, // 101
125, 215, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130 // 102
};
sf::Texture texture;
texture.loadFromMemory(data, sizeof(data));
sf::Sprite error;
error.setTexture(texture);
sf::Sprite okBox;
ErrorWindow.setFramerateLimit(60);
while(ErrorWindow.isOpen()){
sf::Event event;
while (ErrorWindow.pollEvent(event))
{
if (event.type == sf::Event::Closed){
ErrorWindow.close();
return 0;
}
if (sf::Mouse::isButtonPressed(sf::Mouse::Left)){
sf::IntRect box(220,40,100,40);
if(box.contains(sf::Mouse::getPosition(ErrorWindow))){
ErrorWindow.close();
return 0;
}
}
ErrorWindow.clear();
ErrorWindow.draw(error);
ErrorWindow.display();
}
}
}
GameEngine::Game(SCREEN_WIDTH, SCREEN_HEIGHT, "Tic-Tac-Toe");
}