Mercurial > mm7
annotate Arcomage.cpp @ 1212:746f7ef994cb
Merge
author | Gloval |
---|---|
date | Sun, 09 Jun 2013 16:37:31 +0400 |
parents | decc0dd6e4ba |
children | 68655becb94b eb687c8529ee |
rev | line source |
---|---|
1165
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1138
diff
changeset
|
1 #ifdef _MSC_VER |
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1138
diff
changeset
|
2 #define _CRT_SECURE_NO_WARNINGS |
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1138
diff
changeset
|
3 #endif |
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1138
diff
changeset
|
4 |
0 | 5 #include <string> |
1033 | 6 #include <assert.h> |
0 | 7 |
1016 | 8 #include "LightmapBuilder.h" |
0 | 9 #include "Arcomage.h" |
10 #include "VideoPlayer.h" | |
11 #include "AudioPlayer.h" | |
12 #include "Mouse.h" | |
13 #include "Game.h" | |
14 #include "Viewport.h" | |
15 #include "Time.h" | |
16 #include "GUIFont.h" | |
17 #include "Party.h" | |
18 #include "GUIWindow.h" | |
19 #include "Events2D.h" | |
20 #include "VectorTypes.h" | |
189 | 21 #include "texts.h" |
1183 | 22 #include <windef.h> |
0 | 23 |
24 | |
25 | |
1197 | 26 void SetStartConditions(); |
27 | |
28 | |
29 void SetStartGameData(); | |
30 void FillPlayerDeck(); | |
1200 | 31 void InitalHandsFill(); |
32 void GetNextCardFromDeck(int player_num); | |
1185 | 33 int GetEmptyCardSlotIndex(int player_num); |
1197 | 34 void IncreaseResourcesInTurn(int player_num); |
1183 | 35 void __cdecl am_40A383(); |
1197 | 36 bool IsGameOver(); |
1183 | 37 char __thiscall am_40A560(unsigned int _this); |
1200 | 38 void DrawGameUI(int a1); // idb |
1185 | 39 void am_40AA4E(); |
1197 | 40 void DrawRectanglesForText(); |
41 void DrawPlayersText(); | |
42 void DrawPlayerLevels(int a1, char *text, POINT *pXY); // idb | |
43 void DrawBricksCount(int a1, char* text, POINT *pXY); // idb | |
44 void DrawGemsCount(int a1, char* text, POINT* pXY); | |
45 void DrawBeastsCount(int a1, char *text, POINT *pXY); // idb | |
1209 | 46 void DrawPlayersTowers(); |
47 void DrawPlayersWall(); | |
48 void DrawCards(); | |
1183 | 49 void __fastcall am_40B76F(int a1); |
1185 | 50 int GetPlayerHandCardCount(int player_num); |
1200 | 51 signed int DrawCardsRectangles(int player_num); |
52 bool am_40BCFB(int player_num, signed int card_slot_index); | |
1197 | 53 bool PlayCard(int player_num, signed int card_slot_num); |
1200 | 54 bool CanCardBePlayed(int player_num, int hand_card_indx); |
1183 | 55 void __fastcall am_40BF77(int a1, unsigned int uCardID); // idb |
1185 | 56 int am_40D2B4(POINT* a1, int a2); // weak |
1183 | 57 int __fastcall am_40D402(int, int); // weak |
1197 | 58 int __cdecl GameResultsApply(); |
1183 | 59 |
60 void pPrimaryWindow_draws_text(int a1, const char *pText, POINT *pXY); | |
61 void __thiscall am_BeginScene(unsigned __int16 *pPcxPixels, int a2, int a3); // idb | |
62 void __fastcall Blt_Chroma(RECT *pSrcXYZW, POINT *pTargetXY, int a3, int a4); | |
63 void Blt_Copy(RECT *pSrcRect, POINT *pTargetXY, int a3); | |
64 void __cdecl am_EndScene(); | |
65 void __fastcall DrawRect(RECT *pXYZW, unsigned __int16 uColor, char bSolidFill); // idb | |
1185 | 66 void SetPixel(POINT *pTargetXY, unsigned __int16 uColor); |
1183 | 67 int __fastcall rand_interval(int a, int b); // idb |
68 void __fastcall intToString(int val, char *pOut); | |
938 | 69 |
70 /* 388 */ | |
71 #pragma pack(push, 1) | |
1197 | 72 struct ArcomageStartConditions |
938 | 73 { |
1197 | 74 __int16 max_tower; |
75 __int16 max_resources; | |
76 __int16 tower_height; | |
77 __int16 wall_height; | |
78 __int16 quarry_level; | |
79 __int16 magic_level; | |
1200 | 80 __int16 zoo_level; |
1197 | 81 __int16 bricks_amount; |
82 __int16 gems_amount; | |
83 __int16 beasts_amount; | |
938 | 84 int field_14; |
85 }; | |
86 #pragma pack(pop) | |
1197 | 87 ArcomageStartConditions start_conditions[13] = |
938 | 88 { |
89 { 30, 100, 15, 5, 2, 2, 2, 10, 10, 10, 0}, | |
90 { 50, 150, 20, 5, 2, 2, 2, 5, 5, 5, 1}, | |
91 { 50, 150, 20, 5, 2, 2, 2, 5, 5, 5, 2}, | |
92 { 75, 200, 25, 10, 3, 3, 3, 5, 5, 5, 2}, | |
93 { 75, 200, 20, 10, 3, 3, 3, 5, 5, 5, 1}, | |
94 {100, 300, 30, 15, 4, 4, 4, 10, 10, 10, 1}, | |
95 {100, 300, 30, 15, 4, 4, 4, 10, 10, 10, 2}, | |
96 {150, 400, 20, 10, 5, 5, 5, 25, 25, 25, 0}, | |
97 {200, 500, 20, 10, 1, 1, 1, 15, 15, 15, 2}, | |
98 {100, 300, 20, 50, 1, 1, 5, 5, 5, 25, 0}, | |
99 {125, 350, 10, 20, 3, 1, 2, 15, 5, 10, 2}, | |
100 {125, 350, 10, 20, 3, 1, 2, 15, 5, 10, 1}, | |
101 {100, 300, 50, 50, 5, 3, 5, 20, 10, 20, 0} | |
102 }; | |
103 | |
1184 | 104 #define SIG_trpg 0x67707274 |
105 #define SIG_xxxx 0x78787878 | |
0 | 106 |
107 ArcomageGame *pArcomageGame = new ArcomageGame; | |
1194 | 108 |
1183 | 109 ArcomagePlayer am_Players[2]; |
1209 | 110 Acromage_st1 shown_cards[10]; //amuint_4FAA78; // weak |
0 | 111 |
1184 | 112 stru272 array_4FABD0[10]; |
935 | 113 |
1201 | 114 |
1194 | 115 ArcomageDeck playDeck; |
116 ArcomageDeck deckMaster; | |
1201 | 117 |
118 char Player2Name[] = "Enemy"; | |
119 char Player1Name[] = "Player"; | |
120 char pDeckMaster[] = "Master Deck"; | |
0 | 121 |
122 /* 267 */ | |
123 #pragma pack(push, 1) | |
124 struct stru273 | |
125 { | |
126 bool _40DD2F(); | |
1185 | 127 bool Inside(RECT*pXYZW); |
0 | 128 |
129 int x; | |
130 int y; | |
131 char field_8; | |
132 char field_9; | |
133 char field_A; | |
134 char field_B; | |
135 }; | |
136 #pragma pack(pop) | |
137 | |
1186 | 138 |
139 | |
1185 | 140 char am_byte_4E185D; // weak |
141 | |
1201 | 142 int start_tower_height; |
143 int start_wall_height; | |
144 int start_quarry_level; | |
145 int start_magic_level; | |
146 int start_zoo_level; | |
147 | |
148 | |
149 int minimum_cards_at_hand = 5; | |
150 int quarry_bonus = 1; | |
151 int magic_bonus = 1; | |
152 int zoo_bonus = 1; | |
153 | |
154 int max_tower_height = 50; | |
155 int max_resources_amount = 100 ; | |
1185 | 156 |
157 int dword_4DF3A4; // weak | |
158 | |
159 char byte_4FAA2C; // weak | |
1186 | 160 char byte_4FAA2D; // weak |
161 | |
1197 | 162 int current_player_num; // idb |
1185 | 163 char am_byte_4FAA77; // weak |
164 | |
1201 | 165 signed int current_card_slot_index; |
1209 | 166 int played_card_id; // idb 4FABC0 |
167 int uCardID; // idb 4FAA50 | |
1200 | 168 |
1201 | 169 int deck_walk_index; |
170 | |
171 int start_bricks_amount; | |
172 int start_gems_amount; | |
173 int start_beasts_amount; | |
1197 | 174 |
1209 | 175 POINT amuint_4FAA3C_blt_xy; |
176 POINT am_uint_4FAA44_blt_xy; | |
177 POINT amuint_4FAA54_blt_xy; | |
178 POINT amuint_4FAA5C_blt_xy; | |
179 | |
180 | |
181 | |
182 int dword_4FABB8; // weak | |
183 | |
0 | 184 |
185 //----- (0040DD2F) -------------------------------------------------------- | |
186 bool stru273::_40DD2F() | |
187 { | |
188 | |
189 this->x = pArcomageGame->mouse_x; | |
190 this->y = pArcomageGame->mouse_y; | |
191 this->field_8 = pArcomageGame->mouse_left; | |
192 this->field_9 = pArcomageGame->mouse_left == pArcomageGame->field_F7; | |
1185 | 193 this->field_A = pArcomageGame->mouse_right; |
0 | 194 this->field_B = pArcomageGame->mouse_right == pArcomageGame->field_F8; |
195 pArcomageGame->field_F7 = pArcomageGame->mouse_left; | |
196 pArcomageGame->field_F8 = pArcomageGame->mouse_right; | |
1183 | 197 return true; |
0 | 198 } |
199 | |
200 //----- (0040DD93) -------------------------------------------------------- | |
1185 | 201 bool stru273::Inside(RECT*pXYZW ) |
202 { | |
203 | |
204 return (x >= pXYZW->left) && (x <= pXYZW->right) && | |
205 (y>= pXYZW->top) && (y <= pXYZW->bottom); | |
0 | 206 } |
207 | |
1184 | 208 //----- (0040DFD1) -------------------------------------------------------- |
1200 | 209 void stru272_stru0::Ctor(stru272_stru0 *a1) |
1184 | 210 { |
211 stru272_stru0 *v2; // eax@1 | |
212 v2 = (stru272_stru0 *)malloc(0x5Cu); | |
213 a1 = v2; | |
214 v2->signature = SIG_trpg; | |
215 v2->field_8 = 0; | |
216 v2->field_30 = 0.0; | |
217 v2->field_58 = 0; | |
218 v2->field_59 = 0; | |
219 } | |
220 | |
221 //----- (0040DFFE) -------------------------------------------------------- | |
1200 | 222 int stru272_stru0::Dtor() |
1184 | 223 { |
224 | |
225 if ( this->signature == SIG_trpg ) | |
226 { | |
227 this->signature = SIG_xxxx; | |
228 free(this); | |
229 return 0; | |
230 } | |
231 else | |
232 return 2; | |
233 | |
234 } | |
235 | |
236 //----- (0040E01A) -------------------------------------------------------- | |
1186 | 237 int stru272_stru0::_40E01A( stru272_stru2* a2 ) |
1184 | 238 { |
239 auto a1 = this; | |
240 if ( a1->signature == SIG_trpg ) | |
241 { | |
1186 | 242 a1->field_4 = a2->field_20; |
243 a1->field_C = a2->field_0 << 16; | |
244 a1->field_10 = a2->field_4 << 16; | |
245 a1->field_14 = a2->field_8 << 16; | |
246 a1->field_18 = a2->field_C << 16; | |
247 a1->field_1C = a2->field_10; | |
248 a1->field_20 = a2->field_14; | |
249 a1->field_24 = a2->field_18; | |
250 a1->field_28 = (float)(a2->field_1Cf * 65536.0); | |
251 a1->field_2C = a2->field_24f; | |
252 a1->field_34 = (int)(a2->field_28f * 65536.0); | |
253 a1->field_38 = (int)(a2->field_2Cf * 65536.0); | |
254 a1->field_3C = a2->field_30; | |
255 a1->field_40 = a2->field_34; | |
256 a1->field_54 = a2->field_38; | |
1184 | 257 a1->field_59 = 1; |
1186 | 258 |
1185 | 259 return 0; |
1184 | 260 } |
261 else | |
1185 | 262 return 2; |
1184 | 263 } |
264 | |
265 //----- (0040E0F5) -------------------------------------------------------- | |
1200 | 266 int stru272_stru0::Empty(char a2, char a3) |
1184 | 267 { |
1185 | 268 if ( signature == SIG_trpg) |
1184 | 269 { |
270 if ( a2 ) | |
271 { | |
1185 | 272 field_8 = 0; |
273 field_30 = 0.0; | |
1184 | 274 } |
1185 | 275 if ( field_59 && a3 ) |
1184 | 276 { |
1185 | 277 |
278 for (int i=0; i<field_4; ++i) | |
279 field_54[i].field_0 = 0; | |
280 field_58 = 0; | |
1184 | 281 } |
1185 | 282 return 0; |
1184 | 283 } |
284 else | |
1185 | 285 return 2; |
1184 | 286 } |
287 | |
288 //----- (0040E133) -------------------------------------------------------- | |
289 int stru272_stru0::_40E133() | |
290 { | |
1186 | 291 |
1184 | 292 stru272_stru0 *v1; // edi@1 |
293 int v3; // ST18_4@3 | |
294 double v4; // st7@3 | |
295 double v5; // st6@4 | |
296 char v6; // bl@8 | |
1186 | 297 stru272_stru1 *v7; // esi@8 |
1184 | 298 int v8; // ecx@10 |
299 signed int v9; // eax@10 | |
300 int v10; // ecx@10 | |
301 signed int v11; // eax@10 | |
1186 | 302 int v12; // ebx@12 |
303 int v13; // ST1C_4@12 | |
304 int v14; // ebx@12 | |
305 int v15; // ST1C_4@12 | |
306 signed int v16; // edx@12 | |
307 int v17; // ebx@12 | |
308 int v18; // ST1C_4@12 | |
309 signed int v19; // edx@12 | |
310 int v20; // [sp+8h] [bp-10h]@8 | |
311 int v21; // [sp+Ch] [bp-Ch]@8 | |
312 float v22; // [sp+14h] [bp-4h]@3 | |
1184 | 313 |
314 v1 = this; | |
315 if ( this->signature != SIG_trpg ) | |
316 return 2; | |
317 v3 = this->field_8; | |
1186 | 318 v22 = this->field_30; |
319 v4 = v3; | |
1184 | 320 if ( v3 > 0 ) |
321 { | |
1186 | 322 v5 = v22 + this->field_2C; |
323 v22 = v5; | |
1184 | 324 if ( v5 > v4 ) |
1186 | 325 v22 = v4; |
1184 | 326 } |
1186 | 327 if ( v22 >= 1.0 || this->field_58 ) |
1184 | 328 { |
329 v6 = 0; | |
1186 | 330 v7 = this->field_54; |
331 v20 = this->field_28; | |
332 v21 = this->field_4; | |
333 while ( v7->field_0 <= 0 ) | |
1184 | 334 { |
1186 | 335 if ( v22 >= 1.0 ) |
1184 | 336 { |
1186 | 337 v12 = v1->field_40; |
338 v13 = v1->field_3C; | |
339 v7->field_0 = v13 + rand() % (v12 - v13 + 1); | |
340 v7->field_14 = (rand() % 17 - 8) << 16; | |
341 v7->field_18 = (rand() % 17 - 8) << 16; | |
342 v14 = v1->field_14 - 1; | |
343 v15 = v1->field_C; | |
344 v16 = v15 + rand() % (v14 - v15 + 1); | |
345 v7->field_C = v16; | |
346 v7->field_4.x = v16 >> 16; | |
347 | |
348 v17 = v1->field_18 - 1; | |
349 v18 = v1->field_10; | |
350 v22 = v22 - 1.0; | |
351 v19 = v18 + rand() % (v17 - v18 + 1); | |
352 v7->field_10 = v19; | |
353 v7->field_4.y = v19 >> 16; | |
1184 | 354 --v1->field_8; |
355 goto LABEL_13; | |
356 } | |
357 LABEL_14: | |
1186 | 358 ++v7; |
359 --v21; | |
360 if ( !v21 ) | |
1184 | 361 { |
362 v1->field_58 = v6; | |
1186 | 363 v1->field_30 = v22; |
1184 | 364 return 0; |
365 } | |
366 } | |
1186 | 367 v8 = v7->field_14; |
368 --v7->field_0; | |
369 v9 = v8 + v7->field_C; | |
370 | |
371 v10 = v20 + v7->field_18; | |
372 v7->field_C = v9; | |
373 v7->field_4.x = v9 >> 16; | |
374 | |
375 v11 = v10 + v7->field_10; | |
376 v7->field_18 = v10; | |
377 v7->field_10 = v11; | |
378 v7->field_4.y = v11 >> 16; | |
1184 | 379 LABEL_13: |
380 v6 = 1; | |
381 goto LABEL_14; | |
382 } | |
383 return 0; | |
384 } | |
385 | |
386 //----- (0040E2A7) -------------------------------------------------------- | |
387 int stru272_stru0::_40E2A7() | |
388 { | |
1185 | 389 |
390 if (signature == SIG_trpg ) | |
1184 | 391 { |
1185 | 392 if ( field_8 <= 0 ) |
393 return field_58 != 0 ? 2 : 0; | |
1184 | 394 else |
1185 | 395 return 1; |
1184 | 396 } |
397 else | |
1185 | 398 return 3; |
1184 | 399 } |
0 | 400 |
401 | |
402 //----- (0040DFAF) -------------------------------------------------------- | |
403 void ArcomageGame::OnMouseClick(char right_left, bool bDown) | |
404 { | |
405 if ( right_left ) | |
406 pArcomageGame->mouse_right = bDown; | |
407 else | |
408 pArcomageGame->mouse_left = bDown; | |
409 } | |
410 | |
411 //----- (0040DFC1) -------------------------------------------------------- | |
412 void ArcomageGame::OnMouseMove(POINT *pXY) | |
413 { | |
414 pArcomageGame->mouse_x = pXY->x; | |
415 pArcomageGame->mouse_y = pXY->y; | |
416 } | |
417 | |
418 | |
419 //----- (0040DF47) -------------------------------------------------------- | |
420 void DoBlt_Copy(unsigned __int16 *pPixels) | |
421 { | |
1183 | 422 RECT pSrcRect; |
423 POINT pTargetPoint; // [sp+1Ch] [bp-8h]@1 | |
424 | |
0 | 425 pRenderer->Present(); |
1183 | 426 |
427 pTargetPoint.x = 0; | |
428 pTargetPoint.y = 0; | |
429 | |
430 pSrcRect.left = 0; | |
431 pSrcRect.right = 640; | |
432 pSrcRect.top = 0; | |
433 pSrcRect.bottom = 480; | |
434 | |
0 | 435 pRenderer->BeginScene(); |
1183 | 436 pArcomageGame->pBlit_Copy_pixels = pPixels; |
437 Blt_Copy(&pSrcRect, &pTargetPoint, 2); | |
0 | 438 pRenderer->EndScene(); |
439 pArcomageGame->pBlit_Copy_pixels = 0; | |
440 } | |
441 | |
442 //----- (0040DDC9) -------------------------------------------------------- | |
1183 | 443 void ArcomageGame::PlaySound( unsigned int event_id ) |
444 { | |
445 SoundID play_sound_id; // eax@10 | |
446 | |
447 switch ( event_id ) | |
448 { | |
449 case 40: | |
450 case 43: | |
451 case 46: | |
452 play_sound_id = SOUND_Arcomage_LoseResources; | |
453 break; | |
454 case 39: | |
455 case 41: | |
456 case 42: | |
457 case 44: | |
458 case 45: | |
459 case 47: | |
460 play_sound_id = SOUND_Arcomage_AddResources; | |
461 break; | |
462 case 0: | |
463 case 12: | |
464 case 14: | |
465 case 15: | |
466 case 16: | |
467 case 48: | |
468 case 50: | |
469 case 53: | |
470 play_sound_id = SOUND_Arcomage_TowerWallDamage; | |
471 break; | |
472 case 21: | |
473 case 22: | |
474 case 23: | |
475 play_sound_id = SOUND_Arcomage_DrawCard; | |
476 break; | |
477 case 56: | |
478 play_sound_id = SOUND_Arcomage_124; | |
0 | 479 break; |
1183 | 480 case 31: |
481 case 34: | |
482 case 37: | |
483 play_sound_id = SOUND_Arcomage_ProductionDamage; | |
484 break; | |
485 case 1: | |
486 case 30: | |
487 case 32: | |
488 case 33: | |
489 case 35: | |
490 case 36: | |
491 case 38: | |
492 play_sound_id = SOUND_Arcomage_ProductionUpgrade; | |
493 break; | |
494 case 20: | |
495 play_sound_id = SOUND_Arcomage_127; | |
496 break; | |
497 case 3: | |
498 play_sound_id = SOUND_Arcomage_128; | |
499 break; | |
500 case 52: | |
501 case 54: | |
502 play_sound_id = SOUND_Arcomage_TowerUpgrade; | |
503 break; | |
504 case 10: | |
505 case 11: | |
506 case 13: | |
507 play_sound_id = SOUND_Arcomage_130; | |
508 break; | |
509 case 55u: | |
510 play_sound_id = SOUND_Arcomage_131; | |
511 break; | |
512 case 49: | |
513 case 51: | |
514 play_sound_id = SOUND_Arcomage_WallUpgrade; | |
515 break; | |
516 default: | |
0 | 517 return; |
1183 | 518 } |
519 pAudioPlayer->PlaySound(play_sound_id, 0, 0, -1, 0, 0, 0, 0); | |
0 | 520 } |
521 | |
522 //----- (0040DC2D) -------------------------------------------------------- | |
523 bool ArcomageGame::MsgLoop(int a1, ArcomageGame_stru1 *a2) | |
524 { | |
525 void *v2; // ebp@1 | |
526 BOOL v3; // eax@1 | |
1183 | 527 //int v4; // edx@6 |
528 //int v5; // edx@6 | |
529 //int v6; // eax@6 | |
530 //int v7; // edx@7 | |
0 | 531 |
532 v2 = a2; | |
533 pArcomageGame->field_0 = 0; | |
534 pArcomageGame->stru1.field_0 = 0; | |
535 v3 = PeekMessageA(&pArcomageGame->msg, 0, 0, 0, PM_REMOVE); | |
536 if ( pArcomageGame->msg.message == WM_QUIT ) | |
537 Game_DeinitializeAndTerminate(0); | |
538 if ( v3 > 0 ) | |
539 { | |
540 TranslateMessage(&pArcomageGame->msg); | |
541 DispatchMessageA(&pArcomageGame->msg); | |
542 } | |
1038 | 543 /*if (pAsyncMouse) |
0 | 544 { |
545 EnterCriticalSection(&pGame->pThreadWardInstance->csAsyncMouse); | |
546 v4 = *((unsigned int *)pAsyncMouse + 7); | |
547 pArcomageGame->mouse_x = *((unsigned int *)pAsyncMouse + 6); | |
548 pArcomageGame->mouse_y = v4; | |
549 v5 = *((unsigned int *)pAsyncMouse + 27); | |
550 v6 = *(unsigned int *)v5; | |
551 if ( *(unsigned int *)v5 != v5 ) | |
552 { | |
553 do | |
554 { | |
555 v7 = *(unsigned int *)(v6 + 20); | |
556 if ( v7 & 1 ) | |
557 { | |
558 pArcomageGame->stru1.field_0 = 7; | |
559 } | |
560 else | |
561 { | |
562 if ( v7 & 2 ) | |
563 pArcomageGame->stru1.field_0 = 8; | |
564 } | |
565 v6 = *(unsigned int *)v6; | |
566 } | |
567 while ( v6 != *((unsigned int *)pAsyncMouse + 27) ); | |
568 } | |
569 pAsyncMouse->_46B944(); | |
570 if ( !*((unsigned char *)pAsyncMouse + 90) ) | |
571 pArcomageGame->field_F6 = 1; | |
572 LeaveCriticalSection(&pGame->pThreadWardInstance->csAsyncMouse); | |
1038 | 573 }*/ |
0 | 574 memcpy(v2, &pArcomageGame->stru1, 0xCu); |
575 return pArcomageGame->stru1.field_0 != 0; | |
576 } | |
577 | |
578 | |
579 //----- (0040D7D5) -------------------------------------------------------- | |
580 void am_BeginScene(unsigned __int16 *pPcxPixels, int a2, int a3) | |
581 { | |
582 pRenderer->BeginScene(); | |
1183 | 583 pArcomageGame->pBlit_Copy_pixels = pPcxPixels; |
0 | 584 } |
585 | |
586 //----- (0040D7EC) -------------------------------------------------------- | |
1183 | 587 void __fastcall Blt_Chroma(RECT *pSrcRect, POINT *pTargetPoint, int a3, int blend_mode) |
0 | 588 { |
1183 | 589 |
590 unsigned __int16 *pSrc; // eax@2 | |
591 unsigned __int16 *dest_surf_pos; // edi@3 | |
592 int uSrcTotalWidth; // ecx@4 | |
593 unsigned int v10; // esi@9 | |
594 int v21; // [sp+Ch] [bp-18h]@8 | |
595 unsigned __int16 *src_surf_pos; // [sp+10h] [bp-14h]@9 | |
596 __int32 src_width; // [sp+14h] [bp-10h]@3 | |
597 __int32 src_height; // [sp+18h] [bp-Ch]@3 | |
598 int uSrcPitch; // [sp+1Ch] [bp-8h]@5 | |
599 | |
600 | |
601 if ( !pRenderer->uNumSceneBegins ) | |
602 return; | |
603 if ( !pArcomageGame->pBlit_Copy_pixels ) | |
0 | 604 return; |
1183 | 605 |
606 dest_surf_pos = &pRenderer->pTargetSurface[pTargetPoint->x + pTargetPoint->y * pRenderer->uTargetSurfacePitch]; | |
607 src_width = pSrcRect->right - pSrcRect->left; | |
608 src_height = pSrcRect->bottom - pSrcRect->top; | |
609 | |
610 if ( pArcomageGame->pBlit_Copy_pixels == pArcomageGame->pBackgroundPixels ) | |
611 uSrcTotalWidth = pArcomageGame->pGameBackground.uWidth; | |
612 else if ( pArcomageGame->pBlit_Copy_pixels == pArcomageGame->pSpritesPixels ) | |
613 uSrcTotalWidth = pArcomageGame->pSprites.uWidth; | |
614 | |
615 //v20 = 157; | |
616 //v19 = "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\am_nw.cpp"; | |
617 //v21 = &v18; | |
618 //std__string_char_40E2C8(&v18, "Problem in Blit_Chroma", &a3a); | |
619 //466D09_xcpt_string(&v21, v18, v19, v20); | |
620 //pSrc = pArcomageGame.pBlit_Copy_pixels; | |
621 //LABEL_9: | |
622 pSrc = pArcomageGame->pBlit_Copy_pixels; | |
623 uSrcPitch = uSrcTotalWidth; | |
624 | |
625 src_surf_pos = &pSrc[pSrcRect->left + uSrcPitch * pSrcRect->top]; | |
626 v10 = 0xFFu >> (8 - (unsigned __int8)pRenderer->uTargetBBits); | |
627 v21 = (pRenderer->uTargetGBits != 6 ? 0x31EF : 0x7BEF); | |
628 | |
629 | |
630 if ( blend_mode == 2 ) | |
0 | 631 { |
1194 | 632 uSrcPitch = (uSrcPitch - src_width); |
1183 | 633 for (int i=0; i< src_height; ++i) |
634 { | |
635 for (int j=0; j< src_width; ++j) | |
636 { | |
637 if ( *src_surf_pos != v10 ) | |
638 *dest_surf_pos = *src_surf_pos; | |
639 ++dest_surf_pos; | |
640 ++src_surf_pos; | |
641 } | |
642 src_surf_pos+=uSrcPitch; | |
643 dest_surf_pos += pRenderer->uTargetSurfacePitch - src_width; | |
644 } | |
0 | 645 } |
1183 | 646 else |
0 | 647 { |
1194 | 648 uSrcPitch = (uSrcPitch - src_width); |
1183 | 649 for (int i=0; i< src_height; ++i) |
0 | 650 { |
1183 | 651 for (int j=0; j< src_width; ++j) |
0 | 652 { |
1183 | 653 if ( *src_surf_pos != v10 ) |
654 *dest_surf_pos = (v21 & (*dest_surf_pos >> 1)) + (v21 & (*src_surf_pos >> 1)); | |
655 ++dest_surf_pos; | |
656 ++src_surf_pos; | |
0 | 657 } |
1183 | 658 src_surf_pos+=uSrcPitch; |
659 dest_surf_pos += pRenderer->uTargetSurfacePitch - src_width; | |
0 | 660 } |
661 } | |
1183 | 662 |
0 | 663 } |
664 | |
665 //----- (0040D9B1) -------------------------------------------------------- | |
1183 | 666 void Blt_Copy( RECT *pSrcRect, POINT *pTargetPoint, int blend_mode ) |
0 | 667 { |
1183 | 668 |
669 unsigned __int16 *pSrc; // eax@2 | |
670 unsigned __int16 *dest_surf_pos; // edi@3 | |
671 int uSrcTotalWidth; // ecx@4 | |
672 int v21; // [sp+Ch] [bp-18h]@8 | |
673 unsigned __int16 *src_surf_pos; // [sp+10h] [bp-14h]@9 | |
674 __int32 src_width; // [sp+14h] [bp-10h]@3 | |
675 __int32 src_height; // [sp+18h] [bp-Ch]@3 | |
676 int uSrcPitch; // [sp+1Ch] [bp-8h]@5 | |
677 | |
678 if ( !pRenderer->uNumSceneBegins ) | |
679 return; | |
680 if ( !pArcomageGame->pBlit_Copy_pixels ) | |
681 return; | |
682 | |
683 dest_surf_pos = &pRenderer->pTargetSurface[pTargetPoint->x + pTargetPoint->y * pRenderer->uTargetSurfacePitch]; | |
684 src_width = pSrcRect->right - pSrcRect->left; | |
685 src_height = pSrcRect->bottom - pSrcRect->top; | |
686 | |
687 if ( pArcomageGame->pBlit_Copy_pixels == pArcomageGame->pBackgroundPixels ) | |
688 uSrcTotalWidth = pArcomageGame->pGameBackground.uWidth; | |
689 else if ( pArcomageGame->pBlit_Copy_pixels == pArcomageGame->pSpritesPixels ) | |
690 uSrcTotalWidth = pArcomageGame->pSprites.uWidth; | |
691 | |
692 //v20 = 157; | |
693 //v19 = "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\am_nw.cpp"; | |
694 //v21 = &v18; | |
695 //std__string_char_40E2C8(&v18, "Problem in Blit_Chroma", &a3a); | |
696 //466D09_xcpt_string(&v21, v18, v19, v20); | |
697 //pSrc = pArcomageGame.pBlit_Copy_pixels; | |
698 //LABEL_9: | |
699 pSrc = pArcomageGame->pBlit_Copy_pixels; | |
700 uSrcPitch = uSrcTotalWidth; | |
701 | |
702 src_surf_pos = &pSrc[pSrcRect->left + uSrcPitch * pSrcRect->top]; | |
703 v21 = (pRenderer->uTargetGBits != 6 ? 0x31EF : 0x7BEF); | |
704 | |
705 if ( blend_mode == 2 ) | |
0 | 706 { |
1194 | 707 uSrcPitch = (uSrcPitch - src_width); |
1183 | 708 for (int i=0; i< src_height; ++i) |
709 { | |
710 for (int j=0; j< src_width; ++j) | |
711 { | |
712 *dest_surf_pos = *src_surf_pos; | |
713 ++dest_surf_pos; | |
714 ++src_surf_pos; | |
715 } | |
716 src_surf_pos+=uSrcPitch; | |
717 dest_surf_pos += pRenderer->uTargetSurfacePitch - src_width; | |
718 } | |
0 | 719 } |
1183 | 720 else |
0 | 721 { |
1194 | 722 uSrcPitch = (uSrcPitch - src_width); |
1183 | 723 for (int i=0; i< src_height; ++i) |
0 | 724 { |
1183 | 725 for (int j=0; j< src_width; ++j) |
726 { | |
727 *dest_surf_pos = (v21 & (*dest_surf_pos >> 1)) + (v21 & (*src_surf_pos >> 1)); | |
728 ++dest_surf_pos; | |
729 ++src_surf_pos; | |
730 } | |
731 src_surf_pos+=uSrcPitch; | |
732 dest_surf_pos += pRenderer->uTargetSurfacePitch - src_width; | |
0 | 733 } |
734 } | |
735 } | |
736 | |
737 //----- (0040DB10) -------------------------------------------------------- | |
1183 | 738 void am_EndScene() |
0 | 739 { |
740 pRenderer->EndScene(); | |
1183 | 741 pArcomageGame->pBlit_Copy_pixels = NULL; |
0 | 742 } |
743 | |
744 //----- (0040D7B7) -------------------------------------------------------- | |
745 bool ArcomageGame::LoadSprites() | |
746 { | |
747 pArcomageGame->pSprites.Load("sprites.pcx", 2); | |
748 pArcomageGame->pSpritesPixels = pArcomageGame->pSprites.pPixels; | |
1183 | 749 return true; |
0 | 750 } |
751 | |
752 //----- (0040D799) -------------------------------------------------------- | |
753 bool ArcomageGame::LoadBackground() | |
754 { | |
755 pArcomageGame->pGameBackground.Load("layout.pcx", 2); | |
756 pArcomageGame->pBackgroundPixels = pArcomageGame->pGameBackground.pPixels; | |
1183 | 757 return true; |
0 | 758 } |
759 | |
760 //----- (00408BB4) -------------------------------------------------------- | |
761 bool __fastcall am_408BB4(int a1) | |
762 { | |
1183 | 763 // char result; // al@3 |
764 // signed int v3; // ebx@8 | |
765 // int v4; // esi@8 | |
766 // int v5; // eax@9 | |
767 // int v6; // edi@9 | |
768 // int v7; // eax@11 | |
769 // signed int v8; // eax@11 | |
770 // int v9; // ebx@5 | |
771 // int v10; // eax@5 | |
772 // int v11; // ecx@18 | |
773 // char v12; // bl@20 | |
774 // int v13; // eax@20 | |
775 // ArcomageCard *v14; // ecx@20 | |
776 // char v15; // dl@20 | |
777 // char v16; // dl@24 | |
778 // int v17; // edx@25 | |
779 // int v18; // edx@27 | |
780 // char v19; // dl@31 | |
781 // int v20; // edx@32 | |
782 // char v21; // dl@35 | |
783 // char v22; // dl@39 | |
784 // int v23; // edx@40 | |
785 // char v24; // dl@45 | |
786 // int v25; // edx@46 | |
787 // char v26; // dl@52 | |
788 // int v27; // edx@53 | |
789 // char v28; // dl@58 | |
790 // int v29; // edx@59 | |
791 // char v30; // dl@64 | |
792 // int v31; // edx@65 | |
793 // char v32; // dl@70 | |
794 // int v33; // edx@71 | |
795 // char v34; // dl@76 | |
796 // int v35; // edx@77 | |
797 // char v36; // dl@82 | |
798 // int v37; // edx@83 | |
799 // char v38; // dl@86 | |
800 // char v39; // dl@90 | |
801 // int v40; // edi@93 | |
802 // char v41; // dl@93 | |
803 // int v42; // esi@93 | |
804 // char v43; // bl@94 | |
805 // int v44; // esi@95 | |
806 // char v45; // dl@99 | |
807 // char v46; // dl@103 | |
808 // char v47; // dl@107 | |
809 // char v48; // dl@111 | |
810 // char v49; // dl@115 | |
811 // ArcomagePlayer *v50; // ebx@116 | |
812 // ArcomagePlayer *v51; // edx@116 | |
813 // int v52; // esi@124 | |
814 // int v53; // edx@124 | |
815 // int v54; // edx@127 | |
816 // int v55; // esi@130 | |
817 // int v56; // edi@138 | |
818 // int l; // esi@138 | |
819 // int v58; // eax@140 | |
820 // int v59; // ecx@142 | |
821 // int v60; // edx@142 | |
822 // int v61; // ebx@142 | |
823 // int v62; // eax@145 | |
824 // int v63; // esi@146 | |
825 // int v64; // ebx@4 | |
826 // int v65; // eax@4 | |
827 // int v66; // ecx@168 | |
828 // char v67; // bl@170 | |
829 // int v68; // eax@170 | |
830 // ArcomageCard *v69; // ecx@170 | |
831 // char v70; // dl@170 | |
832 // char v71; // dl@174 | |
833 // int v72; // edx@175 | |
834 // int v73; // edx@177 | |
835 // char v74; // dl@181 | |
836 // char v75; // dl@184 | |
837 // char v76; // dl@188 | |
838 // int v77; // edx@189 | |
839 // char v78; // dl@194 | |
840 // char v79; // dl@200 | |
841 // int v80; // edx@201 | |
842 // char v81; // dl@206 | |
843 // int v82; // edx@207 | |
844 // char v83; // dl@212 | |
845 // int v84; // edx@213 | |
846 // char v85; // dl@218 | |
847 // int v86; // edx@219 | |
848 // char v87; // dl@224 | |
849 // int v88; // edx@225 | |
850 // char v89; // dl@230 | |
851 // int v90; // edx@231 | |
852 // char v91; // dl@234 | |
853 // int v92; // edx@235 | |
854 // char v93; // dl@238 | |
855 // int v94; // edx@239 | |
856 // int v95; // esi@241 | |
857 // char v96; // dl@241 | |
858 // int v97; // esi@241 | |
859 // char v98; // bl@242 | |
860 // int v99; // edi@243 | |
861 // int v100; // edx@245 | |
862 // int v101; // edi@246 | |
863 // char v102; // dl@247 | |
864 // int v103; // edx@248 | |
865 // char v104; // dl@251 | |
866 // int v105; // edx@252 | |
867 // char v106; // dl@255 | |
868 // int v107; // edx@256 | |
869 // char v108; // dl@259 | |
870 // int v109; // edx@260 | |
871 // char v110; // dl@263 | |
872 // ArcomagePlayer *v111; // ebx@264 | |
873 // ArcomagePlayer *v112; // edx@264 | |
874 // int v113; // esi@272 | |
875 // int v114; // edx@272 | |
876 // int v115; // edx@275 | |
877 // int v116; // esi@278 | |
878 // int v117; // edi@286 | |
879 // int j; // esi@286 | |
880 // int v119; // eax@288 | |
881 // int v120; // ecx@290 | |
882 // int v121; // edx@290 | |
883 // int v122; // ebx@290 | |
884 // int v123; // eax@293 | |
885 // int v124; // esi@294 | |
886 // int v125; // [sp-28h] [bp-28h]@130 | |
887 // int v126; // [sp-28h] [bp-28h]@278 | |
888 // int k; // [sp-24h] [bp-24h]@18 | |
889 // int i; // [sp-24h] [bp-24h]@168 | |
890 // int v129; // [sp-20h] [bp-20h]@5 | |
891 // int v130; // [sp-20h] [bp-20h]@4 | |
892 // int v131; // [sp-1Ch] [bp-1Ch]@17 | |
893 // int v132; // [sp-1Ch] [bp-1Ch]@140 | |
894 // int v133; // [sp-1Ch] [bp-1Ch]@167 | |
895 // int v134; // [sp-1Ch] [bp-1Ch]@288 | |
896 // int v135; // [sp-18h] [bp-18h]@5 | |
897 // int v136; // [sp-18h] [bp-18h]@4 | |
898 // signed int v137; // [sp-14h] [bp-14h]@0 | |
899 // int v138; // [sp-14h] [bp-14h]@93 | |
900 // int v139; // [sp-14h] [bp-14h]@130 | |
901 // int v140; // [sp-14h] [bp-14h]@241 | |
902 // int v141; // [sp-14h] [bp-14h]@278 | |
903 // ArcomagePlayer *v142; // [sp-10h] [bp-10h]@5 | |
904 // ArcomagePlayer *v143; // [sp-10h] [bp-10h]@4 | |
905 // ArcomagePlayer *v144; // [sp-Ch] [bp-Ch]@5 | |
906 // ArcomagePlayer *v145; // [sp-Ch] [bp-Ch]@4 | |
907 // char v146; // [sp-8h] [bp-8h]@35 | |
908 // char v147; // [sp-8h] [bp-8h]@184 | |
909 // char v148; // [sp-5h] [bp-5h]@20 | |
910 // char v149; // [sp-5h] [bp-5h]@170 | |
911 // | |
912 // byte_4FAA00 = 1; | |
913 // if ( dword_4DF3A4 ) | |
914 // { | |
915 // if ( dword_4DF3A4 != 1 ) | |
916 // { | |
917 // result = dword_4DF3A4 - 2; | |
918 // if ( dword_4DF3A4 != 2 ) | |
919 // return result != 0; | |
920 // v64 = a1; | |
921 // v145 = &stru_505708[a1]; | |
922 // v130 = a1; | |
923 // v143 = &stru_505708[(a1 + 1) % 2]; | |
1185 | 924 // v136 = GetPlayerHandCardCount(a1); |
1183 | 925 // v65 = 0; |
926 // do | |
927 // { | |
928 // if ( v65 >= v136 ) | |
929 // { | |
930 // dword_4FA9B0[2 * v65] = -1; | |
931 // dword_4FA9B4[2 * v65] = -9999; | |
932 // } | |
933 // else | |
934 // { | |
935 // dword_4FA9B0[2 * v65] = v65; | |
936 // dword_4FA9B4[2 * v65] = 0; | |
937 // } | |
938 // ++v65; | |
939 // } | |
940 // while ( v65 < 10 ); | |
941 // v133 = 0; | |
942 // if ( v136 > 0 ) | |
943 // { | |
944 // v66 = 47 * v64; | |
945 // for ( i = 47 * v64; ; v66 = i ) | |
946 // { | |
947 // v67 = 99; | |
948 // v68 = 2 * v133; | |
949 // v69 = &pCards[stru_505708[0].cards_at_hand[v66 + dword_4FA9B0[2 * v133]]]; | |
950 // v70 = v69->field_38[2]; | |
951 // v149 = v69->field_38[2]; | |
952 // if ( v145->field_24 >= 10 ) | |
953 // { | |
954 // if ( v70 == 99 | |
955 // || v69->field_48[4] == 99 | |
956 // || v69->field_48[15] == 99 | |
957 // || (v74 = BYTE1(v69->field_68), v74 == 99) ) | |
958 // v73 = 5 * (v143->field_24 - v145->field_24); | |
959 // else | |
960 // v73 = 5 * (v149 + v69->field_48[4] + v69->field_48[15] + v74); | |
961 // } | |
962 // else | |
963 // { | |
964 // if ( v70 == 99 | |
965 // || v69->field_48[4] == 99 | |
966 // || v69->field_48[15] == 99 | |
967 // || (v71 = BYTE1(v69->field_68), v71 == 99) ) | |
968 // v72 = 5 * (v143->field_24 - v145->field_24); | |
969 // else | |
970 // v72 = 5 * (v149 + v69->field_48[4] + v69->field_48[15] + v71); | |
971 // v73 = 4 * v72; | |
972 // } | |
973 // dword_4FA9B4[v68] += v73; | |
974 // v75 = v69->field_38[1]; | |
975 // v147 = v69->field_38[1]; | |
976 // if ( v145->field_28 >= 10 ) | |
977 // { | |
978 // if ( v75 == 99 | |
979 // || v69->field_48[3] == 99 | |
980 // || v69->field_48[14] == 99 | |
981 // || (v78 = LOBYTE(v69->field_68), v78 == 99) ) | |
982 // v77 = v143->field_28 - v145->field_28; | |
983 // else | |
984 // v77 = v147 + v69->field_48[3] + v69->field_48[14] + v78; | |
985 // } | |
986 // else | |
987 // { | |
988 // if ( v75 == 99 | |
989 // || v69->field_48[3] == 99 | |
990 // || v69->field_48[14] == 99 | |
991 // || (v76 = LOBYTE(v69->field_68), v76 == 99) ) | |
992 // v77 = 5 * (v143->field_28 - v145->field_28); | |
993 // else | |
994 // v77 = 5 * (v147 + v69->field_48[3] + v69->field_48[14] + v76); | |
995 // } | |
996 // dword_4FA9B4[v68] += v77; | |
997 // dword_4FA9B4[v68] += 7 * (v69->field_38[0] + v69->field_48[2] + v69->field_48[13] + v69->field_58[15]); | |
998 // if ( BYTE2(v69->field_30) == 99 | |
999 // || v69->field_38[12] == 99 | |
1000 // || v69->field_48[7] == 99 | |
1001 // || (v79 = v69->field_58[9], v79 == 99) ) | |
1002 // v80 = 5 * (v143->field_2C - v145->field_2C); | |
1003 // else | |
1004 // v80 = 5 * (BYTE2(v69->field_30) + v69->field_38[12] + v69->field_48[7] + v79); | |
1005 // dword_4FA9B4[v68] += 8 * v80; | |
1006 // if ( BYTE3(v69->field_30) == 99 | |
1007 // || v69->field_38[13] == 99 | |
1008 // || v69->field_48[8] == 99 | |
1009 // || (v81 = v69->field_58[10], v81 == 99) ) | |
1010 // v82 = 5 * (v143->field_30 - v145->field_30); | |
1011 // else | |
1012 // v82 = 5 * (BYTE3(v69->field_30) + v69->field_38[13] + v69->field_48[8] + v81); | |
1013 // dword_4FA9B4[v68] += 8 * v82; | |
1014 // if ( LOBYTE(v69->field_34) == 99 | |
1015 // || v69->field_38[14] == 99 | |
1016 // || v69->field_48[9] == 99 | |
1017 // || (v83 = v69->field_58[11], v83 == 99) ) | |
1018 // v84 = 5 * (v143->field_34 - v145->field_34); | |
1019 // else | |
1020 // v84 = 5 * (LOBYTE(v69->field_34) + v69->field_38[14] + v69->field_48[9] + v83); | |
1021 // dword_4FA9B4[v68] += 8 * v84; | |
1022 // if ( BYTE1(v69->field_34) == 99 | |
1023 // || v69->field_38[15] == 99 | |
1024 // || v69->field_48[10] == 99 | |
1025 // || (v85 = v69->field_58[12], v85 == 99) ) | |
1026 // v86 = v143->field_38 - v145->field_38; | |
1027 // else | |
1028 // v86 = BYTE1(v69->field_34) + v69->field_38[15] + v69->field_48[10] + v85; | |
1029 // dword_4FA9B4[v68] += 2 * v86; | |
1030 // if ( BYTE2(v69->field_34) == 99 | |
1031 // || v69->field_48[0] == 99 | |
1032 // || v69->field_48[11] == 99 | |
1033 // || (v87 = v69->field_58[13], v87 == 99) ) | |
1034 // v88 = v143->field_3C - v145->field_3C; | |
1035 // else | |
1036 // v88 = BYTE2(v69->field_34) + v69->field_48[0] + v69->field_48[11] + v87; | |
1037 // dword_4FA9B4[v68] += 2 * v88; | |
1038 // if ( BYTE3(v69->field_34) == 99 | |
1039 // || v69->field_48[1] == 99 | |
1040 // || v69->field_48[12] == 99 | |
1041 // || (v89 = v69->field_58[14], v89 == 99) ) | |
1042 // v90 = v143->field_40 - v145->field_40; | |
1043 // else | |
1044 // v90 = BYTE3(v69->field_34) + v69->field_48[1] + v69->field_48[12] + v89; | |
1045 // dword_4FA9B4[v68] += 2 * v90; | |
1046 // if ( v69->field_38[11] == 99 || (v91 = v69->field_58[8], v91 == 99) ) | |
1047 // v92 = 10 * (v145->field_24 - v143->field_24); | |
1048 // else | |
1049 // v92 = -10 * (v69->field_38[11] + v91); | |
1050 // dword_4FA9B4[v68] += v92; | |
1051 // if ( v69->field_38[10] == 99 || (v93 = v69->field_58[7], v93 == 99) ) | |
1052 // v94 = 3 * (v145->field_28 - v143->field_28); | |
1053 // else | |
1054 // v94 = -3 * (v69->field_38[10] + v93); | |
1055 // dword_4FA9B4[v68] += v94; | |
1056 // v95 = v69->field_38[9]; | |
1057 // v140 = v95; | |
1058 // v96 = v69->field_38[3]; | |
1059 // dword_4FA9B4[v68] += -7 * (v69->field_58[6] + v95); | |
1060 // v97 = dword_4FA9B4[v68]; | |
1061 // if ( v96 == 99 ) | |
1062 // goto LABEL_245; | |
1063 // v98 = v69->field_58[0]; | |
1064 // if ( v98 == 99 ) | |
1065 // break; | |
1066 // v99 = v96 + v98; | |
1067 // v67 = 99; | |
1068 // dword_4FA9B4[v68] = v97 - 5 * v99; | |
1069 //LABEL_246: | |
1070 // v101 = v140; | |
1071 // if ( v69->field_38[4] == v67 || (v102 = v69->field_58[1], v102 == v67) ) | |
1072 // v103 = 5 * (v145->field_30 - v143->field_30); | |
1073 // else | |
1074 // v103 = -5 * (v69->field_38[4] + v102); | |
1075 // dword_4FA9B4[v68] += v103; | |
1076 // if ( v69->field_38[5] == v67 || (v104 = v69->field_58[2], v104 == v67) ) | |
1077 // v105 = 5 * (v145->field_34 - v143->field_34); | |
1078 // else | |
1079 // v105 = -5 * (v69->field_38[5] + v104); | |
1080 // dword_4FA9B4[v68] += v105; | |
1081 // if ( v69->field_38[6] == v67 || (v106 = v69->field_58[3], v106 == v67) ) | |
1082 // v107 = v145->field_38 - v143->field_38; | |
1083 // else | |
1084 // v107 = -(v69->field_38[6] + v106); | |
1085 // dword_4FA9B4[v68] += 2 * v107; | |
1086 // if ( v69->field_38[7] == v67 || (v108 = v69->field_58[4], v108 == v67) ) | |
1087 // v109 = v145->field_3C - v143->field_3C; | |
1088 // else | |
1089 // v109 = -(v69->field_38[7] + v108); | |
1090 // dword_4FA9B4[v68] += 2 * v109; | |
1091 // if ( v69->field_38[8] == v67 || (v110 = v69->field_58[5], v110 == v67) ) | |
1092 // { | |
1093 // v112 = v145; | |
1094 // v111 = v143; | |
1095 // dword_4FA9B4[v68] += 2 * (v145->field_40 - v143->field_40); | |
1096 // } | |
1097 // else | |
1098 // { | |
1099 // v111 = v143; | |
1100 // dword_4FA9B4[v68] += -2 * (v69->field_38[8] + v110); | |
1101 // v112 = v145; | |
1102 // } | |
1103 // if ( LOBYTE(v69->field_30) || v69->field_48[5] ) | |
1104 // dword_4FA9B4[v68] *= 10; | |
1105 // if ( LOBYTE(v69->field_24) == 1 ) | |
1106 // { | |
1107 // v113 = LOBYTE(v69->field_28); | |
1108 // v114 = v112->field_38; | |
1109 // } | |
1110 // else | |
1111 // { | |
1112 // if ( LOBYTE(v69->field_24) == 2 ) | |
1113 // { | |
1114 // v113 = BYTE1(v69->field_28); | |
1115 // v114 = v112->field_3C; | |
1116 // } | |
1117 // else | |
1118 // { | |
1119 // if ( LOBYTE(v69->field_24) != 3 ) | |
1120 // goto LABEL_278; | |
1121 // v113 = BYTE2(v69->field_28); | |
1122 // v114 = v112->field_40; | |
1123 // } | |
1124 // } | |
1125 // v115 = v114 - v113; | |
1126 // if ( v115 > 3 ) | |
1127 // v115 = 3; | |
1128 // dword_4FA9B4[v68] += 5 * v115; | |
1129 //LABEL_278: | |
1130 // v116 = v69->field_58[8]; | |
1131 // v141 = v111->field_24; | |
1132 // v126 = v69->field_38[11]; | |
1133 // if ( v141 <= v116 + v126 ) | |
1134 // dword_4FA9B4[v68] += 9999; | |
1135 // v137 = v111->field_28 + v141; | |
1136 // if ( v137 <= v116 + v126 + v69->field_58[6] + v69->field_58[7] + v101 + v69->field_38[10] ) | |
1137 // dword_4FA9B4[v68] += 9999; | |
1138 // if ( v69->field_48[15] + (signed int)BYTE1(v69->field_68) + v145->field_24 + v69->field_48[4] + v149 >= dword_4E1884 ) | |
1139 // dword_4FA9B4[v68] += 9999; | |
1140 // ++v133; | |
1141 // if ( v133 >= v136 ) | |
1142 // { | |
1143 // v64 = v130; | |
1144 // goto LABEL_286; | |
1145 // } | |
1146 // } | |
1147 // v67 = 99; | |
1148 //LABEL_245: | |
1149 // v100 = v145->field_2C - v143->field_2C; | |
1150 // dword_4FA9B4[v68] = v97 + 4 * v100 + v100; | |
1151 // goto LABEL_246; | |
1152 // } | |
1153 //LABEL_286: | |
1154 // v117 = v136 - 1; | |
1155 // for ( j = v136 - 1; j >= 0; --j ) | |
1156 // { | |
1157 // v137 = 0; | |
1158 // if ( j > 0 ) | |
1159 // { | |
1160 // v119 = (int)dword_4FA9B0; | |
1161 // v134 = j; | |
1162 // v137 = j; | |
1163 // do | |
1164 // { | |
1165 // if ( *(unsigned int *)(v119 + 4) < *(unsigned int *)(v119 + 12) ) | |
1166 // { | |
1167 // v120 = *(unsigned int *)v119; | |
1168 // v121 = *(unsigned int *)(v119 + 4); | |
1169 // *(unsigned int *)v119 = *(unsigned int *)(v119 + 8); | |
1170 // v122 = *(unsigned int *)(v119 + 12); | |
1171 // *(unsigned int *)(v119 + 8) = v120; | |
1172 // *(unsigned int *)(v119 + 4) = v122; | |
1173 // v64 = v130; | |
1174 // *(unsigned int *)(v119 + 12) = v121; | |
1175 // } | |
1176 // v119 += 8; | |
1177 // --v134; | |
1178 // } | |
1179 // while ( v134 ); | |
1180 // } | |
1181 // } | |
1182 // v123 = v136 - 1; | |
1183 // if ( am_byte_4FAA77 ) | |
1184 // { | |
1185 // if ( v117 >= 0 ) | |
1186 // { | |
1187 // while ( !BYTE3(pCards[stru_505708[0].cards_at_hand[47 * v64 + dword_4FA9B0[2 * v123]]].field_28) ) | |
1188 // { | |
1189 // --v123; | |
1190 // if ( v123 < 0 ) | |
1191 // return am_40BCFB(v64, v137) != 0; | |
1192 // } | |
1193 // v137 = dword_4FA9B0[2 * v123]; | |
1194 // } | |
1195 // } | |
1196 // else | |
1197 // { | |
1198 // v124 = 0; | |
1199 // if ( v117 >= 0 ) | |
1200 // { | |
1201 // while ( !BYTE3(pCards[stru_505708[0].cards_at_hand[47 * v64 + dword_4FA9B0[2 * v123]]].field_28) ) | |
1202 // { | |
1203 // --v123; | |
1204 // if ( v123 < 0 ) | |
1205 // goto LABEL_299; | |
1206 // } | |
1207 // v137 = dword_4FA9B0[2 * v123]; | |
1208 // } | |
1209 //LABEL_299: | |
1210 // if ( v136 > 0 ) | |
1211 // { | |
1212 // while ( !am_40BF15(v64, dword_4FA9B0[2 * v124]) || dword_4FA9B4[2 * v124] < 0 ) | |
1213 // { | |
1214 // ++v124; | |
1215 // if ( v124 >= v136 ) | |
1216 // return am_40BCFB(v64, v137) != 0; | |
1217 // } | |
1218 // return am_40BE0E(v64, dword_4FA9B0[2 * v124]) != 0; | |
1219 // } | |
1220 // } | |
1221 // return am_40BCFB(v64, v137) != 0; | |
1222 // } | |
1223 // v9 = a1; | |
1224 // v144 = &stru_505708[a1]; | |
1225 // v129 = a1; | |
1226 // v142 = &stru_505708[(a1 + 1) % 2]; | |
1185 | 1227 // v135 = GetPlayerHandCardCount(a1); |
1183 | 1228 // v10 = 0; |
1229 // do | |
1230 // { | |
1231 // if ( v10 >= v135 ) | |
1232 // { | |
1233 // dword_4FA9B0[2 * v10] = -1; | |
1234 // dword_4FA9B4[2 * v10] = -9999; | |
1235 // } | |
1236 // else | |
1237 // { | |
1238 // dword_4FA9B0[2 * v10] = v10; | |
1239 // dword_4FA9B4[2 * v10] = 0; | |
1240 // } | |
1241 // ++v10; | |
1242 // } | |
1243 // while ( v10 < 10 ); | |
1244 // v131 = 0; | |
1245 // if ( v135 > 0 ) | |
1246 // { | |
1247 // v11 = 47 * v9; | |
1248 // for ( k = 47 * v9; ; v11 = k ) | |
1249 // { | |
1250 // v12 = 99; | |
1251 // v13 = 2 * v131; | |
1252 // v14 = &pCards[stru_505708[0].cards_at_hand[v11 + dword_4FA9B0[2 * v131]]]; | |
1253 // v15 = v14->field_38[2]; | |
1254 // v148 = v14->field_38[2]; | |
1255 // if ( v144->field_24 >= 10 ) | |
1256 // { | |
1257 // if ( v15 == 99 || v14->field_48[4] == 99 || v14->field_48[15] == 99 || (v19 = BYTE1(v14->field_68), v19 == 99) ) | |
1258 // v20 = 5 * (v142->field_24 - v144->field_24); | |
1259 // else | |
1260 // v20 = 5 * (v148 + v14->field_48[4] + v14->field_48[15] + v19); | |
1261 // v18 = 2 * v20; | |
1262 // } | |
1263 // else | |
1264 // { | |
1265 // if ( v15 == 99 || v14->field_48[4] == 99 || v14->field_48[15] == 99 || (v16 = BYTE1(v14->field_68), v16 == 99) ) | |
1266 // v17 = 5 * (v142->field_24 - v144->field_24); | |
1267 // else | |
1268 // v17 = 5 * (v148 + v14->field_48[4] + v14->field_48[15] + v16); | |
1269 // v18 = 4 * v17; | |
1270 // } | |
1271 // dword_4FA9B4[v13] += v18; | |
1272 // v21 = v14->field_38[1]; | |
1273 // v146 = v14->field_38[1]; | |
1274 // if ( v144->field_28 >= 10 ) | |
1275 // { | |
1276 // if ( v21 == 99 | |
1277 // || v14->field_48[3] == 99 | |
1278 // || v14->field_48[14] == 99 | |
1279 // || (v24 = LOBYTE(v14->field_68), v24 == 99) ) | |
1280 // v25 = v142->field_28 - v144->field_28; | |
1281 // else | |
1282 // v25 = v146 + v14->field_48[3] + v14->field_48[14] + v24; | |
1283 // v23 = 2 * v25; | |
1284 // } | |
1285 // else | |
1286 // { | |
1287 // if ( v21 == 99 | |
1288 // || v14->field_48[3] == 99 | |
1289 // || v14->field_48[14] == 99 | |
1290 // || (v22 = LOBYTE(v14->field_68), v22 == 99) ) | |
1291 // v23 = 5 * (v142->field_28 - v144->field_28); | |
1292 // else | |
1293 // v23 = 5 * (v146 + v14->field_48[3] + v14->field_48[14] + v22); | |
1294 // } | |
1295 // dword_4FA9B4[v13] += v23; | |
1296 // dword_4FA9B4[v13] += 7 * (v14->field_38[0] + v14->field_48[2] + v14->field_48[13] + v14->field_58[15]); | |
1297 // if ( BYTE2(v14->field_30) == 99 | |
1298 // || v14->field_38[12] == 99 | |
1299 // || v14->field_48[7] == 99 | |
1300 // || (v26 = v14->field_58[9], v26 == 99) ) | |
1301 // v27 = 5 * (v142->field_2C - v144->field_2C); | |
1302 // else | |
1303 // v27 = 5 * (BYTE2(v14->field_30) + v14->field_38[12] + v14->field_48[7] + v26); | |
1304 // dword_4FA9B4[v13] += 8 * v27; | |
1305 // if ( BYTE3(v14->field_30) == 99 | |
1306 // || v14->field_38[13] == 99 | |
1307 // || v14->field_48[8] == 99 | |
1308 // || (v28 = v14->field_58[10], v28 == 99) ) | |
1309 // v29 = 5 * (v142->field_30 - v144->field_30); | |
1310 // else | |
1311 // v29 = 5 * (BYTE3(v14->field_30) + v14->field_38[13] + v14->field_48[8] + v28); | |
1312 // dword_4FA9B4[v13] += 8 * v29; | |
1313 // if ( LOBYTE(v14->field_34) == 99 | |
1314 // || v14->field_38[14] == 99 | |
1315 // || v14->field_48[9] == 99 | |
1316 // || (v30 = v14->field_58[11], v30 == 99) ) | |
1317 // v31 = 5 * (v142->field_34 - v144->field_34); | |
1318 // else | |
1319 // v31 = 5 * (LOBYTE(v14->field_34) + v14->field_38[14] + v14->field_48[9] + v30); | |
1320 // dword_4FA9B4[v13] += 8 * v31; | |
1321 // if ( BYTE1(v14->field_34) == 99 | |
1322 // || v14->field_38[15] == 99 | |
1323 // || v14->field_48[10] == 99 | |
1324 // || (v32 = v14->field_58[12], v32 == 99) ) | |
1325 // v33 = v142->field_38 - v144->field_38; | |
1326 // else | |
1327 // v33 = BYTE1(v14->field_34) + v14->field_38[15] + v14->field_48[10] + v32; | |
1328 // dword_4FA9B4[v13] += 2 * v33; | |
1329 // if ( BYTE2(v14->field_34) == 99 | |
1330 // || v14->field_48[0] == 99 | |
1331 // || v14->field_48[11] == 99 | |
1332 // || (v34 = v14->field_58[13], v34 == 99) ) | |
1333 // v35 = v142->field_3C - v144->field_3C; | |
1334 // else | |
1335 // v35 = BYTE2(v14->field_34) + v14->field_48[0] + v14->field_48[11] + v34; | |
1336 // dword_4FA9B4[v13] += 2 * v35; | |
1337 // if ( BYTE3(v14->field_34) == 99 | |
1338 // || v14->field_48[1] == 99 | |
1339 // || v14->field_48[12] == 99 | |
1340 // || (v36 = v14->field_58[14], v36 == 99) ) | |
1341 // v37 = v142->field_40 - v144->field_40; | |
1342 // else | |
1343 // v37 = BYTE3(v14->field_34) + v14->field_48[1] + v14->field_48[12] + v36; | |
1344 // dword_4FA9B4[v13] += 2 * v37; | |
1345 // if ( v14->field_38[11] == 99 || (v38 = v14->field_58[8], v38 == 99) ) | |
1346 // dword_4FA9B4[v13] += v144->field_24 - v142->field_24; | |
1347 // else | |
1348 // dword_4FA9B4[v13] -= v14->field_38[11] + v38; | |
1349 // if ( v14->field_38[10] == 99 || (v39 = v14->field_58[7], v39 == 99) ) | |
1350 // dword_4FA9B4[v13] += v144->field_28 - v142->field_28; | |
1351 // else | |
1352 // dword_4FA9B4[v13] -= v14->field_38[10] + v39; | |
1353 // v40 = v14->field_38[9]; | |
1354 // v138 = v14->field_38[9]; | |
1355 // dword_4FA9B4[v13] -= v40 + v14->field_58[6]; | |
1356 // v41 = v14->field_38[3]; | |
1357 // v42 = dword_4FA9B4[v13]; | |
1358 // if ( v41 == 99 ) | |
1359 // goto LABEL_97; | |
1360 // v43 = v14->field_58[0]; | |
1361 // if ( v43 == 99 ) | |
1362 // break; | |
1363 // v44 = v42 - v43; | |
1364 // v12 = 99; | |
1365 // dword_4FA9B4[v13] = v44 - v41; | |
1366 //LABEL_98: | |
1367 // if ( v14->field_38[4] == v12 || (v45 = v14->field_58[1], v45 == v12) ) | |
1368 // dword_4FA9B4[v13] += v144->field_30 - v142->field_30; | |
1369 // else | |
1370 // dword_4FA9B4[v13] -= v14->field_38[4] + v45; | |
1371 // if ( v14->field_38[5] == v12 || (v46 = v14->field_58[2], v46 == v12) ) | |
1372 // dword_4FA9B4[v13] += v144->field_34 - v142->field_34; | |
1373 // else | |
1374 // dword_4FA9B4[v13] -= v14->field_38[5] + v46; | |
1375 // if ( v14->field_38[6] == v12 || (v47 = v14->field_58[3], v47 == v12) ) | |
1376 // dword_4FA9B4[v13] += v144->field_38 - v142->field_38; | |
1377 // else | |
1378 // dword_4FA9B4[v13] -= v14->field_38[6] + v47; | |
1379 // if ( v14->field_38[7] == v12 || (v48 = v14->field_58[4], v48 == v12) ) | |
1380 // dword_4FA9B4[v13] += v144->field_3C - v142->field_3C; | |
1381 // else | |
1382 // dword_4FA9B4[v13] -= v14->field_38[7] + v48; | |
1383 // if ( v14->field_38[8] == v12 || (v49 = v14->field_58[5], v49 == v12) ) | |
1384 // { | |
1385 // v51 = v144; | |
1386 // v50 = v142; | |
1387 // dword_4FA9B4[v13] += v144->field_40 - v142->field_40; | |
1388 // } | |
1389 // else | |
1390 // { | |
1391 // v50 = v142; | |
1392 // dword_4FA9B4[v13] -= v14->field_38[8] + v49; | |
1393 // v51 = v144; | |
1394 // } | |
1395 // if ( LOBYTE(v14->field_30) || v14->field_48[5] ) | |
1396 // dword_4FA9B4[v13] *= 10; | |
1397 // if ( LOBYTE(v14->field_24) == 1 ) | |
1398 // { | |
1399 // v52 = LOBYTE(v14->field_28); | |
1400 // v53 = v51->field_38; | |
1401 // } | |
1402 // else | |
1403 // { | |
1404 // if ( LOBYTE(v14->field_24) == 2 ) | |
1405 // { | |
1406 // v52 = BYTE1(v14->field_28); | |
1407 // v53 = v51->field_3C; | |
1408 // } | |
1409 // else | |
1410 // { | |
1411 // if ( LOBYTE(v14->field_24) != 3 ) | |
1412 // goto LABEL_130; | |
1413 // v52 = BYTE2(v14->field_28); | |
1414 // v53 = v51->field_40; | |
1415 // } | |
1416 // } | |
1417 // v54 = v53 - v52; | |
1418 // if ( v54 > 3 ) | |
1419 // v54 = 3; | |
1420 // dword_4FA9B4[v13] += 5 * v54; | |
1421 //LABEL_130: | |
1422 // v55 = v14->field_58[8]; | |
1423 // v139 = v50->field_24; | |
1424 // v125 = v14->field_38[11]; | |
1425 // if ( v139 <= v55 + v125 ) | |
1426 // dword_4FA9B4[v13] += 9999; | |
1427 // v137 = v50->field_28 + v139; | |
1428 // if ( v137 <= v55 + v125 + v14->field_58[6] + v14->field_58[7] + v40 + v14->field_38[10] ) | |
1429 // dword_4FA9B4[v13] += 9999; | |
1430 // if ( v14->field_48[15] + (signed int)BYTE1(v14->field_68) + v144->field_24 + v14->field_48[4] + v148 >= dword_4E1884 ) | |
1431 // dword_4FA9B4[v13] += 9999; | |
1432 // ++v131; | |
1433 // if ( v131 >= v135 ) | |
1434 // { | |
1435 // v9 = v129; | |
1436 // goto LABEL_138; | |
1437 // } | |
1438 // } | |
1439 // v12 = 99; | |
1440 //LABEL_97: | |
1441 // v40 = v138; | |
1442 // dword_4FA9B4[v13] = v42 + v144->field_2C - v142->field_2C; | |
1443 // goto LABEL_98; | |
1444 // } | |
1445 //LABEL_138: | |
1446 // v56 = v135 - 1; | |
1447 // for ( l = v135 - 1; l >= 0; --l ) | |
1448 // { | |
1449 // v137 = 0; | |
1450 // if ( l > 0 ) | |
1451 // { | |
1452 // v58 = (int)dword_4FA9B0; | |
1453 // v132 = l; | |
1454 // v137 = l; | |
1455 // do | |
1456 // { | |
1457 // if ( *(unsigned int *)(v58 + 4) < *(unsigned int *)(v58 + 12) ) | |
1458 // { | |
1459 // v59 = *(unsigned int *)v58; | |
1460 // v60 = *(unsigned int *)(v58 + 4); | |
1461 // *(unsigned int *)v58 = *(unsigned int *)(v58 + 8); | |
1462 // v61 = *(unsigned int *)(v58 + 12); | |
1463 // *(unsigned int *)(v58 + 8) = v59; | |
1464 // *(unsigned int *)(v58 + 4) = v61; | |
1465 // v9 = v129; | |
1466 // *(unsigned int *)(v58 + 12) = v60; | |
1467 // } | |
1468 // v58 += 8; | |
1469 // --v132; | |
1470 // } | |
1471 // while ( v132 ); | |
1472 // } | |
1473 // } | |
1474 // v62 = v135 - 1; | |
1475 // if ( am_byte_4FAA77 ) | |
1476 // { | |
1477 // if ( v56 >= 0 ) | |
1478 // { | |
1479 // while ( !BYTE3(pCards[stru_505708[0].cards_at_hand[47 * v9 + dword_4FA9B0[2 * v62]]].field_28) ) | |
1480 // { | |
1481 // --v62; | |
1482 // if ( v62 < 0 ) | |
1483 // return am_40BCFB(v9, v137) != 0; | |
1484 // } | |
1485 // v137 = dword_4FA9B0[2 * v62]; | |
1486 // } | |
1487 // } | |
1488 // else | |
1489 // { | |
1490 // v63 = 0; | |
1491 // if ( v56 >= 0 ) | |
1492 // { | |
1493 // while ( !BYTE3(pCards[stru_505708[0].cards_at_hand[47 * v9 + dword_4FA9B0[2 * v62]]].field_28) ) | |
1494 // { | |
1495 // --v62; | |
1496 // if ( v62 < 0 ) | |
1497 // goto LABEL_151; | |
1498 // } | |
1499 // v137 = dword_4FA9B0[2 * v62]; | |
1500 // } | |
1501 //LABEL_151: | |
1502 // if ( v135 > 0 ) | |
1503 // { | |
1504 // while ( !am_40BF15(v9, dword_4FA9B0[2 * v63]) || dword_4FA9B4[2 * v63] < 0 ) | |
1505 // { | |
1506 // ++v63; | |
1507 // if ( v63 >= v135 ) | |
1508 // return am_40BCFB(v9, v137) != 0; | |
1509 // } | |
1510 // return am_40BE0E(v9, dword_4FA9B0[2 * v63]) != 0; | |
1511 // } | |
1512 // } | |
1513 // return am_40BCFB(v9, v137) != 0; | |
1514 // } | |
1515 // v3 = 0; | |
1516 // v4 = a1; | |
1517 // if ( am_byte_4FAA77 ) | |
1518 // { | |
1519 //LABEL_11: | |
1185 | 1520 // v7 = GetPlayerHandCardCount(v4); |
1183 | 1521 // v8 = rand_interval(0, v7 - 1); |
1522 // result = am_40BCFB(v4, v8); | |
1523 // } | |
1524 // else | |
1525 // { | |
1526 // while ( 1 ) | |
1527 // { | |
1185 | 1528 // v5 = GetPlayerHandCardCount(v4); |
1183 | 1529 // v6 = rand_interval(0, v5 - 1); |
1530 // if ( am_40BF15(v4, v6) ) | |
1531 // break; | |
1532 // ++v3; | |
1533 // if ( v3 >= 10 ) | |
1534 // goto LABEL_11; | |
1535 // } | |
1536 // result = am_40BE0E(v4, v6); | |
1537 // } | |
1538 return true;//result != 0; | |
0 | 1539 } |
1540 // 408BB4: could not find valid save-restore pair for ebp | |
1541 // 4DF3A4: using guessed type int dword_4DF3A4; | |
1542 // 4E1884: using guessed type int dword_4E1884; | |
1543 // 4FA9B0: using guessed type int dword_4FA9B0[]; | |
1544 // 4FA9B4: using guessed type int dword_4FA9B4[]; | |
1545 // 4FAA00: using guessed type char byte_4FAA00; | |
1546 // 4FAA77: using guessed type char am_byte_4FAA77; | |
1547 | |
1548 | |
1549 | |
1550 //----- (00409E6A) -------------------------------------------------------- | |
1551 void ArcomageGame::Loop() | |
1552 { | |
1553 int v0; // edx@2 | |
1554 int v1; // ecx@14 | |
1555 signed int v2; // eax@15 | |
1556 stru272 *v3; // esi@17 | |
1557 __int16 *v4; // esi@23 | |
1558 | |
1197 | 1559 while ( !pArcomageGame->GameOver ) |
0 | 1560 { |
1561 pArcomageGame->field_F6 = 1; | |
1562 byte_4FAA24 = 1; | |
1197 | 1563 IncreaseResourcesInTurn(current_player_num); |
0 | 1564 LABEL_8: |
1185 | 1565 while ( byte_4FAA24 ) |
0 | 1566 { |
1200 | 1567 played_card_id = -1; |
1568 GetNextCardFromDeck(current_player_num); | |
0 | 1569 while ( 1 ) |
1570 { | |
1197 | 1571 byte_4FAA24 = am_40A560(current_player_num); |
1200 | 1572 if ( GetPlayerHandCardCount(current_player_num) <= minimum_cards_at_hand ) |
0 | 1573 break; |
1574 am_byte_4FAA77 = 1; | |
1575 if ( pArcomageGame->field_F4 ) | |
1576 goto LABEL_8; | |
1577 } | |
1578 am_byte_4FAA77 = 0; | |
1185 | 1579 } |
1197 | 1580 pArcomageGame->GameOver = IsGameOver(); |
1581 if ( !pArcomageGame->GameOver ) | |
0 | 1582 am_40A383(); |
1583 if ( pArcomageGame->field_F4 ) | |
1197 | 1584 pArcomageGame->GameOver = 1; |
0 | 1585 } |
1197 | 1586 GameResultsApply(); |
0 | 1587 if ( byte_4FAA2C ) |
1588 { | |
1183 | 1589 // v2 = retzero_sub_40DFA7((int)dword_4FAA28); |
1590 // v1 = 1000; | |
1591 // dword_4FAA70 = v2 / 1000; | |
1592 dword_4FAA70 = 0; | |
0 | 1593 } |
1594 else | |
1595 { | |
1596 dword_4FAA70 = -1; | |
1597 } | |
1598 pVideoPlayer->BinkUpdatePalette(dword_4FAA28); | |
1183 | 1599 |
1184 | 1600 for(int i=0; i<10; ++i) |
1601 { | |
1200 | 1602 array_4FABD0[i].field_40->Empty(1,1); |
1603 array_4FABD0[i].field_40->Dtor(); | |
1184 | 1604 } |
1038 | 1605 |
0 | 1606 pArcomageGame->pGameBackground.Release(); |
1607 pArcomageGame->pSprites.Release(); | |
1608 pArcomageGame->bGameInProgress = 0; | |
1609 viewparams->bRedrawGameUI = 1; | |
1610 if ( pVideoPlayer->AnyMovieLoaded() ) | |
1611 pVideoPlayer->_4BF5B2(); | |
1183 | 1612 for(int i=0; i<12; ++i) |
1613 pSoundList->UnloadSound(am_sounds[i], 1); | |
1614 | |
0 | 1615 } |
938 | 1616 |
1617 | |
1618 | |
0 | 1619 |
1620 //----- (00409FE9) -------------------------------------------------------- | |
1197 | 1621 void SetStartGameData() |
1185 | 1622 { |
1194 | 1623 |
1624 signed int j; // edx@7 | |
1625 int card_id_counter; // edx@13 | |
1626 signed int i; // ecx@13 | |
1627 signed int card_dispenser_counter; // eax@13 | |
0 | 1628 |
1197 | 1629 current_player_num = dword_505890; |
1630 SetStartConditions(); | |
1194 | 1631 for(i=0; i<2; ++i ) |
0 | 1632 { |
1194 | 1633 if ( i ) |
0 | 1634 { |
1194 | 1635 strcpy(am_Players[1].pPlayerName, pArcomageGame->pPlayer2Name); |
0 | 1636 if ( byte_4E185C ) |
1197 | 1637 am_Players[1].IsHisTurn = 0; |
0 | 1638 else |
1197 | 1639 am_Players[1].IsHisTurn = 1; |
0 | 1640 } |
1641 else | |
1642 { | |
1194 | 1643 strcpy(am_Players[0].pPlayerName, pArcomageGame->pPlayer1Name); |
1197 | 1644 am_Players[0].IsHisTurn = 1; |
0 | 1645 } |
1200 | 1646 am_Players[i].tower_height = start_tower_height; |
1647 am_Players[i].wall_height = start_wall_height; | |
1648 am_Players[i].quarry_level = start_quarry_level; | |
1649 am_Players[i].magic_level = start_magic_level; | |
1650 am_Players[i].zoo_level = start_zoo_level; | |
1197 | 1651 am_Players[i].resource_bricks = start_bricks_amount; |
1652 am_Players[i].resource_gems = start_gems_amount; | |
1653 am_Players[i].resource_beasts = start_beasts_amount; | |
1194 | 1654 |
1655 for (j=0; j<10; ++j ) | |
0 | 1656 { |
1194 | 1657 am_Players[i].cards_at_hand[j] = -1; |
0 | 1658 if ( am_byte_4E185D ) |
1659 { | |
1194 | 1660 am_Players[i].arr_6C[j].field_0 = -1; |
1661 am_Players[i].arr_6C[j].field_4 = -1; | |
0 | 1662 } |
1663 else | |
1664 { | |
1194 | 1665 am_Players[i].arr_6C[j].field_0 = 0; |
1666 am_Players[i].arr_6C[j].field_4 = 0; | |
0 | 1667 } |
1668 } | |
1185 | 1669 |
0 | 1670 } |
1194 | 1671 strcpy(deckMaster.name, pDeckMaster); |
1672 for (i=0, card_dispenser_counter=-2, card_id_counter=0; i<DECK_SIZE; ++i, ++card_dispenser_counter) | |
1185 | 1673 { |
1194 | 1674 deckMaster.cardsInUse[i] = 0; |
1675 deckMaster.cards_IDs[i] =card_id_counter; | |
1676 switch ( card_dispenser_counter ) | |
1185 | 1677 { |
0 | 1678 case 0: |
1679 case 2: | |
1680 case 6: | |
1681 case 9: | |
1682 case 13: | |
1683 case 18: | |
1684 case 23: | |
1685 case 33: | |
1686 case 36: | |
1687 case 38: | |
1688 case 44: | |
1689 case 46: | |
1690 case 52: | |
1691 case 57: | |
1692 case 69: | |
1693 case 71: | |
1694 case 75: | |
1695 case 79: | |
1696 case 81: | |
1697 case 84: | |
1698 case 89: | |
1185 | 1699 break; |
1700 default: | |
1194 | 1701 ++card_id_counter; |
1185 | 1702 } |
1703 } | |
1704 | |
1197 | 1705 FillPlayerDeck(); |
0 | 1706 } |
1707 | |
1708 //----- (0040A198) -------------------------------------------------------- | |
1197 | 1709 void FillPlayerDeck() |
1194 | 1710 { |
1711 | |
0 | 1712 signed int v3; // eax@4 |
1713 int v6; // edx@13 | |
1194 | 1714 char v7; // eax@13 |
1715 char card_taken_flags[DECK_SIZE]; // [sp+8h] [bp-6Ch]@1 | |
1716 int i,j; | |
0 | 1717 |
1718 ArcomageGame::PlaySound(0x14u); | |
1194 | 1719 memset(deckMaster.cardsInUse, 0,DECK_SIZE ); |
1720 memset(card_taken_flags, 0, DECK_SIZE); | |
1721 | |
1722 for (i=0; i<2; ++i) | |
0 | 1723 { |
1194 | 1724 for (j=0; j<10; ++j) |
0 | 1725 { |
1194 | 1726 if ( am_Players[i].cards_at_hand[j] > -1 ) |
0 | 1727 { |
1194 | 1728 for (v3 = 0; v3<DECK_SIZE; ++v3) |
1729 { | |
1730 if (deckMaster.cards_IDs[v3] == am_Players[i].cards_at_hand[j] && deckMaster.cardsInUse[v3] == 0) | |
1731 { | |
1732 deckMaster.cardsInUse[v3] = 1; | |
1733 break; | |
1734 } | |
1735 } | |
0 | 1736 } |
1737 } | |
1738 } | |
1194 | 1739 |
1740 for (i=0; i<DECK_SIZE; ++i) | |
0 | 1741 { |
1742 do | |
1743 { | |
1194 | 1744 v6 = rand() % DECK_SIZE; |
1745 v7 = card_taken_flags[v6]; | |
0 | 1746 } |
1194 | 1747 while ( v7 == 1 ); |
1748 card_taken_flags[v6]=1; | |
1197 | 1749 playDeck.cards_IDs[i] = deckMaster.cards_IDs[v6]; |
1194 | 1750 playDeck.cardsInUse[i] = deckMaster.cardsInUse[v6]; |
0 | 1751 } |
1194 | 1752 |
1200 | 1753 deck_walk_index = 0; |
0 | 1754 amuint_4FABC4 = -1; |
1755 pArcomageGame->field_F6 = 1; | |
1194 | 1756 |
0 | 1757 } |
1758 | |
1759 //----- (0040A255) -------------------------------------------------------- | |
1200 | 1760 void InitalHandsFill() |
1183 | 1761 { |
1200 | 1762 for (int i = 0; i < minimum_cards_at_hand; ++i ) |
0 | 1763 { |
1200 | 1764 GetNextCardFromDeck(0); |
1765 GetNextCardFromDeck(1); | |
0 | 1766 } |
1767 pArcomageGame->field_F6 = 1; | |
1183 | 1768 |
0 | 1769 } |
1770 // 4E1874: using guessed type int dword_4E1874; | |
1771 | |
1772 //----- (0040A283) -------------------------------------------------------- | |
1200 | 1773 void GetNextCardFromDeck( int player_num ) |
1183 | 1774 { |
1200 | 1775 signed int deck_index; // eax@1 |
1776 int new_card_id; // edi@1 | |
1777 signed int card_slot_indx; // eax@7 | |
1778 | |
1779 deck_index = deck_walk_index; | |
1780 for(;;) | |
0 | 1781 { |
1200 | 1782 if ( deck_index >= DECK_SIZE ) |
0 | 1783 { |
1197 | 1784 FillPlayerDeck(); |
1200 | 1785 deck_index = deck_walk_index; |
0 | 1786 } |
1200 | 1787 if ( !playDeck.cardsInUse[deck_index] ) |
1186 | 1788 { |
1200 | 1789 new_card_id = playDeck.cards_IDs[deck_index]; |
1790 ++deck_index; | |
1791 deck_walk_index = deck_index; | |
1792 break; | |
1186 | 1793 } |
1200 | 1794 ++deck_index; |
1795 deck_walk_index = deck_index; | |
0 | 1796 } |
1200 | 1797 |
1197 | 1798 ArcomageGame::PlaySound(21); |
1200 | 1799 card_slot_indx = GetEmptyCardSlotIndex(player_num); |
1800 if ( card_slot_indx != -1 ) | |
0 | 1801 { |
1200 | 1802 amuint_4FAA4C = card_slot_indx; |
1803 am_Players[player_num].cards_at_hand[card_slot_indx] = new_card_id; | |
1804 am_Players[player_num].arr_6C[card_slot_indx].field_0 = rand_interval(-4, 4); | |
1805 am_Players[player_num].arr_6C[card_slot_indx].field_4 = rand_interval(-4, 4); | |
0 | 1806 pArcomageGame->field_F6 = 1; |
1807 byte_4FAA2D = 1; | |
1808 } | |
1183 | 1809 |
0 | 1810 } |
1186 | 1811 |
0 | 1812 |
1813 //----- (0040A324) -------------------------------------------------------- | |
1185 | 1814 int GetEmptyCardSlotIndex( int player_num ) |
1815 { | |
1816 int i; | |
1817 for (i=0; i<10; ++i ) | |
1818 { | |
1819 if (am_Players[player_num].cards_at_hand[i]==-1) | |
1820 break; | |
1821 } | |
1822 if ( i >= 10 ) | |
1823 return -1; | |
1824 else | |
1825 return i; | |
0 | 1826 } |
1827 | |
1828 //----- (0040A346) -------------------------------------------------------- | |
1197 | 1829 void IncreaseResourcesInTurn( int player_num ) |
1185 | 1830 { |
1197 | 1831 am_Players[player_num].resource_bricks += quarry_bonus + am_Players[player_num].quarry_level; |
1832 am_Players[player_num].resource_gems += magic_bonus + am_Players[player_num].magic_level; | |
1201 | 1833 am_Players[player_num].resource_beasts += zoo_bonus + am_Players[player_num].zoo_level; |
0 | 1834 } |
1183 | 1835 |
0 | 1836 |
1837 //----- (0040A383) -------------------------------------------------------- | |
1838 void __cdecl am_40A383() | |
1839 { | |
1840 int v0; // eax@4 | |
1841 int v1; // ecx@4 | |
1842 unsigned __int8 v2; // sf@4 | |
1843 unsigned __int8 v3; // of@4 | |
1844 int v4; // eax@6 | |
1845 char Dest[64]; // [sp+4h] [bp-64h]@4 | |
1194 | 1846 RECT v6; // [sp+44h] [bp-24h]@6 |
1847 | |
0 | 1848 ArcomageGame_stru1 v10; // [sp+54h] [bp-14h]@7 |
1194 | 1849 POINT v11; // [sp+60h] [bp-8h]@4 |
0 | 1850 |
1851 if ( !pArcomageGame->field_F4 ) | |
1852 { | |
1197 | 1853 if ( am_Players[0].IsHisTurn != 1 || am_Players[1].IsHisTurn != 1 ) |
0 | 1854 { |
1197 | 1855 ++current_player_num; |
0 | 1856 am_byte_4FAA75 = 1; |
1197 | 1857 if ( current_player_num >= 2 ) |
1858 current_player_num = 0; | |
0 | 1859 } |
1860 else | |
1861 { | |
1862 //nullsub_1(); | |
1194 | 1863 v11.x = 0; |
1864 v11.y = 0; | |
1209 | 1865 // inv_strcpy("Ñëåä", Dest); |
0 | 1866 v0 = 0; |
1194 | 1867 v11.y = 200; |
1868 v11.x = 320 - 12 * v0 / 2; | |
1869 pPrimaryWindow_draws_text(-1, Dest, &v11); | |
0 | 1870 am_byte_4FAA75 = 1; |
1197 | 1871 v1 = current_player_num + 1; |
1872 v3 = __OFSUB__(current_player_num + 1, 2); | |
1873 v2 = current_player_num++ - 1 < 0; | |
0 | 1874 if ( !(v2 ^ v3) ) |
1875 { | |
1876 v1 = 0; | |
1197 | 1877 current_player_num = 0; |
0 | 1878 } |
1209 | 1879 strcpy(Dest, am_Players[v1].pPlayerName); |
0 | 1880 v4 = 0; |
1194 | 1881 v11.y = 260; |
1882 v11.x = 320 - 12 * v4 / 2; | |
1883 pPrimaryWindow_draws_text(-1, Dest, &v11); | |
1197 | 1884 /* v6.left = 0; |
1194 | 1885 v6.right = 640; |
1886 v6.top = 0; | |
1197 | 1887 v6.bottom = 480;*/ |
0 | 1888 //nullsub_1(); |
1889 CallRenderPresent(); | |
1890 //nullsub_1(); | |
1891 while ( 1 ) | |
1892 { | |
1893 while ( 1 ) | |
1894 { | |
1895 while ( !ArcomageGame::MsgLoop(20, &v10) ) | |
1896 ; | |
1897 if ( v10.field_0 != 1 ) | |
1898 break; | |
1899 if ( v10.field_4 ) | |
1900 goto LABEL_13; | |
1901 //nullsub_1(); | |
1902 } | |
1903 if ( v10.field_0 > 4 ) | |
1904 { | |
1905 if ( v10.field_0 <= 8 ) | |
1906 goto LABEL_13; | |
1907 if ( v10.field_0 == 10 ) | |
1908 break; | |
1909 } | |
1910 } | |
1911 pArcomageGame->field_F4 = 1; | |
1912 byte_4FAA74 = 1; | |
1913 LABEL_13: | |
1197 | 1914 /* v11.x = 0; |
1194 | 1915 v11.y = 0; |
1916 v6.left = 0; | |
1917 v6.right = 640; | |
1918 v6.top = 0; | |
1197 | 1919 v6.bottom = 480;*/ |
0 | 1920 //nullsub_1(); |
1921 CallRenderPresent(); | |
1922 } | |
1923 } | |
1924 } | |
1925 | |
1926 | |
1927 //----- (0040A514) -------------------------------------------------------- | |
1197 | 1928 bool IsGameOver() |
1183 | 1929 { |
0 | 1930 bool result; // eax@1 |
1183 | 1931 |
1932 result = false; | |
1933 for(int i=0; i<2; ++i) | |
0 | 1934 { |
1197 | 1935 if ( am_Players[i].tower_height <= 0 ) |
1936 result = true; | |
1937 if ( am_Players[i].tower_height >= max_tower_height ) | |
1183 | 1938 result = true; |
1197 | 1939 if ( am_Players[i].resource_bricks >= max_resources_amount |
1940 || am_Players[i].resource_gems >= max_resources_amount | |
1941 || am_Players[i].resource_beasts >= max_resources_amount ) | |
1183 | 1942 result = true; |
0 | 1943 } |
1183 | 1944 |
0 | 1945 if ( result ) |
1946 byte_4FAA2C = 1; | |
1947 return result; | |
1948 } | |
1197 | 1949 |
0 | 1950 |
1951 //----- (0040A560) -------------------------------------------------------- | |
1200 | 1952 char am_40A560(unsigned int player_num) |
0 | 1953 { |
1954 int v1; // ebp@0 | |
1955 unsigned __int64 v2; // qax@3 | |
1956 unsigned __int64 v3; // kr00_8@3 | |
1957 int v4; // ecx@17 | |
1958 int v5; // esi@67 | |
1959 char Dest[100]; // [sp+8h] [bp-A8h]@67 | |
1960 int v8; // [sp+6Ch] [bp-44h]@3 | |
1194 | 1961 RECT pSrcXYZW; // [sp+70h] [bp-40h]@75 |
0 | 1962 int v10[4]; // [sp+80h] [bp-30h]@69 |
1194 | 1963 POINT pTargetXY; // [sp+90h] [bp-20h]@75 |
0 | 1964 ArcomageGame_stru1 a2; // [sp+98h] [bp-18h]@8 |
1965 int v13; // [sp+A4h] [bp-Ch]@1 | |
1966 char v15; // [sp+AEh] [bp-2h]@63 | |
1967 char v16; // [sp+AFh] [bp-1h]@1 | |
1968 | |
1969 uCardID = -1; | |
1970 v16 = 0; | |
1971 v13 = 20; | |
1972 byte_4FAA00 = 0; | |
1973 dword_4FAA68 = 0; | |
1974 amuint_4FAA38 = 10; | |
1975 amuint_4FAA34 = 5; | |
1976 if ( amuint_4FAA4C != -1 ) | |
1977 byte_4FAA2D = 1; | |
1978 do | |
1979 { | |
1194 | 1980 |
0 | 1981 do |
1982 { | |
1194 | 1983 v3 = pEventTimer->Time() - pArcomageGame->event_timer_time; |
0 | 1984 } |
1194 | 1985 while (v3 < 6); |
1986 | |
0 | 1987 pArcomageGame->event_timer_time = pEventTimer->Time(); |
1988 if ( pArcomageGame->field_F4 ) | |
1989 v16 = 1; | |
1990 ArcomageGame::MsgLoop(0, &a2); | |
1991 switch ( a2.field_0 ) | |
1992 { | |
1993 case 2: | |
1994 if ( a2.field_4 == 129 && a2.field_8 == 1 ) | |
1995 { | |
1996 pAudioPlayer->StopChannels(-1, -1); | |
1997 dword_4FAA68 = 0; | |
1185 | 1998 v16 = 1; |
1999 pArcomageGame->field_F4 = 1; | |
0 | 2000 } |
2001 break; | |
2002 case 9: | |
2003 pArcomageGame->field_F6 = 1; | |
2004 break; | |
1194 | 2005 case 10: |
0 | 2006 pAudioPlayer->StopChannels(-1, -1); |
2007 byte_4FAA74 = 1; | |
2008 v16 = 1; | |
2009 pArcomageGame->field_F4 = 1; | |
2010 break; | |
2011 } | |
1197 | 2012 v4 = current_player_num; |
2013 if (am_Players[current_player_num].IsHisTurn != 1 && !byte_4FAA00 && !byte_4FAA2E && !byte_4FAA2D ) | |
0 | 2014 { |
2015 if ( am_byte_4FAA75 ) | |
2016 am_byte_4FAA76 = 1; | |
1197 | 2017 am_408BB4(current_player_num); |
2018 v4 = current_player_num; | |
0 | 2019 byte_4FAA2E = 1; |
2020 } | |
2021 if ( amuint_4FAA4C != -1 && amuint_4FAA38 > 10 ) | |
2022 amuint_4FAA38 = 10; | |
1197 | 2023 if ( byte_4FAA2E || byte_4FAA2D ||am_Players[v4].IsHisTurn != 1 ) |
0 | 2024 { |
2025 pArcomageGame->field_F6 = 1; | |
2026 if ( byte_4FAA2D ) | |
2027 { | |
2028 --amuint_4FAA38; | |
2029 if ( amuint_4FAA38 < 0 ) | |
2030 { | |
2031 byte_4FAA2D = 0; | |
2032 amuint_4FAA38 = 10; | |
2033 v16 = 0; | |
2034 } | |
2035 } | |
2036 if ( byte_4FAA2E ) | |
2037 { | |
2038 --v13; | |
2039 if ( v13 < 0 ) | |
2040 { | |
2041 if ( dword_4FAA68 > 1 ) | |
2042 { | |
2043 --dword_4FAA68; | |
2044 byte_4FAA00 = 0; | |
2045 } | |
2046 else | |
2047 { | |
2048 v16 = 1; | |
2049 } | |
2050 byte_4FAA2E = 0; | |
2051 v13 = 20; | |
2052 } | |
2053 } | |
2054 } | |
2055 else | |
2056 { | |
2057 if ( am_byte_4FAA77 ) | |
2058 { | |
1200 | 2059 if ( a2.field_0 == 7 && am_40BCFB(player_num, current_card_slot_index) ) |
0 | 2060 { |
2061 if ( am_byte_4FAA75 ) | |
2062 am_byte_4FAA76 = 1; | |
2063 if ( dword_4FAA64 > 0 ) | |
2064 { | |
2065 --dword_4FAA64; | |
1200 | 2066 am_byte_4FAA77 = GetPlayerHandCardCount(player_num) > minimum_cards_at_hand; |
0 | 2067 } |
2068 byte_4FAA2E = 1; | |
2069 } | |
1200 | 2070 if ( a2.field_0 == 8 && am_40BCFB(player_num, current_card_slot_index) ) |
0 | 2071 { |
2072 if ( am_byte_4FAA75 ) | |
2073 am_byte_4FAA76 = 1; | |
2074 if ( dword_4FAA64 > 0 ) | |
2075 { | |
2076 --dword_4FAA64; | |
1200 | 2077 am_byte_4FAA77 = GetPlayerHandCardCount(player_num) > minimum_cards_at_hand; |
0 | 2078 } |
2079 byte_4FAA2E = 1; | |
2080 } | |
2081 } | |
2082 else | |
2083 { | |
2084 if ( a2.field_0 == 7 ) | |
2085 { | |
1200 | 2086 if ( PlayCard(player_num, current_card_slot_index) ) |
0 | 2087 { |
2088 byte_4FAA2E = 1; | |
2089 if ( am_byte_4FAA75 ) | |
2090 am_byte_4FAA76 = 1; | |
2091 } | |
2092 } | |
2093 if ( a2.field_0 == 8 ) | |
2094 { | |
1200 | 2095 if ( am_40BCFB(player_num, current_card_slot_index) ) |
0 | 2096 { |
2097 byte_4FAA2E = 1; | |
2098 if ( am_byte_4FAA75 ) | |
2099 am_byte_4FAA76 = 1; | |
2100 } | |
2101 } | |
2102 } | |
2103 } | |
2104 //nullsub_1(); | |
2105 if ( false ) | |
2106 { | |
2107 if ( !v15 ) | |
2108 { | |
2109 //nullsub_1(); | |
2110 v15 = 1; | |
2111 } | |
2112 } | |
2113 else | |
2114 { | |
2115 v15 = 0; | |
2116 } | |
2117 if ( false ) | |
2118 { | |
2119 //nullsub_1(); | |
2120 //nullsub_1(); | |
1209 | 2121 // assert(false && "Invalid strcpy params"); |
2122 // inv_strcpy(nullptr, Dest); | |
0 | 2123 v5 = 0;//unk::const_0(&unk_4E19FC, 0); |
2124 //nullsub_1(); | |
2125 if ( v5 == 1 ) | |
2126 { | |
2127 pAudioPlayer->StopChannels(-1, -1); | |
2128 v16 = 1; | |
2129 pArcomageGame->field_F4 = 1; | |
2130 dword_4FAA68 = 0; | |
2131 } | |
1194 | 2132 /*v10[0] = 0; |
0 | 2133 v10[2] = 640; |
2134 v10[1] = 0; | |
1194 | 2135 v10[3] = 480;*/ |
0 | 2136 //nullsub_1(); |
2137 } | |
1209 | 2138 if ( dword_4FABB8 != DrawCardsRectangles(player_num) ) |
0 | 2139 { |
1209 | 2140 dword_4FABB8 = DrawCardsRectangles(player_num); |
1194 | 2141 pArcomageGame->field_F6 = 1; |
1209 | 2142 } |
0 | 2143 if ( pArcomageGame->field_F6 ) |
2144 { | |
1197 | 2145 DrawGameUI(v13); |
0 | 2146 DoBlt_Copy(pArcomageGame->pBackgroundPixels); |
2147 pArcomageGame->field_F6 = 0; | |
2148 } | |
2149 if ( pArcomageGame->field_F9 ) | |
2150 { | |
1194 | 2151 pTargetXY.x = 0; |
2152 pTargetXY.y = 0; | |
2153 pSrcXYZW.left = 0; | |
2154 pSrcXYZW.right = 640; | |
2155 pSrcXYZW.top = 0; | |
2156 pSrcXYZW.bottom = 480; | |
0 | 2157 am_BeginScene(pArcomageGame->pBackgroundPixels, -1, 1); |
1194 | 2158 Blt_Copy(&pSrcXYZW, &pTargetXY, 2); |
0 | 2159 am_EndScene(); |
1197 | 2160 DrawGameUI(v13); |
0 | 2161 pRenderer->Present(); |
2162 pArcomageGame->field_F9 = 0; | |
2163 } | |
2164 } | |
2165 while ( !v16 ); | |
2166 return dword_4FAA68 > 0; | |
2167 } | |
1194 | 2168 |
0 | 2169 |
2170 //----- (0040A9AF) -------------------------------------------------------- | |
1197 | 2171 void DrawGameUI( int a1 ) |
1185 | 2172 { |
2173 | |
0 | 2174 am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1); |
1197 | 2175 DrawRectanglesForText(); |
0 | 2176 am_EndScene(); |
1197 | 2177 |
0 | 2178 am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1); |
1209 | 2179 DrawCards(); |
1197 | 2180 DrawPlayersTowers(); |
2181 DrawPlayersWall(); | |
2182 DrawPlayersText(); | |
0 | 2183 am_EndScene(); |
1197 | 2184 |
0 | 2185 am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1); |
1185 | 2186 am_40B76F(a1); |
2187 | |
2188 for( int i=0; i<10; ++i) | |
2189 { | |
2190 if (array_4FABD0[i].field_0) | |
2191 array_4FABD0[i].field_40->_40E133(); | |
2192 } | |
1200 | 2193 current_card_slot_index = DrawCardsRectangles(current_player_num); |
0 | 2194 am_40AA4E(); |
2195 am_EndScene(); | |
2196 } | |
2197 | |
2198 //----- (0040AA4E) -------------------------------------------------------- | |
1185 | 2199 void am_40AA4E() |
2200 { | |
0 | 2201 int v5; // [sp-4h] [bp-2Ch]@4 |
1185 | 2202 unsigned int v7; |
0 | 2203 int v8; // [sp+14h] [bp-14h]@10 |
2204 int v9; // [sp+18h] [bp-10h]@10 | |
1185 | 2205 RECT pXYZW; |
2206 | |
2207 v9 = 0x0000FF00; | |
2208 v8 = 0x000000FF; | |
2209 | |
2210 for (int i=0; i<10; ++i) | |
0 | 2211 { |
1185 | 2212 if(array_4FABD0[i].field_0 && (array_4FABD0[i].field_40->_40E2A7()==2)) |
2213 { | |
2214 | |
2215 v5 = v9; | |
2216 if ( !array_4FABD0[i].field_1 ) | |
2217 v5 = v8; | |
2218 | |
2219 v7 = R8G8B8_to_TargetFormat(v5); | |
2220 for(int j=0; j<150; ++j ) | |
2221 { | |
2222 if (array_4FABD0[i].field_44[j].field_0 > 0) | |
2223 { | |
2224 if (j%2) | |
2225 SetPixel(&array_4FABD0[i].field_44[j].field_4, v7); | |
2226 else | |
2227 { | |
2228 pXYZW.left = array_4FABD0[i].field_44[j].field_4.x; | |
2229 pXYZW.right = pXYZW.left + 2; | |
2230 pXYZW.top = array_4FABD0[i].field_44[j].field_4.y; | |
2231 pXYZW.bottom = pXYZW.top + 2; | |
2232 DrawRect(&pXYZW, v7, 1); | |
2233 } | |
2234 } | |
2235 } | |
2236 } | |
0 | 2237 } |
1185 | 2238 |
0 | 2239 } |
2240 | |
2241 //----- (0040AB0A) -------------------------------------------------------- | |
1197 | 2242 void DrawRectanglesForText() |
2243 { | |
1183 | 2244 |
2245 RECT pSrcRect; // [sp+Ch] [bp-18h]@1 | |
2246 POINT pTargetXY; // [sp+1Ch] [bp-8h]@1 | |
1197 | 2247 //resources rectangles |
1183 | 2248 pSrcRect.top = 0; |
2249 pSrcRect.left = 765; | |
2250 pSrcRect.right = 843; | |
2251 pSrcRect.bottom = 216; | |
2252 | |
2253 pTargetXY.x = 8; | |
2254 pTargetXY.y = 56; | |
2255 Blt_Copy(&pSrcRect, &pTargetXY, 2); | |
2256 | |
2257 pTargetXY.x = 555; | |
2258 pTargetXY.y = 56; | |
2259 Blt_Copy(&pSrcRect, &pTargetXY, 2); | |
2260 | |
1197 | 2261 //players name rectangle |
1183 | 2262 pSrcRect.left = 283; |
2263 pSrcRect.right = 361; | |
2264 pSrcRect.top = 166; | |
2265 pSrcRect.bottom = 190; | |
2266 pTargetXY.x = 8; | |
2267 pTargetXY.y = 13; | |
2268 Blt_Chroma(&pSrcRect, &pTargetXY, pArcomageGame->field_54, 2); | |
2269 | |
2270 pTargetXY.x = 555; | |
2271 pTargetXY.y = 13; | |
2272 Blt_Chroma(&pSrcRect, &pTargetXY, pArcomageGame->field_54, 2); | |
2273 | |
1197 | 2274 //tower heigth rectangle |
1183 | 2275 pSrcRect.left = 234; |
2276 pSrcRect.right = 283; | |
2277 pSrcRect.top = 166; | |
2278 pSrcRect.bottom = 190; | |
2279 pTargetXY.x = 100; | |
2280 pTargetXY.y = 296; | |
2281 Blt_Chroma(&pSrcRect, &pTargetXY, pArcomageGame->field_54, 2); | |
2282 | |
2283 pTargetXY.x = 492; | |
2284 pTargetXY.y = 296; | |
2285 Blt_Chroma(&pSrcRect, &pTargetXY, pArcomageGame->field_54, 2); | |
2286 | |
1197 | 2287 //wall heigth rectangle |
1183 | 2288 pSrcRect.left = 192; |
2289 pSrcRect.right = 234; | |
2290 pSrcRect.top = 166; | |
2291 pSrcRect.bottom = 190; | |
2292 pTargetXY.x = 168; | |
2293 pTargetXY.y = 296; | |
2294 Blt_Chroma(&pSrcRect, &pTargetXY, pArcomageGame->field_54, 2); | |
2295 | |
2296 pTargetXY.x = 430; | |
2297 pTargetXY.y = 296; | |
2298 Blt_Chroma(&pSrcRect, &pTargetXY, pArcomageGame->field_54, 2); | |
0 | 2299 } |
2300 | |
2301 //----- (0040AC5F) -------------------------------------------------------- | |
1197 | 2302 void DrawPlayersText() |
2303 { | |
2304 | |
2305 int res_value; // ecx@18 | |
2306 char text_buff[32]; // [sp+Ch] [bp-28h]@2 | |
2307 POINT text_position; // [sp+2Ch] [bp-8h]@2 | |
0 | 2308 |
2309 if ( am_byte_4FAA77 ) | |
2310 { | |
1209 | 2311 strcpy(text_buff, pGlobalTXT_LocalizationStrings[266]);// DISCARD A CARD |
1197 | 2312 text_position.x = 320 - pArcomageGame->pfntArrus->GetLineWidth(text_buff) / 2; |
2313 text_position.y = 306; | |
2314 pPrimaryWindow_draws_text(-1, text_buff, &text_position); | |
0 | 2315 } |
1209 | 2316 strcpy( text_buff, am_Players[0].pPlayerName); |
1197 | 2317 if ( !current_player_num ) |
1209 | 2318 strcat(text_buff, "***"); |
1197 | 2319 text_position.x = 47 - pArcomageGame->pfntComic->GetLineWidth(text_buff) / 2; |
2320 text_position.y = 21; | |
2321 pPrimaryWindow_draws_text(-1, text_buff, &text_position); | |
2322 | |
1209 | 2323 strcpy(text_buff, am_Players[1].pPlayerName); |
1197 | 2324 if ( current_player_num == 1 ) |
1209 | 2325 strcat(text_buff, "***" ); |
1197 | 2326 text_position.x = 595 - pArcomageGame->pfntComic->GetLineWidth(text_buff) / 2; |
2327 text_position.y = 21; | |
2328 pPrimaryWindow_draws_text(-1, text_buff, &text_position); | |
2329 | |
2330 intToString(am_Players[0].tower_height, text_buff); | |
2331 text_position.x = 123 - pArcomageGame->pfntComic->GetLineWidth(text_buff) / 2; | |
2332 text_position.y = 305; | |
2333 pPrimaryWindow_draws_text(-1, text_buff, &text_position); | |
2334 | |
2335 intToString(am_Players[1].tower_height, text_buff); | |
2336 text_position.x = 515 - pArcomageGame->pfntComic->GetLineWidth(text_buff) / 2; | |
2337 text_position.y = 305; | |
2338 pPrimaryWindow_draws_text(-1, text_buff, &text_position); | |
2339 | |
2340 intToString(am_Players[0].wall_height, text_buff); | |
2341 text_position.x = 188 - pArcomageGame->pfntComic->GetLineWidth(text_buff) / 2; | |
2342 text_position.y = 305; | |
2343 pPrimaryWindow_draws_text(-1, text_buff, &text_position); | |
2344 | |
2345 intToString(am_Players[1].wall_height, text_buff); | |
2346 text_position.x = 451 - pArcomageGame->pfntComic->GetLineWidth(text_buff) / 2; | |
2347 text_position.y = 305; | |
2348 pPrimaryWindow_draws_text(-1, text_buff, &text_position); | |
2349 | |
2350 res_value = am_Players[0].quarry_level; | |
0 | 2351 if ( byte_4E185E ) |
1197 | 2352 res_value =am_Players[0].quarry_level + quarry_bonus; |
2353 intToString(res_value, text_buff); | |
2354 text_position.x = 14;// - 6 * 0 / 2; | |
2355 text_position.y = 92; | |
2356 DrawPlayerLevels(-1, text_buff, &text_position); | |
2357 | |
2358 res_value = am_Players[1].quarry_level; | |
0 | 2359 if ( byte_4E185E ) |
1197 | 2360 res_value = am_Players[1].quarry_level + quarry_bonus; |
2361 intToString(res_value, text_buff); | |
2362 // v2 = 0; | |
2363 text_position.y = 92; | |
2364 text_position.x = 561; //- 6 * v2 / 2; | |
2365 DrawPlayerLevels(-1, text_buff, &text_position); | |
2366 | |
2367 res_value = am_Players[0].magic_level; | |
0 | 2368 if ( byte_4E185E ) |
1197 | 2369 res_value = am_Players[0].magic_level + magic_bonus; |
2370 intToString(res_value, text_buff); | |
2371 // v4 = 0; | |
2372 text_position.y = 164; | |
2373 text_position.x = 14; //- 6 * v4 / 2; | |
2374 DrawPlayerLevels(-1, text_buff, &text_position); | |
2375 | |
2376 res_value = am_Players[1].magic_level; | |
0 | 2377 if ( byte_4E185E ) |
1197 | 2378 res_value = am_Players[1].magic_level+magic_bonus; |
2379 intToString(res_value, text_buff); | |
2380 // v6 = 0; | |
2381 text_position.y = 164; | |
2382 text_position.x = 561; //- 6 * v6 / 2; | |
2383 DrawPlayerLevels(-1, text_buff, &text_position); | |
2384 | |
1200 | 2385 res_value = am_Players[0].zoo_level; |
0 | 2386 if ( byte_4E185E ) |
1201 | 2387 res_value = am_Players[0].zoo_level + zoo_bonus; |
1197 | 2388 intToString(res_value, text_buff); |
2389 // v8 = 0; | |
2390 text_position.y = 236; | |
2391 text_position.x = 14;// - 6 * v8 / 2; | |
2392 DrawPlayerLevels(-1, text_buff, &text_position); | |
2393 | |
1200 | 2394 res_value = am_Players[1].zoo_level; |
0 | 2395 if ( byte_4E185E ) |
1201 | 2396 res_value = am_Players[1].zoo_level + zoo_bonus; |
1197 | 2397 intToString(res_value, text_buff); |
2398 // v10 = 0; | |
2399 text_position.y = 236; | |
2400 text_position.x = 561;// - 6 * v10 / 2; | |
2401 DrawPlayerLevels(-1, text_buff, &text_position); | |
2402 | |
2403 intToString(am_Players[0].resource_bricks, text_buff); | |
2404 text_position.y = 114; | |
2405 text_position.x = 10; | |
2406 DrawBricksCount(-1, text_buff, &text_position); | |
2407 | |
2408 intToString(am_Players[1].resource_bricks, text_buff); | |
2409 text_position.x = 557; | |
2410 text_position.y = 114; | |
2411 DrawBricksCount(-1, text_buff, &text_position); | |
2412 | |
2413 intToString(am_Players[0].resource_gems, text_buff); | |
2414 text_position.x = 10; | |
2415 text_position.y = 186; | |
2416 DrawGemsCount(-1, text_buff, &text_position); | |
2417 | |
2418 intToString(am_Players[1].resource_gems, text_buff); | |
2419 text_position.x = 557; | |
2420 text_position.y = 186; | |
2421 DrawGemsCount(-1, text_buff, &text_position); | |
2422 | |
2423 intToString(am_Players[0].resource_beasts, text_buff); | |
2424 text_position.x = 10; | |
2425 text_position.y = 258; | |
2426 DrawBeastsCount(-1, text_buff, &text_position); | |
2427 | |
2428 intToString(am_Players[1].resource_beasts, text_buff); | |
2429 text_position.x = 557; | |
2430 text_position.y = 258; | |
2431 DrawBeastsCount(-1, text_buff, &text_position); | |
0 | 2432 } |
1197 | 2433 |
0 | 2434 |
2435 //----- (0040B102) -------------------------------------------------------- | |
1197 | 2436 void DrawPlayerLevels( int a1, char *text, POINT *pXY ) |
0 | 2437 { |
1194 | 2438 char *v3; // esi@1 |
2439 unsigned char test_char; // bl@2 | |
2440 int v7; // eax@3 | |
2441 RECT pSrcRect; | |
2442 POINT pTargetPoint; | |
2443 | |
2444 v3 = text; | |
2445 am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1); | |
2446 pTargetPoint.x = pXY->x; | |
2447 pTargetPoint.y = pXY->y; | |
2448 do | |
2449 { | |
2450 test_char = *v3; | |
2451 ++v3; | |
2452 if ( test_char ) | |
2453 { | |
2454 v7 = 22 * test_char; | |
2455 pSrcRect.right = v7 - 842; | |
2456 pSrcRect.left = v7 - 864; | |
2457 pSrcRect.top = 190; | |
2458 pSrcRect.bottom = 207; | |
2459 Blt_Chroma(&pSrcRect, &pTargetPoint, pArcomageGame->field_54, 1); | |
2460 pTargetPoint.x += 22; | |
2461 } | |
2462 } | |
2463 while ( test_char!= 0 ); | |
2464 am_EndScene(); | |
0 | 2465 } |
2466 | |
2467 //----- (0040B17E) -------------------------------------------------------- | |
1197 | 2468 void DrawBricksCount( int a1, char* text, POINT *pXY ) |
0 | 2469 { |
1194 | 2470 |
2471 char *v3; // esi@1 | |
2472 unsigned char test_char; // bl@2 | |
2473 int v7; // eax@3 | |
2474 RECT pSrcRect; | |
2475 POINT pTargetPoint; | |
2476 | |
2477 v3 = text; | |
2478 am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1); | |
2479 pTargetPoint.x = pXY->x; | |
2480 pTargetPoint.y = pXY->y; | |
2481 do | |
2482 { | |
2483 test_char = *v3; | |
2484 ++v3; | |
2485 if ( test_char ) | |
2486 { | |
2487 v7 = 13 * test_char; | |
1197 | 2488 pSrcRect.left = v7 - 370; |
2489 pSrcRect.right = v7 - 357; | |
1194 | 2490 pSrcRect.top = 128; |
2491 pSrcRect.bottom = 138; | |
2492 Blt_Copy(&pSrcRect, &pTargetPoint, 2); | |
2493 pTargetPoint.x += 13; | |
2494 } | |
2495 } | |
2496 while ( test_char!= 0 ); | |
2497 am_EndScene(); | |
2498 | |
0 | 2499 } |
2500 | |
2501 //----- (0040B1F3) -------------------------------------------------------- | |
1197 | 2502 void DrawGemsCount( int a1, char* text, POINT* pXY ) |
0 | 2503 { |
1194 | 2504 |
2505 char *v3; // esi@1 | |
2506 unsigned char test_char; // bl@2 | |
2507 int v7; // eax@3 | |
2508 RECT pSrcRect; | |
2509 POINT pTargetPoint; | |
2510 | |
2511 v3 = text; | |
2512 am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1); | |
2513 pTargetPoint.x = pXY->x; | |
2514 pTargetPoint.y = pXY->y; | |
2515 do | |
2516 { | |
2517 test_char = *v3; | |
2518 ++v3; | |
2519 if ( test_char ) | |
2520 { | |
2521 v7 = 13 * test_char; | |
1197 | 2522 pSrcRect.left = v7 - 370; |
2523 pSrcRect.right = v7 - 357; | |
1194 | 2524 pSrcRect.top = 138; |
2525 pSrcRect.bottom = 148; | |
2526 Blt_Copy(&pSrcRect, &pTargetPoint, 2); | |
2527 pTargetPoint.x += 13; | |
2528 } | |
2529 } | |
2530 while ( test_char!= 0 ); | |
2531 am_EndScene(); | |
2532 | |
0 | 2533 } |
2534 | |
2535 //----- (0040B268) -------------------------------------------------------- | |
1197 | 2536 void DrawBeastsCount( int a1, char *text, POINT *pXY ) |
0 | 2537 { |
1194 | 2538 |
2539 char *v3; // esi@1 | |
2540 unsigned char test_char; // bl@2 | |
2541 int v7; // eax@3 | |
2542 RECT pSrcRect; | |
2543 POINT pTargetPoint; | |
2544 | |
2545 v3 = text; | |
2546 am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1); | |
2547 pTargetPoint.x = pXY->x; | |
2548 pTargetPoint.y = pXY->y; | |
2549 do | |
2550 { | |
2551 test_char = *v3; | |
2552 ++v3; | |
2553 if ( test_char ) | |
2554 { | |
2555 v7 = 13 * test_char; | |
1197 | 2556 pSrcRect.left = v7 - 370; |
2557 pSrcRect.right = v7 - 357; | |
1194 | 2558 pSrcRect.top = 148; |
2559 pSrcRect.bottom = 158; | |
2560 Blt_Copy(&pSrcRect, &pTargetPoint, 2); | |
2561 pTargetPoint.x += 13; | |
2562 } | |
2563 } | |
2564 while ( test_char!= 0 ); | |
2565 am_EndScene(); | |
2566 | |
0 | 2567 } |
2568 | |
2569 //----- (0040B2DD) -------------------------------------------------------- | |
1197 | 2570 void DrawPlayersTowers() |
2571 { | |
2572 int tower_height; // eax@1 | |
2573 int tower_top; // esi@3 | |
1194 | 2574 RECT pSrcXYZW; // [sp+0h] [bp-18h]@3 |
2575 POINT pTargetXY; // [sp+10h] [bp-8h]@3 | |
2576 | |
1197 | 2577 tower_height= am_Players[0].tower_height; |
2578 if ( am_Players[0].tower_height > max_tower_height ) | |
2579 tower_height = max_tower_height; | |
1194 | 2580 pSrcXYZW.top = 0; |
2581 pSrcXYZW.left = 892; | |
2582 pSrcXYZW.right = 937; | |
1197 | 2583 tower_top = 200 * tower_height / max_tower_height; |
2584 pSrcXYZW.bottom = tower_top; | |
1194 | 2585 pTargetXY.x = 102; |
1197 | 2586 pTargetXY.y = 297 - tower_top; |
1194 | 2587 Blt_Copy(&pSrcXYZW, &pTargetXY, 2); |
2588 | |
2589 pSrcXYZW.top = 0; | |
2590 pSrcXYZW.left = 384; | |
2591 pSrcXYZW.right = 452; | |
2592 pSrcXYZW.bottom = 94; | |
1197 | 2593 pTargetXY.y = 203 - tower_top; |
1194 | 2594 pTargetXY.x = 91; |
2595 Blt_Chroma(&pSrcXYZW, &pTargetXY, pArcomageGame->field_54, 2); | |
2596 | |
1197 | 2597 |
2598 tower_height = am_Players[1].tower_height; | |
2599 if (am_Players[1].tower_height > max_tower_height ) | |
2600 tower_height = max_tower_height; | |
2601 tower_top = 200 * tower_height / max_tower_height; | |
2602 pSrcXYZW.top = 0; | |
2603 pSrcXYZW.left = 892; | |
2604 pSrcXYZW.right = 937; | |
2605 pSrcXYZW.bottom = tower_top; | |
2606 | |
1194 | 2607 pTargetXY.x = 494; |
1197 | 2608 pTargetXY.y = 297 - tower_top; |
1194 | 2609 Blt_Copy(&pSrcXYZW, &pTargetXY, 2); |
1197 | 2610 //draw tower up cone |
2611 pSrcXYZW.left = 384; | |
2612 pSrcXYZW.right = 452; | |
2613 pSrcXYZW.top = 94; | |
1194 | 2614 pSrcXYZW.bottom = 188; |
1197 | 2615 |
1194 | 2616 pTargetXY.x = 483; |
1197 | 2617 pTargetXY.y = 203 - tower_top; |
1194 | 2618 Blt_Chroma(&pSrcXYZW, &pTargetXY, pArcomageGame->field_54, 2); |
2619 | |
0 | 2620 } |
2621 // 4E1884: using guessed type int dword_4E1884; | |
2622 | |
2623 //----- (0040B400) -------------------------------------------------------- | |
1197 | 2624 void DrawPlayersWall() |
2625 { | |
1194 | 2626 int v0; // eax@1 |
2627 int v1; // eax@4 | |
2628 LONG v2; // ecx@4 | |
2629 int v3; // eax@5 | |
2630 int v4; // eax@8 | |
2631 LONG v5; // esi@8 | |
2632 RECT pSrcXYZW; // [sp+4h] [bp-18h]@4 | |
2633 POINT pTargetXY; // [sp+14h] [bp-8h]@4 | |
2634 | |
1197 | 2635 v0 = am_Players[0].wall_height; |
2636 if ( am_Players[0].wall_height <= 100 ) | |
1194 | 2637 { |
1197 | 2638 if ( am_Players[0].wall_height <= 0 ) |
1194 | 2639 goto LABEL_5; |
2640 } | |
2641 else | |
2642 { | |
2643 v0 = 100; | |
2644 } | |
2645 pSrcXYZW.top = 0; | |
2646 pSrcXYZW.left = 843; | |
2647 v1 = 200 * v0 / 100; | |
2648 pSrcXYZW.right = 867; | |
2649 pSrcXYZW.bottom = v1; | |
2650 pTargetXY.x = 177; | |
2651 pTargetXY.y = 297 - v1; | |
2652 Blt_Chroma(&pSrcXYZW, &pTargetXY, pArcomageGame->field_54, 2); | |
2653 | |
2654 LABEL_5: | |
1197 | 2655 v3 = am_Players[1].wall_height; |
2656 if ( am_Players[1].wall_height <= 100 ) | |
1194 | 2657 { |
1197 | 2658 if ( am_Players[1].wall_height <= 0 ) |
1194 | 2659 return; |
2660 } | |
2661 else | |
2662 { | |
2663 v3 = 100; | |
2664 } | |
2665 pSrcXYZW.top = 0; | |
2666 pSrcXYZW.left = 843; | |
2667 v4 = 200 * v3 / 100; | |
2668 pSrcXYZW.right = 867; | |
2669 pSrcXYZW.bottom = v4; | |
2670 pTargetXY.x = 439; | |
2671 pTargetXY.y = 297 - v4; | |
2672 Blt_Chroma(&pSrcXYZW, &pTargetXY, pArcomageGame->field_54, 2); | |
2673 | |
0 | 2674 } |
2675 | |
2676 //----- (0040B4B9) -------------------------------------------------------- | |
1209 | 2677 void DrawCards() |
2678 { | |
1200 | 2679 |
2680 int v0; // esi@1 | |
2681 char v1; // bl@1 | |
2682 int v2; // edi@1 | |
2683 int v3; // edx@2 | |
2684 int v4; // eax@3 | |
2685 int v5; // ecx@3 | |
2686 int v6; // eax@3 | |
2687 unsigned int v7; // ecx@4 | |
2688 int v8; // eax@16 | |
2689 int v9; // ecx@16 | |
2690 int v10; // eax@16 | |
2691 signed int v11; // edi@18 | |
2692 signed int v12; // esi@20 | |
2693 int v13; // ecx@20 | |
2694 int v14; // eax@23 | |
2695 signed int v15; // eax@25 | |
2696 int v16; // ecx@25 | |
2697 POINT *v17; // esi@26 | |
2698 signed int v18; // eax@29 | |
2699 Acromage_st1 *v19; // ecx@29 | |
2700 int v20; // ecx@31 | |
2701 int v21; // [sp-4h] [bp-2Ch]@8 | |
2702 RECT pSrcXYZW; // [sp+Ch] [bp-1Ch]@8 | |
2703 POINT pTargetXY; // [sp+1Ch] [bp-Ch]@1 | |
2704 int v24; // [sp+24h] [bp-4h]@1 | |
2705 | |
2706 v0 = GetPlayerHandCardCount(current_player_num); | |
2707 v2 = 0; | |
2708 pTargetXY.y = 327; | |
2709 v24 = (640 - 96 * v0) / (v0 + 1); | |
2710 pTargetXY.x = (640 - 96 * v0) / (v0 + 1); | |
2711 while ( v2 < v0 ) | |
2712 { | |
2713 v3 = current_player_num; | |
2714 if ( am_byte_4E185D != 0 ) | |
2715 { | |
2716 | |
2717 pTargetXY.x += am_Players[current_player_num].arr_6C[v2].field_0 ; | |
2718 pTargetXY.y += am_Players[current_player_num].arr_6C[v2].field_4; | |
2719 } | |
2720 v7 = am_Players[current_player_num].cards_at_hand[v2]; | |
2721 if ( v7 == -1 ) | |
2722 { | |
2723 ++v0; | |
2724 goto LABEL_15; | |
2725 } | |
2726 if ( v2 != amuint_4FAA4C ) | |
2727 { | |
2728 if ( am_Players[current_player_num].IsHisTurn == 0 && byte_505881 == 0 ) | |
2729 { | |
2730 pSrcXYZW.left = 192; | |
2731 pSrcXYZW.right = 288; | |
2732 pSrcXYZW.top = 0; | |
2733 pSrcXYZW.bottom = 128; | |
2734 Blt_Copy(&pSrcXYZW, &pTargetXY, 2); | |
2735 goto LABEL_13; | |
2736 } | |
2737 pArcomageGame->GetCardRect(v7, &pSrcXYZW); | |
2738 if ( !CanCardBePlayed(current_player_num, v2) ) | |
2739 { | |
2740 Blt_Copy(&pSrcXYZW, &pTargetXY, 0); | |
2741 goto LABEL_13; | |
2742 } | |
2743 Blt_Copy(&pSrcXYZW, &pTargetXY, 2); | |
2744 | |
2745 } | |
2746 LABEL_13: | |
2747 v3 = current_player_num; | |
2748 pTargetXY.x += v24 + 96; | |
2749 LABEL_15: | |
2750 if ( am_byte_4E185D != 0 ) | |
2751 { | |
2752 pTargetXY.x -= am_Players[current_player_num].arr_6C[v2].field_0 ; | |
2753 pTargetXY.y -= am_Players[current_player_num].arr_6C[v2].field_4 ; | |
2754 } | |
2755 ++v2; | |
2756 } | |
2757 | |
2758 for (v11=0; v11<10; ++v11) | |
2759 { | |
2760 if ( am_byte_4FAA76 == 0 ) | |
2761 { | |
2762 if ( shown_cards[v11].uCardId != -1 ) | |
2763 { | |
2764 pArcomageGame->GetCardRect(shown_cards[v11].uCardId, &pSrcXYZW); | |
2765 Blt_Copy(&pSrcXYZW, &shown_cards[v11].field_18_point, 0); | |
2766 } | |
2767 if ( shown_cards[v11].field_4 != 0 ) | |
2768 { | |
2769 pTargetXY.x = shown_cards[v11].field_18_point.x + 12; | |
2770 pTargetXY.y = shown_cards[v11].field_18_point.y + 40; | |
2771 pSrcXYZW.left = 843; | |
2772 pSrcXYZW.right = 916; | |
2773 pSrcXYZW.top = 200; | |
2774 pSrcXYZW.bottom = 216; | |
2775 Blt_Chroma(&pSrcXYZW, &pTargetXY, pArcomageGame->field_54, 2); | |
2776 } | |
2777 } | |
2778 else if ( amuint_4FAA34 <= 0 ) | |
2779 { | |
2780 if ( v11 == 9 ) | |
2781 { | |
2782 am_byte_4FAA76 = 0; | |
2783 am_byte_4FAA75 = 0; | |
2784 amuint_4FAA34 = 5; | |
2785 } | |
2786 if ( shown_cards[v11].uCardId != -1 ) | |
2787 amuint_4FABC4 = shown_cards[v11].uCardId; | |
2788 shown_cards[v11].uCardId = -1; | |
2789 shown_cards[v11].field_18_point.x = shown_cards[v11].field_8.x; | |
2790 shown_cards[v11].field_18_point.y = shown_cards[v11].field_8.y; | |
2791 shown_cards[v11].field_4 = 0; | |
2792 } | |
2793 else | |
2794 { | |
2795 if ( shown_cards[v11].uCardId != -1 ) | |
2796 { | |
2797 shown_cards[v11].field_18_point.x += shown_cards[v11].field_10_xplus; | |
2798 shown_cards[v11].field_18_point.y += shown_cards[v11].field_14_y_plus; | |
2799 pArcomageGame->GetCardRect(shown_cards[v11].uCardId, &pSrcXYZW); | |
2800 Blt_Copy(&pSrcXYZW, &shown_cards[v11].field_18_point, 0); | |
2801 } | |
2802 } | |
2803 } | |
2804 if ( am_byte_4FAA76 != 0 ) | |
2805 --amuint_4FAA34; | |
2806 | |
2807 pSrcXYZW.left = 192; | |
2808 pSrcXYZW.right = 288; | |
2809 pSrcXYZW.top = 0; | |
2810 pSrcXYZW.bottom = 128; | |
2811 pTargetXY.x = 120; | |
2812 pTargetXY.y = 18; | |
2813 Blt_Copy(&pSrcXYZW, &pTargetXY, 0); | |
2814 | |
0 | 2815 } |
2816 | |
2817 | |
2818 //----- (0040B76F) -------------------------------------------------------- | |
2819 void __fastcall am_40B76F(int a1) | |
2820 { | |
1209 | 2821 |
2822 int v1; // eax@3 | |
2823 int v2; // eax@3 | |
2824 int v3; // esi@4 | |
2825 int v4; // eax@4 | |
2826 POINT *v5; // edx@6 | |
2827 RECT *v6; // ecx@6 | |
2828 Acromage_st1 *v7; // ebx@11 | |
2829 int v8; // eax@15 | |
2830 Acromage_st1 *v9; // ecx@15 | |
2831 int v10; // ecx@19 | |
2832 int v11; // eax@20 | |
2833 int v12; // ecx@20 | |
2834 int v13; // eax@20 | |
2835 unsigned int v14; // ecx@21 | |
2836 double v15; // st7@22 | |
2837 POINT *v16; // edx@23 | |
2838 int v17; // eax@32 | |
2839 char v18; // zf@37 | |
2840 int v19; // eax@41 | |
2841 int v20; // eax@46 | |
2842 int v21; // ecx@46 | |
2843 int v22; // eax@46 | |
2844 int v23; // [sp-4h] [bp-2Ch]@28 | |
2845 RECT pSrcXYZW; // [sp+Ch] [bp-1Ch]@6 | |
2846 POINT pTargetXY; // [sp+1Ch] [bp-Ch]@20 | |
2847 int v26; // [sp+24h] [bp-4h]@1 | |
2848 | |
2849 v26 = a1; | |
2850 if ( amuint_4FAA4C != -1 ) | |
2851 { | |
2852 if ( amuint_4FAA38 >= 9 ) | |
2853 { | |
2854 am_uint_4FAA44_blt_xy.y = 18; | |
2855 am_uint_4FAA44_blt_xy.x = 120; | |
2856 v1 = GetPlayerHandCardCount(current_player_num); | |
2857 v2 = (640 - 96 * v1) / v1 + 96; | |
2858 if ( am_byte_4E185D ) | |
2859 { | |
2860 // v3 = 188 * current_player_num + 8 * amuint_4FAA4C; | |
2861 // amuint_4FAA3C_blt_xy.x = (amuint_4FAA4C * v2 + *(am_Players[0].arr_6C[0] + v3) - 120) / 10; | |
2862 amuint_4FAA3C_blt_xy.x=(amuint_4FAA4C * v2 + am_Players[current_player_num].arr_6C[amuint_4FAA4C].field_0-120)/10; | |
2863 v4 = (am_Players[current_player_num].arr_6C[amuint_4FAA4C].field_4+309) /10;//(*(&am_Players[0].arr_6C[0][1] + v3) + 309) / 10; | |
2864 } | |
2865 else | |
2866 { | |
2867 amuint_4FAA3C_blt_xy.x = (amuint_4FAA4C * v2 - 120) / 10; | |
2868 v4 = 30; | |
2869 } | |
2870 am_uint_4FAA44_blt_xy.y += v4; | |
2871 am_uint_4FAA44_blt_xy.x += amuint_4FAA3C_blt_xy.x; | |
2872 pSrcXYZW.top = 0; | |
2873 amuint_4FAA3C_blt_xy.y = v4; | |
2874 pSrcXYZW.left = 192; | |
2875 pSrcXYZW.right = 288; | |
2876 pSrcXYZW.bottom = 128; | |
2877 v5 = &am_uint_4FAA44_blt_xy; | |
2878 v6 = &pSrcXYZW; | |
2879 Blt_Copy(v6, v5, 2); | |
2880 goto LABEL_11; | |
2881 } | |
2882 pSrcXYZW.top = 0; | |
2883 v6 = &pSrcXYZW; | |
2884 v5 = &am_uint_4FAA44_blt_xy; | |
2885 pSrcXYZW.bottom = 128; | |
2886 pSrcXYZW.right = 288; | |
2887 pSrcXYZW.left = 192; | |
2888 if ( amuint_4FAA38 ) | |
2889 { | |
2890 am_uint_4FAA44_blt_xy.x += amuint_4FAA3C_blt_xy.x; | |
2891 am_uint_4FAA44_blt_xy.y += amuint_4FAA3C_blt_xy.y; | |
2892 Blt_Copy(v6, v5, 2); | |
2893 goto LABEL_11; | |
2894 } | |
2895 am_uint_4FAA44_blt_xy.x += amuint_4FAA3C_blt_xy.x; | |
2896 am_uint_4FAA44_blt_xy.y += amuint_4FAA3C_blt_xy.y; | |
2897 Blt_Copy(&pSrcXYZW, &am_uint_4FAA44_blt_xy, 2); | |
2898 amuint_4FAA4C = -1; | |
2899 } | |
2900 LABEL_11: | |
2901 v7 = shown_cards; | |
2902 if ( uCardID != -1 ) | |
2903 { | |
2904 if ( v26 <= 10 ) | |
2905 { | |
2906 if ( v26 == 10 ) | |
2907 { | |
2908 pArcomageGame->GetCardRect(uCardID, &pSrcXYZW); | |
2909 // v8 = 0; | |
2910 for (v8=0; v8<10; ++v8) | |
2911 { | |
2912 if (shown_cards[v8].uCardId==-1) | |
2913 { | |
2914 shown_cards[v8].uCardId = uCardID; | |
2915 shown_cards[v8].field_4 = 1; | |
2916 break; | |
2917 } | |
2918 } | |
2919 /* v9 = shown_cards; | |
2920 while ( v9->uCardId != -1 ) | |
2921 { | |
2922 ++v9; | |
2923 ++v8; | |
2924 if ( v9 >= &dword_4FABB8 ) | |
2925 goto LABEL_20; | |
2926 } | |
2927 | |
2928 v10 = v8; | |
2929 shown_cards[v10].uCardId = uCardID; | |
2930 shown_cards[v10].field_4 = 1;*/ | |
2931 //LABEL_20: | |
2932 pTargetXY.x = shown_cards[v8].field_8.x; | |
2933 pTargetXY.y = shown_cards[v8].field_8.y; | |
2934 Blt_Copy(&pSrcXYZW, &pTargetXY, 0); | |
2935 uCardID = -1; | |
2936 } | |
2937 } | |
2938 else | |
2939 { | |
2940 pArcomageGame->GetCardRect(uCardID, &pSrcXYZW); | |
2941 amuint_4FAA5C_blt_xy.x += amuint_4FAA54_blt_xy.x; | |
2942 amuint_4FAA5C_blt_xy.y += amuint_4FAA54_blt_xy.y; | |
2943 Blt_Copy(&pSrcXYZW, &amuint_4FAA5C_blt_xy, 0); | |
2944 } | |
2945 } | |
2946 v14 = played_card_id; | |
2947 if ( played_card_id != -1 ) | |
2948 { | |
2949 v15 = v26; | |
2950 if ( v15 > 15.0 ) | |
2951 { | |
2952 pArcomageGame->GetCardRect(played_card_id, &pSrcXYZW); | |
2953 v16 = &amuint_4FAA5C_blt_xy; | |
2954 amuint_4FAA5C_blt_xy.x += amuint_4FAA54_blt_xy.x; | |
2955 amuint_4FAA5C_blt_xy.y += amuint_4FAA54_blt_xy.y; | |
2956 Blt_Copy(&pSrcXYZW, v16, 2); | |
2957 return; | |
2958 } | |
2959 if ( v15 == 15.0 ) | |
2960 { | |
2961 am_40BF77(current_player_num, played_card_id); | |
2962 pArcomageGame->GetCardRect(played_card_id, &pSrcXYZW); | |
2963 pTargetXY.x = 272; | |
2964 pTargetXY.y = 173; | |
2965 Blt_Copy(&pSrcXYZW, &pTargetXY, 2); | |
2966 return; | |
2967 } | |
2968 if ( v15 == 5.0 ) | |
2969 { | |
2970 amuint_4FAA5C_blt_xy.x = 272; | |
2971 amuint_4FAA5C_blt_xy.y = 173; | |
2972 for (v17=0; v17<10; ++v17) | |
2973 { | |
2974 if (shown_cards[v17].uCardId==-1) | |
2975 break; | |
2976 } | |
2977 /* v17 = 0; | |
2978 do | |
2979 { | |
2980 if ( v7->uCardId == -1 ) | |
2981 break; | |
2982 ++v7; | |
2983 ++v17; | |
2984 } | |
2985 while ( v7 < &dword_4FABB8 );*/ | |
2986 // v26 = 32 * v17; | |
2987 | |
2988 amuint_4FAA54_blt_xy.x = (shown_cards[v17].field_8.x - 272) / 5; | |
2989 amuint_4FAA54_blt_xy.y = (shown_cards[v17].field_8.y - 173) / 5; | |
2990 pArcomageGame->GetCardRect(played_card_id, &pSrcXYZW); | |
2991 pTargetXY.x = 272; | |
2992 pTargetXY.y = 173; | |
2993 Blt_Copy(&pSrcXYZW, &pTargetXY, 2); | |
2994 return; | |
2995 } | |
2996 if ( v15 >= 5.0 ) | |
2997 { | |
2998 v18 = v26 == 0; | |
2999 } | |
3000 else | |
3001 { | |
3002 v18 = v26 == 0; | |
3003 if ( v26 > 0 ) | |
3004 { | |
3005 pArcomageGame->GetCardRect(played_card_id, &pSrcXYZW); | |
3006 amuint_4FAA5C_blt_xy.x += amuint_4FAA54_blt_xy.x; | |
3007 amuint_4FAA5C_blt_xy.y += amuint_4FAA54_blt_xy.y; | |
3008 Blt_Copy(&pSrcXYZW, &amuint_4FAA5C_blt_xy, 0); | |
3009 return; | |
3010 } | |
3011 } | |
3012 if ( !v18 ) | |
3013 { | |
3014 | |
3015 pArcomageGame->GetCardRect(v14, &pSrcXYZW); | |
3016 pTargetXY.x = 272; | |
3017 pTargetXY.y = 173; | |
3018 Blt_Copy(&pSrcXYZW, &pTargetXY, 2); | |
3019 return; | |
3020 } | |
3021 pArcomageGame->GetCardRect(played_card_id, &pSrcXYZW); | |
3022 for (v19=0; v19<10; ++v19) | |
3023 { | |
3024 if (shown_cards[v19].uCardId==-1) | |
3025 { | |
3026 shown_cards[v19].uCardId = played_card_id; | |
3027 break; | |
3028 } | |
3029 | |
3030 } | |
3031 /* v19 = 0; | |
3032 while ( v7->uCardId != -1 ) | |
3033 { | |
3034 ++v7; | |
3035 ++v19; | |
3036 if ( v7 >= &dword_4FABB8 ) | |
3037 goto LABEL_46; | |
3038 } | |
3039 shown_cards[v19].uCardId = played_card_id; | |
3040 LABEL_46:*/ | |
3041 | |
3042 pTargetXY.x = shown_cards[v19].field_8.x; | |
3043 pTargetXY.y = shown_cards[v19].field_8.y; | |
3044 Blt_Copy(&pSrcXYZW, &pTargetXY, 0); | |
3045 played_card_id = -1; | |
3046 } | |
3047 | |
3048 | |
1183 | 3049 // int v1; // eax@3 |
3050 // int v2; // eax@3 | |
3051 // int v3; // esi@4 | |
3052 // int v4; // eax@4 | |
3053 // int *v5; // edx@6 | |
3054 // int *v6; // ecx@6 | |
3055 // signed int v7; // ebx@11 | |
3056 // int v8; // eax@15 | |
3057 // signed int v9; // ecx@15 | |
3058 // int v10; // eax@20 | |
3059 // int v11; // ecx@20 | |
3060 // int v12; // eax@20 | |
3061 // unsigned int v13; // ecx@21 | |
3062 // double v14; // st7@22 | |
3063 // int *v15; // edx@23 | |
3064 // int v16; // eax@32 | |
3065 // char v17; // zf@37 | |
3066 // int v18; // eax@41 | |
3067 // int v19; // eax@46 | |
3068 // int v20; // ecx@46 | |
3069 // int v21; // eax@46 | |
3070 // int v22; // [sp-4h] [bp-2Ch]@6 | |
3071 // int v23; // [sp-4h] [bp-2Ch]@28 | |
3072 // int pSrcXYZW[4]; // [sp+Ch] [bp-1Ch]@6 | |
3073 // int pTargetXY[2]; // [sp+1Ch] [bp-Ch]@20 | |
3074 // int v26; // [sp+24h] [bp-4h]@1 | |
3075 // | |
3076 // v26 = a1; | |
3077 // if ( amuint_4FAA4C != -1 ) | |
3078 // { | |
3079 // if ( amuint_4FAA38 >= 9 ) | |
3080 // { | |
3081 // am_uint_4FAA44_blt_xy[1] = 18; | |
3082 // am_uint_4FAA44_blt_xy[0] = 120; | |
1185 | 3083 // v1 = GetPlayerHandCardCount(amuint_4FAA6C); |
1183 | 3084 // v2 = (640 - 96 * v1) / v1 + 96; |
3085 // if ( am_byte_4E185D ) | |
3086 // { | |
3087 // v3 = 188 * amuint_4FAA6C + 8 * amuint_4FAA4C; | |
3088 // amuint_4FAA3C_blt_xy[0] = (amuint_4FAA4C * v2 + *(int *)((char *)stru_505708[0].arr_6C[0] + v3) - 120) / 10; | |
3089 // v4 = (*(int *)((char *)&stru_505708[0].arr_6C[0][1] + v3) + 309) / 10; | |
3090 // } | |
3091 // else | |
3092 // { | |
3093 // amuint_4FAA3C_blt_xy[0] = (amuint_4FAA4C * v2 - 120) / 10; | |
3094 // v4 = 30; | |
3095 // } | |
3096 // am_uint_4FAA44_blt_xy[1] += v4; | |
3097 // am_uint_4FAA44_blt_xy[0] += amuint_4FAA3C_blt_xy[0]; | |
3098 // pSrcXYZW[1] = 0; | |
3099 // amuint_4FAA3C_blt_xy[1] = v4; | |
3100 // pSrcXYZW[0] = 192; | |
3101 // pSrcXYZW[2] = 288; | |
3102 // pSrcXYZW[3] = 128; | |
3103 // v5 = am_uint_4FAA44_blt_xy; | |
3104 // v6 = pSrcXYZW; | |
3105 // goto LABEL_7; | |
3106 // } | |
3107 // pSrcXYZW[1] = 0; | |
3108 // v6 = pSrcXYZW; | |
3109 // v5 = am_uint_4FAA44_blt_xy; | |
3110 // | |
3111 // pSrcXYZW[3] = 128; | |
3112 // pSrcXYZW[2] = 288; | |
3113 // pSrcXYZW[0] = 192; | |
3114 // if ( amuint_4FAA38 ) | |
3115 // { | |
3116 // am_uint_4FAA44_blt_xy[0] += amuint_4FAA3C_blt_xy[0]; | |
3117 // am_uint_4FAA44_blt_xy[1] += amuint_4FAA3C_blt_xy[1]; | |
3118 //LABEL_7: | |
3119 // Blt_Copy(v6, v5, 2); | |
3120 // goto LABEL_11; | |
3121 // } | |
3122 // am_uint_4FAA44_blt_xy[0] += amuint_4FAA3C_blt_xy[0]; | |
3123 // am_uint_4FAA44_blt_xy[1] += amuint_4FAA3C_blt_xy[1]; | |
3124 // Blt_Copy(pSrcXYZW, am_uint_4FAA44_blt_xy, 2); | |
3125 // amuint_4FAA4C = -1; | |
3126 // } | |
3127 //LABEL_11: | |
3128 // v7 = (signed int)amuint_4FAA78; | |
3129 // if ( uCardID != -1 ) | |
3130 // { | |
3131 // if ( v26 <= 10 ) | |
3132 // { | |
3133 // if ( v26 == 10 ) | |
3134 // { | |
3135 // ArcomageGame::GetCardRect(uCardID, pSrcXYZW); | |
3136 // v8 = 0; | |
3137 // v9 = (signed int)amuint_4FAA78; | |
3138 // while ( *(unsigned int *)v9 != -1 ) | |
3139 // { | |
3140 // v9 += 32; | |
3141 // ++v8; | |
3142 // if ( v9 >= (signed int)&dword_4FABB8 ) | |
3143 // goto LABEL_20; | |
3144 // } | |
3145 // amuint_4FAA78[8 * v8] = uCardID; | |
3146 // am_byte_4FAA7C[32 * v8] = 1; | |
3147 //LABEL_20: | |
3148 // v10 = 8 * v8; | |
3149 // v11 = amuint_4FAA80[v10]; | |
3150 // v12 = amuint_4FAA84[v10]; | |
3151 // pTargetXY[0] = v11; | |
3152 // pTargetXY[1] = v12; | |
3153 // Blt_Copy((ArcomageRect *)pSrcXYZW, pTargetXY, 0); | |
3154 // uCardID = -1; | |
3155 // } | |
3156 // } | |
3157 // else | |
3158 // { | |
3159 // ArcomageGame::GetCardRect(uCardID, pSrcXYZW); | |
3160 // amuint_4FAA5C_blt_xy[0] += amuint_4FAA54_blt_xy[0]; | |
3161 // amuint_4FAA5C_blt_xy[1] += amuint_4FAA54_blt_xy[1]; | |
3162 // Blt_Copy(pSrcXYZW, amuint_4FAA5C_blt_xy, 0); | |
3163 // } | |
3164 // } | |
3165 // v13 = amuint_4FABC0; | |
3166 // if ( amuint_4FABC0 != -1 ) | |
3167 // { | |
3168 // v14 = (double)v26; | |
3169 // if ( v14 > 15.0 ) | |
3170 // { | |
3171 // ArcomageGame::GetCardRect(amuint_4FABC0, pSrcXYZW); | |
3172 // v15 = amuint_4FAA5C_blt_xy; | |
3173 // amuint_4FAA5C_blt_xy[0] += amuint_4FAA54_blt_xy[0]; | |
3174 // amuint_4FAA5C_blt_xy[1] += amuint_4FAA54_blt_xy[1]; | |
3175 //LABEL_28: | |
3176 // v23 = 2; | |
3177 //LABEL_29: | |
3178 // Blt_Copy(pSrcXYZW, v15, v23); | |
3179 // return; | |
3180 // } | |
3181 // if ( v14 == 15.0 ) | |
3182 // { | |
3183 // am_40BF77(amuint_4FAA6C, amuint_4FABC0); | |
3184 // v13 = amuint_4FABC0; | |
3185 // goto LABEL_26; | |
3186 // } | |
3187 // if ( v14 == 5.0 ) | |
3188 // { | |
3189 // amuint_4FAA5C_blt_xy[0] = 272; | |
3190 // amuint_4FAA5C_blt_xy[1] = 173; | |
3191 // v16 = 0; | |
3192 // do | |
3193 // { | |
3194 // if ( *(unsigned int *)v7 == -1 ) | |
3195 // break; | |
3196 // v7 += 32; | |
3197 // ++v16; | |
3198 // } | |
3199 // while ( v7 < (signed int)&dword_4FABB8 ); | |
3200 // v26 = 32 * v16; | |
3201 // amuint_4FAA54_blt_xy[0] = (amuint_4FAA80[8 * v16] - 272) / 5; | |
3202 // amuint_4FAA54_blt_xy[1] = (amuint_4FAA84[8 * v16] - 173) / 5; | |
3203 // ArcomageGame::GetCardRect(amuint_4FABC0, pSrcXYZW); | |
3204 // pTargetXY[0] = 272; | |
3205 // pTargetXY[1] = 173; | |
3206 // goto LABEL_27; | |
3207 // } | |
3208 // if ( v14 >= 5.0 ) | |
3209 // { | |
3210 // v17 = v26 == 0; | |
3211 // } | |
3212 // else | |
3213 // { | |
3214 // v17 = v26 == 0; | |
3215 // if ( v26 > 0 ) | |
3216 // { | |
3217 // ArcomageGame::GetCardRect(amuint_4FABC0, pSrcXYZW); | |
3218 // v15 = amuint_4FAA5C_blt_xy; | |
3219 // amuint_4FAA5C_blt_xy[0] += amuint_4FAA54_blt_xy[0]; | |
3220 // amuint_4FAA5C_blt_xy[1] += amuint_4FAA54_blt_xy[1]; | |
3221 // v23 = 0; | |
3222 // goto LABEL_29; | |
3223 // } | |
3224 // } | |
3225 // if ( !v17 ) | |
3226 // { | |
3227 //LABEL_26: | |
3228 // ArcomageGame::GetCardRect(v13, pSrcXYZW); | |
3229 // pTargetXY[0] = 272; | |
3230 // pTargetXY[1] = 173; | |
3231 //LABEL_27: | |
3232 // v15 = pTargetXY; | |
3233 // goto LABEL_28; | |
3234 // } | |
3235 // ArcomageGame::GetCardRect(amuint_4FABC0, pSrcXYZW); | |
3236 // v18 = 0; | |
3237 // while ( *(unsigned int *)v7 != -1 ) | |
3238 // { | |
3239 // v7 += 32; | |
3240 // ++v18; | |
3241 // if ( v7 >= (signed int)&dword_4FABB8 ) | |
3242 // goto LABEL_46; | |
3243 // } | |
3244 // amuint_4FAA78[8 * v18] = amuint_4FABC0; | |
3245 //LABEL_46: | |
3246 // v19 = 8 * v18; | |
3247 // v20 = amuint_4FAA80[v19]; | |
3248 // v21 = amuint_4FAA84[v19]; | |
3249 // pTargetXY[0] = v20; | |
3250 // pTargetXY[1] = v21; | |
3251 // Blt_Copy((ArcomageRect *)pSrcXYZW, pTargetXY, 0); | |
3252 // amuint_4FABC0 = -1; | |
3253 // } | |
0 | 3254 } |
3255 // 4E185D: using guessed type char am_byte_4E185D; | |
3256 // 4FAA38: using guessed type int amuint_4FAA38; | |
3257 // 4FAA4C: using guessed type int amuint_4FAA4C; | |
3258 // 4FAA78: using guessed type int amuint_4FAA78[]; | |
3259 // 4FAA80: using guessed type int amuint_4FAA80[]; | |
3260 // 4FAA84: using guessed type int amuint_4FAA84[]; | |
3261 // 4FABB8: using guessed type int dword_4FABB8; | |
3262 | |
3263 //----- (0040BB12) -------------------------------------------------------- | |
1183 | 3264 void ArcomageGame::GetCardRect(unsigned int uCardID, RECT *pCardRect) |
0 | 3265 { |
3266 int v3; // edx@1 | |
3267 int v4; // ecx@1 | |
3268 | |
3269 v3 = pCards[uCardID].slot % 10; | |
3270 v4 = (pCards[uCardID].slot / 10 << 7) + 220; | |
1183 | 3271 pCardRect->top = v4; |
3272 pCardRect->left = 96 * v3; | |
3273 pCardRect->bottom = v4 + 128; | |
3274 pCardRect->right = 96 * v3 + 96; | |
0 | 3275 } |
3276 | |
3277 //----- (0040BB49) -------------------------------------------------------- | |
1185 | 3278 int GetPlayerHandCardCount( int player_num ) |
3279 { | |
3280 int card_count; // eax@1 | |
3281 | |
3282 card_count = 0; | |
3283 for(int i=0; i<10; ++i) | |
3284 { | |
3285 if (am_Players[player_num].cards_at_hand[i]!=-1) | |
3286 ++card_count; | |
3287 } | |
3288 return card_count; | |
3289 | |
0 | 3290 } |
3291 | |
3292 //----- (0040BB67) -------------------------------------------------------- | |
1200 | 3293 signed int DrawCardsRectangles( int player_num ) |
3294 { | |
3295 | |
3296 | |
3297 //int v1; // esi@1 | |
1194 | 3298 signed int result; // eax@1 |
3299 int v3; // ebx@1 | |
3300 char v4; // zf@1 | |
3301 int v5; // eax@3 | |
3302 int v6; // eax@4 | |
3303 int v7; // ecx@6 | |
3304 char *v8; // eax@6 | |
3305 int v9; // eax@10 | |
3306 int v10; // ecx@10 | |
3307 int v11; // eax@10 | |
3308 char v12; // ch@2@11 | |
3309 int v13; // ST00_4@12 | |
3310 unsigned __int16 v14; // ax@12 | |
3311 int v15; // eax@13 | |
3312 int v16; // ecx@13 | |
3313 int v17; // eax@13 | |
3314 char v18; // al@16 | |
3315 char v19; // ch@2@16 | |
3316 int v20; // ST00_4@19 | |
3317 unsigned __int16 v21; // ax@19 | |
3318 RECT pXYZW; // [sp+Ch] [bp-3Ch]@3 | |
3319 stru273 v26; // [sp+1Ch] [bp-2Ch]@2 | |
3320 int v25; // [sp+2Ch] [bp-1Ch]@3 | |
3321 __int32 var18; // [sp+30h] [bp-18h]@3 | |
3322 int i; // [sp+34h] [bp-14h]@4 | |
3323 int v28; // [sp+38h] [bp-10h]@1 | |
3324 int hand_index; // [sp+3Ch] [bp-Ch]@3 | |
3325 int v30; // [sp+40h] [bp-8h]@1 | |
3326 char v31; // [sp+44h] [bp-4h]@12 | |
3327 char v32; // [sp+45h] [bp-3h]@12 | |
3328 char v33; // [sp+46h] [bp-2h]@12 | |
3329 | |
1200 | 3330 |
1194 | 3331 v30 = 0; |
3332 result = -1; | |
3333 //v3 = 188 * a1; | |
1200 | 3334 |
1194 | 3335 //v4 = LOBYTE(am_Players[a1].field_20) == 0; |
3336 v28 = -1; | |
1200 | 3337 if ( am_Players[player_num].IsHisTurn ) |
1194 | 3338 { |
0 | 3339 if ( v26._40DD2F() ) |
3340 { | |
1200 | 3341 v5 = GetPlayerHandCardCount(player_num); |
1194 | 3342 hand_index = 0; |
3343 v25 = v5; | |
3344 pXYZW.top = 327; | |
3345 pXYZW.bottom = 455; | |
3346 pXYZW.left = (640 - 96 * v5) / (v5 + 1); | |
3347 var18 = pXYZW.left + 96; | |
3348 pXYZW.right = pXYZW.left + 96; | |
3349 if ( v5 > 0 ) | |
0 | 3350 { |
1194 | 3351 // v6 = 47 * v1; |
1200 | 3352 // for ( i = player_num; ; v6 = i ) |
3353 for(;;) | |
1194 | 3354 { |
3355 v7 = v30; | |
3356 // v8 = &am_Players[0].cards_at_hand[v30 + v6]; | |
3357 | |
3358 for (v7=0; v7<10; ++v7) | |
3359 { | |
1200 | 3360 if (am_Players[player_num].cards_at_hand[v7]!= -1 ) |
1194 | 3361 break; |
3362 } | |
3363 //if ( *v8 ) | |
3364 // { | |
3365 // do | |
3366 // { | |
3367 // //v8 += 4; | |
3368 // ++v7; | |
3369 // } | |
3370 // while ( *v8 == -1 ); | |
3371 v30 = v7; | |
3372 // } | |
3373 if ( am_byte_4E185D ) | |
3374 { | |
3375 // v9 = v3 + 8 * v7; | |
1200 | 3376 v10 = am_Players[player_num].arr_6C[v7].field_0;//*(am_player[0].arr_6C[0] + v9); |
3377 v11 = am_Players[player_num].arr_6C[v7].field_4;//*(&am_player[0].arr_6C[0][1] + v9); | |
1194 | 3378 pXYZW.left += v10; |
3379 pXYZW.right += v10; | |
3380 pXYZW.top += v11; | |
3381 pXYZW.bottom += v11; | |
3382 } | |
3383 if (v26.Inside(&pXYZW) ) | |
3384 break; | |
3385 | |
3386 v13=0; | |
3387 v14 = R8G8B8_to_TargetFormat(v13); | |
3388 DrawRect(&pXYZW, v14, 0); | |
3389 pXYZW.left += var18; | |
3390 pXYZW.right += var18; | |
3391 if ( am_byte_4E185D ) | |
3392 { | |
1200 | 3393 v16 = am_Players[player_num].arr_6C[v30].field_0;//*(am_player[0].arr_6C[0] + v15); |
3394 v17 = am_Players[player_num].arr_6C[v30].field_4;//*(&am_player[0].arr_6C[0][1] + v15); | |
1194 | 3395 pXYZW.left -= v16; |
3396 pXYZW.right -= v16; | |
3397 pXYZW.top -= v17; | |
3398 pXYZW.bottom -= v17; | |
3399 } | |
3400 ++v30; | |
3401 ++hand_index; | |
3402 if ( hand_index >= v25 ) | |
3403 return v28; | |
3404 } | |
3405 v28 = hand_index; | |
1197 | 3406 v18 = CanCardBePlayed(player_num, hand_index); |
1194 | 3407 if ( v18 ) |
3408 { | |
3409 v20=0x00FFFFFF; | |
3410 } | |
3411 else | |
3412 { | |
3413 v20=0x000000FF; | |
3414 } | |
3415 | |
3416 v21 = R8G8B8_to_TargetFormat(v20); | |
3417 DrawRect(&pXYZW, v21, 0); | |
0 | 3418 } |
3419 } | |
1194 | 3420 result = v28; |
0 | 3421 } |
1194 | 3422 return result; |
3423 | |
3424 | |
3425 | |
3426 // int v1; // esi@1 | |
3427 // signed int result; // eax@1 | |
3428 // int v3; // ebx@1 | |
3429 // char v4; // zf@1 | |
3430 // int v5; // eax@3 | |
3431 // int v6; // eax@4 | |
3432 // int v7; // ecx@6 | |
3433 // char *v8; // eax@6 | |
3434 // int v9; // eax@10 | |
3435 // int v10; // ecx@10 | |
3436 // int v11; // eax@10 | |
3437 // char v12; // ch@2@11 | |
3438 // int v13; // ST00_4@12 | |
3439 // unsigned __int16 v14; // ax@12 | |
3440 // int v15; // eax@13 | |
3441 // int v16; // ecx@13 | |
3442 // int v17; // eax@13 | |
3443 // char v18; // al@16 | |
3444 // char v19; // ch@2@16 | |
3445 // int v20; // ST00_4@19 | |
3446 // unsigned __int16 v21; // ax@19 | |
3447 // int pXYZW[4]; // [sp+Ch] [bp-3Ch]@3 | |
3448 // stru273 v26; // [sp+1Ch] [bp-2Ch]@2 | |
3449 // int a1a; // [sp+28h] [bp-20h]@1 | |
3450 // int v25; // [sp+2Ch] [bp-1Ch]@3 | |
3451 // int var18; // [sp+30h] [bp-18h]@3 | |
3452 // int i; // [sp+34h] [bp-14h]@4 | |
3453 // int v28; // [sp+38h] [bp-10h]@1 | |
3454 // int a2; // [sp+3Ch] [bp-Ch]@3 | |
3455 // int v30; // [sp+40h] [bp-8h]@1 | |
3456 // char v31; // [sp+44h] [bp-4h]@12 | |
3457 // char v32; // [sp+45h] [bp-3h]@12 | |
3458 // char v33; // [sp+46h] [bp-2h]@12 | |
3459 // | |
3460 // v1 = a1; | |
3461 // v30 = 0; | |
3462 // result = -1; | |
3463 // v3 = 188 * a1; | |
3464 // a1a = a1; | |
3465 // v4 = LOBYTE(am_Players[a1].field_20) == 0; | |
3466 // v28 = -1; | |
3467 // if ( !v4 ) | |
3468 // { | |
3469 // if ( v26._40DD2F() ) | |
3470 // { | |
3471 // v5 = GetPlayerHandCardCount(v1); | |
3472 // a2 = 0; | |
3473 // v25 = v5; | |
3474 // pXYZW[1] = 327; | |
3475 // pXYZW[3] = 455; | |
3476 // pXYZW[0] = (640 - 96 * v5) / (v5 + 1); | |
3477 // var18 = pXYZW[0] + 96; | |
3478 // pXYZW[2] = pXYZW[0] + 96; | |
3479 // if ( v5 > 0 ) | |
3480 // { | |
3481 // v6 = 47 * v1; | |
3482 // for ( i = 47 * v1; ; v6 = i ) | |
3483 // { | |
3484 // v7 = v30; | |
3485 // v8 = (char *)&am_Players[0].cards_at_hand[v30 + v6]; | |
3486 // if ( *(unsigned int *)v8 == -1 ) | |
3487 // { | |
3488 // do | |
3489 // { | |
3490 // v8 += 4; | |
3491 // ++v7; | |
3492 // } | |
3493 // while ( *(unsigned int *)v8 == -1 ); | |
3494 // v30 = v7; | |
3495 // } | |
3496 // if ( am_byte_4E185D ) | |
3497 // { | |
3498 // v9 = v3 + 8 * v7; | |
3499 // // v10 = *(int *)((char *)am_Players[0].arr_6C[0] + v9); | |
3500 // // v11 = *(int *)((char *)&am_Players[0].arr_6C[0][1] + v9); | |
3501 // pXYZW[0] += v10; | |
3502 // pXYZW[2] += v10; | |
3503 // pXYZW[1] += v11; | |
3504 // pXYZW[3] += v11; | |
3505 // } | |
3506 // if ( true)//v26.Inside(pXYZW) ) | |
3507 // break; | |
3508 // v31 = 0; | |
3509 // v32 = 0; | |
3510 // v33 = 0; | |
3511 // BYTE3(v13) = v12; | |
3512 // LOWORD(v13) = *(_WORD *)&v31; | |
3513 // BYTE2(v13) = 0; | |
3514 // v14 = R8G8B8_to_TargetFormat(v13); | |
3515 // // DrawRect(pXYZW, v14, 0); | |
3516 // pXYZW[0] += var18; | |
3517 // pXYZW[2] += var18; | |
3518 // if ( am_byte_4E185D ) | |
3519 // { | |
3520 // v15 = v3 + 8 * v30; | |
3521 // // v16 = *(int *)((char *)am_Players[0].arr_6C[0] + v15); | |
3522 // // v17 = *(int *)((char *)&am_Players[0].arr_6C[0][1] + v15); | |
3523 // pXYZW[0] -= v16; | |
3524 // pXYZW[2] -= v16; | |
3525 // pXYZW[1] -= v17; | |
3526 // pXYZW[3] -= v17; | |
3527 // } | |
3528 // ++v30; | |
3529 // ++a2; | |
3530 // if ( a2 >= v25 ) | |
3531 // goto LABEL_20; | |
3532 // } | |
3533 // v28 = a2; | |
3534 // v18 = am_40BF15(a1a, a2); | |
3535 // v31 = -1; | |
3536 // if ( v18 ) | |
3537 // { | |
3538 // v32 = -1; | |
3539 // v33 = -1; | |
3540 // } | |
3541 // else | |
3542 // { | |
3543 // v32 = 0; | |
3544 // v33 = 0; | |
3545 // } | |
3546 // BYTE3(v20) = v19; | |
3547 // LOWORD(v20) = *(_WORD *)&v31; | |
3548 // BYTE2(v20) = v33; | |
3549 // v21 = R8G8B8_to_TargetFormat(v20); | |
3550 // // DrawRect(pXYZW, v21, 0); | |
3551 // } | |
3552 // } | |
3553 //LABEL_20: | |
3554 // result = v28; | |
3555 // } | |
3556 // return result; | |
0 | 3557 } |
3558 // 4E185D: using guessed type char am_byte_4E185D; | |
3559 | |
3560 //----- (0040BCFB) -------------------------------------------------------- | |
1200 | 3561 bool am_40BCFB( int player_num, signed int card_slot_index ) |
3562 { | |
0 | 3563 int v2; // esi@2 |
3564 signed int v3; // edi@2 | |
3565 char *v4; // eax@2 | |
3566 int v5; // ecx@7 | |
3567 int v6; // ebx@7 | |
3568 int v7; // esi@8 | |
3569 int v8; // eax@8 | |
3570 int v9; // esi@8 | |
3571 int v10; // ecx@8 | |
3572 int v11; // eax@8 | |
3573 int v12; // eax@8 | |
3574 signed int v13; // edx@9 | |
3575 unsigned int v14; // eax@12 | |
3576 char result; // al@12 | |
1194 | 3577 int i; |
0 | 3578 |
1200 | 3579 if ( card_slot_index <= -1 ) |
1209 | 3580 return false; |
0 | 3581 v2 = 0; |
1194 | 3582 |
3583 for(i=0; i<10; ++i) | |
0 | 3584 { |
1200 | 3585 if ( am_Players[player_num].cards_at_hand[i] != -1 ) |
0 | 3586 { |
1200 | 3587 if ( card_slot_index == v2 ) |
0 | 3588 break; |
3589 ++v2; | |
3590 } | |
3591 } | |
1194 | 3592 |
1200 | 3593 if ( pCards[am_Players[player_num].cards_at_hand[i]].field_2B) |
0 | 3594 { |
1209 | 3595 ArcomageGame::PlaySound(22); |
1197 | 3596 v8 = GetPlayerHandCardCount(current_player_num); |
1209 | 3597 v10=am_Players[player_num].arr_6C[i].field_0 + (640 - 96 * v8) / (v8 + 1); |
3598 amuint_4FAA5C_blt_xy.x = v10; | |
3599 amuint_4FAA5C_blt_xy.y = am_Players[player_num].arr_6C[i].field_4 + 327;//v11; | |
0 | 3600 v12 = 0; |
1209 | 3601 |
0 | 3602 if ( !am_byte_4FAA75 ) |
3603 { | |
1209 | 3604 for (v12=0; v12<10; ++v12) |
3605 { | |
3606 if (shown_cards[v12].uCardId== -1) | |
3607 break; | |
3608 } | |
0 | 3609 } |
3610 pArcomageGame->field_F6 = 1; | |
1209 | 3611 amuint_4FAA54_blt_xy.x = (shown_cards[v12].field_8.x - v10) / 10; |
3612 amuint_4FAA54_blt_xy.y = (shown_cards[v12].field_8.y - 327) / 10; | |
3613 | |
3614 uCardID = am_Players[player_num].cards_at_hand[i]; | |
3615 am_Players[player_num].cards_at_hand[i] = -1; | |
0 | 3616 am_byte_4FAA77 = 0; |
1209 | 3617 return true; |
0 | 3618 } |
3619 else | |
1209 | 3620 return false; |
0 | 3621 } |
3622 // 4FAA75: using guessed type char am_byte_4FAA75; | |
3623 // 4FAA77: using guessed type char am_byte_4FAA77; | |
3624 // 4FAA78: using guessed type int amuint_4FAA78[]; | |
3625 // 4FAA80: using guessed type int amuint_4FAA80[]; | |
3626 // 4FAA84: using guessed type int amuint_4FAA84[]; | |
3627 // 4FABB8: using guessed type int dword_4FABB8; | |
3628 | |
3629 //----- (0040BE0E) -------------------------------------------------------- | |
1197 | 3630 bool PlayCard( int player_num, signed int card_slot_num ) |
3631 { | |
0 | 3632 bool result; // eax@0 |
3633 int v3; // ebp@1 | |
3634 int v4; // ecx@2 | |
1183 | 3635 ArcomagePlayer *v5; // esi@2 |
0 | 3636 int v6; // edi@2 |
3637 int v7; // eax@2 | |
3638 int v8; // ebx@8 | |
3639 int v9; // eax@8 | |
3640 int v10; // ebx@8 | |
3641 int v11; // ebp@8 | |
3642 int v12; // ecx@8 | |
3643 int v13; // eax@8 | |
3644 ArcomageCard *v14; // eax@8 | |
3645 int v15; // ecx@8 | |
3646 int v16; // ecx@8 | |
3647 | |
1197 | 3648 if ( card_slot_num <= -1 ) |
3649 return false; | |
0 | 3650 v4 = 0; |
1209 | 3651 |
3652 for (v6=0; v6<10; ++v6) | |
0 | 3653 { |
1209 | 3654 if ( am_Players[player_num].cards_at_hand[v6] != -1 ) |
0 | 3655 { |
1197 | 3656 if ( card_slot_num == v4 ) |
0 | 3657 break; |
3658 ++v4; | |
3659 } | |
3660 } | |
1209 | 3661 |
1200 | 3662 result = CanCardBePlayed(player_num, v6); |
0 | 3663 if ( result ) |
3664 { | |
1209 | 3665 ArcomageGame::PlaySound(23); |
1197 | 3666 v9 = GetPlayerHandCardCount(current_player_num); |
1209 | 3667 // v10 = 188 * v8 + 8 * v6; |
3668 // v11 = v6 + 47 * v3; | |
0 | 3669 pArcomageGame->field_F6 = 1; |
1185 | 3670 //v12 = 96 * v6 + *(int *)((char *)am_Players[0].arr_6C[0] + v10) + (640 - 96 * v9) / (v9 + 1); |
3671 // v13 = *(int *)((char *)&am_Players[0].arr_6C[0][1] + v10) + 327; | |
1209 | 3672 amuint_4FAA5C_blt_xy.x = am_Players[player_num].arr_6C[v6].field_0 + (640 - 96 * v9) / (v9 + 1);//v12; |
3673 amuint_4FAA5C_blt_xy.y = am_Players[player_num].arr_6C[v6].field_4 + 327;//v13; | |
3674 | |
3675 amuint_4FAA54_blt_xy.x = (272 - v12) / 5; | |
3676 amuint_4FAA54_blt_xy.y = -30; | |
1200 | 3677 |
1183 | 3678 v14 = &pCards[v5->cards_at_hand[v6]]; |
1197 | 3679 v5->resource_bricks -= v14->needed_bricks; |
3680 v5->resource_beasts -= v14->needed_beasts; | |
3681 v5->resource_gems -= v14->needed_gems; | |
1200 | 3682 played_card_id = am_Players[player_num].cards_at_hand[v6]; |
3683 am_Players[player_num].cards_at_hand[v6] = -1; | |
1197 | 3684 return true;; |
0 | 3685 } |
3686 else | |
1197 | 3687 return false; |
3688 | |
0 | 3689 } |
3690 | |
3691 //----- (0040BF15) -------------------------------------------------------- | |
1197 | 3692 bool CanCardBePlayed( int player_num, int hand_card_indx ) |
1185 | 3693 { |
0 | 3694 bool result; // eax@1 |
1197 | 3695 ArcomageCard *test_card; // ecx@1 |
3696 ArcomagePlayer *pPlayer; // esi@1 | |
3697 | |
3698 pPlayer = &am_Players[player_num]; | |
1185 | 3699 result = true; |
1197 | 3700 test_card = &pCards[am_Players[player_num].cards_at_hand[hand_card_indx]]; |
3701 if ( test_card->needed_quarry_level > pPlayer->quarry_level ) | |
1185 | 3702 result = false; |
1197 | 3703 if ( test_card->needed_magic_level > pPlayer->magic_level ) |
1185 | 3704 result = false; |
1200 | 3705 if ( test_card->needed_might_level > pPlayer->zoo_level ) |
1185 | 3706 result = false; |
1197 | 3707 if ( test_card->needed_bricks > pPlayer->resource_bricks ) |
1185 | 3708 result = false; |
1197 | 3709 if ( test_card->needed_gems > pPlayer->resource_gems ) |
1185 | 3710 result = false; |
1197 | 3711 if ( test_card->needed_beasts > pPlayer->resource_beasts ) |
1185 | 3712 result = false; |
0 | 3713 return result; |
3714 } | |
3715 | |
3716 | |
3717 | |
3718 | |
3719 //----- (0040BF77) -------------------------------------------------------- | |
3720 void __fastcall am_40BF77(int a1, unsigned int uCardID) | |
3721 { | |
1183 | 3722 // ArcomagePlayer *v2; // esi@1 |
3723 // int v3; // eax@1 | |
3724 // ArcomagePlayer *v4; // edi@1 | |
3725 // int v5; // eax@2 | |
3726 // char v6; // sf@2 | |
3727 // unsigned __int8 v7; // of@2 | |
3728 // int v8; // eax@3 | |
3729 // int v9; // eax@4 | |
3730 // char v10; // zf@5 | |
3731 // int v11; // eax@8 | |
3732 // unsigned __int8 v12; // zf@8 | |
3733 // char v13; // sf@8 | |
3734 // unsigned __int8 v14; // of@8 | |
3735 // int v15; // eax@9 | |
3736 // int v16; // eax@10 | |
3737 // char v17; // zf@12 | |
3738 // char v18; // al@15 | |
3739 // int v19; // eax@16 | |
3740 // int v20; // eax@17 | |
3741 // int v21; // eax@22 | |
3742 // int v22; // eax@23 | |
3743 // int v23; // eax@26 | |
3744 // int v24; // edx@26 | |
3745 // signed int v25; // ebx@26 | |
3746 // ArcomageCard *v26; // ebx@28 | |
3747 // int v27; // eax@28 | |
3748 // int v28; // edx@33 | |
3749 // int v29; // eax@33 | |
3750 // int v30; // eax@35 | |
3751 // int v31; // edx@40 | |
3752 // int v32; // eax@40 | |
3753 // int v33; // eax@42 | |
3754 // int v34; // edx@47 | |
3755 // int v35; // eax@47 | |
3756 // int v36; // eax@49 | |
3757 // int v37; // edx@54 | |
3758 // int v38; // eax@54 | |
3759 // bool v39; // eax@56 | |
3760 // int v40; // edx@61 | |
3761 // int v41; // eax@61 | |
3762 // int v42; // eax@63 | |
3763 // int v43; // edx@68 | |
3764 // int v44; // eax@68 | |
3765 // char v45; // al@70 | |
3766 // int v46; // eax@72 | |
3767 // int v47; // edx@77 | |
3768 // int v48; // eax@77 | |
3769 // int v49; // eax@79 | |
3770 // int v50; // edx@84 | |
3771 // int v51; // eax@84 | |
3772 // int v52; // eax@86 | |
3773 // int v53; // eax@91 | |
3774 // int v54; // edx@91 | |
3775 // int v55; // eax@93 | |
3776 // int v56; // eax@98 | |
3777 // int v57; // edx@98 | |
3778 // int v58; // eax@100 | |
3779 // int v59; // eax@105 | |
3780 // int v60; // edx@105 | |
3781 // int v61; // eax@107 | |
3782 // int v62; // eax@112 | |
3783 // int v63; // edx@112 | |
3784 // int v64; // eax@114 | |
3785 // int v65; // eax@119 | |
3786 // int v66; // edx@119 | |
3787 // int v67; // eax@121 | |
3788 // int v68; // eax@126 | |
3789 // int v69; // edx@126 | |
3790 // char v70; // al@128 | |
3791 // int v71; // eax@130 | |
3792 // int v72; // eax@135 | |
3793 // int v73; // edx@135 | |
3794 // int v74; // eax@137 | |
3795 // int v75; // eax@142 | |
3796 // int v76; // edx@142 | |
3797 // int v77; // eax@144 | |
3798 // int v78; // eax@151 | |
3799 // int v79; // ecx@151 | |
3800 // int v80; // eax@155 | |
3801 // int v81; // eax@162 | |
3802 // int v82; // ecx@162 | |
3803 // int v83; // eax@166 | |
3804 // int v84; // eax@173 | |
3805 // int v85; // ecx@173 | |
3806 // int v86; // eax@177 | |
3807 // int v87; // eax@184 | |
3808 // int v88; // ecx@184 | |
3809 // bool v89; // eax@188 | |
3810 // int v90; // eax@195 | |
3811 // int v91; // ecx@195 | |
3812 // int v92; // eax@199 | |
3813 // int v93; // eax@206 | |
3814 // int v94; // ecx@206 | |
3815 // char v95; // al@210 | |
3816 // int v96; // eax@211 | |
3817 // int v97; // edx@211 | |
3818 // int v98; // eax@211 | |
3819 // int v99; // eax@211 | |
3820 // int v100; // eax@212 | |
3821 // int v101; // eax@219 | |
3822 // int v102; // ecx@219 | |
3823 // int v103; // eax@223 | |
3824 // int v104; // eax@231 | |
3825 // int v105; // edx@231 | |
3826 // signed int v106; // ebx@231 | |
3827 // ArcomageCard *v107; // ebx@233 | |
3828 // int v108; // eax@233 | |
3829 // int v109; // edx@238 | |
3830 // int v110; // eax@238 | |
3831 // int v111; // eax@240 | |
3832 // int v112; // edx@245 | |
3833 // int v113; // eax@245 | |
3834 // int v114; // eax@247 | |
3835 // int v115; // edx@252 | |
3836 // int v116; // eax@252 | |
3837 // int v117; // eax@254 | |
3838 // int v118; // edx@259 | |
3839 // int v119; // eax@259 | |
3840 // bool v120; // eax@261 | |
3841 // int v121; // edx@266 | |
3842 // int v122; // eax@266 | |
3843 // int v123; // eax@268 | |
3844 // int v124; // edx@273 | |
3845 // int v125; // eax@273 | |
3846 // char v126; // al@275 | |
3847 // int v127; // eax@277 | |
3848 // int v128; // edx@282 | |
3849 // int v129; // eax@282 | |
3850 // int v130; // eax@284 | |
3851 // int v131; // edx@289 | |
3852 // int v132; // eax@289 | |
3853 // int v133; // eax@291 | |
3854 // int v134; // eax@296 | |
3855 // int v135; // edx@296 | |
3856 // int v136; // eax@298 | |
3857 // int v137; // eax@303 | |
3858 // int v138; // edx@303 | |
3859 // int v139; // eax@305 | |
3860 // int v140; // eax@310 | |
3861 // int v141; // edx@310 | |
3862 // int v142; // eax@312 | |
3863 // int v143; // eax@317 | |
3864 // int v144; // edx@317 | |
3865 // int v145; // eax@319 | |
3866 // int v146; // eax@324 | |
3867 // int v147; // edx@324 | |
3868 // int v148; // eax@326 | |
3869 // int v149; // eax@331 | |
3870 // int v150; // edx@331 | |
3871 // char v151; // al@333 | |
3872 // int v152; // eax@335 | |
3873 // int v153; // eax@340 | |
3874 // int v154; // edx@340 | |
3875 // int v155; // eax@342 | |
3876 // int v156; // eax@347 | |
3877 // int v157; // edx@347 | |
3878 // int v158; // eax@349 | |
3879 // int v159; // eax@356 | |
3880 // int v160; // ecx@356 | |
3881 // int v161; // eax@360 | |
3882 // int v162; // eax@367 | |
3883 // int v163; // ecx@367 | |
3884 // int v164; // eax@371 | |
3885 // int v165; // eax@378 | |
3886 // int v166; // ecx@378 | |
3887 // int v167; // eax@382 | |
3888 // int v168; // eax@389 | |
3889 // int v169; // ecx@389 | |
3890 // bool v170; // eax@393 | |
3891 // int v171; // eax@400 | |
3892 // int v172; // ecx@400 | |
3893 // int v173; // eax@404 | |
3894 // int v174; // eax@411 | |
3895 // int v175; // ecx@411 | |
3896 // char v176; // al@415 | |
3897 // int v177; // eax@416 | |
3898 // int v178; // edx@416 | |
3899 // int v179; // eax@416 | |
3900 // int v180; // eax@416 | |
3901 // int v181; // eax@417 | |
3902 // int v182; // eax@424 | |
3903 // int v183; // ecx@424 | |
3904 // int v184; // eax@429 | |
3905 // int v185; // ecx@429 | |
3906 // signed int v186; // esi@511 | |
3907 // Vec2_int_ v187; // [sp+Ch] [bp-64h]@488 | |
3908 // //int v188; // [sp+10h] [bp-60h]@488 | |
3909 // int v189; // [sp+14h] [bp-5Ch]@1 | |
3910 // ArcomageCard *pCard; // [sp+18h] [bp-58h]@1 | |
3911 // int v191; // [sp+1Ch] [bp-54h]@1 | |
3912 // int v192; // [sp+20h] [bp-50h]@1 | |
3913 // int v193; // [sp+24h] [bp-4Ch]@1 | |
3914 // int v194; // [sp+28h] [bp-48h]@1 | |
3915 // int v195; // [sp+2Ch] [bp-44h]@1 | |
3916 // int v196; // [sp+30h] [bp-40h]@1 | |
3917 // int v197; // [sp+34h] [bp-3Ch]@1 | |
3918 // int v198; // [sp+38h] [bp-38h]@1 | |
3919 // int v199; // [sp+3Ch] [bp-34h]@1 | |
3920 // int v200; // [sp+40h] [bp-30h]@1 | |
3921 // int v201; // [sp+44h] [bp-2Ch]@1 | |
3922 // int v202; // [sp+48h] [bp-28h]@1 | |
3923 // int v203; // [sp+4Ch] [bp-24h]@1 | |
3924 // int v204; // [sp+50h] [bp-20h]@1 | |
3925 // bool v205; // [sp+54h] [bp-1Ch]@1 | |
3926 // int v206; // [sp+58h] [bp-18h]@1 | |
3927 // int v207; // [sp+5Ch] [bp-14h]@1 | |
3928 // int v208; // [sp+60h] [bp-10h]@1 | |
3929 // int v209; // [sp+64h] [bp-Ch]@1 | |
3930 // int v210; // [sp+68h] [bp-8h]@1 | |
3931 // int v211; // [sp+6Ch] [bp-4h]@1 | |
3932 // | |
3933 // v194 = 0; | |
3934 // v210 = 0; | |
3935 // v208 = 0; | |
3936 // v197 = 0; | |
3937 // v205 = 0; | |
3938 // v203 = 0; | |
3939 // v201 = 0; | |
3940 // v199 = 0; | |
3941 // v192 = 0; | |
3942 // v196 = 0; | |
3943 // v211 = 0; | |
3944 // v209 = 0; | |
3945 // v207 = 0; | |
3946 // v206 = 0; | |
3947 // v204 = 0; | |
3948 // v202 = 0; | |
3949 // v200 = 0; | |
3950 // v198 = 0; | |
3951 // v191 = 0; | |
3952 // v195 = 0; | |
3953 // v193 = a1; | |
3954 // v2 = &stru_505708[a1]; | |
3955 // pCard = &pCards[uCardID]; | |
3956 // v3 = pCard->field_2C; | |
3957 // v189 = (a1 + 1) % 2; | |
3958 // v4 = &stru_505708[v189]; | |
3959 // switch ( v3 ) | |
3960 // { | |
3961 // case 2: | |
3962 // v5 = v2->field_2C; | |
3963 // v7 = __OFSUB__(v5, v4->field_2C); | |
3964 // v6 = v5 - v4->field_2C < 0; | |
3965 // goto LABEL_18; | |
3966 // case 3: | |
3967 // v8 = v2->field_30; | |
3968 // v7 = __OFSUB__(v8, v4->field_30); | |
3969 // v6 = v8 - v4->field_30 < 0; | |
3970 // goto LABEL_18; | |
3971 // case 4: | |
3972 // v9 = v2->field_34; | |
3973 // v7 = __OFSUB__(v9, v4->field_34); | |
3974 // v6 = v9 - v4->field_34 < 0; | |
3975 // goto LABEL_18; | |
3976 // case 5: | |
3977 // v10 = v2->field_2C == v4->field_2C; | |
3978 // goto LABEL_21; | |
3979 // case 6: | |
3980 // v10 = v2->field_30 == v4->field_30; | |
3981 // goto LABEL_21; | |
3982 // case 7: | |
3983 // v10 = v2->field_34 == v4->field_34; | |
3984 // goto LABEL_21; | |
3985 // case 8: | |
3986 // v11 = v2->field_2C; | |
3987 // v14 = __OFSUB__(v11, v4->field_2C); | |
3988 // v12 = v11 == v4->field_2C; | |
3989 // v13 = v11 - v4->field_2C < 0; | |
3990 // goto LABEL_24; | |
3991 // case 9: | |
3992 // v15 = v2->field_30; | |
3993 // v14 = __OFSUB__(v15, v4->field_30); | |
3994 // v12 = v15 == v4->field_30; | |
3995 // v13 = v15 - v4->field_30 < 0; | |
3996 // goto LABEL_24; | |
3997 // case 10: | |
3998 // v16 = v2->field_34; | |
3999 // v14 = __OFSUB__(v16, v4->field_34); | |
4000 // v12 = v16 == v4->field_34; | |
4001 // v13 = v16 - v4->field_34 < 0; | |
4002 // goto LABEL_24; | |
4003 // case 11: | |
4004 // v10 = v2->field_28 == 0; | |
4005 // goto LABEL_21; | |
4006 // case 12: | |
4007 // v17 = v2->field_28 == 0; | |
4008 // goto LABEL_15; | |
4009 // case 13: | |
4010 // v10 = v4->field_28 == 0; | |
4011 // goto LABEL_21; | |
4012 // case 14: | |
4013 // v17 = v4->field_28 == 0; | |
4014 //LABEL_15: | |
4015 // v18 = !v17; | |
4016 // goto LABEL_25; | |
4017 // case 15: | |
4018 // v19 = v2->field_28; | |
4019 // v7 = __OFSUB__(v19, v4->field_28); | |
4020 // v6 = v19 - v4->field_28 < 0; | |
4021 // goto LABEL_18; | |
4022 // case 16: | |
4023 // v20 = v2->field_24; | |
4024 // v7 = __OFSUB__(v20, v4->field_24); | |
4025 // v6 = v20 - v4->field_24 < 0; | |
4026 //LABEL_18: | |
4027 // v18 = v6 ^ v7; | |
4028 // goto LABEL_25; | |
4029 // case 17: | |
4030 // v10 = v2->field_28 == v4->field_28; | |
4031 // goto LABEL_21; | |
4032 // case 18: | |
4033 // v10 = v2->field_24 == v4->field_24; | |
4034 //LABEL_21: | |
4035 // v18 = v10; | |
4036 // goto LABEL_25; | |
4037 // case 19: | |
4038 // v21 = v2->field_28; | |
4039 // v14 = __OFSUB__(v21, v4->field_28); | |
4040 // v12 = v21 == v4->field_28; | |
4041 // v13 = v21 - v4->field_28 < 0; | |
4042 // goto LABEL_24; | |
4043 // case 20: | |
4044 // v22 = v2->field_24; | |
4045 // v14 = __OFSUB__(v22, v4->field_24); | |
4046 // v12 = v22 == v4->field_24; | |
4047 // v13 = v22 - v4->field_24 < 0; | |
4048 //LABEL_24: | |
4049 // v18 = !((unsigned __int8)(v13 ^ v14) | v12); | |
4050 //LABEL_25: | |
4051 // if ( v18 ) | |
4052 // goto LABEL_26; | |
4053 // goto LABEL_231; | |
4054 // default: | |
4055 //LABEL_26: | |
4056 // v23 = BYTE1(pCard->field_30); | |
4057 // v24 = v23 + (LOBYTE(pCard->field_30) == 1); | |
4058 // v25 = 0; | |
4059 // dword_4FAA68 = v23 + (LOBYTE(pCard->field_30) == 1); | |
4060 // dword_4FAA64 = v23; | |
4061 // if ( v23 > 0 ) | |
4062 // { | |
4063 // do | |
4064 // { | |
4065 // am_40A283(v193, v24); | |
4066 // ++v25; | |
4067 // } | |
4068 // while ( v25 < SBYTE1(pCard->field_30) ); | |
4069 // } | |
4070 // v26 = pCard; | |
1185 | 4071 // am_byte_4FAA77 = GetPlayerHandCardCount(v193) > dword_4E1874; |
1183 | 4072 // LOBYTE(v27) = BYTE2(pCard->field_30); |
4073 // if ( (_BYTE)v27 ) | |
4074 // { | |
4075 // if ( (_BYTE)v27 == 99 ) | |
4076 // { | |
4077 // v28 = v2->field_2C; | |
4078 // v29 = v4->field_2C; | |
4079 // if ( v28 < v29 ) | |
4080 // { | |
4081 // v2->field_2C = v29; | |
4082 // v194 = v29 - v28; | |
4083 // } | |
4084 // } | |
4085 // else | |
4086 // { | |
4087 // v27 = (char)v27; | |
4088 // v6 = (char)v27 + v2->field_2C < 0; | |
4089 // v2->field_2C += (char)v27; | |
4090 // if ( v6 ) | |
4091 // v2->field_2C = 0; | |
4092 // v194 = v27; | |
4093 // } | |
4094 // } | |
4095 // LOBYTE(v30) = BYTE3(v26->field_30); | |
4096 // if ( (_BYTE)v30 ) | |
4097 // { | |
4098 // if ( (_BYTE)v30 == 99 ) | |
4099 // { | |
4100 // v31 = v2->field_30; | |
4101 // v32 = v4->field_30; | |
4102 // if ( v31 < v32 ) | |
4103 // { | |
4104 // v2->field_30 = v32; | |
4105 // v210 = v32 - v31; | |
4106 // } | |
4107 // } | |
4108 // else | |
4109 // { | |
4110 // v30 = (char)v30; | |
4111 // v6 = (char)v30 + v2->field_30 < 0; | |
4112 // v2->field_30 += (char)v30; | |
4113 // if ( v6 ) | |
4114 // v2->field_30 = 0; | |
4115 // v210 = v30; | |
4116 // } | |
4117 // } | |
4118 // LOBYTE(v33) = LOBYTE(v26->field_34); | |
4119 // if ( (_BYTE)v33 ) | |
4120 // { | |
4121 // if ( (_BYTE)v33 == 99 ) | |
4122 // { | |
4123 // v34 = v2->field_34; | |
4124 // v35 = v4->field_34; | |
4125 // if ( v34 < v35 ) | |
4126 // { | |
4127 // v2->field_34 = v35; | |
4128 // v208 = v35 - v34; | |
4129 // } | |
4130 // } | |
4131 // else | |
4132 // { | |
4133 // v33 = (char)v33; | |
4134 // v6 = (char)v33 + v2->field_34 < 0; | |
4135 // v2->field_34 += (char)v33; | |
4136 // if ( v6 ) | |
4137 // v2->field_34 = 0; | |
4138 // v208 = v33; | |
4139 // } | |
4140 // } | |
4141 // LOBYTE(v36) = BYTE1(v26->field_34); | |
4142 // if ( (_BYTE)v36 ) | |
4143 // { | |
4144 // if ( (_BYTE)v36 == 99 ) | |
4145 // { | |
4146 // v37 = v2->field_38; | |
4147 // v38 = v4->field_38; | |
4148 // if ( v37 < v38 ) | |
4149 // { | |
4150 // v2->field_38 = v38; | |
4151 // v197 = v38 - v37; | |
4152 // } | |
4153 // } | |
4154 // else | |
4155 // { | |
4156 // v36 = (char)v36; | |
4157 // v6 = (char)v36 + v2->field_38 < 0; | |
4158 // v2->field_38 += (char)v36; | |
4159 // if ( v6 ) | |
4160 // v2->field_38 = 0; | |
4161 // v197 = v36; | |
4162 // } | |
4163 // } | |
4164 // LOBYTE(v39) = BYTE2(v26->field_34); | |
4165 // if ( v39 ) | |
4166 // { | |
4167 // if ( v39 == 99 ) | |
4168 // { | |
4169 // v40 = v2->field_3C; | |
4170 // v41 = v4->field_3C; | |
4171 // if ( v40 < v41 ) | |
4172 // { | |
4173 // v2->field_3C = v41; | |
4174 // v205 = v41 - v40; | |
4175 // } | |
4176 // } | |
4177 // else | |
4178 // { | |
4179 // v39 = v39; | |
4180 // v6 = v39 + v2->field_3C < 0; | |
4181 // v2->field_3C += v39; | |
4182 // if ( v6 ) | |
4183 // v2->field_3C = 0; | |
4184 // v205 = v39; | |
4185 // } | |
4186 // } | |
4187 // LOBYTE(v42) = BYTE3(v26->field_34); | |
4188 // if ( (_BYTE)v42 ) | |
4189 // { | |
4190 // if ( (_BYTE)v42 == 99 ) | |
4191 // { | |
4192 // v43 = v2->field_40; | |
4193 // v44 = v4->field_40; | |
4194 // if ( v43 < v44 ) | |
4195 // { | |
4196 // v2->field_40 = v44; | |
4197 // v203 = v44 - v43; | |
4198 // } | |
4199 // } | |
4200 // else | |
4201 // { | |
4202 // v42 = (char)v42; | |
4203 // v6 = (char)v42 + v2->field_40 < 0; | |
4204 // v2->field_40 += (char)v42; | |
4205 // if ( v6 ) | |
4206 // v2->field_40 = 0; | |
4207 // v203 = v42; | |
4208 // } | |
4209 // } | |
4210 // v45 = v26->field_38[0]; | |
4211 // if ( v45 ) | |
4212 // { | |
4213 // v196 = am_40D402(v193, v45); | |
4214 // v192 = v26->field_38[0] - v196; | |
4215 // } | |
4216 // LOBYTE(v46) = v26->field_38[1]; | |
4217 // if ( (_BYTE)v46 ) | |
4218 // { | |
4219 // if ( (_BYTE)v46 == 99 ) | |
4220 // { | |
4221 // v47 = v2->field_28; | |
4222 // v48 = v4->field_28; | |
4223 // if ( v47 < v48 ) | |
4224 // { | |
4225 // v2->field_28 = v48; | |
4226 // v201 = v48 - v47; | |
4227 // } | |
4228 // } | |
4229 // else | |
4230 // { | |
4231 // v46 = (char)v46; | |
4232 // v6 = (char)v46 + v2->field_28 < 0; | |
4233 // v2->field_28 += (char)v46; | |
4234 // if ( v6 ) | |
4235 // v2->field_28 = 0; | |
4236 // v201 = v46; | |
4237 // } | |
4238 // } | |
4239 // LOBYTE(v49) = v26->field_38[2]; | |
4240 // if ( (_BYTE)v49 ) | |
4241 // { | |
4242 // if ( (_BYTE)v49 == 99 ) | |
4243 // { | |
4244 // v50 = v2->field_24; | |
4245 // v51 = v4->field_24; | |
4246 // if ( v50 < v51 ) | |
4247 // { | |
4248 // v2->field_24 = v51; | |
4249 // v199 = v51 - v50; | |
4250 // } | |
4251 // } | |
4252 // else | |
4253 // { | |
4254 // v49 = (char)v49; | |
4255 // v6 = (char)v49 + v2->field_24 < 0; | |
4256 // v2->field_24 += (char)v49; | |
4257 // if ( v6 ) | |
4258 // v2->field_24 = 0; | |
4259 // v199 = v49; | |
4260 // } | |
4261 // } | |
4262 // LOBYTE(v52) = v26->field_38[3]; | |
4263 // if ( (_BYTE)v52 ) | |
4264 // { | |
4265 // if ( (_BYTE)v52 == 99 ) | |
4266 // { | |
4267 // v53 = v2->field_2C; | |
4268 // v54 = v4->field_2C; | |
4269 // if ( v53 > v54 ) | |
4270 // { | |
4271 // v4->field_2C = v53; | |
4272 // v211 = v53 - v54; | |
4273 // } | |
4274 // } | |
4275 // else | |
4276 // { | |
4277 // v52 = (char)v52; | |
4278 // v6 = (char)v52 + v4->field_2C < 0; | |
4279 // v4->field_2C += (char)v52; | |
4280 // if ( v6 ) | |
4281 // v4->field_2C = 0; | |
4282 // v211 = v52; | |
4283 // } | |
4284 // } | |
4285 // LOBYTE(v55) = v26->field_38[4]; | |
4286 // if ( (_BYTE)v55 ) | |
4287 // { | |
4288 // if ( (_BYTE)v55 == 99 ) | |
4289 // { | |
4290 // v56 = v2->field_30; | |
4291 // v57 = v4->field_30; | |
4292 // if ( v56 > v57 ) | |
4293 // { | |
4294 // v4->field_30 = v56; | |
4295 // v209 = v56 - v57; | |
4296 // } | |
4297 // } | |
4298 // else | |
4299 // { | |
4300 // v55 = (char)v55; | |
4301 // v6 = (char)v55 + v4->field_30 < 0; | |
4302 // v4->field_30 += (char)v55; | |
4303 // if ( v6 ) | |
4304 // v4->field_30 = 0; | |
4305 // v209 = v55; | |
4306 // } | |
4307 // } | |
4308 // LOBYTE(v58) = v26->field_38[5]; | |
4309 // if ( (_BYTE)v58 ) | |
4310 // { | |
4311 // if ( (_BYTE)v58 == 99 ) | |
4312 // { | |
4313 // v59 = v2->field_34; | |
4314 // v60 = v4->field_34; | |
4315 // if ( v59 > v60 ) | |
4316 // { | |
4317 // v4->field_34 = v59; | |
4318 // v207 = v59 - v60; | |
4319 // } | |
4320 // } | |
4321 // else | |
4322 // { | |
4323 // v58 = (char)v58; | |
4324 // v6 = (char)v58 + v4->field_34 < 0; | |
4325 // v4->field_34 += (char)v58; | |
4326 // if ( v6 ) | |
4327 // v4->field_34 = 0; | |
4328 // v207 = v58; | |
4329 // } | |
4330 // } | |
4331 // LOBYTE(v61) = v26->field_38[6]; | |
4332 // if ( (_BYTE)v61 ) | |
4333 // { | |
4334 // if ( (_BYTE)v61 == 99 ) | |
4335 // { | |
4336 // v62 = v2->field_38; | |
4337 // v63 = v4->field_38; | |
4338 // if ( v62 > v63 ) | |
4339 // { | |
4340 // v4->field_38 = v62; | |
4341 // v206 = v62 - v63; | |
4342 // } | |
4343 // } | |
4344 // else | |
4345 // { | |
4346 // v61 = (char)v61; | |
4347 // v6 = (char)v61 + v4->field_38 < 0; | |
4348 // v4->field_38 += (char)v61; | |
4349 // if ( v6 ) | |
4350 // v4->field_38 = 0; | |
4351 // v206 = v61; | |
4352 // } | |
4353 // } | |
4354 // LOBYTE(v64) = v26->field_38[7]; | |
4355 // if ( (_BYTE)v64 ) | |
4356 // { | |
4357 // if ( (_BYTE)v64 == 99 ) | |
4358 // { | |
4359 // v65 = v2->field_3C; | |
4360 // v66 = v4->field_3C; | |
4361 // if ( v65 > v66 ) | |
4362 // { | |
4363 // v4->field_3C = v65; | |
4364 // v204 = v65 - v66; | |
4365 // } | |
4366 // } | |
4367 // else | |
4368 // { | |
4369 // v64 = (char)v64; | |
4370 // v6 = (char)v64 + v4->field_3C < 0; | |
4371 // v4->field_3C += (char)v64; | |
4372 // if ( v6 ) | |
4373 // v4->field_3C = 0; | |
4374 // v204 = v64; | |
4375 // } | |
4376 // } | |
4377 // LOBYTE(v67) = v26->field_38[8]; | |
4378 // if ( (_BYTE)v67 ) | |
4379 // { | |
4380 // if ( (_BYTE)v67 == 99 ) | |
4381 // { | |
4382 // v68 = v2->field_40; | |
4383 // v69 = v4->field_40; | |
4384 // if ( v68 > v69 ) | |
4385 // { | |
4386 // v4->field_40 = v68; | |
4387 // v202 = v68 - v69; | |
4388 // } | |
4389 // } | |
4390 // else | |
4391 // { | |
4392 // v67 = (char)v67; | |
4393 // v6 = (char)v67 + v4->field_40 < 0; | |
4394 // v4->field_40 += (char)v67; | |
4395 // if ( v6 ) | |
4396 // v4->field_40 = 0; | |
4397 // v202 = v67; | |
4398 // } | |
4399 // } | |
4400 // v70 = v26->field_38[9]; | |
4401 // if ( v70 ) | |
4402 // { | |
4403 // v195 = am_40D402(v189, v70); | |
4404 // v191 = v26->field_38[9] - v195; | |
4405 // } | |
4406 // LOBYTE(v71) = v26->field_38[10]; | |
4407 // if ( (_BYTE)v71 ) | |
4408 // { | |
4409 // if ( (_BYTE)v71 == 99 ) | |
4410 // { | |
4411 // v72 = v2->field_28; | |
4412 // v73 = v4->field_28; | |
4413 // if ( v72 > v73 ) | |
4414 // { | |
4415 // v4->field_28 = v72; | |
4416 // v200 = v72 - v73; | |
4417 // } | |
4418 // } | |
4419 // else | |
4420 // { | |
4421 // v71 = (char)v71; | |
4422 // v6 = (char)v71 + v4->field_28 < 0; | |
4423 // v4->field_28 += (char)v71; | |
4424 // if ( v6 ) | |
4425 // v4->field_28 = 0; | |
4426 // v200 = v71; | |
4427 // } | |
4428 // } | |
4429 // LOBYTE(v74) = v26->field_38[11]; | |
4430 // if ( (_BYTE)v74 ) | |
4431 // { | |
4432 // if ( (_BYTE)v74 == 99 ) | |
4433 // { | |
4434 // v75 = v2->field_24; | |
4435 // v76 = v4->field_24; | |
4436 // if ( v75 > v76 ) | |
4437 // { | |
4438 // v4->field_24 = v75; | |
4439 // v198 = v75 - v76; | |
4440 // } | |
4441 // } | |
4442 // else | |
4443 // { | |
4444 // v74 = (char)v74; | |
4445 // v6 = (char)v74 + v4->field_24 < 0; | |
4446 // v4->field_24 += (char)v74; | |
4447 // if ( v6 ) | |
4448 // v4->field_24 = 0; | |
4449 // v198 = v74; | |
4450 // } | |
4451 // } | |
4452 // LOBYTE(v77) = v26->field_38[12]; | |
4453 // if ( (_BYTE)v77 ) | |
4454 // { | |
4455 // if ( (_BYTE)v77 == 99 ) | |
4456 // { | |
4457 // v78 = v2->field_2C; | |
4458 // v79 = v4->field_2C; | |
4459 // if ( v78 != v79 ) | |
4460 // { | |
4461 // if ( v78 <= v79 ) | |
4462 // { | |
4463 // v2->field_2C = v79; | |
4464 // v194 = v79 - v78; | |
4465 // } | |
4466 // else | |
4467 // { | |
4468 // v4->field_2C = v78; | |
4469 // v211 = v78 - v79; | |
4470 // } | |
4471 // } | |
4472 // } | |
4473 // else | |
4474 // { | |
4475 // v77 = (char)v77; | |
4476 // v2->field_2C += (char)v77; | |
4477 // v4->field_2C += (char)v77; | |
4478 // if ( v2->field_2C < 0 ) | |
4479 // v2->field_2C = 0; | |
4480 // if ( v4->field_2C < 0 ) | |
4481 // v4->field_2C = 0; | |
4482 // v194 = v77; | |
4483 // v211 = v77; | |
4484 // } | |
4485 // } | |
4486 // LOBYTE(v80) = v26->field_38[13]; | |
4487 // if ( (_BYTE)v80 ) | |
4488 // { | |
4489 // if ( (_BYTE)v80 == 99 ) | |
4490 // { | |
4491 // v81 = v2->field_30; | |
4492 // v82 = v4->field_30; | |
4493 // if ( v81 != v82 ) | |
4494 // { | |
4495 // if ( v81 <= v82 ) | |
4496 // { | |
4497 // v2->field_30 = v82; | |
4498 // v210 = v82 - v81; | |
4499 // } | |
4500 // else | |
4501 // { | |
4502 // v4->field_30 = v81; | |
4503 // v209 = v81 - v82; | |
4504 // } | |
4505 // } | |
4506 // } | |
4507 // else | |
4508 // { | |
4509 // v80 = (char)v80; | |
4510 // v2->field_30 += (char)v80; | |
4511 // v4->field_30 += (char)v80; | |
4512 // if ( v2->field_30 < 0 ) | |
4513 // v2->field_30 = 0; | |
4514 // if ( v4->field_30 < 0 ) | |
4515 // v4->field_30 = 0; | |
4516 // v209 = v80; | |
4517 // v210 = v80; | |
4518 // } | |
4519 // } | |
4520 // LOBYTE(v83) = v26->field_38[14]; | |
4521 // if ( (_BYTE)v83 ) | |
4522 // { | |
4523 // if ( (_BYTE)v83 == 99 ) | |
4524 // { | |
4525 // v84 = v2->field_34; | |
4526 // v85 = v4->field_34; | |
4527 // if ( v84 != v85 ) | |
4528 // { | |
4529 // if ( v84 <= v85 ) | |
4530 // { | |
4531 // v2->field_34 = v85; | |
4532 // v208 = v85 - v84; | |
4533 // } | |
4534 // else | |
4535 // { | |
4536 // v4->field_34 = v84; | |
4537 // v207 = v84 - v85; | |
4538 // } | |
4539 // } | |
4540 // } | |
4541 // else | |
4542 // { | |
4543 // v83 = (char)v83; | |
4544 // v2->field_34 += (char)v83; | |
4545 // v4->field_34 += (char)v83; | |
4546 // if ( v2->field_34 < 0 ) | |
4547 // v2->field_34 = 0; | |
4548 // if ( v4->field_34 < 0 ) | |
4549 // v4->field_34 = 0; | |
4550 // v208 = v83; | |
4551 // v207 = v83; | |
4552 // } | |
4553 // } | |
4554 // LOBYTE(v86) = v26->field_38[15]; | |
4555 // if ( (_BYTE)v86 ) | |
4556 // { | |
4557 // if ( (_BYTE)v86 == 99 ) | |
4558 // { | |
4559 // v87 = v2->field_38; | |
4560 // v88 = v4->field_38; | |
4561 // if ( v87 != v88 ) | |
4562 // { | |
4563 // if ( v87 <= v88 ) | |
4564 // { | |
4565 // v2->field_38 = v88; | |
4566 // v197 = v88 - v87; | |
4567 // } | |
4568 // else | |
4569 // { | |
4570 // v4->field_38 = v87; | |
4571 // v206 = v87 - v88; | |
4572 // } | |
4573 // } | |
4574 // } | |
4575 // else | |
4576 // { | |
4577 // v86 = (char)v86; | |
4578 // v2->field_38 += (char)v86; | |
4579 // v4->field_38 += (char)v86; | |
4580 // if ( v2->field_38 < 0 ) | |
4581 // v2->field_38 = 0; | |
4582 // if ( v4->field_38 < 0 ) | |
4583 // v4->field_38 = 0; | |
4584 // v197 = v86; | |
4585 // v206 = v86; | |
4586 // } | |
4587 // } | |
4588 // LOBYTE(v89) = v26->field_48[0]; | |
4589 // if ( v89 ) | |
4590 // { | |
4591 // if ( v89 == 99 ) | |
4592 // { | |
4593 // v90 = v2->field_3C; | |
4594 // v91 = v4->field_3C; | |
4595 // if ( v90 != v91 ) | |
4596 // { | |
4597 // if ( v90 <= v91 ) | |
4598 // { | |
4599 // v205 = v91 > v90; | |
4600 // v2->field_3C = v91; | |
4601 // } | |
4602 // else | |
4603 // { | |
4604 // v204 = 1; | |
4605 // v4->field_3C = v90; | |
4606 // } | |
4607 // } | |
4608 // } | |
4609 // else | |
4610 // { | |
4611 // v89 = v89; | |
4612 // v2->field_3C += v89; | |
4613 // v4->field_3C += v89; | |
4614 // if ( v2->field_3C < 0 ) | |
4615 // v2->field_3C = 0; | |
4616 // if ( v4->field_3C < 0 ) | |
4617 // v4->field_3C = 0; | |
4618 // v205 = v89; | |
4619 // v204 = v89; | |
4620 // } | |
4621 // } | |
4622 // LOBYTE(v92) = v26->field_48[1]; | |
4623 // if ( (_BYTE)v92 ) | |
4624 // { | |
4625 // if ( (_BYTE)v92 == 99 ) | |
4626 // { | |
4627 // v93 = v2->field_40; | |
4628 // v94 = v4->field_40; | |
4629 // if ( v93 != v94 ) | |
4630 // { | |
4631 // if ( v93 <= v94 ) | |
4632 // { | |
4633 // v2->field_40 = v94; | |
4634 // v203 = v94 - v93; | |
4635 // } | |
4636 // else | |
4637 // { | |
4638 // v4->field_40 = v93; | |
4639 // v202 = v93 - v94; | |
4640 // } | |
4641 // } | |
4642 // } | |
4643 // else | |
4644 // { | |
4645 // v92 = (char)v92; | |
4646 // v2->field_40 += (char)v92; | |
4647 // v4->field_40 += (char)v92; | |
4648 // if ( v2->field_40 < 0 ) | |
4649 // v2->field_40 = 0; | |
4650 // if ( v4->field_40 < 0 ) | |
4651 // v4->field_40 = 0; | |
4652 // v203 = v92; | |
4653 // v202 = v92; | |
4654 // } | |
4655 // } | |
4656 // v95 = v26->field_48[2]; | |
4657 // if ( v95 ) | |
4658 // { | |
4659 // v96 = am_40D402(v193, v95); | |
4660 // v97 = v26->field_48[2]; | |
4661 // v196 = v96; | |
4662 // v98 = am_40D402(v189, v97); | |
4663 // v195 = v98; | |
4664 // v99 = v26->field_48[2] - v98; | |
4665 // v192 = v26->field_48[2] - v196; | |
4666 // v191 = v99; | |
4667 // } | |
4668 // LOBYTE(v100) = v26->field_48[3]; | |
4669 // if ( (_BYTE)v100 ) | |
4670 // { | |
4671 // if ( (_BYTE)v100 == 99 ) | |
4672 // { | |
4673 // v101 = v2->field_28; | |
4674 // v102 = v4->field_28; | |
4675 // if ( v101 != v102 ) | |
4676 // { | |
4677 // if ( v101 <= v102 ) | |
4678 // { | |
4679 // v2->field_28 = v102; | |
4680 // v201 = v102 - v101; | |
4681 // } | |
4682 // else | |
4683 // { | |
4684 // v4->field_28 = v101; | |
4685 // v200 = v101 - v102; | |
4686 // } | |
4687 // } | |
4688 // } | |
4689 // else | |
4690 // { | |
4691 // v100 = (char)v100; | |
4692 // v2->field_28 += (char)v100; | |
4693 // v4->field_28 += (char)v100; | |
4694 // if ( v2->field_28 < 0 ) | |
4695 // v2->field_28 = 0; | |
4696 // if ( v4->field_28 < 0 ) | |
4697 // v4->field_28 = 0; | |
4698 // v201 = v100; | |
4699 // v200 = v100; | |
4700 // } | |
4701 // } | |
4702 // LOBYTE(v103) = v26->field_48[4]; | |
4703 // break; | |
4704 // case 0: | |
4705 //LABEL_231: | |
4706 // v104 = pCard->field_48[6]; | |
4707 // v105 = v104 + (pCard->field_48[5] == 1); | |
4708 // v106 = 0; | |
4709 // dword_4FAA68 = v104 + (pCard->field_48[5] == 1); | |
4710 // dword_4FAA64 = v104; | |
4711 // if ( v104 > 0 ) | |
4712 // { | |
4713 // do | |
4714 // { | |
4715 // am_40A283(v193, v105); | |
4716 // ++v106; | |
4717 // } | |
4718 // while ( v106 < pCard->field_48[6] ); | |
4719 // } | |
4720 // v107 = pCard; | |
1185 | 4721 // am_byte_4FAA77 = GetPlayerHandCardCount(v193) > dword_4E1874; |
1183 | 4722 // LOBYTE(v108) = pCard->field_48[7]; |
4723 // if ( (_BYTE)v108 ) | |
4724 // { | |
4725 // if ( (_BYTE)v108 == 99 ) | |
4726 // { | |
4727 // v109 = v2->field_2C; | |
4728 // v110 = v4->field_2C; | |
4729 // if ( v109 < v110 ) | |
4730 // { | |
4731 // v2->field_2C = v110; | |
4732 // v194 = v110 - v109; | |
4733 // } | |
4734 // } | |
4735 // else | |
4736 // { | |
4737 // v108 = (char)v108; | |
4738 // v6 = (char)v108 + v2->field_2C < 0; | |
4739 // v2->field_2C += (char)v108; | |
4740 // if ( v6 ) | |
4741 // v2->field_2C = 0; | |
4742 // v194 = v108; | |
4743 // } | |
4744 // } | |
4745 // LOBYTE(v111) = v107->field_48[8]; | |
4746 // if ( (_BYTE)v111 ) | |
4747 // { | |
4748 // if ( (_BYTE)v111 == 99 ) | |
4749 // { | |
4750 // v112 = v2->field_30; | |
4751 // v113 = v4->field_30; | |
4752 // if ( v112 < v113 ) | |
4753 // { | |
4754 // v2->field_30 = v113; | |
4755 // v210 = v113 - v112; | |
4756 // } | |
4757 // } | |
4758 // else | |
4759 // { | |
4760 // v111 = (char)v111; | |
4761 // v6 = (char)v111 + v2->field_30 < 0; | |
4762 // v2->field_30 += (char)v111; | |
4763 // if ( v6 ) | |
4764 // v2->field_30 = 0; | |
4765 // v210 = v111; | |
4766 // } | |
4767 // } | |
4768 // LOBYTE(v114) = v107->field_48[9]; | |
4769 // if ( (_BYTE)v114 ) | |
4770 // { | |
4771 // if ( (_BYTE)v114 == 99 ) | |
4772 // { | |
4773 // v115 = v2->field_34; | |
4774 // v116 = v4->field_34; | |
4775 // if ( v115 < v116 ) | |
4776 // { | |
4777 // v2->field_34 = v116; | |
4778 // v208 = v116 - v115; | |
4779 // } | |
4780 // } | |
4781 // else | |
4782 // { | |
4783 // v114 = (char)v114; | |
4784 // v6 = (char)v114 + v2->field_34 < 0; | |
4785 // v2->field_34 += (char)v114; | |
4786 // if ( v6 ) | |
4787 // v2->field_34 = 0; | |
4788 // v208 = v114; | |
4789 // } | |
4790 // } | |
4791 // LOBYTE(v117) = v107->field_48[10]; | |
4792 // if ( (_BYTE)v117 ) | |
4793 // { | |
4794 // if ( (_BYTE)v117 == 99 ) | |
4795 // { | |
4796 // v118 = v2->field_38; | |
4797 // v119 = v4->field_38; | |
4798 // if ( v118 < v119 ) | |
4799 // { | |
4800 // v2->field_38 = v119; | |
4801 // v197 = v119 - v118; | |
4802 // } | |
4803 // } | |
4804 // else | |
4805 // { | |
4806 // v117 = (char)v117; | |
4807 // v6 = (char)v117 + v2->field_38 < 0; | |
4808 // v2->field_38 += (char)v117; | |
4809 // if ( v6 ) | |
4810 // v2->field_38 = 0; | |
4811 // v197 = v117; | |
4812 // } | |
4813 // } | |
4814 // LOBYTE(v120) = v107->field_48[11]; | |
4815 // if ( v120 ) | |
4816 // { | |
4817 // if ( v120 == 99 ) | |
4818 // { | |
4819 // v121 = v2->field_3C; | |
4820 // v122 = v4->field_3C; | |
4821 // if ( v121 < v122 ) | |
4822 // { | |
4823 // v2->field_3C = v122; | |
4824 // v205 = v122 - v121; | |
4825 // } | |
4826 // } | |
4827 // else | |
4828 // { | |
4829 // v120 = v120; | |
4830 // v6 = v120 + v2->field_3C < 0; | |
4831 // v2->field_3C += v120; | |
4832 // if ( v6 ) | |
4833 // v2->field_3C = 0; | |
4834 // v205 = v120; | |
4835 // } | |
4836 // } | |
4837 // LOBYTE(v123) = v107->field_48[12]; | |
4838 // if ( (_BYTE)v123 ) | |
4839 // { | |
4840 // if ( (_BYTE)v123 == 99 ) | |
4841 // { | |
4842 // v124 = v2->field_40; | |
4843 // v125 = v4->field_40; | |
4844 // if ( v124 < v125 ) | |
4845 // { | |
4846 // v2->field_40 = v125; | |
4847 // v203 = v125 - v124; | |
4848 // } | |
4849 // } | |
4850 // else | |
4851 // { | |
4852 // v123 = (char)v123; | |
4853 // v6 = (char)v123 + v2->field_40 < 0; | |
4854 // v2->field_40 += (char)v123; | |
4855 // if ( v6 ) | |
4856 // v2->field_40 = 0; | |
4857 // v203 = v123; | |
4858 // } | |
4859 // } | |
4860 // v126 = v107->field_48[13]; | |
4861 // if ( v126 ) | |
4862 // { | |
4863 // v196 = am_40D402(v193, v126); | |
4864 // v192 = v107->field_48[13] - v196; | |
4865 // } | |
4866 // LOBYTE(v127) = v107->field_48[14]; | |
4867 // if ( (_BYTE)v127 ) | |
4868 // { | |
4869 // if ( (_BYTE)v127 == 99 ) | |
4870 // { | |
4871 // v128 = v2->field_28; | |
4872 // v129 = v4->field_28; | |
4873 // if ( v128 < v129 ) | |
4874 // { | |
4875 // v2->field_28 = v129; | |
4876 // v201 = v129 - v128; | |
4877 // } | |
4878 // } | |
4879 // else | |
4880 // { | |
4881 // v127 = (char)v127; | |
4882 // v6 = (char)v127 + v2->field_28 < 0; | |
4883 // v2->field_28 += (char)v127; | |
4884 // if ( v6 ) | |
4885 // v2->field_28 = 0; | |
4886 // v201 = v127; | |
4887 // } | |
4888 // } | |
4889 // LOBYTE(v130) = v107->field_48[15]; | |
4890 // if ( (_BYTE)v130 ) | |
4891 // { | |
4892 // if ( (_BYTE)v130 == 99 ) | |
4893 // { | |
4894 // v131 = v2->field_24; | |
4895 // v132 = v4->field_24; | |
4896 // if ( v131 < v132 ) | |
4897 // { | |
4898 // v2->field_24 = v132; | |
4899 // v199 = v132 - v131; | |
4900 // } | |
4901 // } | |
4902 // else | |
4903 // { | |
4904 // v130 = (char)v130; | |
4905 // v6 = (char)v130 + v2->field_24 < 0; | |
4906 // v2->field_24 += (char)v130; | |
4907 // if ( v6 ) | |
4908 // v2->field_24 = 0; | |
4909 // v199 = v130; | |
4910 // } | |
4911 // } | |
4912 // LOBYTE(v133) = v107->field_58[0]; | |
4913 // if ( (_BYTE)v133 ) | |
4914 // { | |
4915 // if ( (_BYTE)v133 == 99 ) | |
4916 // { | |
4917 // v134 = v2->field_2C; | |
4918 // v135 = v4->field_2C; | |
4919 // if ( v134 > v135 ) | |
4920 // { | |
4921 // v4->field_2C = v134; | |
4922 // v211 = v134 - v135; | |
4923 // } | |
4924 // } | |
4925 // else | |
4926 // { | |
4927 // v133 = (char)v133; | |
4928 // v6 = (char)v133 + v4->field_2C < 0; | |
4929 // v4->field_2C += (char)v133; | |
4930 // if ( v6 ) | |
4931 // v4->field_2C = 0; | |
4932 // v211 = v133; | |
4933 // } | |
4934 // } | |
4935 // LOBYTE(v136) = v107->field_58[1]; | |
4936 // if ( (_BYTE)v136 ) | |
4937 // { | |
4938 // if ( (_BYTE)v136 == 99 ) | |
4939 // { | |
4940 // v137 = v2->field_30; | |
4941 // v138 = v4->field_30; | |
4942 // if ( v137 > v138 ) | |
4943 // { | |
4944 // v4->field_30 = v137; | |
4945 // v209 = v137 - v138; | |
4946 // } | |
4947 // } | |
4948 // else | |
4949 // { | |
4950 // v136 = (char)v136; | |
4951 // v6 = (char)v136 + v4->field_30 < 0; | |
4952 // v4->field_30 += (char)v136; | |
4953 // if ( v6 ) | |
4954 // v4->field_30 = 0; | |
4955 // v209 = v136; | |
4956 // } | |
4957 // } | |
4958 // LOBYTE(v139) = v107->field_58[2]; | |
4959 // if ( (_BYTE)v139 ) | |
4960 // { | |
4961 // if ( (_BYTE)v139 == 99 ) | |
4962 // { | |
4963 // v140 = v2->field_34; | |
4964 // v141 = v4->field_34; | |
4965 // if ( v140 > v141 ) | |
4966 // { | |
4967 // v4->field_34 = v140; | |
4968 // v207 = v140 - v141; | |
4969 // } | |
4970 // } | |
4971 // else | |
4972 // { | |
4973 // v139 = (char)v139; | |
4974 // v6 = (char)v139 + v4->field_34 < 0; | |
4975 // v4->field_34 += (char)v139; | |
4976 // if ( v6 ) | |
4977 // v4->field_34 = 0; | |
4978 // v207 = v139; | |
4979 // } | |
4980 // } | |
4981 // LOBYTE(v142) = v107->field_58[3]; | |
4982 // if ( (_BYTE)v142 ) | |
4983 // { | |
4984 // if ( (_BYTE)v142 == 99 ) | |
4985 // { | |
4986 // v143 = v2->field_38; | |
4987 // v144 = v4->field_38; | |
4988 // if ( v143 > v144 ) | |
4989 // { | |
4990 // v4->field_38 = v143; | |
4991 // v206 = v143 - v144; | |
4992 // } | |
4993 // } | |
4994 // else | |
4995 // { | |
4996 // v142 = (char)v142; | |
4997 // v6 = (char)v142 + v4->field_38 < 0; | |
4998 // v4->field_38 += (char)v142; | |
4999 // if ( v6 ) | |
5000 // v4->field_38 = 0; | |
5001 // v206 = v142; | |
5002 // } | |
5003 // } | |
5004 // LOBYTE(v145) = v107->field_58[4]; | |
5005 // if ( (_BYTE)v145 ) | |
5006 // { | |
5007 // if ( (_BYTE)v145 == 99 ) | |
5008 // { | |
5009 // v146 = v2->field_3C; | |
5010 // v147 = v4->field_3C; | |
5011 // if ( v146 > v147 ) | |
5012 // { | |
5013 // v4->field_3C = v146; | |
5014 // v204 = v146 - v147; | |
5015 // } | |
5016 // } | |
5017 // else | |
5018 // { | |
5019 // v145 = (char)v145; | |
5020 // v6 = (char)v145 + v4->field_3C < 0; | |
5021 // v4->field_3C += (char)v145; | |
5022 // if ( v6 ) | |
5023 // v4->field_3C = 0; | |
5024 // v204 = v145; | |
5025 // } | |
5026 // } | |
5027 // LOBYTE(v148) = v107->field_58[5]; | |
5028 // if ( (_BYTE)v148 ) | |
5029 // { | |
5030 // if ( (_BYTE)v148 == 99 ) | |
5031 // { | |
5032 // v149 = v2->field_40; | |
5033 // v150 = v4->field_40; | |
5034 // if ( v149 > v150 ) | |
5035 // { | |
5036 // v4->field_40 = v149; | |
5037 // v202 = v149 - v150; | |
5038 // } | |
5039 // } | |
5040 // else | |
5041 // { | |
5042 // v148 = (char)v148; | |
5043 // v6 = (char)v148 + v4->field_40 < 0; | |
5044 // v4->field_40 += (char)v148; | |
5045 // if ( v6 ) | |
5046 // v4->field_40 = 0; | |
5047 // v202 = v148; | |
5048 // } | |
5049 // } | |
5050 // v151 = v107->field_58[6]; | |
5051 // if ( v151 ) | |
5052 // { | |
5053 // v195 = am_40D402(v189, v151); | |
5054 // v191 = v107->field_58[6] - v195; | |
5055 // } | |
5056 // LOBYTE(v152) = v107->field_58[7]; | |
5057 // if ( (_BYTE)v152 ) | |
5058 // { | |
5059 // if ( (_BYTE)v152 == 99 ) | |
5060 // { | |
5061 // v153 = v2->field_28; | |
5062 // v154 = v4->field_28; | |
5063 // if ( v153 > v154 ) | |
5064 // { | |
5065 // v4->field_28 = v153; | |
5066 // v200 = v153 - v154; | |
5067 // } | |
5068 // } | |
5069 // else | |
5070 // { | |
5071 // v152 = (char)v152; | |
5072 // v6 = (char)v152 + v4->field_28 < 0; | |
5073 // v4->field_28 += (char)v152; | |
5074 // if ( v6 ) | |
5075 // v4->field_28 = 0; | |
5076 // v200 = v152; | |
5077 // } | |
5078 // } | |
5079 // LOBYTE(v155) = v107->field_58[8]; | |
5080 // if ( (_BYTE)v155 ) | |
5081 // { | |
5082 // if ( (_BYTE)v155 == 99 ) | |
5083 // { | |
5084 // v156 = v2->field_24; | |
5085 // v157 = v4->field_24; | |
5086 // if ( v156 > v157 ) | |
5087 // { | |
5088 // v4->field_24 = v156; | |
5089 // v198 = v156 - v157; | |
5090 // } | |
5091 // } | |
5092 // else | |
5093 // { | |
5094 // v155 = (char)v155; | |
5095 // v6 = (char)v155 + v4->field_24 < 0; | |
5096 // v4->field_24 += (char)v155; | |
5097 // if ( v6 ) | |
5098 // v4->field_24 = 0; | |
5099 // v198 = v155; | |
5100 // } | |
5101 // } | |
5102 // LOBYTE(v158) = v107->field_58[9]; | |
5103 // if ( (_BYTE)v158 ) | |
5104 // { | |
5105 // if ( (_BYTE)v158 == 99 ) | |
5106 // { | |
5107 // v159 = v2->field_2C; | |
5108 // v160 = v4->field_2C; | |
5109 // if ( v159 != v160 ) | |
5110 // { | |
5111 // if ( v159 <= v160 ) | |
5112 // { | |
5113 // v2->field_2C = v160; | |
5114 // v194 = v160 - v159; | |
5115 // } | |
5116 // else | |
5117 // { | |
5118 // v4->field_2C = v159; | |
5119 // v211 = v159 - v160; | |
5120 // } | |
5121 // } | |
5122 // } | |
5123 // else | |
5124 // { | |
5125 // v158 = (char)v158; | |
5126 // v2->field_2C += (char)v158; | |
5127 // v4->field_2C += (char)v158; | |
5128 // if ( v2->field_2C < 0 ) | |
5129 // v2->field_2C = 0; | |
5130 // if ( v4->field_2C < 0 ) | |
5131 // v4->field_2C = 0; | |
5132 // v194 = v158; | |
5133 // v211 = v158; | |
5134 // } | |
5135 // } | |
5136 // LOBYTE(v161) = v107->field_58[10]; | |
5137 // if ( (_BYTE)v161 ) | |
5138 // { | |
5139 // if ( (_BYTE)v161 == 99 ) | |
5140 // { | |
5141 // v162 = v2->field_30; | |
5142 // v163 = v4->field_30; | |
5143 // if ( v162 != v163 ) | |
5144 // { | |
5145 // if ( v162 <= v163 ) | |
5146 // { | |
5147 // v2->field_30 = v163; | |
5148 // v210 = v163 - v162; | |
5149 // } | |
5150 // else | |
5151 // { | |
5152 // v4->field_30 = v162; | |
5153 // v209 = v162 - v163; | |
5154 // } | |
5155 // } | |
5156 // } | |
5157 // else | |
5158 // { | |
5159 // v161 = (char)v161; | |
5160 // v2->field_30 += (char)v161; | |
5161 // v4->field_30 += (char)v161; | |
5162 // if ( v2->field_30 < 0 ) | |
5163 // v2->field_30 = 0; | |
5164 // if ( v4->field_30 < 0 ) | |
5165 // v4->field_30 = 0; | |
5166 // v209 = v161; | |
5167 // v210 = v161; | |
5168 // } | |
5169 // } | |
5170 // LOBYTE(v164) = v107->field_58[11]; | |
5171 // if ( (_BYTE)v164 ) | |
5172 // { | |
5173 // if ( (_BYTE)v164 == 99 ) | |
5174 // { | |
5175 // v165 = v2->field_34; | |
5176 // v166 = v4->field_34; | |
5177 // if ( v165 != v166 ) | |
5178 // { | |
5179 // if ( v165 <= v166 ) | |
5180 // { | |
5181 // v2->field_34 = v166; | |
5182 // v208 = v166 - v165; | |
5183 // } | |
5184 // else | |
5185 // { | |
5186 // v4->field_34 = v165; | |
5187 // v207 = v165 - v166; | |
5188 // } | |
5189 // } | |
5190 // } | |
5191 // else | |
5192 // { | |
5193 // v164 = (char)v164; | |
5194 // v2->field_34 += (char)v164; | |
5195 // v4->field_34 += (char)v164; | |
5196 // if ( v2->field_34 < 0 ) | |
5197 // v2->field_34 = 0; | |
5198 // if ( v4->field_34 < 0 ) | |
5199 // v4->field_34 = 0; | |
5200 // v208 = v164; | |
5201 // v207 = v164; | |
5202 // } | |
5203 // } | |
5204 // LOBYTE(v167) = v107->field_58[12]; | |
5205 // if ( (_BYTE)v167 ) | |
5206 // { | |
5207 // if ( (_BYTE)v167 == 99 ) | |
5208 // { | |
5209 // v168 = v2->field_38; | |
5210 // v169 = v4->field_38; | |
5211 // if ( v168 != v169 ) | |
5212 // { | |
5213 // if ( v168 <= v169 ) | |
5214 // { | |
5215 // v2->field_38 = v169; | |
5216 // v197 = v169 - v168; | |
5217 // } | |
5218 // else | |
5219 // { | |
5220 // v4->field_38 = v168; | |
5221 // v206 = v168 - v169; | |
5222 // } | |
5223 // } | |
5224 // } | |
5225 // else | |
5226 // { | |
5227 // v167 = (char)v167; | |
5228 // v2->field_38 += (char)v167; | |
5229 // v4->field_38 += (char)v167; | |
5230 // if ( v2->field_38 < 0 ) | |
5231 // v2->field_38 = 0; | |
5232 // if ( v4->field_38 < 0 ) | |
5233 // v4->field_38 = 0; | |
5234 // v197 = v167; | |
5235 // v206 = v167; | |
5236 // } | |
5237 // } | |
5238 // LOBYTE(v170) = v107->field_58[13]; | |
5239 // if ( v170 ) | |
5240 // { | |
5241 // if ( v170 == 99 ) | |
5242 // { | |
5243 // v171 = v2->field_3C; | |
5244 // v172 = v4->field_3C; | |
5245 // if ( v171 != v172 ) | |
5246 // { | |
5247 // if ( v171 <= v172 ) | |
5248 // { | |
5249 // v205 = v172 > v171; | |
5250 // v2->field_3C = v172; | |
5251 // } | |
5252 // else | |
5253 // { | |
5254 // v204 = 1; | |
5255 // v4->field_3C = v171; | |
5256 // } | |
5257 // } | |
5258 // } | |
5259 // else | |
5260 // { | |
5261 // v170 = v170; | |
5262 // v2->field_3C += v170; | |
5263 // v4->field_3C += v170; | |
5264 // if ( v2->field_3C < 0 ) | |
5265 // v2->field_3C = 0; | |
5266 // if ( v4->field_3C < 0 ) | |
5267 // v4->field_3C = 0; | |
5268 // v205 = v170; | |
5269 // v204 = v170; | |
5270 // } | |
5271 // } | |
5272 // LOBYTE(v173) = v107->field_58[14]; | |
5273 // if ( (_BYTE)v173 ) | |
5274 // { | |
5275 // if ( (_BYTE)v173 == 99 ) | |
5276 // { | |
5277 // v174 = v2->field_40; | |
5278 // v175 = v4->field_40; | |
5279 // if ( v174 != v175 ) | |
5280 // { | |
5281 // if ( v174 <= v175 ) | |
5282 // { | |
5283 // v2->field_40 = v175; | |
5284 // v203 = v175 - v174; | |
5285 // } | |
5286 // else | |
5287 // { | |
5288 // v4->field_40 = v174; | |
5289 // v202 = v174 - v175; | |
5290 // } | |
5291 // } | |
5292 // } | |
5293 // else | |
5294 // { | |
5295 // v173 = (char)v173; | |
5296 // v2->field_40 += (char)v173; | |
5297 // v4->field_40 += (char)v173; | |
5298 // if ( v2->field_40 < 0 ) | |
5299 // v2->field_40 = 0; | |
5300 // if ( v4->field_40 < 0 ) | |
5301 // v4->field_40 = 0; | |
5302 // v203 = v173; | |
5303 // v202 = v173; | |
5304 // } | |
5305 // } | |
5306 // v176 = v107->field_58[15]; | |
5307 // if ( v176 ) | |
5308 // { | |
5309 // v177 = am_40D402(v193, v176); | |
5310 // v178 = v107->field_58[15]; | |
5311 // v196 = v177; | |
5312 // v179 = am_40D402(v189, v178); | |
5313 // v195 = v179; | |
5314 // v180 = v107->field_58[15] - v179; | |
5315 // v192 = v107->field_58[15] - v196; | |
5316 // v191 = v180; | |
5317 // } | |
5318 // LOBYTE(v181) = LOBYTE(v107->field_68); | |
5319 // if ( (_BYTE)v181 ) | |
5320 // { | |
5321 // if ( (_BYTE)v181 == 99 ) | |
5322 // { | |
5323 // v182 = v2->field_28; | |
5324 // v183 = v4->field_28; | |
5325 // if ( v182 != v183 ) | |
5326 // { | |
5327 // if ( v182 <= v183 ) | |
5328 // { | |
5329 // v2->field_28 = v183; | |
5330 // v201 = v183 - v182; | |
5331 // } | |
5332 // else | |
5333 // { | |
5334 // v4->field_28 = v182; | |
5335 // v200 = v182 - v183; | |
5336 // } | |
5337 // } | |
5338 // } | |
5339 // else | |
5340 // { | |
5341 // v181 = (char)v181; | |
5342 // v2->field_28 += (char)v181; | |
5343 // v4->field_28 += (char)v181; | |
5344 // if ( v2->field_28 < 0 ) | |
5345 // v2->field_28 = 0; | |
5346 // if ( v4->field_28 < 0 ) | |
5347 // v4->field_28 = 0; | |
5348 // v201 = v181; | |
5349 // v200 = v181; | |
5350 // } | |
5351 // } | |
5352 // LOBYTE(v103) = BYTE1(v107->field_68); | |
5353 // break; | |
5354 // } | |
5355 // if ( (_BYTE)v103 ) | |
5356 // { | |
5357 // if ( (_BYTE)v103 == 99 ) | |
5358 // { | |
5359 // v184 = v2->field_24; | |
5360 // v185 = v4->field_24; | |
5361 // if ( v184 != v185 ) | |
5362 // { | |
5363 // if ( v184 <= v185 ) | |
5364 // { | |
5365 // v2->field_24 = v185; | |
5366 // v199 = v185 - v184; | |
5367 // } | |
5368 // else | |
5369 // { | |
5370 // v4->field_24 = v184; | |
5371 // v198 = v184 - v185; | |
5372 // } | |
5373 // } | |
5374 // } | |
5375 // else | |
5376 // { | |
5377 // v103 = (char)v103; | |
5378 // v2->field_24 += (char)v103; | |
5379 // v4->field_24 += (char)v103; | |
5380 // if ( v2->field_24 < 0 ) | |
5381 // v2->field_24 = 0; | |
5382 // if ( v4->field_24 < 0 ) | |
5383 // v4->field_24 = 0; | |
5384 // v199 = v103; | |
5385 // v198 = v103; | |
5386 // } | |
5387 // } | |
5388 // if ( v194 > 0 || v211 > 0 ) | |
5389 // ArcomageGame::PlaySound(0x1Eu); | |
5390 // if ( v194 < 0 || v211 < 0 ) | |
5391 // ArcomageGame::PlaySound(0x1Fu); | |
5392 // if ( v210 > 0 || v209 > 0 ) | |
5393 // ArcomageGame::PlaySound(0x21u); | |
5394 // if ( v210 < 0 || v209 < 0 ) | |
5395 // ArcomageGame::PlaySound(0x22u); | |
5396 // if ( v208 > 0 || v207 > 0 ) | |
5397 // ArcomageGame::PlaySound(0x24u); | |
5398 // if ( v208 < 0 || v207 < 0 ) | |
5399 // ArcomageGame::PlaySound(0x25u); | |
5400 // if ( v197 > 0 || v206 > 0 ) | |
5401 // ArcomageGame::PlaySound(0x27u); | |
5402 // if ( v197 < 0 || v206 < 0 ) | |
5403 // ArcomageGame::PlaySound(0x28u); | |
5404 // if ( v205 > 0 || v204 > 0 ) | |
5405 // ArcomageGame::PlaySound(0x2Au); | |
5406 // if ( v205 < 0 || v204 < 0 ) | |
5407 // ArcomageGame::PlaySound(0x2Bu); | |
5408 // if ( v203 > 0 || v202 > 0 ) | |
5409 // ArcomageGame::PlaySound(0x2Du); | |
5410 // if ( v203 < 0 || v202 < 0 ) | |
5411 // ArcomageGame::PlaySound(0x2Eu); | |
5412 // if ( v192 || v191 || v196 || v195 ) | |
5413 // ArcomageGame::PlaySound(0x30u); | |
5414 // if ( v201 > 0 || v200 > 0 ) | |
5415 // ArcomageGame::PlaySound(0x31u); | |
5416 // if ( v201 < 0 || v200 < 0 ) | |
5417 // ArcomageGame::PlaySound(0x32u); | |
5418 // if ( v199 > 0 || v198 > 0 ) | |
5419 // ArcomageGame::PlaySound(0x34u); | |
5420 // if ( v199 < 0 || v198 < 0 ) | |
5421 // ArcomageGame::PlaySound(0x35u); | |
5422 // if ( v193 ) | |
5423 // { | |
5424 // if ( v194 ) | |
5425 // { | |
5426 // v187.x = 573; | |
5427 // v187.y = 92; | |
5428 // am_40D2B4(&v187, v194); | |
5429 // } | |
5430 // if ( v211 ) | |
5431 // { | |
5432 // v187.x = 26; | |
5433 // v187.y = 92; | |
5434 // am_40D2B4(&v187, v211); | |
5435 // } | |
5436 // if ( v210 ) | |
5437 // { | |
5438 // v187.x = 573; | |
5439 // v187.y = 164; | |
5440 // am_40D2B4(&v187, v210); | |
5441 // } | |
5442 // if ( v209 ) | |
5443 // { | |
5444 // v187.x = 26; | |
5445 // v187.y = 164; | |
5446 // am_40D2B4(&v187, v209); | |
5447 // } | |
5448 // if ( v208 ) | |
5449 // { | |
5450 // v187.x = 573; | |
5451 // v187.y = 236; | |
5452 // am_40D2B4(&v187, v208); | |
5453 // } | |
5454 // if ( v207 ) | |
5455 // { | |
5456 // v187.x = 26; | |
5457 // v187.y = 236; | |
5458 // am_40D2B4(&v187, v207); | |
5459 // } | |
5460 // if ( v197 ) | |
5461 // { | |
5462 // v187.x = 563; | |
5463 // v187.y = 114; | |
5464 // am_40D2B4(&v187, v197); | |
5465 // } | |
5466 // if ( v206 ) | |
5467 // { | |
5468 // v187.x = 16; | |
5469 // v187.y = 114; | |
5470 // am_40D2B4(&v187, v206); | |
5471 // } | |
5472 // if ( v205 ) | |
5473 // { | |
5474 // v187.x = 563; | |
5475 // v187.y = 186; | |
5476 // am_40D2B4(&v187, v205); | |
5477 // } | |
5478 // if ( v204 ) | |
5479 // { | |
5480 // v187.x = 16; | |
5481 // v187.y = 186; | |
5482 // am_40D2B4(&v187, v204); | |
5483 // } | |
5484 // if ( v203 ) | |
5485 // { | |
5486 // v187.x = 563; | |
5487 // v187.y = 258; | |
5488 // am_40D2B4(&v187, v203); | |
5489 // } | |
5490 // if ( v202 ) | |
5491 // { | |
5492 // v187.x = 16; | |
5493 // v187.y = 258; | |
5494 // am_40D2B4(&v187, v202); | |
5495 // } | |
5496 // v186 = 296; | |
5497 // if ( v201 ) | |
5498 // { | |
5499 // v187.x = 442; | |
5500 // v187.y = 296; | |
5501 // am_40D2B4(&v187, v201); | |
5502 // } | |
5503 // if ( v200 ) | |
5504 // { | |
5505 // v187.x = 180; | |
5506 // v187.y = 296; | |
5507 // am_40D2B4(&v187, v200); | |
5508 // } | |
5509 // if ( v199 ) | |
5510 // { | |
5511 // v187.x = 514; | |
5512 // v187.y = 296; | |
5513 // am_40D2B4(&v187, v199); | |
5514 // } | |
5515 // if ( v198 ) | |
5516 // { | |
5517 // v187.x = 122; | |
5518 // v187.y = 296; | |
5519 // am_40D2B4(&v187, v198); | |
5520 // } | |
5521 // if ( v196 ) | |
5522 // { | |
5523 // v187.x = 442; | |
5524 // v187.y = 296; | |
5525 // am_40D2B4(&v187, v196); | |
5526 // } | |
5527 // if ( v192 ) | |
5528 // { | |
5529 // v187.x = 514; | |
5530 // v187.y = 296; | |
5531 // am_40D2B4(&v187, v192); | |
5532 // } | |
5533 // if ( v195 ) | |
5534 // { | |
5535 // v187.x = 180; | |
5536 // v187.y = 296; | |
5537 // am_40D2B4(&v187, v195); | |
5538 // } | |
5539 // if ( v191 ) | |
5540 // { | |
5541 // v187.x = 122; | |
5542 // goto LABEL_567; | |
5543 // } | |
5544 // } | |
5545 // else | |
5546 // { | |
5547 // if ( v194 ) | |
5548 // { | |
5549 // v187.x = 26; | |
5550 // v187.y = 92; | |
5551 // am_40D2B4(&v187, v194); | |
5552 // } | |
5553 // if ( v211 ) | |
5554 // { | |
5555 // v187.x = 573; | |
5556 // v187.y = 92; | |
5557 // am_40D2B4(&v187, v211); | |
5558 // } | |
5559 // if ( v210 ) | |
5560 // { | |
5561 // v187.x = 26; | |
5562 // v187.y = 164; | |
5563 // am_40D2B4(&v187, v210); | |
5564 // } | |
5565 // if ( v209 ) | |
5566 // { | |
5567 // v187.x = 573; | |
5568 // v187.y = 164; | |
5569 // am_40D2B4(&v187, v209); | |
5570 // } | |
5571 // if ( v208 ) | |
5572 // { | |
5573 // v187.x = 26; | |
5574 // v187.y = 236; | |
5575 // am_40D2B4(&v187, v208); | |
5576 // } | |
5577 // if ( v207 ) | |
5578 // { | |
5579 // v187.x = 573; | |
5580 // v187.y = 236; | |
5581 // am_40D2B4(&v187, v207); | |
5582 // } | |
5583 // if ( v197 ) | |
5584 // { | |
5585 // v187.x = 16; | |
5586 // v187.y = 114; | |
5587 // am_40D2B4(&v187, v197); | |
5588 // } | |
5589 // if ( v206 ) | |
5590 // { | |
5591 // v187.x = 563; | |
5592 // v187.y = 114; | |
5593 // am_40D2B4(&v187, v206); | |
5594 // } | |
5595 // if ( v205 ) | |
5596 // { | |
5597 // v187.x = 16; | |
5598 // v187.y = 186; | |
5599 // am_40D2B4(&v187, v205); | |
5600 // } | |
5601 // if ( v204 ) | |
5602 // { | |
5603 // v187.x = 563; | |
5604 // v187.y = 186; | |
5605 // am_40D2B4(&v187, v204); | |
5606 // } | |
5607 // if ( v203 ) | |
5608 // { | |
5609 // v187.x = 16; | |
5610 // v187.y = 258; | |
5611 // am_40D2B4(&v187, v203); | |
5612 // } | |
5613 // if ( v202 ) | |
5614 // { | |
5615 // v187.x = 563; | |
5616 // v187.y = 258; | |
5617 // am_40D2B4(&v187, v202); | |
5618 // } | |
5619 // v186 = 296; | |
5620 // if ( v201 ) | |
5621 // { | |
5622 // v187.x = 180; | |
5623 // v187.y = 296; | |
5624 // am_40D2B4(&v187, v201); | |
5625 // } | |
5626 // if ( v200 ) | |
5627 // { | |
5628 // v187.x = 442; | |
5629 // v187.y = 296; | |
5630 // am_40D2B4(&v187, v200); | |
5631 // } | |
5632 // if ( v199 ) | |
5633 // { | |
5634 // v187.x = 122; | |
5635 // v187.y = 296; | |
5636 // am_40D2B4(&v187, v199); | |
5637 // } | |
5638 // if ( v198 ) | |
5639 // { | |
5640 // v187.x = 514; | |
5641 // v187.y = 296; | |
5642 // am_40D2B4(&v187, v198); | |
5643 // } | |
5644 // if ( v196 ) | |
5645 // { | |
5646 // v187.x = 180; | |
5647 // v187.y = 296; | |
5648 // am_40D2B4(&v187, v196); | |
5649 // } | |
5650 // if ( v192 ) | |
5651 // { | |
5652 // v187.x = 122; | |
5653 // v187.y = 296; | |
5654 // am_40D2B4(&v187, v192); | |
5655 // } | |
5656 // if ( v195 ) | |
5657 // { | |
5658 // v187.x = 442; | |
5659 // v187.y = 296; | |
5660 // am_40D2B4(&v187, v195); | |
5661 // } | |
5662 // if ( v191 ) | |
5663 // { | |
5664 // v187.x = 514; | |
5665 //LABEL_567: | |
5666 // v187.y = v186; | |
5667 // am_40D2B4(&v187, v191); | |
5668 // return; | |
5669 // } | |
5670 // } | |
0 | 5671 } |
5672 | |
5673 | |
5674 | |
5675 | |
5676 //----- (0040D2B4) -------------------------------------------------------- | |
1185 | 5677 int am_40D2B4( POINT* a1, int a2 ) |
5678 { | |
0 | 5679 int v2; // ebp@1 |
1185 | 5680 POINT *v3; // edi@1 |
0 | 5681 int result; // eax@3 |
1194 | 5682 int v6; |
0 | 5683 stru272_stru0 *v8; // ecx@12 |
5684 signed int v11; // [sp+10h] [bp-8h]@1 | |
1194 | 5685 |
0 | 5686 |
5687 v11 = 0; | |
5688 v2 = a2; | |
5689 v3 = a1; | |
1185 | 5690 while ( array_4FABD0[v11].field_0 ) |
5691 { | |
5692 result = array_4FABD0[v11].field_40->_40E2A7(); | |
5693 if ( !result ) | |
5694 { | |
5695 array_4FABD0[v11].field_0 = 0; | |
5696 --v11; | |
5697 } | |
5698 ++v11; | |
5699 if ( v11 >= 10 ) | |
5700 return result; | |
5701 } | |
5702 v6 = v11; | |
5703 array_4FABD0[v11].field_0 = 1; | |
0 | 5704 if ( v2 <= 0 ) |
1185 | 5705 { |
5706 array_4FABD0[v6].field_1 = 0; | |
5707 v2 = -v2; | |
5708 } | |
0 | 5709 else |
1185 | 5710 { |
5711 array_4FABD0[v6].field_1 = 1; | |
5712 } | |
1186 | 5713 array_4FABD0[v6].field_4.field_0 = v3->x - 20; |
5714 array_4FABD0[v6].field_4.field_8 = v3->x + 20; | |
5715 array_4FABD0[v6].field_4.field_4 = v3->y - 20; | |
5716 array_4FABD0[v6].field_4.field_C = v3->y + 20; | |
5717 array_4FABD0[v6].field_4.field_10 = -60; | |
5718 array_4FABD0[v6].field_4.field_14 = 60; | |
5719 array_4FABD0[v6].field_4.field_18 = 180; | |
5720 array_4FABD0[v6].field_4.field_1Cf = 0.5; | |
5721 array_4FABD0[v6].field_4.field_20 = 150; | |
5722 array_4FABD0[v6].field_4.field_24f= 50.0; | |
5723 array_4FABD0[v6].field_4.field_28f = 3.0; | |
5724 array_4FABD0[v6].field_4.field_2Cf = 8.0; | |
5725 array_4FABD0[v6].field_4.field_30 = 5; | |
5726 array_4FABD0[v6].field_4.field_34 = 15; | |
5727 array_4FABD0[v6].field_4.field_38 = &array_4FABD0[v6].field_44[0]; | |
1185 | 5728 v8 = array_4FABD0[v6].field_40; |
1186 | 5729 v8->_40E01A(&array_4FABD0[v6].field_4); |
0 | 5730 if ( 10 * v2 > 150 ) |
1185 | 5731 v2 = 15; |
5732 | |
1184 | 5733 if ( v8->signature != SIG_trpg ) |
0 | 5734 return 2; |
5735 if ( !v8->field_59 ) | |
5736 return 3; | |
5737 v8->field_8 = 10 * v2; | |
5738 v8->field_30 = 0.0; | |
5739 v8->field_58 = 0; | |
5740 v8->field_44 = 0; | |
5741 v8->field_4C = 0; | |
5742 v8->field_48 = 0; | |
5743 v8->field_50 = 0; | |
1185 | 5744 for (int i=0; i<v8->field_4; ++i) |
5745 v8->field_54[i].field_0=0; | |
0 | 5746 return 0; |
5747 } | |
1185 | 5748 |
0 | 5749 |
5750 //----- (0040D402) -------------------------------------------------------- | |
5751 int __fastcall am_40D402(int a1, int a2) | |
5752 { | |
1183 | 5753 ArcomagePlayer *v2; // ecx@1 |
0 | 5754 int v3; // esi@1 |
5755 int result; // eax@3 | |
5756 | |
1183 | 5757 v2 = &am_Players[a1]; |
1197 | 5758 v3 = v2->wall_height; |
0 | 5759 if ( v3 <= 0 ) |
5760 { | |
5761 result = 0; | |
5762 } | |
5763 else | |
5764 { | |
5765 if ( v3 >= -a2 ) | |
5766 { | |
5767 result = a2; | |
1197 | 5768 v2->wall_height = a2 + v3; |
1209 | 5769 |
0 | 5770 } |
1209 | 5771 else |
5772 { | |
0 | 5773 a2 += v3; |
5774 result = -v3; | |
1197 | 5775 v2->wall_height = 0; |
1209 | 5776 v2->tower_height += a2; |
5777 } | |
0 | 5778 } |
1209 | 5779 |
1197 | 5780 if ( v2->tower_height < 0 ) |
5781 v2->tower_height = 0; | |
0 | 5782 return result; |
5783 } | |
5784 // 40D402: using guessed type int __fastcall am_40D402(uint, uint); | |
5785 | |
5786 //----- (0040D444) -------------------------------------------------------- | |
1197 | 5787 int __cdecl GameResultsApply() |
0 | 5788 { |
5789 int v0; // esi@1 | |
5790 int v1; // edi@1 | |
5791 int v2; // eax@1 | |
5792 int v3; // eax@23 | |
5793 int v4; // edx@25 | |
5794 int v5; // ecx@28 | |
5795 int v6; // eax@28 | |
5796 GUIWindow *v7; // ecx@50 | |
5797 signed int v8; // eax@50 | |
5798 char *v9; // eax@52 | |
5799 signed int v10; // eax@54 | |
5800 char *v11; // esi@59 | |
5801 char *v12; // esi@65 | |
5802 signed int v14; // [sp-4h] [bp-58h]@46 | |
5803 char pText[64]; // [sp+Ch] [bp-48h]@1 | |
5804 int xy[2]; // [sp+4Ch] [bp-8h]@1 | |
5805 | |
5806 v0 = -1; | |
5807 v1 = -1; | |
5808 //nullsub_1(); | |
5809 xy[0] = 0; | |
5810 xy[1] = 0; | |
1209 | 5811 // inv_strcpy("Ïîáåäè", pText); |
0 | 5812 v2 = 0; |
5813 xy[1] = 160; | |
5814 xy[0] = 320 - 12 * v2 / 2; | |
1183 | 5815 // pPrimaryWindow_draws_text(-1, pText, xy); |
1197 | 5816 if ( am_Players[0].tower_height < max_tower_height ) |
0 | 5817 { |
1197 | 5818 if ( am_Players[1].tower_height < max_tower_height ) |
0 | 5819 goto LABEL_10; |
5820 v0 = 2; | |
5821 } | |
5822 else | |
5823 { | |
1197 | 5824 if ( am_Players[1].tower_height < max_tower_height ) |
0 | 5825 { |
5826 v0 = 1; | |
5827 } | |
5828 else | |
5829 { | |
1197 | 5830 if ( am_Players[0].tower_height == am_Players[1].tower_height ) |
0 | 5831 { |
5832 v0 = 0; | |
5833 v1 = 4; | |
5834 goto LABEL_10; | |
5835 } | |
1197 | 5836 v0 = (am_Players[0].tower_height <= am_Players[1].tower_height) + 1; |
0 | 5837 } |
5838 } | |
5839 v1 = 0; | |
5840 LABEL_10: | |
1197 | 5841 if ( am_Players[0].tower_height <= 0 ) |
0 | 5842 { |
1197 | 5843 if ( am_Players[1].tower_height > 0 ) |
0 | 5844 { |
5845 v0 = 2; | |
5846 } | |
5847 else | |
5848 { | |
1197 | 5849 if ( am_Players[0].tower_height == am_Players[1].tower_height ) |
0 | 5850 { |
5851 LABEL_20: | |
1197 | 5852 if ( am_Players[0].wall_height == am_Players[1].wall_height ) |
0 | 5853 { |
5854 v0 = 0; | |
5855 v1 = 4; | |
5856 } | |
5857 else | |
5858 { | |
1197 | 5859 v0 = (am_Players[0].wall_height <= am_Players[1].wall_height) + 1; |
0 | 5860 v1 = 1; |
5861 } | |
5862 goto LABEL_23; | |
5863 } | |
1197 | 5864 v0 = (am_Players[0].tower_height <= am_Players[1].tower_height) + 1; |
0 | 5865 } |
5866 goto LABEL_17; | |
5867 } | |
1197 | 5868 if ( am_Players[1].tower_height <= 0 ) |
0 | 5869 { |
5870 v0 = 1; | |
5871 LABEL_17: | |
5872 v1 = 2; | |
5873 } | |
5874 if ( !v0 && v1 == 4 ) | |
5875 goto LABEL_20; | |
5876 LABEL_23: | |
1197 | 5877 v3 = am_Players[0].resource_bricks; |
5878 if ( am_Players[0].resource_bricks <= am_Players[0].resource_gems ) | |
0 | 5879 { |
1197 | 5880 v3 = am_Players[0].resource_beasts; |
5881 v4 = am_Players[0].resource_gems; | |
5882 if ( am_Players[0].resource_gems > am_Players[0].resource_beasts ) | |
0 | 5883 goto LABEL_28; |
5884 } | |
5885 else | |
5886 { | |
1197 | 5887 if ( am_Players[0].resource_bricks <= am_Players[0].resource_beasts ) |
0 | 5888 { |
1197 | 5889 v4 = am_Players[0].resource_beasts; |
0 | 5890 goto LABEL_28; |
5891 } | |
5892 } | |
5893 v4 = v3; | |
5894 LABEL_28: | |
1197 | 5895 v5 = am_Players[1].resource_bricks; |
5896 v6 = am_Players[1].resource_gems; | |
5897 if ( am_Players[1].resource_bricks <= am_Players[1].resource_gems ) | |
0 | 5898 { |
1197 | 5899 v5 = am_Players[1].resource_beasts; |
5900 if ( am_Players[1].resource_gems > am_Players[1].resource_beasts ) | |
0 | 5901 goto LABEL_33; |
5902 goto LABEL_32; | |
5903 } | |
1197 | 5904 v6 = am_Players[1].resource_beasts; |
5905 if ( am_Players[1].resource_bricks > am_Players[1].resource_beasts ) | |
0 | 5906 LABEL_32: |
5907 v6 = v5; | |
5908 LABEL_33: | |
5909 if ( v0 == -1 ) | |
5910 { | |
5911 if ( v1 != -1 ) | |
5912 goto LABEL_49; | |
1197 | 5913 if ( v4 < max_resources_amount ) |
0 | 5914 { |
1197 | 5915 if ( v6 < max_resources_amount ) |
0 | 5916 goto LABEL_49; |
5917 v0 = 2; | |
5918 } | |
5919 else | |
5920 { | |
1197 | 5921 if ( v6 < max_resources_amount ) |
0 | 5922 { |
5923 v0 = 1; | |
5924 } | |
5925 else | |
5926 { | |
5927 if ( v4 == v6 ) | |
5928 goto LABEL_46; | |
5929 v0 = (v4 <= v6) + 1; | |
5930 } | |
5931 } | |
5932 v1 = 3; | |
5933 } | |
5934 if ( !v0 && v1 == 4 ) | |
5935 { | |
5936 if ( v4 != v6 ) | |
5937 { | |
5938 v14 = 5; | |
5939 v0 = (v4 <= v6) + 1; | |
5940 goto LABEL_48; | |
5941 } | |
5942 LABEL_46: | |
5943 v0 = 0; | |
5944 v14 = 4; | |
5945 LABEL_48: | |
5946 v1 = v14; | |
5947 } | |
5948 LABEL_49: | |
5949 pArcomageGame->field_B0 = v1; | |
5950 pArcomageGame->uGameResult = v0; | |
5951 if ( v0 == 1 ) | |
5952 { | |
336 | 5953 v7 = window_SpeakInHouse; |
1197 | 5954 v8 = (signed int)window_SpeakInHouse->par1C; |
0 | 5955 if ( v8 >= 108 ) |
5956 { | |
5957 if ( v8 <= 120 ) | |
5958 { | |
5959 v9 = (char *)&pParty->uNumGoldInBank + v8 + 1; | |
5960 if ( !*v9 ) | |
5961 { | |
5962 *v9 = 1; | |
5963 | |
5964 //auto _a = (signed __int64)(p2DEvents_minus1__20[13 * (unsigned int)v7->ptr_1C] * 100.0); | |
1197 | 5965 auto _a = (signed int)(p2DEvents[(unsigned int)v7->par1C - 1].fPriceMultiplier * 100.0); |
0 | 5966 party_finds_gold(_a, 0); |
5967 } | |
5968 } | |
5969 } | |
5970 v10 = 108; | |
5971 do | |
5972 { | |
5973 if ( !*((unsigned char *)&pParty->uNumGoldInBank + v10 + 1) ) | |
5974 break; | |
5975 ++v10; | |
5976 } | |
5977 while ( v10 <= 120 ); | |
5978 if ( v10 == 121 ) | |
484 | 5979 _449B7E_toggle_bit(pParty->_quest_bits, 238, 1u); |
735 | 5980 v11 = (char *)pParty->pPlayers[0]._guilds_member_bits; |
0 | 5981 do |
5982 { | |
5983 if ( !(unsigned __int16)_449B57_test_bit((unsigned __int8 *)v11, 1) ) | |
949 | 5984 _449B7E_toggle_bit((unsigned char *)v11, PLAYER_GUILD_BITS__ARCOMAGE_WIN, 1); |
0 | 5985 v11 += 6972; |
5986 } | |
463 | 5987 while ( (signed int)v11 < (signed int)((char *)&pParty->StandartItemsInShops[36] + 2) ); |
949 | 5988 ++pParty->uNumArcomageWins; |
5989 if ( pParty->uNumArcomageWins > 1000000 ) | |
5990 pParty->uNumArcomageWins = 1000000; | |
0 | 5991 } |
5992 else | |
5993 { | |
735 | 5994 v12 = (char *)pParty->pPlayers[0]._guilds_member_bits; |
0 | 5995 do |
5996 { | |
5997 if ( !(unsigned __int16)_449B57_test_bit((unsigned __int8 *)v12, 1) ) | |
949 | 5998 _449B7E_toggle_bit((unsigned char *)v12, PLAYER_GUILD_BITS__ARCOMAGE_LOSE, 1); |
0 | 5999 v12 += 6972; |
6000 } | |
463 | 6001 while ( (signed int)v12 < (signed int)((char *)&pParty->StandartItemsInShops[36] + 2) ); |
949 | 6002 ++pParty->uNumArcomageLoses; |
6003 if ( pParty->uNumArcomageLoses > 1000000 ) | |
6004 pParty->uNumArcomageLoses = 1000000; | |
0 | 6005 } |
6006 return 0; | |
6007 } | |
6008 | |
6009 | |
6010 | |
6011 //----- (00409C8B) -------------------------------------------------------- | |
1197 | 6012 void PrepareArcomage() |
6013 { | |
0 | 6014 signed __int64 v1; // qax@4 |
6015 int v2; // esi@4 | |
1183 | 6016 int v3; // esi@5 |
0 | 6017 signed int v4; // edi@5 |
6018 int v6; // edx@9 | |
1183 | 6019 RECT pXYZW; // [sp+8h] [bp-1Ch]@5 |
6020 POINT pXY; // [sp+18h] [bp-Ch]@5 | |
0 | 6021 |
6022 pAudioPlayer->StopChannels(-1, -1); | |
1201 | 6023 strcpy(pArcomageGame->pPlayer1Name, Player1Name); |
6024 strcpy(pArcomageGame->pPlayer2Name, Player2Name); | |
0 | 6025 am_byte_4FAA76 = 0; |
6026 am_byte_4FAA75 = 0; | |
1183 | 6027 |
6028 for (int i=0; i<10; ++i) | |
6029 { | |
6030 v2 = (i+1) % 4; | |
6031 v3 = (i+1) / 4; | |
1200 | 6032 shown_cards[i].uCardId = -1; |
6033 shown_cards[i].field_4 = 0; | |
6034 shown_cards[i].field_8.x = 100 * v2 + 120; | |
6035 shown_cards[i].field_8.y = 138 * v3 + 18; | |
6036 shown_cards[i].field_10_xplus = -100 * v2 / 5; | |
6037 shown_cards[i].field_14_y_plus = -138 * v3 / 5; | |
6038 shown_cards[i].field_18_point.x = shown_cards[i].field_8.x; | |
6039 shown_cards[i].field_18_point.y = shown_cards[i].field_8.y; | |
1183 | 6040 } |
6041 | |
6042 pXY.x = 0; | |
6043 pXY.y = 0; | |
0 | 6044 ArcomageGame::LoadBackground(); |
1183 | 6045 pXYZW.left = 0; |
6046 pXYZW.right = 640; | |
6047 pXYZW.top = 0; | |
6048 pXYZW.bottom = 480; | |
0 | 6049 am_BeginScene(pArcomageGame->pBackgroundPixels, -1, 1); |
1183 | 6050 Blt_Copy(&pXYZW, &pXY, 2); |
0 | 6051 am_EndScene(); |
6052 pRenderer->Present(); | |
6053 ArcomageGame::LoadSprites(); | |
6054 CallRenderPresent(); | |
1183 | 6055 |
0 | 6056 v4 = 120; |
1183 | 6057 for (int i=0; i<12; ++i) |
6058 am_sounds[i] = pSoundList->LoadSound(v4++, 0); | |
6059 | |
1184 | 6060 |
6061 for (int i=0; i<10; ++i) | |
1200 | 6062 array_4FABD0[i].field_40->Ctor(array_4FABD0[i].field_40); |
1184 | 6063 |
1200 | 6064 current_card_slot_index = -1; |
0 | 6065 amuint_4FAA4C = -1; |
6066 byte_4FAA74 = 0; | |
6067 pArcomageGame->field_F4 = 0; | |
6068 byte_4FAA2C = 0; | |
6069 byte_505880 = 0; | |
6070 dword_4FAA70 = 0; | |
6071 am_byte_4FAA77 = 0; | |
1197 | 6072 SetStartGameData(); |
1200 | 6073 InitalHandsFill(); |
0 | 6074 //nullsub_1(); |
1197 | 6075 pArcomageGame->GameOver = 0; |
1183 | 6076 pArcomageGame->pfntComic = pFontComic; |
6077 pArcomageGame->pfntArrus = pFontArrus; | |
0 | 6078 } |
6079 | |
6080 | |
6081 //----- (0040D711) -------------------------------------------------------- | |
6082 ArcomageGame::ArcomageGame() | |
6083 { | |
1183 | 6084 field_4 = 0; |
0 | 6085 //RGBTexture::RGBTexture(&this->pGameBackground); |
6086 //RGBTexture::RGBTexture(&v1->pSprites); | |
1183 | 6087 bGameInProgress = 0; |
6088 field_F9 = 0; | |
0 | 6089 } |
938 | 6090 |
6091 | |
6092 | |
6093 | |
6094 | |
6095 | |
6096 //----- (00409BE8) -------------------------------------------------------- | |
1197 | 6097 void SetStartConditions() |
938 | 6098 { |
1200 | 6099 ArcomageStartConditions *st_cond; // eax@1 |
1185 | 6100 |
1200 | 6101 st_cond = &start_conditions[window_SpeakInHouse->par1C - 108]; |
6102 start_tower_height = st_cond->tower_height; | |
6103 start_wall_height = st_cond->wall_height; | |
6104 start_quarry_level = st_cond->quarry_level - 1; | |
6105 start_magic_level = st_cond->magic_level - 1; | |
6106 start_zoo_level = st_cond->zoo_level - 1; | |
6107 minimum_cards_at_hand = 5; | |
1197 | 6108 quarry_bonus = 1; |
6109 magic_bonus = 1; | |
1201 | 6110 zoo_bonus = 1; |
1200 | 6111 max_tower_height = st_cond->max_tower; |
6112 max_resources_amount = st_cond->max_resources; | |
6113 | |
6114 dword_4DF3A4 = st_cond->field_14; | |
6115 | |
6116 start_bricks_amount = st_cond->bricks_amount; | |
6117 start_gems_amount = st_cond->gems_amount; | |
6118 start_beasts_amount = st_cond->beasts_amount; | |
1185 | 6119 |
1183 | 6120 } |
6121 | |
6122 | |
6123 //----- (0040D75D) -------------------------------------------------------- | |
6124 void pPrimaryWindow_draws_text( int a1, const char *pText, POINT *pXY ) | |
6125 { | |
6126 int v4; // qax@1 | |
6127 v4 = pFontComic->uFontHeight - 3; | |
6128 pPrimaryWindow->DrawText( pFontComic, pXY->x, pXY->y - (v4 >> 1) + 3, 0, pText, 0, 0, 0); | |
6129 } | |
6130 | |
6131 | |
6132 //----- (0040DB27) -------------------------------------------------------- | |
1185 | 6133 void __fastcall DrawRect(RECT *pXYZW, unsigned __int16 uColor, char bSolidFill) |
1183 | 6134 { |
1185 | 6135 RECT *v3; // esi@1 |
1183 | 6136 |
6137 v3 = pXYZW; | |
6138 pRenderer->BeginScene(); | |
6139 pRenderer->SetRasterClipRect(0, 0, 639u, 479u); | |
6140 if ( bSolidFill ) | |
6141 { | |
1185 | 6142 for ( int i = v3->top; i <= v3->bottom; ++i ) |
6143 pRenderer->RasterLine2D(v3->left, i, v3->right, i, uColor); | |
1183 | 6144 } |
6145 else | |
6146 { | |
1185 | 6147 pRenderer->RasterLine2D(v3->left, v3->top, v3->right, v3->top, uColor); |
6148 pRenderer->RasterLine2D(v3->right, v3->top, v3->right, v3->bottom, uColor); | |
6149 pRenderer->RasterLine2D(v3->right, v3->bottom, v3->left, v3->bottom, uColor); | |
6150 pRenderer->RasterLine2D(v3->left, v3->bottom, v3->left, v3->top, uColor); | |
1183 | 6151 } |
6152 pRenderer->EndScene(); | |
6153 } | |
6154 | |
1185 | 6155 |
6156 //----- (0040DBD3) -------------------------------------------------------- | |
6157 void SetPixel( POINT *pTargetXY, unsigned __int16 uColor ) | |
6158 { | |
6159 pRenderer->BeginScene(); | |
6160 if ( pRenderer->uNumSceneBegins ) | |
6161 { | |
6162 int xVal = pTargetXY->x; | |
6163 int yVal = pTargetXY->y; | |
6164 if ( xVal >= 0 && xVal <= 639 && yVal >= 0 && yVal <= 479) | |
6165 { | |
6166 pRenderer->pTargetSurface[xVal + pRenderer->uTargetSurfacePitch * yVal] = uColor; | |
6167 } | |
6168 pRenderer->EndScene(); | |
6169 } | |
6170 } | |
6171 | |
6172 | |
1183 | 6173 //----- (0040DDB1) -------------------------------------------------------- |
6174 int __fastcall rand_interval(int a, int b) | |
6175 { | |
6176 return a + rand() % (b - a + 1); | |
6177 } | |
6178 | |
6179 | |
6180 //----- (0040DEC8) -------------------------------------------------------- | |
6181 void __fastcall intToString(int val, char *pOut) | |
6182 { | |
6183 sprintf(pOut, "%d", val); | |
6184 } |