Mercurial > mm7
comparison mm7_3.cpp @ 722:70c5a87a1307
Слияние
author | Ritor1 |
---|---|
date | Wed, 20 Mar 2013 17:49:15 +0600 |
parents | a5ee769b02c6 d6236f6a9882 |
children | 256211e8243a |
comparison
equal
deleted
inserted
replaced
721:f39d5902c85a | 722:70c5a87a1307 |
---|---|
11640 pCurrentScreen > SCREEN_LOADGAME && pCurrentScreen <= SCREEN_E || | 11640 pCurrentScreen > SCREEN_LOADGAME && pCurrentScreen <= SCREEN_E || |
11641 pCurrentScreen > SCREEN_VIDEO && pCurrentScreen <= SCREEN_INPUT_BLV || pCurrentScreen == SCREEN_CASTING; | 11641 pCurrentScreen > SCREEN_VIDEO && pCurrentScreen <= SCREEN_INPUT_BLV || pCurrentScreen == SCREEN_CASTING; |
11642 } | 11642 } |
11643 // 4E28F8: using guessed type int pCurrentScreen; | 11643 // 4E28F8: using guessed type int pCurrentScreen; |
11644 | 11644 |
11645 //----- (00441498) -------------------------------------------------------- | 11645 |
11646 void __cdecl GameUI_DrawTorchlightAndWizardEye() | |
11647 { | |
11648 if (pCurrentScreen == SCREEN_GAME | |
11649 || pCurrentScreen == SCREEN_MENU | |
11650 || pCurrentScreen == SCREEN_OPTIONS | |
11651 || pCurrentScreen == SCREEN_REST | |
11652 || pCurrentScreen == SCREEN_SPELL_BOOK | |
11653 || pCurrentScreen == SCREEN_CHEST | |
11654 || pCurrentScreen == SCREEN_SAVEGAME | |
11655 || pCurrentScreen == SCREEN_LOADGAME | |
11656 || pCurrentScreen == SCREEN_F | |
11657 || pCurrentScreen == SCREEN_BOOKS | |
11658 || pCurrentScreen == SCREEN_BRANCHLESS_NPC_DIALOG ) | |
11659 { | |
11660 if (pParty->TorchlightActive()) | |
11661 { | |
11662 auto icon = pIconsFrameTable->GetFrame((signed __int16)pUIAnum_Torchlight->uIconID, pEventTimer->Time()); | |
11663 pRenderer->DrawTextureTransparent(pUIAnum_Torchlight->x, pUIAnum_Torchlight->y, pIcons_LOD->GetTexture(icon->uTextureID)); | |
11664 } | |
11665 if (pParty->WizardEyeActive()) | |
11666 { | |
11667 auto icon = pIconsFrameTable->GetFrame((signed __int16)pUIAnim_WizardEye->uIconID, pEventTimer->Time()); | |
11668 pRenderer->DrawTextureTransparent(pUIAnim_WizardEye->x, pUIAnim_WizardEye->y, pIcons_LOD->GetTexture(icon->uTextureID)); | |
11669 } | |
11670 } | |
11671 } | |
11672 // 4E28F8: using guessed type int pCurrentScreen; | |
11673 | |
11674 //----- (0044158F) -------------------------------------------------------- | |
11675 void __cdecl GameUI_DrawCharacterSelectionFrame() | |
11676 { | |
11677 if ( uActiveCharacter ) | |
11678 pRenderer->DrawTextureTransparent( | |
11679 pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[uActiveCharacter - 1] - 9, | |
11680 0x17Cu, | |
11681 &pIcons_LOD->pTextures[dword_50C98C]); | |
11682 } | |
11683 | |
11684 //----- (004415C5) -------------------------------------------------------- | |
11685 void LoadPartyBuffIcons() | |
11686 { | |
11687 for (uint i = 0; i < 14; ++i) | |
11688 { | |
11689 char filename[200]; | |
11690 sprintf(filename, "isn-%02d", i + 1); | |
11691 pTextureIDs_PartyBuffIcons[i] = pIcons_LOD->LoadTexture(filename, TEXTURE_16BIT_PALETTE); | |
11692 } | |
11693 | |
11694 uIconIdx_FlySpell = pIconsFrameTable->FindIcon("spell21"); | |
11695 uIconIdx_WaterWalk = pIconsFrameTable->FindIcon("spell27"); | |
11696 } | |
11697 | |
11698 //----- (0044162D) -------------------------------------------------------- | |
11699 void __cdecl GameUI_DrawPartySpells() | |
11700 { | |
11701 unsigned int v0; // ebp@1 | |
11702 //signed int v1; // edi@1 | |
11703 //int v2; // eax@2 | |
11704 //int v3; // ecx@5 | |
11705 //__int16 *v4; // ebx@25 | |
11706 //Player *v5; // edi@26 | |
11707 //unsigned int v6; // [sp-4h] [bp-1Ch]@11 | |
11708 Texture *v7; // [sp-4h] [bp-1Ch]@12 | |
11709 //unsigned int v8; // [sp-4h] [bp-1Ch]@20 | |
11710 Texture *v9; // [sp-4h] [bp-1Ch]@21 | |
11711 //Player **v10; // [sp+10h] [bp-8h]@25 | |
11712 | |
11713 v0 = (signed __int64)((double)GetTickCount() * 0.050000001); | |
11714 //v1 = 0; | |
11715 for (uint i = 0; i < 14; ++i) | |
11716 { | |
11717 //v2 = byte_4E5DD8[v1]; | |
11718 if (pParty->pPartyBuffs[byte_4E5DD8[i]].uExpireTime) | |
11719 { | |
11720 auto tex = pIcons_LOD->GetTexture(pTextureIDs_PartyBuffIcons[i]); | |
11721 //v3 = pTextureIDs_PartyBuffIcons[i]; | |
11722 if (tex) | |
11723 pRenderer->_4A65CC(pPartySpellbuffsUI_XYs[i][0], | |
11724 pPartySpellbuffsUI_XYs[i][1], tex, tex, | |
11725 v0 + 20 * pPartySpellbuffsUI_smthns[i], 0, 63); | |
11726 } | |
11727 //++v1; | |
11728 } | |
11729 //while ( v1 < 14 ); | |
11730 | |
11731 if (pCurrentScreen == SCREEN_GAME || pCurrentScreen == SCREEN_NPC_DIALOGUE) | |
11732 { | |
11733 if (pParty->FlyActive()) | |
11734 { | |
11735 if ( pParty->bFlying ) | |
11736 v7 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_FlySpell, v0)->uTextureID]; | |
11737 else | |
11738 v7 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_FlySpell, 0)->uTextureID]; | |
11739 if ( pRenderer->pRenderD3D ) | |
11740 pRenderer->DrawTextureIndexed(8u, 8u, v7); | |
11741 else | |
11742 pRenderer->DrawTextureTransparent(8u, 8u, v7); | |
11743 } | |
11744 if (pParty->WaterWalkActive()) | |
11745 { | |
11746 if ( pParty->uFlags & PARTY_FLAGS_1_STANDING_ON_WATER) | |
11747 v9 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_WaterWalk, v0)->uTextureID]; | |
11748 else | |
11749 v9 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_WaterWalk, 0)->uTextureID]; | |
11750 if ( pRenderer->pRenderD3D ) | |
11751 pRenderer->DrawTextureIndexed(396u, 8u, v9); | |
11752 else | |
11753 pRenderer->DrawTextureTransparent(396u, 8u, v9); | |
11754 } | |
11755 } | |
11756 | |
11757 for (uint i = 0; i < 4; ++i) | |
11758 { | |
11759 auto player = pParty->pPlayers + i; | |
11760 | |
11761 if (player->pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].uExpireTime) | |
11762 pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 427, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Hammerhands)); | |
11763 if (player->pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime) | |
11764 pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 393, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Bless)); | |
11765 if (player->pPlayerBuffs[PLAYER_BUFF_PRESERVATION].uExpireTime) | |
11766 pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 410, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Preservation)); | |
11767 if (player->pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].uExpireTime) | |
11768 pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 444, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_PainReflection)); | |
11769 } | |
11770 } | |
11771 | 11646 |
11772 //----- (00441A4E) -------------------------------------------------------- | 11647 //----- (00441A4E) -------------------------------------------------------- |
11773 __int16 __fastcall sub_441A4E(int a1) | 11648 __int16 __fastcall sub_441A4E(int a1) |
11774 { | 11649 { |
11775 __int16 result; // ax@1 | 11650 __int16 result; // ax@1 |
11843 while ( (signed int)v3 < (signed int)&pOverlayList->pOverlays ); | 11718 while ( (signed int)v3 < (signed int)&pOverlayList->pOverlays ); |
11844 return result; | 11719 return result; |
11845 } | 11720 } |
11846 | 11721 |
11847 | 11722 |
11848 | |
11849 //----- (00441D38) -------------------------------------------------------- | |
11850 void GameUI_DrawMinimap(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW, unsigned int uZoom, unsigned int bRedrawOdmMinimap) | |
11851 { | |
11852 int uHeight; // ebx@6 | |
11853 __int16 v11; // cx@11 | |
11854 unsigned int v14; // ebx@23 | |
11855 int v15; // eax@23 | |
11856 __int16 v17; // di@30 | |
11857 double v18; // st7@30 | |
11858 float v19; // ST38_4@30 | |
11859 double v20; // st7@30 | |
11860 double v21; // st6@30 | |
11861 double v22; // st5@33 | |
11862 signed int v27; // eax@37 | |
11863 unsigned __int16 *v28; // ecx@37 | |
11864 signed int v29; // edi@40 | |
11865 //signed int v33; // ebx@50 | |
11866 //unsigned int v34; // eax@50 | |
11867 //signed int v35; // ecx@50 | |
11868 //unsigned __int16 v36; // di@66 | |
11869 int v37; // edi@72 | |
11870 int v38; // ebx@72 | |
11871 __int16 v39; // ax@87 | |
11872 int v40; // edi@91 | |
11873 int v41; // ebx@91 | |
11874 unsigned int v42; // eax@101 | |
11875 unsigned int v43; // ebx@101 | |
11876 unsigned int v44; // ST30_4@101 | |
11877 char *v45; // ebx@106 | |
11878 int v46; // edi@108 | |
11879 int v47; // eax@108 | |
11880 unsigned int v48; // ebx@114 | |
11881 unsigned int v49; // ST64_4@114 | |
11882 unsigned int v51; // [sp-10h] [bp-64h]@79 | |
11883 unsigned int v52; // [sp-10h] [bp-64h]@100 | |
11884 unsigned int v53; // [sp-Ch] [bp-60h]@79 | |
11885 unsigned int v54; // [sp-Ch] [bp-60h]@100 | |
11886 unsigned int v55; // [sp-8h] [bp-5Ch]@77 | |
11887 unsigned int v56; // [sp-8h] [bp-5Ch]@100 | |
11888 //signed int v57; // [sp-4h] [bp-58h]@54 | |
11889 unsigned __int16 v58; // [sp-4h] [bp-58h]@77 | |
11890 unsigned __int16 v59; // [sp-4h] [bp-58h]@100 | |
11891 unsigned __int16 v60; // [sp+10h] [bp-44h]@66 | |
11892 unsigned int v61; // [sp+10h] [bp-44h]@85 | |
11893 unsigned int v63; // [sp+14h] [bp-40h]@85 | |
11894 unsigned int v65; // [sp+18h] [bp-3Ch]@85 | |
11895 unsigned int lPitch; // [sp+20h] [bp-34h]@1 | |
11896 unsigned int lPitcha; // [sp+20h] [bp-34h]@23 | |
11897 char *lPitchb; // [sp+20h] [bp-34h]@106 | |
11898 unsigned int v69; // [sp+24h] [bp-30h]@23 | |
11899 signed int v70; // [sp+24h] [bp-30h]@37 | |
11900 unsigned __int16 uBlue; // [sp+28h] [bp-2Ch]@1 | |
11901 signed int uBluea; // [sp+28h] [bp-2Ch]@37 | |
11902 int v73; // [sp+2Ch] [bp-28h]@30 | |
11903 int v76; // [sp+34h] [bp-20h]@91 | |
11904 int v77; // [sp+34h] [bp-20h]@108 | |
11905 int v79; // [sp+38h] [bp-1Ch]@72 | |
11906 char *a2c; // [sp+40h] [bp-14h]@68 | |
11907 signed int uCenterY; // [sp+48h] [bp-Ch]@1 | |
11908 signed int uCenterX; // [sp+4Ch] [bp-8h]@1 | |
11909 signed int uWidth; // [sp+5Ch] [bp+8h]@30 | |
11910 signed int uZe; // [sp+5Ch] [bp+8h]@67 | |
11911 signed int uZf; // [sp+5Ch] [bp+8h]@85 | |
11912 signed int uZg; // [sp+5Ch] [bp+8h]@105 | |
11913 unsigned int uWa; // [sp+60h] [bp+Ch]@23 | |
11914 float uWb; // [sp+60h] [bp+Ch]@30 | |
11915 unsigned int uWd; // [sp+60h] [bp+Ch]@95 | |
11916 float uZooma; // [sp+64h] [bp+10h]@117 | |
11917 unsigned int flagsb; // [sp+68h] [bp+14h]@66 | |
11918 Actor *flagsc; // [sp+68h] [bp+14h]@86 | |
11919 unsigned int flagsd; // [sp+68h] [bp+14h]@105 | |
11920 | |
11921 uCenterX = (uX + uZ) / 2; | |
11922 uCenterY = (uY + uW) / 2; | |
11923 lPitch = pRenderer->uTargetSurfacePitch; | |
11924 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0); | |
11925 uBlue = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0xFFu); | |
11926 auto bWizardEyeActive = pParty->WizardEyeActive(); | |
11927 auto uWizardEyeSkillLevel = pParty->WizardEyeSkillLevel(); | |
11928 if (CheckHiredNPCSpeciality(Cartographer)) | |
11929 { | |
11930 bWizardEyeActive = true; | |
11931 uWizardEyeSkillLevel = 2; | |
11932 } | |
11933 pRenderer->Clip_v2(uX, uY, uZ - 1, uW - 1); | |
11934 uHeight = uW - uY; | |
11935 uWidth = uZ - uX; | |
11936 | |
11937 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor) | |
11938 { | |
11939 v17 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2; | |
11940 auto pMapLod0 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pLevelOfDetail0; | |
11941 auto pPal = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pPalette16; | |
11942 v73 = (1 << (v17 + 16)) / (signed int)uZoom; | |
11943 v18 = (double)(1 << (16 - v17)); | |
11944 v19 = v18; | |
11945 v20 = (double)(pParty->vPosition.x + 32768) / v18; | |
11946 v21 = (double)(32768 - pParty->vPosition.y) / v19; | |
11947 uWb = v21; | |
11948 switch (uZoom) | |
11949 { | |
11950 case 512: | |
11951 { | |
11952 v20 = v20 - (double)(uWidth / 2); | |
11953 v22 = (double)(uHeight / 2); | |
11954 uWb = v21 - v22; | |
11955 } | |
11956 break; | |
11957 | |
11958 case 1024: | |
11959 { | |
11960 v20 = v20 - (double)(uWidth / 4); | |
11961 v22 = (double)(uHeight / 4); | |
11962 uWb = v21 - v22; | |
11963 } | |
11964 break; | |
11965 | |
11966 case 2048: | |
11967 { | |
11968 v20 = v20 - (double)(uWidth / 8); | |
11969 v22 = (double)(uHeight / 8); | |
11970 uWb = v21 - v22; | |
11971 } | |
11972 break; | |
11973 | |
11974 default: assert(false); | |
11975 } | |
11976 assert(sizeof(pOdmMinimap) == 137 * 117 * sizeof(short)); | |
11977 | |
11978 v70 = floorf(v20 * 65536.0 + 0.5f);//LODWORD(v24); | |
11979 uBluea = floorf(uWb * 65536.0 + 0.5f);//LODWORD(v25); | |
11980 v27 = uBluea >> 16; | |
11981 v28 = &pRenderer->pTargetSurface[uX + uY * lPitch]; | |
11982 if (pMapLod0 && bRedrawOdmMinimap) | |
11983 { | |
11984 assert(uWidth == 137 && uHeight == 117); | |
11985 //auto pMinimap = (unsigned __int16 *)pOdmMinimap; | |
11986 | |
11987 auto mapWidth = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uTextureWidth; | |
11988 | |
11989 v29 = v70 >> 16; | |
11990 | |
11991 for (int y = 0; y < uHeight; ++y) | |
11992 { | |
11993 auto pMapLod0Line = &pMapLod0[v27 * mapWidth]; | |
11994 for (int x = 0; x < uWidth; ++x) | |
11995 { | |
11996 //*pMinimap++ = pPal[pMapLod0Line[v29]]; | |
11997 pOdmMinimap[y][x] = pPal[pMapLod0Line[v29]]; | |
11998 v29 = (v70 + x * v73) >> 16; | |
11999 } | |
12000 | |
12001 v29 = v70 >> 16; | |
12002 v28 += 137 - uWidth; | |
12003 uBluea += v73; | |
12004 v27 = uBluea >> 16; | |
12005 } | |
12006 } | |
12007 | |
12008 for (int y = 0; y < 117; ++y) | |
12009 { | |
12010 for (int x = 0; x < 137; ++x) | |
12011 { | |
12012 *v28++ = pOdmMinimap[y][x]; | |
12013 } | |
12014 v28 += lPitch - 137; | |
12015 } | |
12016 uNumBlueFacesInBLVMinimap = 0; | |
12017 } | |
12018 else | |
12019 { | |
12020 pRenderer->FillRectFast(uX, uY, uZ - uX, uHeight, 0xF); | |
12021 uNumBlueFacesInBLVMinimap = 0; | |
12022 | |
12023 for (uint i = 0; i < pIndoor->pMapOutlines->uNumOutlines; ++i) | |
12024 { | |
12025 auto pOutline = &pIndoor->pMapOutlines->pOutlines[i]; | |
12026 | |
12027 auto pFace1 = pIndoor->pFaces + pOutline->uFace1ID; | |
12028 auto pFace2 = pIndoor->pFaces + pOutline->uFace2ID; | |
12029 //v9 = pIndoor->pFaces[pMapVertex->uFace1ID].uAttributes; | |
12030 //v10 = pIndoor->pFaces[pMapVertex->uFace2ID].uAttributes; | |
12031 if (pFace1->Visible() && pFace2->Visible()) | |
12032 { | |
12033 v11 = pOutline->uFlags; | |
12034 if ( v11 & 1 ) | |
12035 goto LABEL_15; | |
12036 if (pFace1->uAttributes & 0x80 || pFace2->uAttributes & 0x80u != 0 ) | |
12037 goto LABEL_ABC; | |
12038 | |
12039 } | |
12040 continue; | |
12041 | |
12042 LABEL_ABC: | |
12043 pOutline->uFlags = v11 | 1; | |
12044 pIndoor->_visible_outlines[i >> 3] |= 1 << (7 - i % 8); | |
12045 | |
12046 LABEL_15: | |
12047 //v12 = &pIndoor->pFaces[pOutline->uFace1ID]; | |
12048 if (bWizardEyeActive && uWizardEyeSkillLevel >= 3 && | |
12049 (pFace1->uAttributes & 0x2000000 || pFace2->uAttributes & 0x2000000) && | |
12050 (pIndoor->pFaceExtras[pFace1->uFaceExtraID].uEventID || pIndoor->pFaceExtras[pFace2->uFaceExtraID].uEventID)) | |
12051 { | |
12052 if (uNumBlueFacesInBLVMinimap < 49) | |
12053 pBlueFacesInBLVMinimapIDs[uNumBlueFacesInBLVMinimap++] = i; | |
12054 } | |
12055 else | |
12056 { | |
12057 auto _a = (uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x); | |
12058 auto _b = ((unsigned int)((unsigned __int64)_a >> 16) << 16); | |
12059 auto _c = ((signed int)(_b - uZoom * pParty->vPosition.x) >> 16); | |
12060 v69 = uCenterX + _c; | |
12061 v69 = uCenterX + ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x) >> 16) << 16) - uZoom * pParty->vPosition.x) >> 16); | |
12062 lPitcha = uCenterY - ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].y) >> 16) << 16) - uZoom * pParty->vPosition.y) >> 16); | |
12063 uWa = uCenterX + ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].x) >> 16) << 16) - uZoom * pParty->vPosition.x) >> 16); | |
12064 v14 = uCenterY - ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].y) >> 16) << 16) - uZoom * pParty->vPosition.y) >> 16); | |
12065 v15 = abs(pOutline->sZ - pParty->vPosition.z) / 8; | |
12066 if ( v15 > 100 ) | |
12067 v15 = 100; | |
12068 pRenderer->Line2D(v69, lPitcha, uWa, v14, viewparams->pPalette[-v15 + 200]); | |
12069 } | |
12070 } | |
12071 | |
12072 | |
12073 for (uint i = 0; i < uNumBlueFacesInBLVMinimap; ++i) | |
12074 { | |
12075 //v16 = (uint *)&pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[uZb]]; | |
12076 auto pOutline = &pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[i]]; | |
12077 pRenderer->Line2D(uCenterX + ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom | |
12078 * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x) >> 16) << 16) | |
12079 - uZoom * pParty->vPosition.x) >> 16), | |
12080 uCenterY | |
12081 - ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom | |
12082 * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].y) >> 16) << 16) | |
12083 - uZoom * pParty->vPosition.y) >> 16), | |
12084 uCenterX | |
12085 + ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom | |
12086 * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].x) >> 16) << 16) | |
12087 - uZoom * pParty->vPosition.x) >> 16), | |
12088 uCenterY | |
12089 - ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom | |
12090 * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].y) >> 16) << 16) | |
12091 - uZoom * pParty->vPosition.y) >> 16), | |
12092 uBlue); | |
12093 } | |
12094 } | |
12095 | |
12096 | |
12097 assert(pParty->sRotationY >= 0); | |
12098 float angle = (pParty->sRotationY % 2048) / 2048.0f; | |
12099 const float two_pi = 2.0f * 3.14159f; | |
12100 | |
12101 uint arrow_idx = floorf(0.5f + 7 * angle); | |
12102 pRenderer->DrawTextureTransparent(uCenterX - 3, uCenterY - 3, pIcons_LOD->GetTexture(pTextureIDs_pMapDirs[arrow_idx])); | |
12103 | |
12104 flagsb = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0xFFu); | |
12105 v60 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0, 0); | |
12106 if (bWizardEyeActive) | |
12107 { | |
12108 uZe = 0; | |
12109 //for (uint i = 0; i < uNumSpriteObjects; ++i) | |
12110 if (uNumSpriteObjects > 0) | |
12111 { | |
12112 a2c = (char *)&pSpriteObjects[0].uObjectDescID; | |
12113 while ( 1 ) | |
12114 { | |
12115 if ( !*((short *)a2c - 1) | |
12116 || !*(short *)a2c | |
12117 || uWizardEyeSkillLevel == 1 | |
12118 || (v37 = ((unsigned __int64)((*(int *)(a2c + 2) - pParty->vPosition.x) * (signed __int64)(signed int)uZoom) >> 16) | |
12119 + uCenterX, | |
12120 v79 = (unsigned __int64)((*(int *)(a2c + 6) - pParty->vPosition.y) * (signed __int64)(signed int)uZoom) >> 16, | |
12121 v38 = uCenterY - v79, | |
12122 v37 < pRenderer->field_1C_clipx) | |
12123 || v37 > pRenderer->field_24_width | |
12124 || v38 < pRenderer->field_20_clipy | |
12125 || v38 > pRenderer->field_28_height ) | |
12126 goto LABEL_83; | |
12127 if ( pObjectList->pObjects[*(short *)a2c].uFlags & 0x10 ) | |
12128 break; | |
12129 if ( (signed int)uZoom > 512 ) | |
12130 { | |
12131 pRenderer->Line2D(v37 - 1, v38 - 1, v37 - 1, v38 + 1, flagsb); | |
12132 pRenderer->Line2D(v37, v38 - 2, v37, v38 + 1, flagsb); | |
12133 pRenderer->Line2D(v37 + 1, v38 - 1, v37 + 1, v38 + 1, flagsb); | |
12134 pRenderer->Line2D(v37 - 2, v38, v37 - 2, v38 + 1, flagsb); | |
12135 v37 += 2; | |
12136 v58 = flagsb; | |
12137 v55 = v38 + 1; | |
12138 goto LABEL_81; | |
12139 } | |
12140 pRenderer->Line2D(v37 - 1, v38 - 1, v37 - 1, uCenterY - v79, flagsb); | |
12141 v58 = flagsb; | |
12142 v55 = uCenterY - v79; | |
12143 v53 = v37; | |
12144 v51 = v38 - 1; | |
12145 LABEL_82: | |
12146 pRenderer->Line2D(v37, v51, v53, v55, v58); | |
12147 LABEL_83: | |
12148 ++uZe; | |
12149 a2c += 112; | |
12150 if ( uZe >= (signed int)uNumSpriteObjects ) | |
12151 { | |
12152 goto LABEL_85; | |
12153 } | |
12154 } | |
12155 v58 = v60; | |
12156 v55 = uCenterY - v79; | |
12157 LABEL_81: | |
12158 v53 = v37; | |
12159 v51 = uCenterY - v79; | |
12160 goto LABEL_82; | |
12161 } | |
12162 LABEL_85: | |
12163 v63 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(255, 0, 0); | |
12164 v61 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 255, 0); | |
12165 v65 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(255, 255, 0); | |
12166 uZf = 0; | |
12167 if ( (signed int)uNumActors > 0 ) | |
12168 { | |
12169 flagsc = pActors;//[0].uAIState; | |
12170 do | |
12171 { | |
12172 v39 = flagsc->uAIState; | |
12173 if ( flagsc->uAIState != 11 && v39 != 19 && (v39 == 5 || BYTE1(flagsc->uAttributes) & 0x80) ) | |
12174 { | |
12175 v40 = ((unsigned __int64)(( flagsc->vPosition.x - pParty->vPosition.x) | |
12176 * (signed __int64)(signed int)uZoom) >> 16) | |
12177 + uCenterX; | |
12178 v76 = (unsigned __int64)(( flagsc->vPosition.y - pParty->vPosition.y) | |
12179 * (signed __int64)(signed int)uZoom) >> 16; | |
12180 v41 = uCenterY - v76; | |
12181 if ( v40 >= pRenderer->field_1C_clipx ) | |
12182 { | |
12183 if ( v40 <= pRenderer->field_24_width && v41 >= pRenderer->field_20_clipy && v41 <= pRenderer->field_28_height ) | |
12184 { | |
12185 uWd = v61; | |
12186 if ( BYTE3(flagsc->uAttributes) & 1 ) | |
12187 uWd = v63; | |
12188 if ( flagsc->uAIState == 5 ) | |
12189 uWd = v65; | |
12190 if ( (signed int)uZoom > 1024 ) | |
12191 { | |
12192 pRenderer->Line2D(v40 - 1, v41 - 2, v40 - 1, v41 + 2, uWd); | |
12193 pRenderer->Line2D(v40, v41 - 2, v40, v41 + 2, uWd); | |
12194 pRenderer->Line2D(v40 + 1, v41 - 2, v40 + 1, v41 + 2, uWd); | |
12195 v42 = v41 + 1; | |
12196 v43 = v41 - 1; | |
12197 v44 = v42; | |
12198 pRenderer->Line2D(v40 - 2, v43, v40 - 2, v42, uWd); | |
12199 v40 += 2; | |
12200 v59 = uWd; | |
12201 v56 = v44; | |
12202 v54 = v40; | |
12203 v52 = v43; | |
12204 } | |
12205 else | |
12206 { | |
12207 pRenderer->Line2D(v40 - 1, v41 - 1, v40 - 1, uCenterY - v76, uWd); | |
12208 v59 = uWd; | |
12209 v56 = uCenterY - v76; | |
12210 v54 = v40; | |
12211 v52 = v41 - 1; | |
12212 } | |
12213 pRenderer->Line2D(v40, v52, v54, v56, v59); | |
12214 } | |
12215 } | |
12216 } | |
12217 ++uZf; | |
12218 ++flagsc; | |
12219 } | |
12220 while ( uZf < (signed int)uNumActors ); | |
12221 } | |
12222 } | |
12223 flagsd = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(255, 255, 255); | |
12224 uZg = 0; | |
12225 if ( (signed int)uNumLevelDecorations > 0 ) | |
12226 { | |
12227 v45 = (char *)&pLevelDecorations[0].vPosition; | |
12228 lPitchb = (char *)&pLevelDecorations[0].vPosition; | |
12229 do | |
12230 { | |
12231 if ( *(v45 - 2) & 8 ) | |
12232 { | |
12233 v46 = ((unsigned __int64)((*(int *)v45 - pParty->vPosition.x) * (signed __int64)(signed int)uZoom) >> 16) | |
12234 + uCenterX; | |
12235 v77 = (unsigned __int64)((*((int *)v45 + 1) - pParty->vPosition.y) * (signed __int64)(signed int)uZoom) >> 16; | |
12236 v47 = uCenterY - v77; | |
12237 if ( v46 >= pRenderer->field_1C_clipx ) | |
12238 { | |
12239 if ( v46 <= pRenderer->field_24_width && v47 >= pRenderer->field_20_clipy && v47 <= pRenderer->field_28_height ) | |
12240 { | |
12241 if ( (signed int)uZoom > 512 ) | |
12242 { | |
12243 v48 = v47 + 1; | |
12244 v49 = v47 - 1; | |
12245 pRenderer->Line2D(v46 - 1, v47 - 1, v46 - 1, v47 + 1, flagsd); | |
12246 pRenderer->Line2D(v46, v49, v46, v48, flagsd); | |
12247 pRenderer->Line2D(v46 + 1, v49, v46 + 1, v48, flagsd); | |
12248 v45 = lPitchb; | |
12249 } | |
12250 else | |
12251 { | |
12252 pRenderer->Line2D(v46, uCenterY - v77, v46, uCenterY - v77, flagsd); | |
12253 } | |
12254 } | |
12255 } | |
12256 } | |
12257 ++uZg; | |
12258 v45 += 32; | |
12259 lPitchb = v45; | |
12260 } | |
12261 while ( uZg < (signed int)uNumLevelDecorations ); | |
12262 } | |
12263 pRenderer->DrawTextureTransparent(0x1D4u, 0, (Texture *)(dword_5079D8 != -1 ? &pIcons_LOD->pTextures[dword_5079D8] : 0)); | |
12264 uZooma = (double)pParty->sRotationY * 0.1171875; | |
12265 //v50 = uZooma + 6.7553994e15; | |
12266 pRenderer->Clip(541, 0, 567, 480); | |
12267 pRenderer->DrawTextureIndexed(floorf(uZooma + 0.5f) + 285, 136, (Texture *)(dword_5079B4 != -1 ? &pIcons_LOD->pTextures[dword_5079B4] : 0)); | |
12268 pRenderer->ResetClip(); | |
12269 } | |
12270 | |
12271 | |
12272 //----- (00442955) -------------------------------------------------------- | |
12273 void DrawBook_Map_sub( unsigned int tl_x, unsigned int tl_y, unsigned int br_x, int br_y, int _48074 ) | |
12274 { | |
12275 int v5; // ebx@1 | |
12276 int v6; // edi@1 | |
12277 BLVMapOutlines *v7; // eax@8 | |
12278 unsigned __int8 v8; // zf@8 | |
12279 unsigned __int8 v9; // sf@8 | |
12280 int v10; // esi@10 | |
12281 unsigned int v11; // edx@11 | |
12282 __int16 v12; // cx@12 | |
12283 signed int v13; // eax@15 | |
12284 int v14; // eax@16 | |
12285 Vec3_short_ *v15; // ecx@16 | |
12286 int v16; // edx@16 | |
12287 int v17; // ecx@16 | |
12288 Vec3_short_ *v18; // eax@16 | |
12289 int v19; // ecx@16 | |
12290 int v20; // eax@16 | |
12291 signed int v21; // esi@18 | |
12292 int v22; // ecx@21 | |
12293 BLVMapOutline *v23; // ecx@21 | |
12294 Vec3_short_ *v24; // edx@21 | |
12295 Vec3_short_ *v25; // eax@21 | |
12296 int v26; // ecx@21 | |
12297 unsigned __int16 *v27; // edi@21 | |
12298 int v28; // edx@21 | |
12299 int v29; // eax@21 | |
12300 double v30; // st7@23 | |
12301 signed __int64 v31; // qax@23 | |
12302 unsigned short *v32; // edx@23 | |
12303 int textr_width; // esi@23 | |
12304 signed int v34; // eax@23 | |
12305 signed int v35; // ecx@23 | |
12306 int v36; // esi@27 | |
12307 int v37; // ecx@27 | |
12308 int v38; // edx@31 | |
12309 unsigned int v39; // eax@33 | |
12310 short *v40; // esi@33 | |
12311 short *v41; // edi@33 | |
12312 unsigned __int8 v42; // cf@33 | |
12313 unsigned int v43; // ecx@33 | |
12314 short *v44; // edi@33 | |
12315 short *v45; // esi@33 | |
12316 int v46; // ecx@33 | |
12317 signed int v47; // esi@38 | |
12318 signed int v48; // ecx@38 | |
12319 int v49; // eax@38 | |
12320 signed int v50; // edx@55 | |
12321 unsigned int v51; // ecx@55 | |
12322 int result; // eax@72 | |
12323 int v53; // eax@75 | |
12324 int v54; // esi@75 | |
12325 int v55; // eax@75 | |
12326 __int16 v56; // si@85 | |
12327 double v57; // st7@85 | |
12328 int v58; // ebx@85 | |
12329 signed __int64 v59; // qax@85 | |
12330 signed int v60; // edi@85 | |
12331 signed __int64 v61; // qax@85 | |
12332 signed int v62; // ebx@85 | |
12333 signed int v63; // esi@85 | |
12334 int v64; // eax@87 | |
12335 unsigned int v65; // ebx@95 | |
12336 unsigned short *v66; // edx@95 | |
12337 unsigned __int16 *v67; // esi@96 | |
12338 int v68; // edi@98 | |
12339 unsigned __int16 v69; // cx@99 | |
12340 unsigned int v70; // [sp-10h] [bp-48074h]@80 | |
12341 unsigned int v71; // [sp-Ch] [bp-48070h]@80 | |
12342 unsigned int v72; // [sp-8h] [bp-4806Ch]@80 | |
12343 signed int v73; // [sp-4h] [bp-48068h]@59 | |
12344 unsigned __int16 v74; // [sp-4h] [bp-48068h]@79 | |
12345 unsigned short map_texture_16[147456]; // [sp+Ch] [bp-48058h]@23 | |
12346 int v76; // [sp+4800Ch] [bp-58h]@23 | |
12347 unsigned __int16 *v77; // [sp+48010h] [bp-54h]@27 | |
12348 unsigned __int16 *pPalette_16; // [sp+48014h] [bp-50h]@23 | |
12349 unsigned int surfPitch; // [sp+48018h] [bp-4Ch]@1 | |
12350 | |
12351 int v81; // [sp+48020h] [bp-44h]@23 | |
12352 unsigned __int16* render16_data; | |
12353 unsigned char* texture8_data; | |
12354 unsigned char* curr_line; | |
12355 int scale_increment; | |
12356 int scaled_posX; | |
12357 int scaled_posY; | |
12358 int stepX_r; | |
12359 int stepY_r; | |
12360 | |
12361 | |
12362 unsigned int teal; // [sp+48028h] [bp-3Ch]@8 | |
12363 int v84; // [sp+4802Ch] [bp-38h]@1 | |
12364 int screenCenter_X; // [sp+48030h] [bp-34h]@1 | |
12365 int v86; // [sp+48034h] [bp-30h]@1 | |
12366 int v87; // [sp+48038h] [bp-2Ch]@16 | |
12367 unsigned int v88; // [sp+4803Ch] [bp-28h]@16 | |
12368 int black; // [sp+48040h] [bp-24h]@8 | |
12369 int screenCenterY; // [sp+48044h] [bp-20h]@1 | |
12370 unsigned int i; // [sp+48048h] [bp-1Ch]@9 | |
12371 unsigned int screenHeight; // [sp+4804Ch] [bp-18h]@16 | |
12372 unsigned __int16 *v93; // [sp+48050h] [bp-14h]@16 | |
12373 signed int screenWidth; // [sp+48054h] [bp-10h]@8 | |
12374 unsigned int v95; // [sp+48058h] [bp-Ch]@16 | |
12375 int v96; // [sp+4805Ch] [bp-8h]@10 | |
12376 const void *v97; // [sp+48060h] [bp-4h]@16 | |
12377 unsigned short *a4a; // [sp+4806Ch] [bp+8h]@85 | |
12378 int a5a; // [sp+48070h] [bp+Ch]@86 | |
12379 | |
12380 tl_x = tl_x; | |
12381 tl_y = tl_y; | |
12382 screenCenter_X = (signed int)(tl_x + br_x) >> 1; | |
12383 screenCenterY = (signed int)(tl_y + br_y) >> 1; | |
12384 surfPitch = pRenderer->uTargetSurfacePitch; | |
12385 pRenderer->Clip_v2(tl_x, tl_y, br_x, br_y); | |
12386 v5 = viewparams->field_2C; | |
12387 v6 = viewparams->sViewCenterX; | |
12388 v86 = viewparams->sViewCenterX; | |
12389 v84 = viewparams->sViewCenterY; | |
12390 if ( viewparams->field_2C != 384 ) | |
12391 { | |
12392 if ( viewparams->field_2C == 768 ) | |
12393 { | |
12394 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
12395 v5 = 680; | |
12396 } | |
12397 } | |
12398 else | |
12399 { | |
12400 v6 = viewparams->field_38; | |
12401 v86 = viewparams->field_38; | |
12402 v84 = viewparams->field_3A; | |
12403 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
12404 v5 = viewparams->field_2C - 34; | |
12405 } | |
12406 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor) | |
12407 { | |
12408 screenWidth = br_x - tl_x + 1; | |
12409 screenHeight = br_y - tl_y + 1; | |
12410 render16_data = &pRenderer->pTargetSurface[tl_x + tl_y * surfPitch]; | |
12411 texture8_data = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pLevelOfDetail0; | |
12412 pPalette_16 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pPalette16; | |
12413 scale_increment = (1 << (pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2 + 16)) / v5; | |
12414 | |
12415 v30 = (double)(1 << (16 - pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2)); | |
12416 | |
12417 | |
12418 teal = (unsigned int)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30) << 16; | |
12419 v97 = (const void *)((unsigned int)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30) << 16); | |
12420 | |
12421 v32 = map_texture_16; | |
12422 textr_width = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uTextureWidth; | |
12423 stepY_r = (int)(signed __int64)((double)(- v84 - 22528 / (v5 / 384)+ 32768) / v30) << 16; | |
12424 v81 = (signed __int16)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30); | |
12425 black = (signed __int16)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30); | |
12426 | |
12427 v76 = textr_width; | |
12428 scaled_posY = stepY_r >> 16; | |
12429 //nearest neiborhood scaling | |
12430 if ( texture8_data) | |
12431 { | |
12432 for(uint i=0; i<screenHeight;++i) | |
12433 { | |
12434 curr_line=&texture8_data[scaled_posY*textr_width]; | |
12435 stepX_r=teal; | |
12436 for(uint j=0; j<screenWidth;++j) | |
12437 { | |
12438 scaled_posX=stepX_r>>16; | |
12439 map_texture_16[i*screenWidth+j]=pPalette_16[*(curr_line+scaled_posX)]; | |
12440 stepX_r+=scale_increment; | |
12441 } | |
12442 stepY_r+=scale_increment; | |
12443 scaled_posY=stepY_r>>16; | |
12444 } | |
12445 } | |
12446 //move visible square to render | |
12447 for(uint i=0; i<screenHeight;++i) | |
12448 { | |
12449 if ( screenWidth > 0 ) | |
12450 { | |
12451 memcpy((void*)&render16_data[surfPitch*i],(void*)&map_texture_16[i*screenWidth], screenWidth*2); | |
12452 } | |
12453 } | |
12454 } | |
12455 else | |
12456 { | |
12457 black = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0); | |
12458 teal = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0xFFu); | |
12459 v7 = pIndoor->pMapOutlines; | |
12460 uNumBlueFacesInBLVMinimap = 0; | |
12461 v8 = pIndoor->pMapOutlines->uNumOutlines == 0; | |
12462 v9 = pIndoor->pMapOutlines->uNumOutlines < 0; | |
12463 screenWidth = 0; | |
12464 if ( !(v9 | v8) ) | |
12465 { | |
12466 i = 0; | |
12467 do | |
12468 { | |
12469 v10 = (int)((char *)v7 + i + 4); | |
12470 v96 = pIndoor->pFaces[*(short *)((char *)v7 + i + 8)].uAttributes; | |
12471 if ( !(BYTE1(v96) & 0x20 || (v11 = pIndoor->pFaces[*(short *)((char *)v7 + i + 10)].uAttributes, BYTE1(v11) & 0x20) )) | |
12472 { | |
12473 v12 = *(short *)((char *)v7 + i + 14); | |
12474 if ( !(v12 & 1) ) | |
12475 { | |
12476 if ( !(!(v96 & 0x80) && (v11 & 0x80u) == 0 )) | |
12477 { | |
12478 v96 = (signed int)screenWidth >> 3; | |
12479 v13 = screenWidth; | |
12480 *(short *)(v10 + 10) = v12 | 1; | |
12481 pIndoor->_visible_outlines[v96] |= 1 << (7 - v13 % 8); | |
12482 } | |
12483 } | |
12484 if ( (!(v12 & 1) && !(!(v96 & 0x80) && (v11 & 0x80u) == 0 )) || v12 & 1) | |
12485 { | |
12486 v14 = *(short *)v10; | |
12487 v88 = v5; | |
12488 v15 = &pIndoor->pVertices[v14]; | |
12489 v16 = v15->x; | |
12490 v17 = v15->y - v84; | |
12491 v93 = (unsigned __int16 *)(v16 - v6); | |
12492 screenHeight = v17; | |
12493 v18 = &pIndoor->pVertices[*(short *)(v10 + 2)]; | |
12494 v19 = v18->x; | |
12495 v20 = v18->y - v84; | |
12496 v95 = v19 - v6; | |
12497 v97 = (const void *)v20; | |
12498 v88 = (unsigned __int64)((v16 - v6) * (signed __int64)v5) >> 16; | |
12499 v87 = (unsigned __int64)((signed int)screenHeight * (signed __int64)v5) >> 16; | |
12500 v93 = (unsigned __int16 *)((unsigned __int64)((v19 - v6) * (signed __int64)v5) >> 16); | |
12501 screenHeight = (unsigned __int64)(v20 * (signed __int64)v5) >> 16; | |
12502 pRenderer->Line2D( | |
12503 screenCenter_X + v88, | |
12504 screenCenterY - v87, | |
12505 screenCenter_X + ((unsigned __int64)((v19 - v6) * (signed __int64)v5) >> 16), | |
12506 screenCenterY - screenHeight, | |
12507 black); | |
12508 v7 = pIndoor->pMapOutlines; | |
12509 } | |
12510 } | |
12511 ++screenWidth; | |
12512 i += 12; | |
12513 } | |
12514 while ( screenWidth < (signed int)v7->uNumOutlines ); | |
12515 } | |
12516 v21 = 0; | |
12517 if ( (signed int)uNumBlueFacesInBLVMinimap > 0 ) | |
12518 { | |
12519 while ( 1 ) | |
12520 { | |
12521 v22 = pBlueFacesInBLVMinimapIDs[v21]; | |
12522 v87 = v5; | |
12523 v23 = &v7->pOutlines[v22]; | |
12524 v24 = &pIndoor->pVertices[v23->uVertex1ID]; | |
12525 v25 = &pIndoor->pVertices[v23->uVertex2ID]; | |
12526 v26 = v25->x; | |
12527 v27 = (unsigned __int16 *)(v24->x - v86); | |
12528 v28 = v24->y - v84; | |
12529 v29 = v25->y - v84; | |
12530 v93 = v27; | |
12531 screenHeight = v28; | |
12532 v97 = (const void *)v29; | |
12533 v87 = (unsigned __int64)((signed int)v27 * (signed __int64)v5) >> 16; | |
12534 v88 = (unsigned __int64)(v28 * (signed __int64)v5) >> 16; | |
12535 i = (unsigned __int64)((v26 - v86) * (signed __int64)v5) >> 16; | |
12536 v95 = (unsigned __int64)(v29 * (signed __int64)v5) >> 16; | |
12537 pRenderer->Line2D( | |
12538 screenCenter_X + ((unsigned __int64)((signed int)v27 * (signed __int64)v5) >> 16), | |
12539 screenCenterY - v88, | |
12540 screenCenter_X + ((unsigned __int64)((v26 - v86) * (signed __int64)v5) >> 16), | |
12541 screenCenterY - v95, | |
12542 teal); | |
12543 ++v21; | |
12544 if ( v21 >= (signed int)uNumBlueFacesInBLVMinimap ) | |
12545 break; | |
12546 v7 = pIndoor->pMapOutlines; | |
12547 } | |
12548 v6 = v86; | |
12549 } | |
12550 } | |
12551 v47 = ((unsigned __int64)((pParty->vPosition.x - v6) * (signed __int64)v5) >> 16) + screenCenter_X - 3; | |
12552 v81 = pParty->vPosition.y - v84; | |
12553 v97 = (const void *)((unsigned __int64)((pParty->vPosition.y - v84) * (signed __int64)v5) >> 16); | |
12554 v48 = 1; | |
12555 v49 = screenCenterY - (int)v97 - 3; | |
12556 if ( v47 >= (signed int)tl_x ) | |
12557 { | |
12558 if ( v47 > (signed int)br_x ) | |
12559 { | |
12560 if ( (signed int)(((unsigned __int64)((pParty->vPosition.x - v6) * (signed __int64)v5) >> 16) + screenCenter_X - 6) > (signed int)br_x ) | |
12561 v48 = 0; | |
12562 v47 = br_x; | |
12563 } | |
12564 } | |
12565 else | |
12566 { | |
12567 if ( (signed int)(((unsigned __int64)((pParty->vPosition.x - v6) * (signed __int64)v5) >> 16) + screenCenter_X) < (signed int)tl_x ) | |
12568 v48 = 0; | |
12569 v47 = tl_x; | |
12570 } | |
12571 if ( v49 >= (signed int)tl_y ) | |
12572 { | |
12573 if ( v49 > br_y ) | |
12574 { | |
12575 if ( screenCenterY - (signed int)v97 - 6 > br_y ) | |
12576 v48 = 0; | |
12577 v49 = br_y; | |
12578 } | |
12579 } | |
12580 else | |
12581 { | |
12582 if ( screenCenterY - (signed int)v97 < (signed int)tl_y ) | |
12583 v48 = 0; | |
12584 v49 = tl_y; | |
12585 } | |
12586 if ( v48 == 1 ) | |
12587 { | |
12588 v50 = 0; | |
12589 v51 = pParty->sRotationY & stru_5C6E00->uDoublePiMask; | |
12590 if ( (signed int)(pParty->sRotationY & stru_5C6E00->uDoublePiMask) >= 128 ) | |
12591 { | |
12592 if ( (signed int)v51 > 384 ) | |
12593 { | |
12594 if ( (signed int)v51 >= 640 ) | |
12595 { | |
12596 if ( (signed int)v51 > 896 ) | |
12597 { | |
12598 if ( (signed int)v51 >= 1152 ) | |
12599 { | |
12600 if ( (signed int)v51 > 1408 ) | |
12601 { | |
12602 if ( (signed int)v51 >= 1664 ) | |
12603 { | |
12604 if ( (signed int)v51 <= 1920 ) | |
12605 v73 = 7; | |
12606 } | |
12607 else | |
12608 { | |
12609 v73 = 6; | |
12610 } | |
12611 } | |
12612 else | |
12613 { | |
12614 v73 = 5; | |
12615 } | |
12616 } | |
12617 else | |
12618 { | |
12619 v73 = 4; | |
12620 } | |
12621 } | |
12622 else | |
12623 { | |
12624 v73 = 3; | |
12625 } | |
12626 } | |
12627 else | |
12628 { | |
12629 v73 = 2; | |
12630 } | |
12631 if( (signed int)v51 <=1920) | |
12632 v50 = v73; | |
12633 } | |
12634 else | |
12635 v50 = 1; | |
12636 } | |
12637 pRenderer->DrawTransparentRedShade(v47, v49, (Texture *)(pTextureIDs_pMapDirs[v50] != -1 ? (int)&pIcons_LOD->pTextures[pTextureIDs_pMapDirs[v50]] : 0)); | |
12638 } | |
12639 result = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); | |
12640 v95 = 0; | |
12641 v86 = result; | |
12642 if ( (signed int)uNumLevelDecorations > 0 ) | |
12643 { | |
12644 screenWidth = (unsigned int)&pLevelDecorations[0].vPosition; | |
12645 do | |
12646 { | |
12647 if ( *(char *)(screenWidth - 2) & 8 ) | |
12648 { | |
12649 v53 = *(int *)(screenWidth + 4) - v84; | |
12650 v93 = (unsigned __int16 *)(*(int *)screenWidth - v6); | |
12651 screenHeight = v53; | |
12652 v54 = ((unsigned __int64)((signed int)v93 * (signed __int64)v5) >> 16) + screenCenter_X; | |
12653 v97 = (const void *)((unsigned __int64)(v53 * (signed __int64)v5) >> 16); | |
12654 v55 = screenCenterY - (int)v97; | |
12655 if ( v54 >= pRenderer->field_1C_clipx ) | |
12656 { | |
12657 if ( v54 <= pRenderer->field_24_width && v55 >= pRenderer->field_20_clipy && v55 <= pRenderer->field_28_height ) | |
12658 { | |
12659 v74 = v86; | |
12660 if ( v5 > 512 ) | |
12661 { | |
12662 v96 = v55 + 1; | |
12663 black = v55 - 1; | |
12664 pRenderer->Line2D(v54 - 1, v55 - 1, v54 - 1, v55 + 1, v86); | |
12665 pRenderer->Line2D(v54, black, v54, v96, v86); | |
12666 ++v54; | |
12667 v74 = v86; | |
12668 v72 = v96; | |
12669 v71 = v54; | |
12670 v70 = black; | |
12671 } | |
12672 else | |
12673 { | |
12674 v72 = screenCenterY - (int)v97; | |
12675 v71 = ((unsigned __int64)((signed int)v93 * (signed __int64)v5) >> 16) + screenCenter_X; | |
12676 v70 = screenCenterY - (int)v97; | |
12677 } | |
12678 pRenderer->Line2D(v54, v70, v71, v72, v74); | |
12679 } | |
12680 } | |
12681 } | |
12682 ++v95; | |
12683 result = v95; | |
12684 screenWidth += 32; | |
12685 } | |
12686 while ( (signed int)v95 < (signed int)uNumLevelDecorations ); | |
12687 } | |
12688 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
12689 { | |
12690 screenCenterY = br_x - tl_x + 1; | |
12691 v95 = br_y - tl_y + 1; | |
12692 v77 = &pRenderer->pTargetSurface[tl_x + tl_y * surfPitch]; | |
12693 v56 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2; | |
12694 black = (1 << (v56 + 16)) / v5; | |
12695 v57 = (double)(1 << (16 - v56)); | |
12696 v58 = 22528 / (v5 / 384); | |
12697 v59 = (signed __int64)((double)(v6 - v58 + 32768) / v57); | |
12698 v60 = (int)v59 << 16; | |
12699 v97 = (const void *)((int)v59 << 16); | |
12700 v61 = (signed __int64)((double)(32768 - v58 - v84) / v57); | |
12701 pPalette_16 = (unsigned __int16 *)(v60 >> 16); | |
12702 v62 = (int)v61 << 16; | |
12703 teal = v60 >> 16; | |
12704 v63 = (signed __int16)v61; | |
12705 a4a = map_texture_16; | |
12706 result = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xCu, 0xCu, 0xCu); | |
12707 screenCenter_X = 0; | |
12708 for ( i = result; screenCenter_X < (signed int)v95; result = screenCenter_X ) | |
12709 { | |
12710 a5a = 0; | |
12711 if ( screenCenterY > 0 ) | |
12712 { | |
12713 v96 = (v63 - 80) / 4; | |
12714 v64 = teal; | |
12715 do | |
12716 { | |
12717 v81 = (v64 - 80) / 4; | |
12718 if ( !pOutdoor->_47F04C(v81, v96) ) | |
12719 { | |
12720 if ( pOutdoor->_47F097(v81, v96) ) | |
12721 { | |
12722 if ( !((a5a + screenCenter_X) % 2) ) | |
12723 *a4a = i; | |
12724 } | |
12725 else | |
12726 { | |
12727 *a4a = 0; | |
12728 } | |
12729 } | |
12730 ++a4a; | |
12731 v97 = (char *)v97 + black; | |
12732 v64 = (signed int)v97 >> 16; | |
12733 ++a5a; | |
12734 } | |
12735 while ( a5a < screenCenterY ); | |
12736 } | |
12737 v62 += black; | |
12738 v97 = (const void *)v60; | |
12739 a4a += screenCenterY - a5a; | |
12740 v63 = v62 >> 16; | |
12741 ++screenCenter_X; | |
12742 teal = (unsigned int)pPalette_16; | |
12743 } | |
12744 v65 = v95; | |
12745 v66 = map_texture_16; | |
12746 if ( (signed int)v95 > 0 ) | |
12747 { | |
12748 v67 = v77; | |
12749 result = 2 * (surfPitch - screenCenterY); | |
12750 do | |
12751 { | |
12752 if ( screenCenterY > 0 ) | |
12753 { | |
12754 v68 = screenCenterY; | |
12755 do | |
12756 { | |
12757 v69 = *(short *)v66; | |
12758 if ( !*(short *)v66 || v69 == (short)i ) | |
12759 *v67 = v69; | |
12760 ++v66; | |
12761 ++v67; | |
12762 --v68; | |
12763 } | |
12764 while ( v68 ); | |
12765 } | |
12766 v67 = (unsigned __int16 *)((char *)v67 + result); | |
12767 --v65; | |
12768 } | |
12769 while ( v65 ); | |
12770 } | |
12771 } | |
12772 } | |
12773 | 11723 |
12774 | 11724 |
12775 | 11725 |
12776 | 11726 |
12777 //----- (00443801) -------------------------------------------------------- | 11727 //----- (00443801) -------------------------------------------------------- |
14861 pParty->uFlags |= 2u; | 13811 pParty->uFlags |= 2u; |
14862 } | 13812 } |
14863 } | 13813 } |
14864 | 13814 |
14865 | 13815 |
14866 //----- (00448A17) -------------------------------------------------------- | 13816 |
14867 void Chest::ToggleFlag(unsigned int uChestID, unsigned __int16 uFlag, unsigned int bToggle) | |
14868 { | |
14869 unsigned __int16 *pFlags; // eax@3 | |
14870 | |
14871 if ( (uChestID & 0x80000000u) == 0 && (signed int)uChestID <= 19 ) | |
14872 { | |
14873 pFlags = &pChests[uChestID].uFlags; | |
14874 if ( bToggle ) | |
14875 *pFlags |= uFlag; | |
14876 else | |
14877 *pFlags &= ~uFlag; | |
14878 } | |
14879 } | |
14880 | 13817 |
14881 //----- (00448A40) -------------------------------------------------------- | 13818 //----- (00448A40) -------------------------------------------------------- |
14882 void Actor::ToggleFlag(signed int uActorID, unsigned int uFlag, int bToggle) | 13819 void Actor::ToggleFlag(signed int uActorID, unsigned int uFlag, int bToggle) |
14883 { | 13820 { |
14884 if ( uActorID >= 0 && uActorID <= (signed int)(uNumActors - 1) ) | 13821 if ( uActorID >= 0 && uActorID <= (signed int)(uNumActors - 1) ) |