aboutsummaryrefslogtreecommitdiff
path: root/engines/mortevielle/ques.cpp
blob: 6f7a05e0c7e3ad2e5acb1295dda35b0bc51ac068 (plain)
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
/* overlay */ boolean ques() {
	const array<1, 10, int> ta
	= {{
			511, 516, 524, 531, 545,
			552, 559, 563, 570, 576
		}
	};
	const array<1, 10, int> ok
	= {{ 4, 7, 1, 6, 4, 4, 2, 5, 3, 1 }};

	boolean q, func, test;
	int i, j, k, y, memk;
	int tay , tmax;
	int rep, prem, der;
	phrase st;
	char key;
	mult_rect coor;
	array<1, 14, str40> chaines;
	int compte;


	boolean ques_result;
	test = false;
	i = 0;
	compte = 0;

	do {
		hide_mouse();
		hirs();
		show_mouse();
		i = i + 1;
		deline(ta[i], st, tay);
		if (res == 1)  y = 29;
		else y = 23;
		box(15, gd, 0, 14, 630, y, 255);
		afftex(st, 20, 15, 100, 2, 0);
		if (i != 10) {
			prem = ta[i] + 1;
			der = ta[i + 1] - 1;
		} else {
			prem = 503;
			der = 510;
		}
		y = 35;
		tmax = 0;
		memk = 1;
		for (j = prem; j <= der; j ++) {
			deline(j, st, tay);
			if (tay > tmax)  tmax = tay;
			afftex(st, 100, y, 100, 1, 0);
			chaines[memk] = delig;
			memk = memk + 1;
			y = y + 8;
		}
		for (j = 1; j <= succ(int, der - prem); j ++) {
			{
				rectangle &with = coor[j];

				with.x1 = 45 * res;
				with.x2 = (tmax * 3 + 55) * res;
				with.y1 = 27 + j * 8;
				with.y2 = 34 + j * 8;
				with.etat = true;
			}
			while (length(chaines[j]) < tmax) {
				chaines[j] = chaines[j] + ' ';
			}
		}
		coor[j + 1].etat = false;
		if (res == 1)  rep = 10;
		else rep = 6;
		boite(80, 33, 40 + tmax * rep, (der - prem) * 8 + 16, 15);
		rep = 0;
		j = 0;
		memk = 0;
		do {
			clic = false;
			tesok = false;
			mov_mouse(func, key);
			k = 1;
			while (coor[k].etat && ! dans_rect(coor[k]))  k = k + 1;
			if (coor[k].etat) {
				if ((memk != 0) && (memk != k)) {
					/*DeLine(T_rec[ta[i]+memk].indis,T_rec[ta[i]+memk].point,st,tay);*/
					for (j = 1; j <= tmax; j ++) st[j] = chaines[memk][j];
					st[1 + tmax] = '$';
					afftex(st, 100, 27 + memk * 8, 100, 1, 0);
				}
				if (memk != k) {
					/*DeLine(T_rec[pred(prem)+k].indis,T_rec[pred(prem)+k].point,st,tay);*/
					for (j = 1; j <= tmax; j ++) st[j] = chaines[k][j];
					st[1 + tmax] = '$';
					afftex(st, 100, 27 + k * 8, 100, 1, 1);
					memk = k;
				}
			} else if (memk != 0) {
				for (j = 1; j <= tmax; j ++) st[j] = chaines[memk][j];
				st[1 + tmax] = '$';
				afftex(st, 100, 27 + memk * 8, 100, 1, 0);
				memk = 0;
			}
		} while (!((memk != 0) && clic));
		if (memk == ok[i])  compte = compte + 1;
		else {
			if (i == 5)  i = i + 1;
			if ((i == 7) || (i == 8))  i = 10;
		}
		if (i == 10)  q =   /*testprot*/ true;
	} while (!(i == 10));
	ques_result = (compte == 10) && q;
	return ques_result;
}