Mercurial > mm7
comparison UIBooks.cpp @ 949:c0d0656aa662
Awards
author | Nomad |
---|---|
date | Wed, 01 May 2013 20:04:24 +0200 |
parents | 5a2dbb00c399 |
children | 9a5db2cf999a |
comparison
equal
deleted
inserted
replaced
948:5a2dbb00c399 | 949:c0d0656aa662 |
---|---|
407 v13 = pTex_tab_an_6b__zoom_on; | 407 v13 = pTex_tab_an_6b__zoom_on; |
408 v11 = pViewport->uViewportTL_Y + 1; | 408 v11 = pViewport->uViewportTL_Y + 1; |
409 v0 = pViewport->uViewportTL_X + 398; | 409 v0 = pViewport->uViewportTL_X + 398; |
410 } | 410 } |
411 pRenderer->DrawTextureTransparent(v0, v11, v13); | 411 pRenderer->DrawTextureTransparent(v0, v11, v13); |
412 if ( dword_506544 || dword_506528 + awards_count >= awards_count2 ) | 412 if ( dword_506544 || dword_506528 + num_achieved_awards >= num_achieved_awards_2 ) |
413 { | 413 { |
414 v14 = pTex_tab_an_7a__zoot_off; | 414 v14 = pTex_tab_an_7a__zoot_off; |
415 v12 = pViewport->uViewportTL_Y + 38; | 415 v12 = pViewport->uViewportTL_Y + 38; |
416 v1 = pViewport->uViewportTL_X + 407; | 416 v1 = pViewport->uViewportTL_X + 407; |
417 } | 417 } |
422 v1 = pViewport->uViewportTL_X + 398; | 422 v1 = pViewport->uViewportTL_X + 398; |
423 } | 423 } |
424 pRenderer->DrawTextureTransparent(v1, v12, v14); | 424 pRenderer->DrawTextureTransparent(v1, v12, v14); |
425 if ( !byte_5C6D50[dword_506528] ) | 425 if ( !byte_5C6D50[dword_506528] ) |
426 { | 426 { |
427 v2 = achievedAwardsIndex[dword_506528]; | 427 v2 = achieved_awards[dword_506528]; |
428 a1.uFrameWidth = game_viewport_width; | 428 a1.uFrameWidth = game_viewport_width; |
429 a1.uFrameX = game_viewport_x; | 429 a1.uFrameX = game_viewport_x; |
430 a1.uFrameY = game_viewport_y; | 430 a1.uFrameY = game_viewport_y; |
431 a1.uFrameHeight = game_viewport_height; | 431 a1.uFrameHeight = game_viewport_height; |
432 v3 = (const char *)pStorylineText->StoreLine[v2].pPageTitle;//field_4[]; | 432 v3 = (const char *)pStorylineText->StoreLine[v2].pPageTitle;//field_4[]; |
441 a1.uFrameHeight = 264; | 441 a1.uFrameHeight = 264; |
442 v4 = LOBYTE(pAutonoteFont->uFontHeight) - 3; | 442 v4 = LOBYTE(pAutonoteFont->uFontHeight) - 3; |
443 a1.uFrameZ = 407; | 443 a1.uFrameZ = 407; |
444 a1.uFrameHeight = v4 * 264 / v4; | 444 a1.uFrameHeight = v4 * 264 / v4; |
445 a1.uFrameW = a1.uFrameHeight + 69; | 445 a1.uFrameW = a1.uFrameHeight + 69; |
446 if ( dword_506544 && dword_506528 + awards_count < awards_count2 ) | 446 if ( dword_506544 && dword_506528 + num_achieved_awards < num_achieved_awards_2 ) |
447 { | 447 { |
448 pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0); | 448 pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0); |
449 v5 = dword_50651C++; | 449 v5 = dword_50651C++; |
450 dword_506528 += awards_count; | 450 dword_506528 += num_achieved_awards; |
451 byte_506130[v5] = awards_count; | 451 byte_506130[v5] = num_achieved_awards; |
452 } | 452 } |
453 if ( dword_506548 && dword_50651C ) | 453 if ( dword_506548 && dword_50651C ) |
454 { | 454 { |
455 pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0); | 455 pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0); |
456 --dword_50651C; | 456 --dword_50651C; |
457 dword_506528 -= (unsigned __int8)byte_506130[dword_50651C]; | 457 dword_506528 -= (unsigned __int8)byte_506130[dword_50651C]; |
458 } | 458 } |
459 if ( !awards_count || dword_506528 < 1 ) | 459 if ( !num_achieved_awards || dword_506528 < 1 ) |
460 { | 460 { |
461 dword_506528 = 0; | 461 dword_506528 = 0; |
462 dword_50651C = 0; | 462 dword_50651C = 0; |
463 } | 463 } |
464 dword_506544 = 0; | 464 dword_506544 = 0; |
465 v6 = achievedAwardsIndex[dword_506528]; | 465 v6 = achieved_awards[dword_506528]; |
466 dword_506548 = 0; | 466 dword_506548 = 0; |
467 awards_count = 0; | 467 num_achieved_awards = 0; |
468 //v7 = *pStorylineText->StoreLine[v6].pText;//*(&pStorylineText->field_0 + 3 * v6); | 468 //v7 = *pStorylineText->StoreLine[v6].pText;//*(&pStorylineText->field_0 + 3 * v6); |
469 v7 = (int)pStorylineText->StoreLine[v6].pText;//*(&pStorylineText->field_0 + 3 * v6); | 469 v7 = (int)pStorylineText->StoreLine[v6].pText;//*(&pStorylineText->field_0 + 3 * v6); |
470 v8 = BuilDialogueString( | 470 v8 = BuilDialogueString( |
471 pStorylineText->StoreLine[v6].pText, | 471 pStorylineText->StoreLine[v6].pText, |
472 uActiveCharacter - 1, | 472 uActiveCharacter - 1, |
476 (__int64 *)&pParty->field_3C._s_times[ v6 + 21]); | 476 (__int64 *)&pParty->field_3C._s_times[ v6 + 21]); |
477 if ( v7 ) | 477 if ( v7 ) |
478 { | 478 { |
479 v9 = pAutonoteFont->_44C6C2(v8, &a1, 1u, (unsigned __int8)byte_5C6D50[dword_506528]); | 479 v9 = pAutonoteFont->_44C6C2(v8, &a1, 1u, (unsigned __int8)byte_5C6D50[dword_506528]); |
480 LOBYTE(v8) = a1.DrawText(pAutonoteFont, 1, 0, 0, (const char *)v9, 0, a1.uFrameY + a1.uFrameHeight, 0); | 480 LOBYTE(v8) = a1.DrawText(pAutonoteFont, 1, 0, 0, (const char *)v9, 0, a1.uFrameY + a1.uFrameHeight, 0); |
481 ++awards_count; | 481 ++num_achieved_awards; |
482 } | 482 } |
483 return (char)v8; | 483 return (char)v8; |
484 } | 484 } |
485 | 485 |
486 | 486 |
513 v10 = pTex_tab_an_6b__zoom_on; | 513 v10 = pTex_tab_an_6b__zoom_on; |
514 v8 = pViewport->uViewportTL_Y + 1; | 514 v8 = pViewport->uViewportTL_Y + 1; |
515 v0 = pViewport->uViewportTL_X + 398; | 515 v0 = pViewport->uViewportTL_X + 398; |
516 } | 516 } |
517 pRenderer->DrawTextureTransparent(v0, v8, v10); | 517 pRenderer->DrawTextureTransparent(v0, v8, v10); |
518 if ( dword_506544 || dword_506528 + awards_count >= awards_count2 ) | 518 if ( dword_506544 || dword_506528 + num_achieved_awards >= num_achieved_awards_2 ) |
519 { | 519 { |
520 v11 = pTex_tab_an_7a__zoot_off; | 520 v11 = pTex_tab_an_7a__zoot_off; |
521 v9 = pViewport->uViewportTL_Y + 38; | 521 v9 = pViewport->uViewportTL_Y + 38; |
522 v1 = pViewport->uViewportTL_X + 407; | 522 v1 = pViewport->uViewportTL_X + 407; |
523 } | 523 } |
539 a1.uFrameY = 70; | 539 a1.uFrameY = 70; |
540 a1.uFrameWidth = 360; | 540 a1.uFrameWidth = 360; |
541 a1.uFrameHeight = 264; | 541 a1.uFrameHeight = 264; |
542 a1.uFrameZ = 407; | 542 a1.uFrameZ = 407; |
543 a1.uFrameW = 333; | 543 a1.uFrameW = 333; |
544 if ( dword_506544 && dword_506528 + awards_count < awards_count2 ) | 544 if ( dword_506544 && dword_506528 + num_achieved_awards < num_achieved_awards_2 ) |
545 { | 545 { |
546 pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0); | 546 pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0); |
547 v2 = dword_50651C++; | 547 v2 = dword_50651C++; |
548 dword_506528 += awards_count; | 548 dword_506528 += num_achieved_awards; |
549 byte_506130[v2] = awards_count; | 549 byte_506130[v2] = num_achieved_awards; |
550 } | 550 } |
551 if ( dword_506548 && dword_50651C ) | 551 if ( dword_506548 && dword_50651C ) |
552 { | 552 { |
553 pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0); | 553 pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0); |
554 --dword_50651C; | 554 --dword_50651C; |
555 dword_506528 -= (unsigned __int8)byte_506130[dword_50651C]; | 555 dword_506528 -= (unsigned __int8)byte_506130[dword_50651C]; |
556 } | 556 } |
557 if ( !awards_count || (v3 = dword_506528, dword_506528 < 1) ) | 557 if ( !num_achieved_awards || (v3 = dword_506528, dword_506528 < 1) ) |
558 { | 558 { |
559 v3 = 0; | 559 v3 = 0; |
560 dword_50651C = 0; | 560 dword_50651C = 0; |
561 dword_506528 = 0; | 561 dword_506528 = 0; |
562 } | 562 } |
563 dword_506544 = 0; | 563 dword_506544 = 0; |
564 dword_506548 = 0; | 564 dword_506548 = 0; |
565 awards_count = 0; | 565 num_achieved_awards = 0; |
566 while ( v3 < awards_count2 ) | 566 while ( v3 < num_achieved_awards_2 ) |
567 { | 567 { |
568 v4 = achievedAwardsIndex[v3]; | 568 v4 = achieved_awards[v3]; |
569 ++awards_count; | 569 ++num_achieved_awards; |
570 v5 = pQuestTable[v4-1];//(&dword_722F10)[4 * v4]; | 570 v5 = pQuestTable[v4-1];//(&dword_722F10)[4 * v4]; |
571 a1.DrawText(pAutonoteFont, 1, 0, 0, pQuestTable[v4-1], 0, 0, 0);//(&dword_722F10)[4 * v4], 0, 0, 0); | 571 a1.DrawText(pAutonoteFont, 1, 0, 0, pQuestTable[v4-1], 0, 0, 0);//(&dword_722F10)[4 * v4], 0, 0, 0); |
572 v6 = pAutonoteFont->CalcTextHeight(v5, &a1, 1, 0); | 572 v6 = pAutonoteFont->CalcTextHeight(v5, &a1, 1, 0); |
573 v7 = a1.uFrameY + v6; | 573 v7 = a1.uFrameY + v6; |
574 if ( (signed int)(a1.uFrameY + v6) > (signed int)a1.uFrameHeight ) | 574 if ( (signed int)(a1.uFrameY + v6) > (signed int)a1.uFrameHeight ) |
631 v24 = pTex_tab_an_6b__zoom_on; | 631 v24 = pTex_tab_an_6b__zoom_on; |
632 v17 = pViewport->uViewportTL_Y + 1; | 632 v17 = pViewport->uViewportTL_Y + 1; |
633 v0 = pViewport->uViewportTL_X + 398; | 633 v0 = pViewport->uViewportTL_X + 398; |
634 } | 634 } |
635 pRenderer->DrawTextureTransparent(v0, v17, v24); | 635 pRenderer->DrawTextureTransparent(v0, v17, v24); |
636 if ( dword_506544 || dword_506528 + awards_count >= awards_count2 ) | 636 if ( dword_506544 || dword_506528 + num_achieved_awards >= num_achieved_awards_2 ) |
637 { | 637 { |
638 v25 = pTex_tab_an_7a__zoot_off; | 638 v25 = pTex_tab_an_7a__zoot_off; |
639 v18 = pViewport->uViewportTL_Y + 38; | 639 v18 = pViewport->uViewportTL_Y + 38; |
640 v1 = pViewport->uViewportTL_X + 407; | 640 v1 = pViewport->uViewportTL_X + 407; |
641 } | 641 } |
805 a1.uFrameHeight = 264; | 805 a1.uFrameHeight = 264; |
806 a1.uFrameZ = 407; | 806 a1.uFrameZ = 407; |
807 a1.uFrameW = 333; | 807 a1.uFrameW = 333; |
808 if ( v31 ) | 808 if ( v31 ) |
809 { | 809 { |
810 awards_count2 = 0; | 810 num_achieved_awards_2 = 0; |
811 dword_506528 = 0; | 811 dword_506528 = 0; |
812 dword_50651C = 0; | 812 dword_50651C = 0; |
813 awards_count = 0; | 813 num_achieved_awards = 0; |
814 v8 = 0; | 814 v8 = 0; |
815 do | 815 do |
816 { | 816 { |
817 //if ( dword_72371C[2 * v8] == dword_506568 ) | 817 //if ( dword_72371C[2 * v8] == dword_506568 ) |
818 if ( pAutonoteTxt[v8-1].eType == dword_506568 ) | 818 if ( pAutonoteTxt[v8-1].eType == dword_506568 ) |
821 v32 = (char *)pAutonoteTxt[v8-1].pText; | 821 v32 = (char *)pAutonoteTxt[v8-1].pText; |
822 if ( (short)v8 ) | 822 if ( (short)v8 ) |
823 { | 823 { |
824 if ( (unsigned __int16)_449B57_test_bit(pParty->_autonote_bits, v8) && v32 ) | 824 if ( (unsigned __int16)_449B57_test_bit(pParty->_autonote_bits, v8) && v32 ) |
825 { | 825 { |
826 v9 = awards_count++; | 826 v9 = num_achieved_awards++; |
827 achievedAwardsIndex[v9] = (signed __int16)v8; | 827 achieved_awards[v9] = (AwardType)v8; |
828 } | 828 } |
829 } | 829 } |
830 } | 830 } |
831 ++v8; | 831 ++v8; |
832 } | 832 } |
833 while ( v8 < 196 ); | 833 while ( v8 < 196 ); |
834 awards_count2 = awards_count; | 834 num_achieved_awards_2 = num_achieved_awards; |
835 } | 835 } |
836 else | 836 else |
837 { | 837 { |
838 if ( dword_506544 ) | 838 if ( dword_506544 ) |
839 { | 839 { |
840 v10 = awards_count + dword_506528; | 840 v10 = num_achieved_awards + dword_506528; |
841 if ( awards_count + dword_506528 < awards_count2 ) | 841 if ( num_achieved_awards + dword_506528 < num_achieved_awards_2 ) |
842 { | 842 { |
843 v11 = dword_50651C++; | 843 v11 = dword_50651C++; |
844 byte_506130[v11] = awards_count; | 844 byte_506130[v11] = num_achieved_awards; |
845 dword_506528 = v10; | 845 dword_506528 = v10; |
846 pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0); | 846 pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0); |
847 } | 847 } |
848 } | 848 } |
849 if ( dword_506548 && dword_50651C ) | 849 if ( dword_506548 && dword_50651C ) |
850 { | 850 { |
851 --dword_50651C; | 851 --dword_50651C; |
852 dword_506528 -= (unsigned __int8)byte_506130[dword_50651C]; | 852 dword_506528 -= (unsigned __int8)byte_506130[dword_50651C]; |
853 pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0); | 853 pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0); |
854 } | 854 } |
855 if ( !awards_count || dword_506528 < 1 ) | 855 if ( !num_achieved_awards || dword_506528 < 1 ) |
856 { | 856 { |
857 dword_506528 = 0; | 857 dword_506528 = 0; |
858 dword_50651C = 0; | 858 dword_50651C = 0; |
859 } | 859 } |
860 } | 860 } |
861 v12 = dword_506528; | 861 v12 = dword_506528; |
862 dword_50652C = 0; | 862 dword_50652C = 0; |
863 dword_506544 = 0; | 863 dword_506544 = 0; |
864 dword_506548 = 0; | 864 dword_506548 = 0; |
865 awards_count = 0; | 865 num_achieved_awards = 0; |
866 dword_506530 = 0; | 866 dword_506530 = 0; |
867 dword_506534 = 0; | 867 dword_506534 = 0; |
868 dword_506538 = 0; | 868 dword_506538 = 0; |
869 dword_50653C = 0; | 869 dword_50653C = 0; |
870 dword_506540 = 0; | 870 dword_506540 = 0; |
871 while ( v12 < awards_count2 ) | 871 while ( v12 < num_achieved_awards_2 ) |
872 { | 872 { |
873 v13 = achievedAwardsIndex[v12]; | 873 v13 = achieved_awards[v12]; |
874 ++awards_count; | 874 ++num_achieved_awards; |
875 //v14 = (&dword_723718_autonote_related)[8 * v13]; | 875 //v14 = (&dword_723718_autonote_related)[8 * v13]; |
876 v14 = pAutonoteTxt[v13-1].pText; | 876 v14 = pAutonoteTxt[v13-1].pText; |
877 //a1.DrawText(pAutonoteFont, 1, 0, 0, (&dword_723718_autonote_related)[8 * v13], 0, 0, 0); | 877 //a1.DrawText(pAutonoteFont, 1, 0, 0, (&dword_723718_autonote_related)[8 * v13], 0, 0, 0); |
878 a1.DrawText(pAutonoteFont, 1, 0, 0, pAutonoteTxt[v13-1].pText, 0, 0, 0); | 878 a1.DrawText(pAutonoteFont, 1, 0, 0, pAutonoteTxt[v13-1].pText, 0, 0, 0); |
879 v15 = pAutonoteFont->CalcTextHeight(v14, &a1, 1, 0); | 879 v15 = pAutonoteFont->CalcTextHeight(v14, &a1, 1, 0); |
1197 } | 1197 } |
1198 } | 1198 } |
1199 } | 1199 } |
1200 else | 1200 else |
1201 { | 1201 { |
1202 black = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0); | 1202 black = TargetColor(0, 0, 0); |
1203 teal = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0xFFu); | 1203 teal = TargetColor(0, 0xFFu, 0xFFu); |
1204 v7 = pIndoor->pMapOutlines; | 1204 v7 = pIndoor->pMapOutlines; |
1205 uNumBlueFacesInBLVMinimap = 0; | 1205 uNumBlueFacesInBLVMinimap = 0; |
1206 v8 = pIndoor->pMapOutlines->uNumOutlines == 0; | 1206 v8 = pIndoor->pMapOutlines->uNumOutlines == 0; |
1207 v9 = pIndoor->pMapOutlines->uNumOutlines < 0; | 1207 v9 = pIndoor->pMapOutlines->uNumOutlines < 0; |
1208 screenWidth = 0; | 1208 screenWidth = 0; |
1379 else | 1379 else |
1380 v50 = 1; | 1380 v50 = 1; |
1381 } | 1381 } |
1382 pRenderer->DrawTransparentRedShade(v47, v49, (Texture *)(pTextureIDs_pMapDirs[v50] != -1 ? (int)&pIcons_LOD->pTextures[pTextureIDs_pMapDirs[v50]] : 0)); | 1382 pRenderer->DrawTransparentRedShade(v47, v49, (Texture *)(pTextureIDs_pMapDirs[v50] != -1 ? (int)&pIcons_LOD->pTextures[pTextureIDs_pMapDirs[v50]] : 0)); |
1383 } | 1383 } |
1384 result = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); | 1384 result = TargetColor(0xFFu, 0xFFu, 0xFFu); |
1385 v95 = 0; | 1385 v95 = 0; |
1386 v86 = result; | 1386 v86 = result; |
1387 if ( (signed int)uNumLevelDecorations > 0 ) | 1387 if ( (signed int)uNumLevelDecorations > 0 ) |
1388 { | 1388 { |
1389 screenWidth = (unsigned int)&pLevelDecorations[0].vPosition; | 1389 screenWidth = (unsigned int)&pLevelDecorations[0].vPosition; |
1446 pPalette_16 = (unsigned __int16 *)(v60 >> 16); | 1446 pPalette_16 = (unsigned __int16 *)(v60 >> 16); |
1447 v62 = (int)v61 << 16; | 1447 v62 = (int)v61 << 16; |
1448 teal = v60 >> 16; | 1448 teal = v60 >> 16; |
1449 v63 = (signed __int16)v61; | 1449 v63 = (signed __int16)v61; |
1450 a4a = map_texture_16; | 1450 a4a = map_texture_16; |
1451 result = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xCu, 0xCu, 0xCu); | 1451 result = TargetColor(0xCu, 0xCu, 0xCu); |
1452 screenCenter_X = 0; | 1452 screenCenter_X = 0; |
1453 for ( i = result; screenCenter_X < (signed int)v95; result = screenCenter_X ) | 1453 for ( i = result; screenCenter_X < (signed int)v95; result = screenCenter_X ) |
1454 { | 1454 { |
1455 a5a = 0; | 1455 a5a = 0; |
1456 if ( screenCenterY > 0 ) | 1456 if ( screenCenterY > 0 ) |