comparison UI/Books/UIMapBook.cpp @ 1446:8b4f4c723edd

Questbook_Draw
author Ritor1
date Mon, 05 Aug 2013 22:31:12 +0600
parents 6de9c1316852
children dfc9484ed94c
comparison
equal deleted inserted replaced
1445:6de9c1316852 1446:8b4f4c723edd
34 34
35 35
36 //----- (00411150) -------------------------------------------------------- 36 //----- (00411150) --------------------------------------------------------
37 void BookUI_DrawTownPortalMap() 37 void BookUI_DrawTownPortalMap()
38 { 38 {
39 //signed int v0; // edi@1
40 //__int16 v1; // dx@8
41 //POINT *v2; // edi@17
42 int v3; // edi@17 39 int v3; // edi@17
43 //__int16 v4; // dx@24 40 GUIWindow TownPortalWindow; // [sp+Ch] [bp-64h]@1
44 GUIWindow v6; // [sp+Ch] [bp-64h]@1
45 //POINT v7; // [sp+60h] [bp-10h]@17
46 POINT a2; // [sp+68h] [bp-8h]@17 41 POINT a2; // [sp+68h] [bp-8h]@17
47 42
48 pRenderer->ClearZBuffer(0, 479); 43 pRenderer->ClearZBuffer(0, 479);
49 pRenderer->DrawTextureTransparent(8, 8, pTexture_CurrentBook); 44 pRenderer->DrawTextureTransparent(8, 8, pTexture_CurrentBook);
50 pRenderer->DrawTextureTransparent(471, 445, pIcons_LOD->GetTexture(uExitCancelTextureId)); 45 pRenderer->DrawTextureTransparent(471, 445, pIcons_LOD->GetTexture(uExitCancelTextureId));
51 46
52 v6.uFrameX = game_viewport_x; 47 TownPortalWindow.uFrameX = game_viewport_x;
53 v6.uFrameY = game_viewport_y; 48 TownPortalWindow.uFrameY = game_viewport_y;
54 v6.uFrameWidth = game_viewport_width; 49 TownPortalWindow.uFrameWidth = game_viewport_width;
55 v6.uFrameHeight = game_viewport_height; 50 TownPortalWindow.uFrameHeight = game_viewport_height;
56 v6.uFrameZ = game_viewport_z; 51 TownPortalWindow.uFrameZ = game_viewport_z;
57 v6.uFrameW = game_viewport_w; 52 TownPortalWindow.uFrameW = game_viewport_w;
58 53
59 const uint fountain_bits_lut[] = {PARTY_QUEST_FOUNTAIN_HARMONDALE, 54 const uint fountain_bits_lut[] = {PARTY_QUEST_FOUNTAIN_HARMONDALE,
60 PARTY_QUEST_FOUNTAIN_PIERPONT, 55 PARTY_QUEST_FOUNTAIN_PIERPONT,
61 PARTY_QUEST_FOUNTAIN_NIGHON, 56 PARTY_QUEST_FOUNTAIN_NIGHON,
62 PARTY_QUEST_FOUNTAIN_EVENMORN_ISLE, 57 PARTY_QUEST_FOUNTAIN_EVENMORN_ISLE,
77 if (v3) 72 if (v3)
78 { 73 {
79 if (_449B57_test_bit(pParty->_quest_bits, fountain_bits_lut[v3 - 1])) 74 if (_449B57_test_bit(pParty->_quest_bits, fountain_bits_lut[v3 - 1]))
80 pRenderer->DrawTextureIndexed(pTownPortalBook_xs[v3 - 1], pTownPortalBook_ys[v3 - 1], pTexture_TownPortalIcons[v3 - 1]); 75 pRenderer->DrawTextureIndexed(pTownPortalBook_xs[v3 - 1], pTownPortalBook_ys[v3 - 1], pTexture_TownPortalIcons[v3 - 1]);
81 } 76 }
82 v6.DrawTitleText(pBook2Font, 0, 22u, 0, pGlobalTXT_LocalizationStrings[10], 3u); 77 TownPortalWindow.DrawTitleText(pBook2Font, 0, 22, 0, pGlobalTXT_LocalizationStrings[10], 3);
83 } 78 }
84 79
85 //----- (00410DEC) -------------------------------------------------------- 80 //----- (00410DEC) --------------------------------------------------------
86 unsigned int __cdecl DrawLloydBeaconsScreen() 81 unsigned int __cdecl DrawLloydBeaconsScreen()
87 { 82 {
88 Player *pPlayer; // esi@1 83 Player *pPlayer; // esi@1
89 char *pText; // eax@1 84 char *pText; // eax@1
90 //unsigned __int16 v2; // ax@6
91 //unsigned int result; // eax@11
92 //unsigned int v4; // esi@13
93 //unsigned int v5; // ecx@13
94 //char v6; // zf@13
95 //LloydBeacon *v7; // esi@14
96 int pTextHeight; // eax@14 85 int pTextHeight; // eax@14
97 int RemainingTime; // kr08_8@14 86 int RemainingTime; // kr08_8@14
98 unsigned int pHours; // esi@14 87 unsigned int pHours; // esi@14
99 unsigned int pDays; // eax@14 88 unsigned int pDays; // eax@14
100 char *pSelectionText; // eax@19 89 char *pSelectionText; // eax@19
101 //char *v13; // ecx@22
102 //int v14; // eax@27
103 Texture *v19; // [sp-4h] [bp-8Ch]@4 90 Texture *v19; // [sp-4h] [bp-8Ch]@4
104 GUIWindow pWindow; // [sp+Ch] [bp-7Ch]@1 91 GUIWindow pWindow; // [sp+Ch] [bp-7Ch]@1
105 //unsigned int v23; // [sp+64h] [bp-24h]@14
106 //__int64 v24; // [sp+68h] [bp-20h]@14
107 //unsigned int v25; // [sp+70h] [bp-18h]@13
108 char *Str; // [sp+74h] [bp-14h]@14 92 char *Str; // [sp+74h] [bp-14h]@14
109 int BeaconID; // [sp+78h] [bp-10h]@11 93 int BeaconID; // [sp+78h] [bp-10h]@11
110 //LloydBeacon *v28; // [sp+7Ch] [bp-Ch]@12
111 //RGBTexture *v29; // [sp+80h] [bp-8h]@12
112 int uNumMaxBeacons; // [sp+84h] [bp-4h]@6 94 int uNumMaxBeacons; // [sp+84h] [bp-4h]@6
113 95
114 pPlayer = &pParty->pPlayers[_506348_current_lloyd_playerid]; 96 pPlayer = &pParty->pPlayers[_506348_current_lloyd_playerid];
115 pRenderer->DrawTextureIndexed(8, 8, pTexture_LloydBeacons[(unsigned __int8)bRecallingBeacon]); 97 pRenderer->DrawTextureIndexed(8, 8, pTexture_LloydBeacons[(unsigned __int8)bRecallingBeacon]);
116 pText = pGlobalTXT_LocalizationStrings[523]; // Recall Beacon 98 pText = pGlobalTXT_LocalizationStrings[523]; // Recall Beacon
121 pWindow.uFrameZ = 435; 103 pWindow.uFrameZ = 435;
122 pWindow.uFrameW = game_viewport_w; 104 pWindow.uFrameW = game_viewport_w;
123 if ( !bRecallingBeacon ) 105 if ( !bRecallingBeacon )
124 pText = pGlobalTXT_LocalizationStrings[375]; // Set Beacon 106 pText = pGlobalTXT_LocalizationStrings[375]; // Set Beacon
125 sprintf(pTmpBuf.data(), "%s", pText); 107 sprintf(pTmpBuf.data(), "%s", pText);
126 pWindow.DrawTitleText(pBook2Font, 0, 22u, 0, pTmpBuf.data(), 3); 108 pWindow.DrawTitleText(pBook2Font, 0, 22, 0, pTmpBuf.data(), 3);
127 if ( bRecallingBeacon ) 109 if ( bRecallingBeacon )
128 { 110 {
129 pRenderer->DrawTextureTransparent(pBtn_Book_1->uX, pBtn_Book_1->uY, pTex_tab_an_6b__zoom_on); 111 pRenderer->DrawTextureTransparent(pBtn_Book_1->uX, pBtn_Book_1->uY, pTex_tab_an_6b__zoom_on);
130 v19 = pTex_tab_an_6a__zoom_off; 112 v19 = pTex_tab_an_6a__zoom_off;
131 } 113 }
333 } 315 }
334 316
335 //----- (00442955) -------------------------------------------------------- 317 //----- (00442955) --------------------------------------------------------
336 void DrawBook_Map_sub( unsigned int tl_x, unsigned int tl_y, unsigned int br_x, int br_y, int _48074 ) 318 void DrawBook_Map_sub( unsigned int tl_x, unsigned int tl_y, unsigned int br_x, int br_y, int _48074 )
337 { 319 {
338 //unsigned int v11; // edx@11
339 //__int16 v12; // cx@12
340 //signed int v13; // eax@15
341 //int v14; // eax@16
342 int v20; // eax@16 320 int v20; // eax@16
343 signed int v21; // esi@18 321 signed int v21; // esi@18
344 int v22; // ecx@21 322 int v22; // ecx@21
345 BLVMapOutline *v23; // ecx@21 323 BLVMapOutline *v23; // ecx@21
346 Vec3_short_ *v24; // edx@21 324 Vec3_short_ *v24; // edx@21
370 signed int v48; // ecx@38 348 signed int v48; // ecx@38
371 int v49; // eax@38 349 int v49; // eax@38
372 signed int v50; // edx@55 350 signed int v50; // edx@55
373 unsigned int v51; // ecx@55 351 unsigned int v51; // ecx@55
374 int result; // eax@72 352 int result; // eax@72
375 int v53; // eax@75
376 int v54; // esi@75 353 int v54; // esi@75
377 int v55; // eax@75 354 int v55; // eax@75
378 __int16 v56; // si@85 355 __int16 v56; // si@85
379 double v57; // st7@85 356 double v57; // st7@85
380 int v58; // ebx@85 357 int v58; // ebx@85
413 int pCenterX; // [sp+48034h] [bp-30h]@1 390 int pCenterX; // [sp+48034h] [bp-30h]@1
414 int v87; // [sp+48038h] [bp-2Ch]@16 391 int v87; // [sp+48038h] [bp-2Ch]@16
415 unsigned int v88; // [sp+4803Ch] [bp-28h]@16 392 unsigned int v88; // [sp+4803Ch] [bp-28h]@16
416 int black; // [sp+48040h] [bp-24h]@8 393 int black; // [sp+48040h] [bp-24h]@8
417 int screenCenterY; // [sp+48044h] [bp-20h]@1 394 int screenCenterY; // [sp+48044h] [bp-20h]@1
418 unsigned int i; // [sp+48048h] [bp-1Ch]@9
419 unsigned int screenHeight; // [sp+4804Ch] [bp-18h]@16 395 unsigned int screenHeight; // [sp+4804Ch] [bp-18h]@16
420 unsigned __int16 *v93; // [sp+48050h] [bp-14h]@16 396 unsigned __int16 *v93; // [sp+48050h] [bp-14h]@16
421 signed int screenWidth; // [sp+48054h] [bp-10h]@8 397 signed int screenWidth; // [sp+48054h] [bp-10h]@8
422 unsigned int v95; // [sp+48058h] [bp-Ch]@16 398 unsigned int v95; // [sp+48058h] [bp-Ch]@16
423 int v96; // [sp+4805Ch] [bp-8h]@10 399 int v96; // [sp+4805Ch] [bp-8h]@10
618 if ( (signed int)v51 < 128 ) 594 if ( (signed int)v51 < 128 )
619 v50 = 0; 595 v50 = 0;
620 pRenderer->DrawTransparentRedShade(v47, v49, pIcons_LOD->GetTexture(pTextureIDs_pMapDirs[v50])); 596 pRenderer->DrawTransparentRedShade(v47, v49, pIcons_LOD->GetTexture(pTextureIDs_pMapDirs[v50]));
621 } 597 }
622 result = TargetColor(0xFFu, 0xFFu, 0xFFu); 598 result = TargetColor(0xFFu, 0xFFu, 0xFFu);
623 v95 = 0;
624 pCenterX = result; 599 pCenterX = result;
625 if ( (signed int)uNumLevelDecorations > 0 ) 600 if ( (signed int)uNumLevelDecorations > 0 )
626 { 601 {
627 screenWidth = (unsigned int)&pLevelDecorations[0].vPosition; 602 for ( uint i = 0; i < (signed int)uNumLevelDecorations; ++i )
628 do 603 {
629 { 604 if ( pLevelDecorations[i].field_2 & 8 )
630 if ( *(char *)(screenWidth - 2) & 8 )
631 { 605 {
632 v53 = *(int *)(screenWidth + 4) - pCenterY; 606 screenHeight = pLevelDecorations[i].vPosition.y - pCenterY;
633 v93 = (unsigned __int16 *)(*(int *)screenWidth - viewparams->sViewCenterX); 607 v93 = (unsigned __int16 *)(pLevelDecorations[i].vPosition.x - viewparams->sViewCenterX);
634 screenHeight = v53; 608 v54 = ((unsigned __int64)((signed int)v93 * (signed __int64)viewparams->field_2C) >> 16) + screenCenter_X;
635 v54 = ((unsigned __int64)((signed int)v93 * (signed __int64)viewparams->field_2C) >> 16) + screenCenter_X; 609 v97 = (const void *)((unsigned __int64)(screenHeight * (signed __int64)viewparams->field_2C) >> 16);
636 v97 = (const void *)((unsigned __int64)(v53 * (signed __int64)viewparams->field_2C) >> 16); 610 v55 = screenCenterY - (int)v97;
637 v55 = screenCenterY - (int)v97; 611 if ( v54 >= pRenderer->raster_clip_x )
638 if ( v54 >= pRenderer->raster_clip_x ) 612 {
639 { 613 if ( v54 <= pRenderer->raster_clip_z && v55 >= pRenderer->raster_clip_y && v55 <= pRenderer->raster_clip_w )
640 if ( v54 <= pRenderer->raster_clip_z && v55 >= pRenderer->raster_clip_y && v55 <= pRenderer->raster_clip_w ) 614 {
641 { 615 if ( viewparams->field_2C > 512 )
642 if ( viewparams->field_2C > 512 ) 616 {
643 { 617 pRenderer->RasterLine2D(v54 - 1, v55 - 1, v54 - 1, v55 + 1, pCenterX);
644 v96 = v55 + 1; 618 pRenderer->RasterLine2D(v54, v55 - 1, v54, v55 + 1, pCenterX);
645 black = v55 - 1; 619 ++v54;
646 pRenderer->RasterLine2D(v54 - 1, v55 - 1, v54 - 1, v55 + 1, pCenterX); 620 v72 = v55 + 1;
647 pRenderer->RasterLine2D(v54, black, v54, v96, pCenterX); 621 v71 = v54;
648 ++v54; 622 v70 = v55 - 1;
649 v72 = v96;
650 v71 = v54;
651 v70 = black;
652 }
653 else
654 {
655 v72 = screenCenterY - (int)v97;
656 v71 = ((unsigned __int64)((signed int)v93 * (signed __int64)viewparams->field_2C) >> 16) + screenCenter_X;
657 v70 = screenCenterY - (int)v97;
658 }
659 pRenderer->RasterLine2D(v54, v70, v71, v72, pCenterX);
660 }
661 }
662 } 623 }
663 ++v95; 624 else
664 result = v95; 625 {
665 screenWidth += 32; 626 v72 = screenCenterY - (int)v97;
627 v71 = ((unsigned __int64)((signed int)v93 * (signed __int64)viewparams->field_2C) >> 16) + screenCenter_X;
628 v70 = screenCenterY - (int)v97;
666 } 629 }
667 while ( (signed int)v95 < (signed int)uNumLevelDecorations ); 630 pRenderer->RasterLine2D(v54, v70, v71, v72, pCenterX);
631 }
668 } 632 }
669 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) 633 }
634 }
635 }
636 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
637 {
638 screenCenterY = br_x - tl_x + 1;
639 v95 = br_y - tl_y + 1;
640 v77 = &pRenderer->pTargetSurface[tl_x + tl_y * pRenderer->uTargetSurfacePitch];
641 v56 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2;
642 black = (1 << (v56 + 16)) / viewparams->field_2C;
643 v57 = (double)(1 << (16 - v56));
644 v58 = 22528 / (viewparams->field_2C / 384);
645 v59 = (signed __int64)((double)(viewparams->sViewCenterX - v58 + 32768) / v57);
646 v60 = (int)v59 << 16;
647 v97 = (const void *)((int)v59 << 16);
648 v61 = (signed __int64)((double)(32768 - v58 - pCenterY) / v57);
649 pPalette_16 = (unsigned __int16 *)(v60 >> 16);
650 v62 = (int)v61 << 16;
651 teal = v60 >> 16;
652 v63 = (signed __int16)v61;
653 a4a = map_texture_16;
654 result = TargetColor(0xCu, 0xCu, 0xCu);
655 for ( screenCenter_X = 0; screenCenter_X < (signed int)v95; ++screenCenter_X )
656 {
657 if ( screenCenterY > 0 )
658 {
659 v96 = (v63 - 80) / 4;
660 v64 = teal;
661 for ( a5a = 0; a5a < screenCenterY; ++a5a )
670 { 662 {
671 screenCenterY = br_x - tl_x + 1; 663 v81 = (v64 - 80) / 4;
672 v95 = br_y - tl_y + 1; 664 if ( !pOutdoor->_47F04C(v81, v96) )
673 v77 = &pRenderer->pTargetSurface[tl_x + tl_y * pRenderer->uTargetSurfacePitch]; 665 {
674 v56 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2; 666 if ( pOutdoor->_47F097(v81, v96) )
675 black = (1 << (v56 + 16)) / viewparams->field_2C;
676 v57 = (double)(1 << (16 - v56));
677 v58 = 22528 / (viewparams->field_2C / 384);
678 v59 = (signed __int64)((double)(viewparams->sViewCenterX - v58 + 32768) / v57);
679 v60 = (int)v59 << 16;
680 v97 = (const void *)((int)v59 << 16);
681 v61 = (signed __int64)((double)(32768 - v58 - pCenterY) / v57);
682 pPalette_16 = (unsigned __int16 *)(v60 >> 16);
683 v62 = (int)v61 << 16;
684 teal = v60 >> 16;
685 v63 = (signed __int16)v61;
686 a4a = map_texture_16;
687 result = TargetColor(0xCu, 0xCu, 0xCu);
688 screenCenter_X = 0;
689 for ( i = result; screenCenter_X < (signed int)v95; result = screenCenter_X )
690 { 667 {
691 a5a = 0; 668 if ( !((a5a + screenCenter_X) % 2) )
692 if ( screenCenterY > 0 ) 669 *a4a = result;
693 {
694 v96 = (v63 - 80) / 4;
695 v64 = teal;
696 do
697 {
698 v81 = (v64 - 80) / 4;
699 if ( !pOutdoor->_47F04C(v81, v96) )
700 {
701 if ( pOutdoor->_47F097(v81, v96) )
702 {
703 if ( !((a5a + screenCenter_X) % 2) )
704 *a4a = i;
705 }
706 else
707 {
708 *a4a = 0;
709 }
710 }
711 ++a4a;
712 v97 = (char *)v97 + black;
713 v64 = (signed int)v97 >> 16;
714 ++a5a;
715 }
716 while ( a5a < screenCenterY );
717 }
718 v62 += black;
719 v97 = (const void *)v60;
720 a4a += screenCenterY - a5a;
721 v63 = v62 >> 16;
722 ++screenCenter_X;
723 teal = (unsigned int)pPalette_16;
724 } 670 }
725 v65 = v95; 671 else
726 v66 = map_texture_16; 672 *a4a = 0;
727 if ( (signed int)v95 > 0 ) 673 }
728 { 674 ++a4a;
729 v67 = v77; 675 v97 = (char *)v97 + black;
730 result = 2 * (pRenderer->uTargetSurfacePitch - screenCenterY); 676 v64 = (signed int)v97 >> 16;
731 do
732 {
733 if ( screenCenterY > 0 )
734 {
735 v68 = screenCenterY;
736 do
737 {
738 v69 = *(short *)v66;
739 if ( !*(short *)v66 || v69 == (short)i )
740 *v67 = v69;
741 ++v66;
742 ++v67;
743 --v68;
744 }
745 while ( v68 );
746 }
747 v67 = (unsigned __int16 *)((char *)v67 + result);
748 --v65;
749 }
750 while ( v65 );
751 }
752 } 677 }
753 } 678 }
679 v62 += black;
680 v97 = (const void *)v60;
681 a4a += screenCenterY - a5a;
682 v63 = v62 >> 16;
683 teal = (unsigned int)pPalette_16;
684 }
685 v66 = map_texture_16;
686 if ( (signed int)v95 > 0 )
687 {
688 v67 = v77;
689 result = 2 * (pRenderer->uTargetSurfacePitch - screenCenterY);
690 for ( v65 = v95; v65; --v65 )
691 {
692 if ( screenCenterY > 0 )
693 {
694 for ( v68 = screenCenterY; v68; --v68 )
695 {
696 v69 = *(short *)v66;
697 if ( !*(short *)v66 || v69 == (short)result )
698 *v67 = v69;
699 ++v66;
700 ++v67;
701 }
702 }
703 v67 = (unsigned __int16 *)((char *)v67 + result);
704 }
705 }
706 }
707 }