ScummVM API documentation
3mice2_testo.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef QDENGINE_MINIGAMES_3MICE2_TESTO_H
23#define QDENGINE_MINIGAMES_3MICE2_TESTO_H
24
25#include "common/debug.h"
26#include "common/rect.h"
27
28#include "qdengine/qd_fwd.h"
29#include "qdengine/qdcore/qd_minigame_interface.h"
30
31namespace QDEngine {
32
34public:
37
38 bool init(const qdEngineInterface *engine_interface) {
39 debugC(1, kDebugMinigames, "3mice2Testo::init()");
40
41 _engine = engine_interface;
42 _scene = engine_interface->current_scene_interface();
43 if (!_scene)
44 return false;
45
46 _figures[0] = _scene->object_interface("figure1");
47 _figures[1] = _scene->object_interface("figure2");
48 _figures[2] = _scene->object_interface("figure3");
49 _figures[3] = _scene->object_interface("figure4");
50 _figures[4] = _scene->object_interface("figure5");
51 _figures[5] = _scene->object_interface("figure6");
52 _figures[6] = _scene->object_interface("figure7");
53 _figures[7] = _scene->object_interface("figure8");
54 _figures[8] = _scene->object_interface("figure1fake");
55 _figures[9] = _scene->object_interface("figure2fake");
56 _figures[10] = _scene->object_interface("figure3fake");
57 _figures[11] = _scene->object_interface("figure4fake");
58 _figures[12] = _scene->object_interface("figure5fake");
59 _figures[13] = _scene->object_interface("figure6fake");
60 _figures[14] = _scene->object_interface("figure7fake");
61 _figures[15] = _scene->object_interface("figure8fake");
62 _figures[16] = _scene->object_interface("figure1inv");
63 _figures[17] = _scene->object_interface("figure2inv");
64 _figures[18] = _scene->object_interface("figure3inv");
65 _figures[19] = _scene->object_interface("figure4inv");
66 _figures[20] = _scene->object_interface("figure5inv");
67 _figures[21] = _scene->object_interface("figure6inv");
68 _figures[22] = _scene->object_interface("figure7inv");
69 _figures[23] = _scene->object_interface("figure8inv");
70
71 _objNoDough = _scene->object_interface("notesto");
72 _objNoDoughFake = _scene->object_interface("notesto_fake");
73 _objDone = _scene->object_interface("$done");
74 _objLoadPassed = _scene->object_interface("$\xE7\xE0\xE3\xF0\xF3\xE7\xEA\xE0 \xE1\xFB\xEB\xE0"); // "$загрузка была"
75
76#if 0
77 for (int i = 0; i < 1088; i++) {
78 debugN("{ %3d, %3d }, ", _figureVerts[i].x, _figureVerts[i].y);
79
80 if ((i + 1) % 8 == 0)
81 debugN("// %d\n", i - 7);
82 }
83#endif
84
85 _noDoughX = 1000;
86
87 _numVerts[0] = 66;
88 _numVerts[1] = 94;
89 _numVerts[2] = 136;
90 _numVerts[3] = 136;
91 _numVerts[4] = 68;
92 _numVerts[5] = 68;
93 _numVerts[6] = 112;
94 _numVerts[7] = 112;
95
96 for (int i = 0; i < 8; i++) {
97 int v = i;
98 int maxX = 0;
99 int minX = 0;
100 int minY = 0;
101 int maxY = 0;
102
103 for (int j = 0; j < _numVerts[i]; j++) {
104 if (_figureVerts[v].x < minX)
105 minX = _figureVerts[v].x;
106 if (_figureVerts[v].x > maxX)
107 maxX = _figureVerts[v].x;
108 if (_figureVerts[v].y < minY)
109 minY = _figureVerts[v].y;
110 if (_figureVerts[v].y > maxY)
111 maxY = _figureVerts[v].y;
112
113 v += 8; // Data is arranged in vertical columns
114 }
115
116 _figureBboxes[i].top = maxX;
117 _figureBboxes[i].left = minX;
118 _figureBboxes[i].bottom = maxY;
119 _figureBboxes[i].top = minY;
120
121 debugC(2, kDebugMinigames, "bbox for: %d: [%d, %d, %d, %d]", i, _figureBboxes[i].left, _figureBboxes[i].top, _figureBboxes[i].right, _figureBboxes[i].bottom);
122 }
123
124 mgVect2i pos = _objNoDough->screen_R();
125
126 pos.x += _noDoughX;
127
128 _objNoDoughFake->set_R(_scene->screen2world_coords(pos, -100.0));
129
130 _initialCoords[0].x = 75;
131 _initialCoords[0].y = 80;
132 _initialCoords[1].x = 695;
133 _initialCoords[1].y = 100;
134 _initialCoords[2].x = 82;
135 _initialCoords[2].y = 234;
136 _initialCoords[3].x = 738;
137 _initialCoords[3].y = 468;
138 _initialCoords[4].x = 84;
139 _initialCoords[4].y = 392;
140 _initialCoords[5].x = 302;
141 _initialCoords[5].y = 465;
142 _initialCoords[6].x = 687;
143 _initialCoords[6].y = 293;
144 _initialCoords[7].x = 611;
145 _initialCoords[7].y = 472;
146
147 if (_objLoadPassed->is_state_active("\xed\xe5\xf2")) { // "нет"
148 for (int i = 0; i < 8; i++)
149 _figures[i]->set_R(_scene->screen2world_coords(_initialCoords[i], 0.0));
150
151 _objLoadPassed->set_state("\xe4\xe0"); // "да"
152
153 return true;
154 }
155
156 return false;
157 }
158
159 bool quant(float dt) {
160 debugC(3, kDebugMinigames, "3mice2Testo::quant(%f)", dt);
161
162 if (checkSolution())
163 _objDone->set_state("\xe4\xe0"); // "да"
164 else
165 _objDone->set_state("\xed\xe5\xf2"); // "нет"
166
167 for (int i = 0; i < 8; i++) {
168 mgVect2i pos = _figures[i]->screen_R();
169
170 pos.x += _noDoughX;
171
172 _figures[i + 8]->set_R(_scene->screen2world_coords(pos, 1000.0));
173 }
174
177
178 const char *name = nullptr;
179
180 if (mouseObj) {
181 name = mouseObj->name();
182 if (strstr(name, "figure") && strstr(name, "inv")) {
183 int num = atol(name + 6);
184
185 if (checkSnapPiece(num - 1))
186 mouseObj->set_state("inv");
187 else
188 mouseObj->set_state("inv_glow");
189 }
190 }
191
193 int hit = hitTest();
194
195 debugC(2, kDebugMinigames, "hit: %d", hit);
196
197 if (hit > -1) {
198 _figures[hit]->set_state("hide");
199 _figures[hit + 16]->set_state("to_inv");
200 }
201 }
202
204 int num = -1;
205
206 if (strstr(name, "figure") && strstr(name, "inv")) {
207 num = atol(name + 6);
208
209 debugC(2, kDebugMinigames, "drop: %d", num);
210
211 if (num > 0 && num <= 8 && !checkSnapPiece(num - 1)) {
212 _figures[num - 1]->set_state("testo");
213 _figures[num + 15]->set_state("del");
214 _figures[num - 1]->set_R(_scene->screen2world_coords(_engine->mouse_cursor_position(), 0.0));
215 }
216 }
217
218 if (clickObj) { // && mouseObj
219 name = clickObj->name();
220
221 if (strstr(name, "notesto") && num > 0 && num <= 8) {
222 _figures[num - 1]->set_state("base");
223 _figures[num + 15]->set_state("del");
224
225 _figures[num - 1]->set_R(_scene->screen2world_coords(_initialCoords[num - 1], 0.0));
226 }
227 }
228 }
229
231 name = mouseObj->name();
232 if (strstr(name, "figure") && strstr(name, "inv")) {
233 int num = atol(name + 6);
234
235 if (num > 0 && num <= 8) {
236 _figures[num - 1]->set_state("base");
237 _figures[num + 15]->set_state("del");
238
239 _figures[num - 1]->set_R(_scene->screen2world_coords(_initialCoords[num - 1], 0.0));
240 }
241 }
242 }
243
244 return true;
245 }
246
247 bool finit() {
248 debugC(1, kDebugMinigames, "3mice2Testo::finit()");
249
250 if (_scene) {
251 _engine->release_scene_interface(_scene);
252 _scene = 0;
253 }
254
255 return true;
256 }
257
258 bool new_game(const qdEngineInterface *engine_interface) {
259 return true;
260 }
261
262 int save_game(const qdEngineInterface *engine_interface, const qdMinigameSceneInterface *scene_interface, char *buffer, int buffer_size) {
263 return 0;
264 }
265
266 int load_game(const qdEngineInterface *engine_interface, const qdMinigameSceneInterface *scene_interface, const char *buffer, int buffer_size) {
267 return 0;
268 }
269
270 enum { INTERFACE_VERSION = 112 };
271 int version() const {
272 return INTERFACE_VERSION;
273 }
274
275private:
276 bool checkSolution() {
277 return _figures[1]->is_state_active("testo")
278 && _figures[3]->is_state_active("testo")
279 && _figures[4]->is_state_active("testo")
280 && _figures[5]->is_state_active("testo")
281 && _figures[6]->is_state_active("testo");
282 }
283
284 int hitTest() {
285 mgVect2i pos = _engine->mouse_cursor_position();
286 pos.x += _noDoughX;
287
288 for (int i = 0; i < 8; i++) {
289 if (_figures[i + 8]->hit_test(pos))
290 return i;
291 }
292
293 return -1;
294 }
295
296 bool checkSnapPiece(int num) {
297 mgVect2i pos = _engine->mouse_cursor_position();
298 pos.x += _noDoughX;
299
300 int v = num;
301
302 for (int i = 0; i < _numVerts[num]; i++) {
303 mgVect2i npos = _figureVerts[v];
304 npos.x += pos.x;
305 npos.y += pos.y;
306
307 for (int j = 0; j < 8; j++) {
308 if (j != num) {
309 if (_figures[8 + j]->hit_test(npos))
310 return true;
311
312 if (_objNoDoughFake->hit_test(npos))
313 return true;
314 }
315 }
316
317 v += 8;
318 }
319
320 for (int i = 0; i < 8; i++) {
321 if (i != num) {
322 if (_figureBboxes[i].right + _figures[i]->screen_R().x < pos.x + _figureBboxes[num].right &&
323 _figureBboxes[i].left + _figures[i]->screen_R().x > pos.x + _figureBboxes[num].left &&
324 _figureBboxes[i].top + _figures[i]->screen_R().y < pos.y + _figureBboxes[num].top &&
325 _figureBboxes[i].bottom + _figures[i]->screen_R().y > pos.y + _figureBboxes[num].bottom)
326 return true;
327 }
328 }
329
330 return false;
331 }
332
333private:
334 const qdEngineInterface *_engine = nullptr;
335 qdMinigameSceneInterface *_scene = nullptr;
336
337 qdMinigameObjectInterface *_figures[24] = { nullptr };
338
339 int _numVerts[8] = { 0 };
340
341 qdMinigameObjectInterface *_objNoDough = nullptr;
342 qdMinigameObjectInterface *_objNoDoughFake = nullptr;
343 qdMinigameObjectInterface *_objLoadPassed = nullptr;
344 qdMinigameObjectInterface *_objDone = nullptr;
345
346 mgVect2i _initialCoords[8];
347 int _noDoughX = 0;
348 Common::Rect _figureBboxes[8];
349
350
351 const mgVect2i _figureVerts[1088] = {
352 { -66, 0 }, { -86, 0 }, { -73, 0 }, { -54, 0 }, { -65, 0 }, { -22, 0 }, { -83, 0 }, { -62, 0 }, // 0
353 { -66, -10 }, { -86, -11 }, { -68, -3 }, { -50, -2 }, { -65, -10 }, { -22, -3 }, { -83, -6 }, { -62, -5 }, // 8
354 { -65, -20 }, { -85, -20 }, { -63, -6 }, { -47, -4 }, { -65, -17 }, { -22, -6 }, { -80, -9 }, { -60, -7 }, // 16
355 { -65, -30 }, { -85, -30 }, { -58, -11 }, { -43, -8 }, { -62, -27 }, { -21, -9 }, { -77, -12 }, { -58, -9 }, // 24
356 { -65, -40 }, { -85, -41 }, { -53, -14 }, { -39, -10 }, { -58, -34 }, { -20, -12 }, { -74, -15 }, { -56, -11 }, // 32
357 { -64, -50 }, { -84, -50 }, { -50, -16 }, { -37, -12 }, { -53, -41 }, { -18, -14 }, { -71, -20 }, { -53, -15 }, // 40
358 { -63, -60 }, { -84, -57 }, { -50, -17 }, { -37, -13 }, { -48, -45 }, { -17, -15 }, { -70, -23 }, { -53, -17 }, // 48
359 { -62, -63 }, { -84, -63 }, { -53, -22 }, { -39, -16 }, { -43, -50 }, { -15, -17 }, { -71, -27 }, { -53, -20 }, // 56
360 { -59, -64 }, { -83, -74 }, { -53, -26 }, { -39, -19 }, { -38, -53 }, { -13, -18 }, { -72, -31 }, { -54, -23 }, // 64
361 { -49, -65 }, { -82, -80 }, { -57, -35 }, { -42, -26 }, { -33, -56 }, { -11, -19 }, { -73, -36 }, { -55, -27 }, // 72
362 { -39, -65 }, { -81, -81 }, { -61, -41 }, { -45, -30 }, { -28, -58 }, { -10, -20 }, { -71, -40 }, { -53, -30 }, // 80
363 { -29, -65 }, { -80, -82 }, { -61, -44 }, { -45, -33 }, { -23, -60 }, { -8, -21 }, { -69, -44 }, { -52, -33 }, // 88
364 { -19, -65 }, { -77, -82 }, { -56, -44 }, { -41, -33 }, { -18, -61 }, { -6, -21 }, { -68, -46 }, { -51, -35 }, // 96
365 { -9, -65 }, { -74, -83 }, { -51, -44 }, { -38, -33 }, { -13, -63 }, { -4, -22 }, { -64, -47 }, { -48, -35 }, // 104
366 { 1, -65 }, { -57, -84 }, { -45, -42 }, { -33, -31 }, { -8, -63 }, { -3, -22 }, { -59, -47 }, { -44, -35 }, // 112
367 { 11, -65 }, { -47, -84 }, { -40, -41 }, { -30, -30 }, { -3, -63 }, { -1, -22 }, { -57, -48 }, { -43, -36 }, // 120
368 { 21, -65 }, { -37, -85 }, { -34, -40 }, { -25, -30 }, { 2, -63 }, { 1, -22 }, { -53, -52 }, { -40, -39 }, // 128
369 { 31, -65 }, { -30, -86 }, { -33, -40 }, { -24, -30 }, { 7, -63 }, { 2, -22 }, { -52, -55 }, { -39, -41 }, // 136
370 { 39, -65 }, { -20, -86 }, { -33, -45 }, { -24, -33 }, { 12, -63 }, { 4, -22 }, { -52, -61 }, { -39, -46 }, // 144
371 { 47, -64 }, { -10, -86 }, { -33, -50 }, { -24, -37 }, { 17, -62 }, { 6, -21 }, { -49, -67 }, { -37, -50 }, // 152
372 { 52, -64 }, { 0, -86 }, { -33, -55 }, { -24, -41 }, { 22, -60 }, { 8, -21 }, { -45, -71 }, { -34, -53 }, // 160
373 { 57, -63 }, { 10, -86 }, { -33, -60 }, { -24, -44 }, { 27, -58 }, { 9, -20 }, { -40, -74 }, { -30, -56 }, // 168
374 { 61, -63 }, { 20, -86 }, { -34, -61 }, { -25, -45 }, { 32, -56 }, { 11, -19 }, { -35, -76 }, { -26, -57 }, // 176
375 { 64, -62 }, { 30, -86 }, { -34, -68 }, { -25, -50 }, { 37, -53 }, { 13, -18 }, { -30, -75 }, { -23, -56 }, // 184
376 { 65, -61 }, { 41, -86 }, { -30, -68 }, { -22, -50 }, { 42, -50 }, { 14, -17 }, { -25, -72 }, { -19, -54 }, // 192
377 { 65, -60 }, { 51, -85 }, { -29, -67 }, { -21, -50 }, { 47, -45 }, { 16, -15 }, { -20, -71 }, { -15, -53 }, // 200
378 { 65, -50 }, { 59, -84 }, { -24, -66 }, { -18, -49 }, { 53, -39 }, { 18, -13 }, { -15, -72 }, { -11, -54 }, // 208
379 { 65, -40 }, { 74, -83 }, { -20, -64 }, { -15, -47 }, { 57, -34 }, { 20, -12 }, { -10, -77 }, { -8, -58 }, // 216
380 { 65, -30 }, { 79, -82 }, { -15, -61 }, { -11, -45 }, { 60, -29 }, { 21, -10 }, { -5, -80 }, { -4, -60 }, // 224
381 { 65, -20 }, { 83, -81 }, { -10, -58 }, { -7, -43 }, { 63, -22 }, { 22, -8 }, { 0, -80 }, { 0, -60 }, // 232
382 { 65, -10 }, { 84, -80 }, { -6, -56 }, { -4, -41 }, { 65, -15 }, { 22, -5 }, { 5, -80 }, { 4, -60 }, // 240
383 { 65, 0 }, { 85, -79 }, { 0, -65 }, { 0, -48 }, { 65, -10 }, { 22, -3 }, { 10, -76 }, { 8, -57 }, // 248
384 { 65, 6 }, { 86, -78 }, { 5, -72 }, { 4, -53 }, { 65, -5 }, { 22, -2 }, { 15, -71 }, { 11, -53 }, // 256
385 { 64, 7 }, { 87, -75 }, { 9, -76 }, { 7, -56 }, { 65, 0 }, { 22, 0 }, { 20, -70 }, { 15, -53 }, // 264
386 { 64, 17 }, { 87, -68 }, { 12, -76 }, { 9, -56 }, { 65, 5 }, { 22, 2 }, { 25, -71 }, { 19, -53 }, // 272
387 { 64, 20 }, { 87, -58 }, { 15, -69 }, { 11, -51 }, { 65, 10 }, { 22, 3 }, { 30, -72 }, { 23, -54 }, // 280
388 { 63, 22 }, { 86, -58 }, { 18, -60 }, { 13, -44 }, { 63, 15 }, { 22, 5 }, { 35, -71 }, { 26, -53 }, // 288
389 { 63, 32 }, { 86, -48 }, { 19, -53 }, { 14, -39 }, { 61, 20 }, { 21, 7 }, { 40, -68 }, { 30, -51 }, // 296
390 { 63, 42 }, { 86, -38 }, { 20, -52 }, { 15, -38 }, { 59, 25 }, { 20, 9 }, { 43, -64 }, { 32, -48 }, // 304
391 { 63, 44 }, { 86, -28 }, { 25, -53 }, { 18, -39 }, { 56, 30 }, { 19, 10 }, { 44, -60 }, { 33, -45 }, // 312
392 { 62, 45 }, { 86, -18 }, { 30, -54 }, { 22, -40 }, { 53, 35 }, { 18, 12 }, { 46, -54 }, { 35, -41 }, // 320
393 { 62, 55 }, { 86, -10 }, { 35, -55 }, { 26, -41 }, { 49, 40 }, { 17, 14 }, { 50, -51 }, { 38, -38 }, // 328
394 { 62, 61 }, { 85, -10 }, { 40, -57 }, { 30, -42 }, { 44, 45 }, { 15, 15 }, { 55, -49 }, { 41, -37 }, // 336
395 { 61, 62 }, { 85, 9 }, { 43, -58 }, { 32, -43 }, { 37, 50 }, { 13, 17 }, { 59, -50 }, { 44, -38 }, // 344
396 { 61, 63 }, { 84, 9 }, { 45, -57 }, { 33, -42 }, { 33, 53 }, { 11, 18 }, { 65, -48 }, { 49, -36 }, // 352
397 { 60, 64 }, { 84, 26 }, { 45, -52 }, { 33, -38 }, { 28, 56 }, { 10, 19 }, { 70, -43 }, { 53, -32 }, // 360
398 { 50, 64 }, { 83, 26 }, { 43, -46 }, { 32, -34 }, { 21, 59 }, { 7, 20 }, { 71, -41 }, { 53, -31 }, // 368
399 { 40, 65 }, { 83, 42 }, { 41, -37 }, { 30, -27 }, { 16, 61 }, { 6, 21 }, { 71, -36 }, { 53, -27 }, // 376
400 { 30, 65 }, { 82, 42 }, { 39, -32 }, { 29, -24 }, { 10, 63 }, { 3, 22 }, { 69, -32 }, { 52, -24 }, // 384
401 { 20, 65 }, { 82, 50 }, { 40, -31 }, { 30, -23 }, { 5, 63 }, { 2, 22 }, { 68, -27 }, { 51, -20 }, // 392
402 { 10, 65 }, { 83, 50 }, { 45, -30 }, { 33, -22 }, { 0, 63 }, { 0, 22 }, { 71, -22 }, { 53, -17 }, // 400
403 { 0, 65 }, { 83, 55 }, { 50, -30 }, { 37, -22 }, { -5, 63 }, { -2, 22 }, { 76, -18 }, { 57, -14 }, // 408
404 { -10, 65 }, { 82, 55 }, { 55, -31 }, { 41, -23 }, { -10, 63 }, { -3, 22 }, { 80, -15 }, { 60, -11 }, // 416
405 { -20, 65 }, { 82, 68 }, { 60, -31 }, { 44, -23 }, { -15, 63 }, { -5, 22 }, { 84, -10 }, { 63, -8 }, // 424
406 { -30, 65 }, { 81, 68 }, { 67, -31 }, { 50, -23 }, { -20, 61 }, { -7, 21 }, { 84, -5 }, { 63, -4 }, // 432
407 { -40, 65 }, { 81, 81 }, { 67, -29 }, { 50, -21 }, { -25, 59 }, { -9, 20 }, { 84, -2 }, { 63, -2 }, // 440
408 { -45, 64 }, { 80, 81 }, { 64, -25 }, { 47, -18 }, { -30, 57 }, { -10, 20 }, { 82, 0 }, { 62, 0 }, // 448
409 { -50, 63 }, { 80, 83 }, { 61, -20 }, { 45, -15 }, { -35, 54 }, { -12, 19 }, { 78, 3 }, { 59, 2 }, // 456
410 { -60, 63 }, { 79, 83 }, { 57, -16 }, { 42, -12 }, { -40, 51 }, { -14, 18 }, { 75, 7 }, { 56, 5 }, // 464
411 { -66, 63 }, { 79, 84 }, { 54, -12 }, { 40, -9 }, { -45, 46 }, { -15, 16 }, { 73, 10 }, { 55, 8 }, // 472
412 { -66, 53 }, { 71, 84 }, { 52, -9 }, { 38, -7 }, { -49, 42 }, { -17, 14 }, { 73, 14 }, { 55, 11 }, // 480
413 { -66, 43 }, { 71, 85 }, { 55, -6 }, { 41, -4 }, { -53, 37 }, { -18, 13 }, { 77, 20 }, { 58, 15 }, // 488
414 { -66, 33 }, { 61, 85 }, { 60, -3 }, { 44, -2 }, { -57, 32 }, { -20, 11 }, { 79, 24 }, { 59, 18 }, // 496
415 { -66, 23 }, { 53, 85 }, { 65, 0 }, { 48, 0 }, { -60, 26 }, { -21, 9 }, { 78, 29 }, { 59, 22 }, // 504
416 { -66, 13 }, { 49, 85 }, { 69, 3 }, { 51, 2 }, { -63, 19 }, { -22, 7 }, { 75, 32 }, { 56, 24 }, // 512
417 { -67, 9 }, { 49, 86 }, { 72, 5 }, { 53, 4 }, { -64, 16 }, { -22, 6 }, { 73, 34 }, { 55, 26 }, // 520
418 { 0, 0 }, { 39, 86 }, { 72, 6 }, { 53, 4 }, { -65, 11 }, { -22, 4 }, { 73, 34 }, { 55, 26 }, // 528
419 { 0, 0 }, { 29, 86 }, { 67, 9 }, { 50, 7 }, { -65, 5 }, { -22, 2 }, { 68, 34 }, { 51, 26 }, // 536
420 { 0, 0 }, { 19, 86 }, { 62, 11 }, { 46, 8 }, { 0, 0 }, { 0, 0 }, { 63, 35 }, { 47, 26 }, // 544
421 { 0, 0 }, { 9, 86 }, { 57, 13 }, { 42, 10 }, { 0, 0 }, { 0, 0 }, { 58, 35 }, { 44, 26 }, // 552
422 { 0, 0 }, { 0, 86 }, { 52, 16 }, { 38, 12 }, { 0, 0 }, { 0, 0 }, { 56, 38 }, { 42, 29 }, // 560
423 { 0, 0 }, { -3, 86 }, { 50, 18 }, { 37, 13 }, { 0, 0 }, { 0, 0 }, { 55, 41 }, { 41, 31 }, // 568
424 { 0, 0 }, { -3, 85 }, { 52, 23 }, { 38, 17 }, { 0, 0 }, { 0, 0 }, { 55, 46 }, { 41, 35 }, // 576
425 { 0, 0 }, { -13, 85 }, { 54, 28 }, { 40, 21 }, { 0, 0 }, { 0, 0 }, { 50, 52 }, { 38, 39 }, // 584
426 { 0, 0 }, { -23, 85 }, { 56, 35 }, { 41, 26 }, { 0, 0 }, { 0, 0 }, { 45, 57 }, { 34, 43 }, // 592
427 { 0, 0 }, { -33, 85 }, { 57, 38 }, { 42, 28 }, { 0, 0 }, { 0, 0 }, { 39, 60 }, { 29, 45 }, // 600
428 { 0, 0 }, { -43, 85 }, { 57, 42 }, { 42, 31 }, { 0, 0 }, { 0, 0 }, { 33, 59 }, { 25, 44 }, // 608
429 { 0, 0 }, { -50, 85 }, { 54, 42 }, { 40, 31 }, { 0, 0 }, { 0, 0 }, { 27, 65 }, { 20, 49 }, // 616
430 { 0, 0 }, { -57, 85 }, { 49, 42 }, { 36, 31 }, { 0, 0 }, { 0, 0 }, { 26, 69 }, { 20, 52 }, // 624
431 { 0, 0 }, { -57, 84 }, { 45, 41 }, { 33, 30 }, { 0, 0 }, { 0, 0 }, { 25, 74 }, { 19, 56 }, // 632
432 { 0, 0 }, { -62, 84 }, { 40, 41 }, { 30, 30 }, { 0, 0 }, { 0, 0 }, { 22, 76 }, { 17, 57 }, // 640
433 { 0, 0 }, { -62, 83 }, { 35, 41 }, { 26, 30 }, { 0, 0 }, { 0, 0 }, { 17, 77 }, { 13, 58 }, // 648
434 { 0, 0 }, { -72, 83 }, { 30, 41 }, { 22, 30 }, { 0, 0 }, { 0, 0 }, { 12, 76 }, { 9, 57 }, // 656
435 { 0, 0 }, { -83, 83 }, { 28, 41 }, { 21, 30 }, { 0, 0 }, { 0, 0 }, { 7, 74 }, { 5, 56 }, // 664
436 { 0, 0 }, { -84, 82 }, { 27, 41 }, { 20, 30 }, { 0, 0 }, { 0, 0 }, { 3, 70 }, { 2, 53 }, // 672
437 { 0, 0 }, { -84, 71 }, { 27, 45 }, { 20, 33 }, { 0, 0 }, { 0, 0 }, { 0, 68 }, { 0, 51 }, // 680
438 { 0, 0 }, { -84, 61 }, { 27, 50 }, { 20, 37 }, { 0, 0 }, { 0, 0 }, { -5, 71 }, { -4, 53 }, // 688
439 { 0, 0 }, { -85, 61 }, { 27, 55 }, { 20, 41 }, { 0, 0 }, { 0, 0 }, { -10, 76 }, { -8, 57 }, // 696
440 { 0, 0 }, { -85, 51 }, { 27, 60 }, { 20, 44 }, { 0, 0 }, { 0, 0 }, { -16, 78 }, { -12, 59 }, // 704
441 { 0, 0 }, { -85, 41 }, { 27, 65 }, { 20, 48 }, { 0, 0 }, { 0, 0 }, { -22, 77 }, { -17, 58 }, // 712
442 { 0, 0 }, { -85, 31 }, { 25, 66 }, { 18, 49 }, { 0, 0 }, { 0, 0 }, { -28, 73 }, { -21, 55 }, // 720
443 { 0, 0 }, { -85, 21 }, { 20, 63 }, { 15, 47 }, { 0, 0 }, { 0, 0 }, { -33, 64 }, { -25, 48 }, // 728
444 { 0, 0 }, { -85, 12 }, { 15, 59 }, { 11, 44 }, { 0, 0 }, { 0, 0 }, { -40, 64 }, { -30, 48 }, // 736
445 { 0, 0 }, { -86, 1 }, { 10, 57 }, { 7, 42 }, { 0, 0 }, { 0, 0 }, { -45, 66 }, { -34, 50 }, // 744
446 { 0, 0 }, { 0, 0 }, { 5, 54 }, { 4, 40 }, { 0, 0 }, { 0, 0 }, { -50, 66 }, { -38, 50 }, // 752
447 { 0, 0 }, { 0, 0 }, { 2, 60 }, { 1, 44 }, { 0, 0 }, { 0, 0 }, { -55, 64 }, { -41, 48 }, // 760
448 { 0, 0 }, { 0, 0 }, { -1, 65 }, { -1, 48 }, { 0, 0 }, { 0, 0 }, { -59, 60 }, { -44, 45 }, // 768
449 { 0, 0 }, { 0, 0 }, { -4, 71 }, { -3, 53 }, { 0, 0 }, { 0, 0 }, { -60, 56 }, { -45, 42 }, // 776
450 { 0, 0 }, { 0, 0 }, { -6, 73 }, { -4, 54 }, { 0, 0 }, { 0, 0 }, { -60, 51 }, { -45, 38 }, // 784
451 { 0, 0 }, { 0, 0 }, { -9, 73 }, { -7, 54 }, { 0, 0 }, { 0, 0 }, { -60, 47 }, { -45, 35 }, // 792
452 { 0, 0 }, { 0, 0 }, { -11, 71 }, { -8, 53 }, { 0, 0 }, { 0, 0 }, { -64, 41 }, { -48, 31 }, // 800
453 { 0, 0 }, { 0, 0 }, { -13, 65 }, { -10, 48 }, { 0, 0 }, { 0, 0 }, { -69, 39 }, { -52, 29 }, // 808
454 { 0, 0 }, { 0, 0 }, { -15, 60 }, { -11, 44 }, { 0, 0 }, { 0, 0 }, { -74, 38 }, { -56, 29 }, // 816
455 { 0, 0 }, { 0, 0 }, { -17, 56 }, { -13, 41 }, { 0, 0 }, { 0, 0 }, { -78, 35 }, { -59, 26 }, // 824
456 { 0, 0 }, { 0, 0 }, { -19, 51 }, { -14, 38 }, { 0, 0 }, { 0, 0 }, { -79, 33 }, { -59, 25 }, // 832
457 { 0, 0 }, { 0, 0 }, { -22, 53 }, { -16, 39 }, { 0, 0 }, { 0, 0 }, { -80, 30 }, { -60, 23 }, // 840
458 { 0, 0 }, { 0, 0 }, { -27, 57 }, { -20, 42 }, { 0, 0 }, { 0, 0 }, { -77, 25 }, { -58, 19 }, // 848
459 { 0, 0 }, { 0, 0 }, { -32, 60 }, { -24, 44 }, { 0, 0 }, { 0, 0 }, { -74, 19 }, { -56, 14 }, // 856
460 { 0, 0 }, { 0, 0 }, { -38, 63 }, { -28, 47 }, { 0, 0 }, { 0, 0 }, { -73, 14 }, { -55, 11 }, // 864
461 { 0, 0 }, { 0, 0 }, { -39, 62 }, { -29, 46 }, { 0, 0 }, { 0, 0 }, { -76, 9 }, { -57, 7 }, // 872
462 { 0, 0 }, { 0, 0 }, { -41, 62 }, { -30, 46 }, { 0, 0 }, { 0, 0 }, { -80, 7 }, { -60, 5 }, // 880
463 { 0, 0 }, { 0, 0 }, { -41, 57 }, { -30, 42 }, { 0, 0 }, { 0, 0 }, { -82, 4 }, { -62, 3 }, // 888
464 { 0, 0 }, { 0, 0 }, { -41, 52 }, { -30, 38 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, // 896
465 { 0, 0 }, { 0, 0 }, { -42, 48 }, { -31, 36 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, // 904
466 { 0, 0 }, { 0, 0 }, { -42, 43 }, { -31, 32 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, // 912
467 { 0, 0 }, { 0, 0 }, { -39, 39 }, { -29, 29 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, // 920
468 { 0, 0 }, { 0, 0 }, { -43, 38 }, { -32, 28 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, // 928
469 { 0, 0 }, { 0, 0 }, { -49, 38 }, { -36, 28 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, // 936
470 { 0, 0 }, { 0, 0 }, { -54, 37 }, { -40, 27 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, // 944
471 { 0, 0 }, { 0, 0 }, { -59, 36 }, { -44, 27 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, // 952
472 { 0, 0 }, { 0, 0 }, { -62, 34 }, { -46, 25 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, // 960
473 { 0, 0 }, { 0, 0 }, { -60, 29 }, { -44, 21 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, // 968
474 { 0, 0 }, { 0, 0 }, { -58, 26 }, { -43, 19 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, // 976
475 { 0, 0 }, { 0, 0 }, { -55, 21 }, { -41, 16 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, // 984
476 { 0, 0 }, { 0, 0 }, { -52, 17 }, { -38, 13 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, // 992
477 { 0, 0 }, { 0, 0 }, { -51, 15 }, { -38, 11 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, // 1000
478 { 0, 0 }, { 0, 0 }, { -54, 13 }, { -40, 10 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, // 1008
479 { 0, 0 }, { 0, 0 }, { -57, 10 }, { -42, 7 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, // 1016
480 { 0, 0 }, { 0, 0 }, { -60, 9 }, { -44, 7 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, // 1024
481 { 0, 0 }, { 0, 0 }, { -65, 6 }, { -48, 4 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, // 1032
482 { 0, 0 }, { 0, 0 }, { -68, 4 }, { -50, 3 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, // 1040
483 { 0, 0 }, { 0, 0 }, { -71, 3 }, { -53, 2 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, // 1048
484 { 0, 0 }, { 0, 0 }, { -73, 2 }, { -54, 1 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, // 1056
485 { 0, 0 }, { 0, 0 }, { -74, 1 }, { -55, 1 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, // 1064
486 { 0, 0 }, { 0, 0 }, { -75, 0 }, { -55, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, // 1072
487 { 0, 0 }, { 0, 0 }, { -75, -1 }, { -55, -1 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, // 1080
488 };
489
490};
491
492} // namespace QDEngine
493
494#endif // QDENGINE_MINIGAMES_3MICE2_TESTO_H
Definition: 3mice2_testo.h:33
bool quant(float dt)
Обсчёт логики игры, параметр - время, которое должно пройти в игре (в секундах).
Definition: 3mice2_testo.h:159
bool finit()
Деинициализация игры.
Definition: 3mice2_testo.h:247
int load_game(const qdEngineInterface *engine_interface, const qdMinigameSceneInterface *scene_interface, const char *buffer, int buffer_size)
Загрузка данных, вызывается при загрузке сцены, на которую повешена миниигра.
Definition: 3mice2_testo.h:266
bool new_game(const qdEngineInterface *engine_interface)
Инициализация миниигры, вызывается при старте и перезапуске игры.
Definition: 3mice2_testo.h:258
bool init(const qdEngineInterface *engine_interface)
Инициализация игры.
Definition: 3mice2_testo.h:38
int save_game(const qdEngineInterface *engine_interface, const qdMinigameSceneInterface *scene_interface, char *buffer, int buffer_size)
Сохранение данных, вызывается при сохранении сцены, на которую повешена миниигра.
Definition: 3mice2_testo.h:262
Definition: qd_minigame_interface.h:365
virtual mgVect2i mouse_cursor_position() const =0
Возвращает текущие координаты мышиного курсора.
virtual bool is_mouse_event_active(qdMinigameMouseEvent event_id) const =0
Возвращает true, если в данный момент произошло событие event_id.
@ MOUSE_EV_LEFT_DOWN
Нажатие левой кнопки.
Definition: qd_minigame_interface.h:372
@ MOUSE_EV_RIGHT_DOWN
Нажатие правой кнопки.
Definition: qd_minigame_interface.h:374
Definition: qd_minigame_interface.h:78
Интерфейс к динамическому объекту.
Definition: qd_minigame_interface.h:230
virtual mgVect2i screen_R() const =0
Возвращает координаты объекта в экранной системе координат.
virtual bool set_state(const char *state_name)=0
Включает состояние с именем state_name.
virtual void set_R(const mgVect3f &r)=0
Устанавливает координаты объекта в мировой системе координат.
virtual bool hit_test(const mgVect2i &pos) const =0
Проверка, попадает ли точка с экранными координатами pos в объект
virtual bool is_state_active(const char *state_name) const =0
Возвращает true, если состояние с именем state_name включено в данный момент.
virtual const char * name() const =0
Имя объекта.
Интерфейс к сцене.
Definition: qd_minigame_interface.h:315
virtual qdMinigameObjectInterface * mouse_object_interface() const =0
Создаёт интерфейс к объекту, который взят мышью в данный момент.
virtual qdMinigameObjectInterface * mouse_click_object_interface() const =0
Создаёт интерфейс к объекту, по которому кликнули мышью.
virtual mgVect3f screen2world_coords(const mgVect2i &screen_pos, float screen_depth=0) const =0
Преобразование из экранных координат в мировые.
virtual qdMinigameObjectInterface * object_interface(const char *object_name, bool test=false)=0
Создаёт интерфейс к объекту с именем object_name.
void void void void void debugC(int level, uint32 debugChannel, MSVC_PRINTF const char *s,...) GCC_PRINTF(3
void void void debugN(MSVC_PRINTF const char *s,...) GCC_PRINTF(1
Базовый класс для игровых ресурсов.
Definition: console.h:28
T left
Definition: rect.h:170
Definition: rect.h:536