Mercurial > mm7
comparison Outdoor.cpp @ 87:170259c8c71f
Слияние
author | Ritor1 |
---|---|
date | Mon, 04 Feb 2013 09:17:49 +0600 |
parents | ec84db4c8f9d be45fc285970 |
children | b9196a36b7c9 56e11be29db1 |
comparison
equal
deleted
inserted
replaced
86:ec84db4c8f9d | 87:170259c8c71f |
---|---|
56 v2 = bRedraw; | 56 v2 = bRedraw; |
57 if ( viewparams->field_54 ) | 57 if ( viewparams->field_54 ) |
58 v1 = 2; | 58 v1 = 2; |
59 pIndoorCamera->sRotationX = pParty->sRotationX; | 59 pIndoorCamera->sRotationX = pParty->sRotationX; |
60 pIndoorCamera->sRotationY = pParty->sRotationY; | 60 pIndoorCamera->sRotationY = pParty->sRotationY; |
61 pIndoorCamera->pos.x = pParty->vPosition.x - ((unsigned __int64)(stru_5C6E00->SinCos(pParty->sRotationY) * (signed __int64)pParty->field_18) >> 16); | 61 pIndoorCamera->pos.x = pParty->vPosition.x |
62 - ((unsigned __int64)(stru_5C6E00->SinCos(pParty->sRotationY) | |
63 * (signed __int64)pParty->field_18) >> 16); | |
62 v3 = stru_5C6E00->SinCos(pParty->sRotationY - stru_5C6E00->uIntegerHalfPi); | 64 v3 = stru_5C6E00->SinCos(pParty->sRotationY - stru_5C6E00->uIntegerHalfPi); |
63 pIndoorCamera->field_4C = v1; | 65 pIndoorCamera->field_4C = v1; |
64 pIndoorCamera->pos.y = pParty->vPosition.y - pParty->field_18 * ((stru_5C6E00->SinCos(pParty->sRotationY)) >> 16); | 66 pIndoorCamera->pos.y = pParty->vPosition.y - pParty->field_18 * ((stru_5C6E00->SinCos(pParty->sRotationY)) >> 16); |
65 pIndoorCamera->pos.z = pParty->vPosition.z + pParty->sEyelevel; | 67 pIndoorCamera->pos.z = pParty->vPosition.z + pParty->sEyelevel; |
66 if ( v2 || pRenderer->pRenderD3D ) | 68 if ( v2 || pRenderer->pRenderD3D ) |
85 if ( !v2 ) | 87 if ( !v2 ) |
86 { | 88 { |
87 if ( !pRenderer->pRenderD3D ) | 89 if ( !pRenderer->pRenderD3D ) |
88 { | 90 { |
89 pRenderer->OnOutdoorRedrawSW(); | 91 pRenderer->OnOutdoorRedrawSW(); |
90 goto LABEL_16; | 92 } |
91 } | 93 else |
92 //goto LABEL_14; | 94 { |
93 pRenderer->DrawSkyD3D(); | 95 pRenderer->DrawSkyD3D(); |
94 pRenderer->DrawBuildingsD3D(); | 96 pRenderer->DrawBuildingsD3D(); |
95 pRenderer->DrawBezierTerrain(); | 97 pRenderer->DrawBezierTerrain(); |
96 goto LABEL_16; | 98 } |
97 } | 99 } |
98 if ( pRenderer->pRenderD3D ) | 100 else if ( pRenderer->pRenderD3D ) |
99 { | 101 { |
100 //LABEL_14: | |
101 pRenderer->DrawSkyD3D(); | 102 pRenderer->DrawSkyD3D(); |
102 pRenderer->DrawBuildingsD3D(); | 103 pRenderer->DrawBuildingsD3D(); |
103 pRenderer->DrawBezierTerrain();// Ritor1: sometimes crash | 104 pRenderer->DrawBezierTerrain();// Ritor1: sometimes crash |
104 goto LABEL_16; | 105 } |
105 } | 106 else |
106 pRenderer->DrawBuildingsSW(); | 107 { |
107 pRenderer->DrawBezierTerrain(); | 108 pRenderer->DrawBuildingsSW(); |
108 sr_sub_486F92_MessWithEdgesAndSpans(); | 109 pRenderer->DrawBezierTerrain(); |
109 pOutdoorCamera->_487355(); | 110 sr_sub_486F92_MessWithEdgesAndSpans(); |
110 LABEL_16: | 111 pOutdoorCamera->_487355(); |
112 } | |
111 pMobileLightsStack->uNumLightsActive = 0; | 113 pMobileLightsStack->uNumLightsActive = 0; |
112 pStationaryLightsStack->uNumLightsActive = 0; | 114 pStationaryLightsStack->uNumLightsActive = 0; |
113 if ( !pRenderer->pRenderD3D ) | 115 if ( !pRenderer->pRenderD3D ) |
114 { | 116 { |
115 pRenderer->ExecOutdoorDrawSW(); | 117 pRenderer->ExecOutdoorDrawSW(); |
215 } | 217 } |
216 // 47F44B: using guessed type int __stdcall WorldPosToGridCellX(int); | 218 // 47F44B: using guessed type int __stdcall WorldPosToGridCellX(int); |
217 // 47F458: using guessed type int __stdcall WorldPosToGridCellZ(int); | 219 // 47F458: using guessed type int __stdcall WorldPosToGridCellZ(int); |
218 | 220 |
219 //----- (00488EEF) -------------------------------------------------------- | 221 //----- (00488EEF) -------------------------------------------------------- |
220 unsigned int OutdoorLocation::GetTileTexture(int sX, int sZ) | 222 unsigned int OutdoorLocation::GetTileTexture(int sX, int sY) |
221 { | 223 { |
222 //OutdoorLocation *v3; // esi@1 | 224 //OutdoorLocation *v3; // esi@1 |
223 unsigned int v4; // edi@1 | 225 unsigned int v4; // edi@1 |
224 unsigned int v5; // eax@1 | 226 unsigned int v5; // eax@1 |
225 // unsigned int result; // eax@5 | 227 // unsigned int result; // eax@5 |
230 if ( v5< 0 || (signed int)v5 > 127 || v4 < 0 || (signed int)v4 > 127 )//if ( (v5 & 0x80000000u) != 0 || (signed int)v5 > 127 || (v4 & 0x80000000u) != 0 || (signed int)v4 > 127 ) | 232 if ( v5< 0 || (signed int)v5 > 127 || v4 < 0 || (signed int)v4 > 127 )//if ( (v5 & 0x80000000u) != 0 || (signed int)v5 > 127 || (v4 & 0x80000000u) != 0 || (signed int)v4 > 127 ) |
231 result = -1; | 233 result = -1; |
232 else | 234 else |
233 result = DoGetTileTexture(v5, v4); | 235 result = DoGetTileTexture(v5, v4); |
234 return result;*/ | 236 return result;*/ |
235 v4 = WorldPosToGridCellZ(sZ); | 237 v4 = WorldPosToGridCellZ(sY); |
236 v5 = WorldPosToGridCellX(sX); | 238 v5 = WorldPosToGridCellX(sX); |
237 if ( v5 < 0 || v5 > 127 || v4 < 0 || v4 > 127 ) | 239 if ( v5 < 0 || v5 > 127 || v4 < 0 || v4 > 127 ) |
238 return -1; | 240 return -1; |
239 return DoGetTileTexture(v5, v4); | 241 return DoGetTileTexture(v5, v4); |
240 } | 242 } |
1768 //uSourceLen = (char *)v44 + (int)pFilename; | 1770 //uSourceLen = (char *)v44 + (int)pFilename; |
1769 //v151 = 0; | 1771 //v151 = 0; |
1770 for (uint i = 0; i < uNumBModels; ++i) | 1772 for (uint i = 0; i < uNumBModels; ++i) |
1771 { | 1773 { |
1772 //v48 = 0; | 1774 //v48 = 0; |
1773 auto model = pBModels + i; | 1775 auto model = &pBModels[i]; |
1774 | 1776 |
1775 model->pVertices.pVertices = nullptr; | 1777 model->pVertices.pVertices = nullptr; |
1776 model->pFaces = nullptr; | 1778 model->pFaces = nullptr; |
1777 model->pFacesOrdering = nullptr; | 1779 model->pFacesOrdering = nullptr; |
1778 model->pNodes = nullptr; | 1780 model->pNodes = nullptr; |
1852 { | 1854 { |
1853 auto texFilename = textureFilenames + j * 10; | 1855 auto texFilename = textureFilenames + j * 10; |
1854 //v149 = 0; | 1856 //v149 = 0; |
1855 //Str2 = (char *)ptr; | 1857 //Str2 = (char *)ptr; |
1856 | 1858 |
1857 auto face = model->pFaces + j; | 1859 auto *face = &model->pFaces[j]; |
1858 //pFilename = (char *)v149 + (unsigned int)v60[v48].pFaces; | 1860 //pFilename = (char *)v149 + (unsigned int)v60[v48].pFaces; |
1859 if (~face->uAttributes & 0x40) | 1861 if (~face->uAttributes & 0x40) |
1860 { | 1862 { |
1861 v62 = pBitmaps_LOD->LoadTexture(texFilename); | 1863 v62 = pBitmaps_LOD->LoadTexture(texFilename); |
1862 // v63 = (ODMFace *)pFilename; | 1864 // v63 = (ODMFace *)pFilename; |
2126 //v25 = uNumBModels == 0; | 2128 //v25 = uNumBModels == 0; |
2127 //v26 = (uNumBModels & 0x80000000u) != 0; | 2129 //v26 = (uNumBModels & 0x80000000u) != 0; |
2128 //v151 = 0; | 2130 //v151 = 0; |
2129 for (uint i = 0; i < uNumBModels; ++i) | 2131 for (uint i = 0; i < uNumBModels; ++i) |
2130 { | 2132 { |
2131 auto model = pBModels + i; | 2133 auto model = pBModels[i]; |
2132 //pNumItems = 0; | 2134 //pNumItems = 0; |
2133 //do | 2135 //do |
2134 //{ | 2136 //{ |
2135 //v86 = pBModels; | 2137 //v86 = pBModels; |
2136 //thisa = 0; | 2138 //thisa = 0; |
2137 //v87 = (unsigned int)((char *)v86 + pNumItems); | 2139 //v87 = (unsigned int)((char *)v86 + pNumItems); |
2138 for (uint j = 0; j < model->uNumFaces; ++j) | 2140 for (uint j = 0; j < model.uNumFaces; ++j) |
2139 { | 2141 { |
2140 auto face = model->pFaces + j; | 2142 auto face = model.pFaces[j]; |
2141 | 2143 |
2142 //if ( *(int *)(v87 + 76) > 0 ) | 2144 //if ( *(int *)(v87 + 76) > 0 ) |
2143 //{ | 2145 //{ |
2144 //File = 0; | 2146 //File = 0; |
2145 //do | 2147 //do |
2146 //{ | 2148 //{ |
2147 //v106 = (char *)&File->uAttributes + *(int *)(v87 + 84); | 2149 //v106 = (char *)&File->uAttributes + *(int *)(v87 + 84); |
2148 memcpy(&face->uAttributes, pSrc, 4); | 2150 memcpy(&face.uAttributes, pSrc, 4); |
2149 pSrc += 4; | 2151 pSrc += 4; |
2150 //v88 = pBModels; | 2152 //v88 = pBModels; |
2151 //++File; | 2153 //++File; |
2152 //v85 = (char *)v85 + 4; | 2154 //v85 = (char *)v85 + 4; |
2153 //++thisa; | 2155 //++thisa; |
2156 //while ( thisa < *(int *)(v87 + 76) ); | 2158 //while ( thisa < *(int *)(v87 + 76) ); |
2157 } | 2159 } |
2158 | 2160 |
2159 //v89 = pBModels; | 2161 //v89 = pBModels; |
2160 //thisa = 0; | 2162 //thisa = 0; |
2161 for (uint j = 0; j < model->uNumFaces; ++j) | 2163 for (uint j = 0; j < model.uNumFaces; ++j) |
2162 { | 2164 { |
2163 auto face = model->pFaces + j; | 2165 auto face = model.pFaces[j]; |
2164 //pFilename = 0; | 2166 //pFilename = 0; |
2165 //do | 2167 //do |
2166 //{ | 2168 //{ |
2167 //v90 = (ODMFace *)&pFilename[*(unsigned int *)((char *)&v89->pFaces + pNumItems)]; | 2169 //v90 = (ODMFace *)&pFilename[*(unsigned int *)((char *)&v89->pFaces + pNumItems)]; |
2168 //File = v90; | 2170 //File = v90; |
2169 if (face->sCogTriggeredID) | 2171 if (face.sCogTriggeredID) |
2170 { | 2172 { |
2171 if (face->HasEventHint()) | 2173 if (face.HasEventHint()) |
2172 BYTE2(face->uAttributes) |= 0x10u; | 2174 BYTE2(face.uAttributes) |= 0x10u; |
2173 else | 2175 else |
2174 BYTE2(face->uAttributes) &= 0xEFu; | 2176 BYTE2(face.uAttributes) &= 0xEFu; |
2175 } | 2177 } |
2176 //++thisa; | 2178 //++thisa; |
2177 //v89 = pBModels; | 2179 //v89 = pBModels; |
2178 //pFilename += 308; | 2180 //pFilename += 308; |
2179 //} | 2181 //} |
2395 } | 2397 } |
2396 return result; | 2398 return result; |
2397 } | 2399 } |
2398 | 2400 |
2399 //----- (0047ED08) -------------------------------------------------------- | 2401 //----- (0047ED08) -------------------------------------------------------- |
2400 unsigned int OutdoorLocation::DoGetTileTexture(unsigned int uX, unsigned int uZ) | 2402 unsigned int OutdoorLocation::DoGetTileTexture(unsigned int uX, unsigned int uY) |
2401 { | 2403 { |
2402 int uTileID; // esi@5 | 2404 int v3; // esi@5 |
2403 unsigned int result; // eax@9 | 2405 unsigned int result; // eax@9 |
2404 | 2406 |
2405 | 2407 |
2406 /* v3 = *(&this->pTerrain.pTilemap[128 * uZ] + uX); | 2408 /* v3 = *(&this->pTerrain.pTilemap[128 * uZ] + uX); |
2407 if ( v3 < 198 ) | 2409 if ( v3 < 198 ) |
2414 v3 = v3 + this->pTileTypes[3].uTileID - 198; | 2416 v3 = v3 + this->pTileTypes[3].uTileID - 198; |
2415 } | 2417 } |
2416 result = pTileTable->pTiles[v3].uBitmapID; | 2418 result = pTileTable->pTiles[v3].uBitmapID; |
2417 } | 2419 } |
2418 return result;*/ | 2420 return result;*/ |
2419 if (uX > 127 || uZ > 127) | 2421 if (uX > 127 || uY > 127) |
2420 return 0; | 2422 return 0; |
2421 | 2423 |
2422 uTileID = this->pTerrain.pTilemap[uZ * 128 + uX]; | 2424 v3 = this->pTerrain.pTilemap[uY * 128 + uX]; |
2423 if (uTileID < 198) | 2425 if (v3 < 198) |
2424 { | 2426 { |
2425 if (uTileID >= 90) | 2427 if (v3 >= 90) |
2426 uTileID = uTileID + this->pTileTypes[(uTileID - 90) / 18].uTileID - 36 * (uTileID - 90) / 36 - 90; | 2428 v3 = v3 + this->pTileTypes[(v3 - 90) / 18].uTileID - 36 * (v3 - 90) / 36 - 90; |
2427 } | 2429 } |
2428 else | 2430 else |
2429 uTileID = uTileID + this->pTileTypes[3].uTileID - 198; | 2431 v3 = v3 + this->pTileTypes[3].uTileID - 198; |
2430 | 2432 |
2431 return pTileTable->pTiles[uTileID].uBitmapID; | 2433 return pTileTable->pTiles[v3].uBitmapID; |
2432 } | 2434 } |
2433 | 2435 |
2434 //----- (0047ED83) -------------------------------------------------------- | 2436 //----- (0047ED83) -------------------------------------------------------- |
2435 int OutdoorLocation::_47ED83(signed int a2, signed int a3) | 2437 int OutdoorLocation::_47ED83(signed int a2, signed int a3) |
2436 { | 2438 { |
2785 | 2787 |
2786 //----- (0047F2D3) -------------------------------------------------------- | 2788 //----- (0047F2D3) -------------------------------------------------------- |
2787 bool OutdoorLocation::InitalizeActors(int a1) | 2789 bool OutdoorLocation::InitalizeActors(int a1) |
2788 { | 2790 { |
2789 int v2; // ebx@1 | 2791 int v2; // ebx@1 |
2790 char *v3; // esi@2 | 2792 Actor *v3; // esi@2 |
2791 int v4; // eax@3 | 2793 int v4; // eax@3 |
2792 __int16 v5; // ax@11 | 2794 __int16 v5; // ax@11 |
2793 int v8; // [sp+348h] [bp-8h]@1 | 2795 int v8; // [sp+348h] [bp-8h]@1 |
2794 int v9; // [sp+34Ch] [bp-4h]@1 | 2796 int v9; // [sp+34Ch] [bp-4h]@1 |
2795 | 2797 |
2796 v2 = 0; | 2798 v2 = 0; |
2797 v8 = 0; | 2799 v8 = 0; |
2798 v9 = 0; | 2800 v9 = 0; |
2799 if ( (signed int)uNumActors > 0 ) | 2801 if ( (signed int)uNumActors > 0 ) |
2800 { | 2802 { |
2801 v3 = (char *)&pActors[0].uAttributes; | 2803 v3 = pActors;//[0].uAttributes; |
2802 while ( 1 ) | 2804 while ( v9 < (signed int)uNumActors ) |
2803 { | 2805 { |
2804 v4 = *(int *)v3; | 2806 v4 = v3->uAttributes; |
2805 if ( !(v4 & 0x100000) ) | 2807 if ( !(v4 & 0x100000) ) |
2806 break; | 2808 { |
2807 if ( a1 == v2 ) | 2809 if ( v8 != 1 ) |
2808 goto LABEL_8; | 2810 { |
2809 if ( v8 != v2 ) | 2811 v3->uCurrentActionTime = v2; |
2810 goto LABEL_9; | 2812 v3->uCurrentActionLength = v2; |
2811 *((short *)v3 + 70) = 19; | 2813 if ( v4 & 0x10000 ) |
2812 *(int *)v3 = v4 | 0x10000; | 2814 v3->uAIState = (AIState) 19; |
2813 v8 = GetAlertStatus(); | 2815 v5 = v3->uAIState; |
2814 LABEL_17: | 2816 if ( v5 != 11 && v5 != 19 && (v3->sCurrentHP == (short)v2 || v3->pMonsterInfo.uHP == v2) ) |
2817 v3->uAIState = (AIState) 5; | |
2818 v3->vVelocity.x = v2; | |
2819 v3->vVelocity.y = v2; | |
2820 v3->vVelocity.z = v2; | |
2821 v3->UpdateAnimation(); | |
2822 v3->pMonsterInfo.uHostilityType = (MonsterInfo::HostilityRadius)0; | |
2823 v3->PrepareSprites(0); | |
2824 v2 = 0; | |
2825 } | |
2826 else | |
2827 { | |
2828 v3->uAIState = (AIState) 19; | |
2829 v3->uAttributes = v4 | 0x10000; | |
2830 } | |
2831 } | |
2832 else if ( a1 == v2 ) | |
2833 { | |
2834 v3->uAIState = (AIState) 19; | |
2835 v3->uAttributes = v4 | 0x10000; | |
2836 } | |
2837 else if ( v8 != v2 ) | |
2838 { | |
2839 v3->uCurrentActionTime = v2; | |
2840 v3->uCurrentActionLength = v2; | |
2841 if ( v4 & 0x10000 ) | |
2842 v3->uAIState = (AIState) 19; | |
2843 v5 = v3->uAIState; | |
2844 if ( v5 != 11 && v5 != 19 && (v3->sCurrentHP == (short)v2 || v3->pMonsterInfo.uHP == v2) ) | |
2845 v3->uAIState = (AIState) 5; | |
2846 v3->vVelocity.x = v2; | |
2847 v3->vVelocity.y = v2; | |
2848 v3->vVelocity.z = v2; | |
2849 v3->UpdateAnimation(); | |
2850 v3->pMonsterInfo.uHostilityType = (MonsterInfo::HostilityRadius)0; | |
2851 v3->PrepareSprites(0); | |
2852 v2 = 0; | |
2853 } | |
2854 else | |
2855 { | |
2856 v3->uAIState = (AIState) 19; | |
2857 v3->uAttributes = v4 | 0x10000; | |
2858 v8 = GetAlertStatus(); | |
2859 } | |
2815 ++v9; | 2860 ++v9; |
2816 v3 += 836; | 2861 ++v3; |
2817 if ( v9 >= (signed int)uNumActors ) | 2862 } |
2818 goto LABEL_18; | 2863 } |
2819 } | |
2820 if ( v8 != 1 ) | |
2821 { | |
2822 LABEL_9: | |
2823 *((int *)v3 + 37) = v2; | |
2824 *((short *)v3 + 62) = v2; | |
2825 if ( v4 & 0x10000 ) | |
2826 *((short *)v3 + 70) = 19; | |
2827 v5 = *((short *)v3 + 70); | |
2828 if ( v5 != 11 && v5 != 19 && (*((short *)v3 + 2) == (short)v2 || *((int *)v3 + 18) == v2) ) | |
2829 *((short *)v3 + 70) = 5; | |
2830 *((short *)v3 + 56) = v2; | |
2831 *((short *)v3 + 57) = v2; | |
2832 *((short *)v3 + 58) = v2; | |
2833 ((Actor *)(v3 - 36))->UpdateAnimation(); | |
2834 v3[25] = 0; | |
2835 ((Actor *)(v3 - 36))->PrepareSprites(0); | |
2836 v2 = 0; | |
2837 goto LABEL_17; | |
2838 } | |
2839 LABEL_8: | |
2840 *((short *)v3 + 70) = 19; | |
2841 *(int *)v3 = v4 | 0x10000; | |
2842 goto LABEL_17; | |
2843 } | |
2844 LABEL_18: | |
2845 pGameLoadingUI_ProgressBar->Progress(); | 2864 pGameLoadingUI_ProgressBar->Progress(); |
2846 | 2865 |
2847 Actor thisa; | 2866 Actor thisa; |
2848 thisa.pMonsterInfo.uID = 45; | 2867 thisa.pMonsterInfo.uID = 45; |
2849 thisa.PrepareSprites(v2); | 2868 thisa.PrepareSprites(v2); |
2872 | 2891 |
2873 //----- (0047B42C) -------------------------------------------------------- | 2892 //----- (0047B42C) -------------------------------------------------------- |
2874 unsigned int OutdoorLocation::DrawActors() | 2893 unsigned int OutdoorLocation::DrawActors() |
2875 { | 2894 { |
2876 unsigned int result; // eax@1 | 2895 unsigned int result; // eax@1 |
2877 char *v1; // edi@2 | 2896 Actor *v1; // edi@2 |
2878 __int16 v2; // ax@3 | 2897 __int16 v2; // ax@3 |
2879 int v3; // esi@5 | 2898 int v3; // esi@5 |
2880 float v4; // ST48_4@8 | 2899 float v4; // ST48_4@8 |
2881 double v5; // ST38_8@8 | 2900 double v5; // ST38_8@8 |
2882 float v6; // ST48_4@10 | 2901 float v6; // ST48_4@10 |
2940 result = 0; | 2959 result = 0; |
2941 v59 = 0; | 2960 v59 = 0; |
2942 if ( (signed int)uNumActors > 0 ) | 2961 if ( (signed int)uNumActors > 0 ) |
2943 { | 2962 { |
2944 v54 = 0; | 2963 v54 = 0; |
2945 v1 = (char *)&pActors[0].vPosition.z; | 2964 v1 = pActors;//[0].vPosition.z; |
2946 do | 2965 do |
2947 { | 2966 { |
2948 v2 = *((short *)v1 + 15); | 2967 v2 = v1->uAIState; |
2949 *(int *)(v1 - 110) &= 0xFFFFFFF7u; | 2968 v1->uAttributes &= 0xFFFFFFF7u; |
2950 if ( v2 == 11 || v2 == 19 ) | 2969 if ( v2 == 11 || v2 == 19 ) |
2951 goto LABEL_58; | 2970 goto LABEL_58; |
2952 v3 = *(short *)v1; | 2971 v3 = v1->vPosition.z; |
2953 v49 = 0; | 2972 v49 = 0; |
2954 x = *((short *)v1 - 2); | 2973 x = v1->vPosition.x; |
2955 y = *((short *)v1 - 1); | 2974 y = v1->vPosition.y; |
2956 v61 = *(short *)v1; | 2975 v61 = v1->vPosition.z; |
2957 if ( v2 == 17 ) | 2976 if ( v2 == 17 ) |
2958 { | 2977 { |
2959 if ( (v1[666] & 7) != 3 || pActors[*(int *)(v1 + 666) >> 3].pMonsterInfo.uSpecialAbilityDamageDiceSides != 1 ) | 2978 if ( (v1->uSummonerID & 7) != 3 || pActors[v1->uSummonerID >> 3].pMonsterInfo.uSpecialAbilityDamageDiceSides != 1 ) |
2960 { | 2979 { |
2961 v6 = (double)*((short *)v1 - 4) * 0.5; | 2980 v6 = (double)v1->uActorHeight * 0.5; |
2962 v7 = v6 + 6.7553994e15; | 2981 v7 = v6 + 6.7553994e15; |
2963 v3 += LODWORD(v7); | 2982 v3 += LODWORD(v7); |
2964 v61 = v3; | 2983 v61 = v3; |
2965 } | 2984 } |
2966 else | 2985 else |
2967 { | 2986 { |
2968 v49 = 1; | 2987 v49 = 1; |
2969 pGame->pStru6Instance->_4A7F74(*((short *)v1 - 2), *((short *)v1 - 1), v3); | 2988 pGame->pStru6Instance->_4A7F74(v1->vPosition.x, v1->vPosition.y, v3); |
2970 v4 = (1.0 - (double)*(signed int *)(v1 + 38) / (double)*((short *)v1 + 7)) | 2989 v4 = (1.0 - (double)*(signed int *)(v1 + 38) / (double)*((short *)v1 + 7)) |
2971 * (double)(2 * (signed int)*((short *)v1 - 4)); | 2990 * (double)(2 * (signed int)v1->uActorHeight); |
2972 v5 = v4 + 6.7553994e15; | 2991 v5 = v4 + 6.7553994e15; |
2973 v3 -= LODWORD(v5); | 2992 v3 -= LODWORD(v5); |
2974 v61 = v3; | 2993 v61 = v3; |
2975 if ( v3 > *(short *)v1 ) | 2994 if ( v3 > v1->vPosition.z ) |
2976 { | 2995 { |
2977 v61 = *(short *)v1; | 2996 v61 = v1->vPosition.z; |
2978 v3 = *(short *)v1; | 2997 v3 = v1->vPosition.z; |
2979 } | 2998 } |
2980 } | 2999 } |
2981 } | 3000 } |
2982 v8 = stru_5C6E00->Atan2( | 3001 v8 = stru_5C6E00->Atan2( |
2983 *((short *)v1 - 2) - pIndoorCamera->pos.x, | 3002 v1->vPosition.x - pIndoorCamera->pos.x, |
2984 *((short *)v1 - 1) - pIndoorCamera->pos.y); | 3003 v1->vPosition.y - pIndoorCamera->pos.y); |
2985 LOWORD(v9) = *((short *)v1 + 4); | 3004 LOWORD(v9) = v1->uYawAngle; |
2986 v41 = ((signed int)(stru_5C6E00->uIntegerPi + ((signed int)stru_5C6E00->uIntegerPi >> 3) + v9 - v8) >> 8) & 7; | 3005 v41 = ((signed int)(stru_5C6E00->uIntegerPi + ((signed int)stru_5C6E00->uIntegerPi >> 3) + v9 - v8) >> 8) & 7; |
2987 v10 = *((short *)v1 + 16); | 3006 v10 = v1->uCurrentActionAnimation; |
2988 if ( pParty->bTurnBasedModeOn ) | 3007 if ( pParty->bTurnBasedModeOn ) |
2989 { | 3008 { |
2990 if ( v10 != 1 ) | 3009 if ( v10 != 1 ) |
2991 { | 3010 { |
2992 LABEL_17: | 3011 LABEL_17: |
2993 v12 = *(int *)(v1 + 38); | 3012 v12 = v1->uCurrentActionTime; |
2994 goto LABEL_18; | 3013 goto LABEL_18; |
2995 } | 3014 } |
2996 v11 = pMiscTimer->uTotalGameTimeElapsed; | 3015 v11 = pMiscTimer->uTotalGameTimeElapsed; |
2997 } | 3016 } |
2998 else | 3017 else |
3001 goto LABEL_17; | 3020 goto LABEL_17; |
3002 v11 = pEventTimer->uTotalGameTimeElapsed; | 3021 v11 = pEventTimer->uTotalGameTimeElapsed; |
3003 } | 3022 } |
3004 v12 = v54 + v11; | 3023 v12 = v54 + v11; |
3005 LABEL_18: | 3024 LABEL_18: |
3006 if ( *(_QWORD *)(v1 + 146) > 0i64 || *(_QWORD *)(v1 + 162) > 0i64 ) | 3025 if ( (signed __int64)v1->pActorBuffs[5].uExpireTime > 0 || (signed __int64)v1->pActorBuffs[6].uExpireTime > 0 ) |
3007 v12 = 0; | 3026 v12 = 0; |
3008 v13 = *((short *)v1 + 15); | 3027 v13 = v1->uAIState; |
3009 if ( v13 == 17 && !v49 ) | 3028 if ( v13 == 17 && !v49 ) |
3010 { | 3029 { |
3011 v40 = v12; | 3030 v40 = v12; |
3012 v39 = uSpriteID_Spell11; | 3031 v39 = uSpriteID_Spell11; |
3013 LABEL_24: | 3032 LABEL_24: |
3014 v14 = pSpriteFrameTable->GetFrame(v39, v40); | 3033 v14 = pSpriteFrameTable->GetFrame(v39, v40); |
3015 goto LABEL_25; | 3034 goto LABEL_25; |
3016 } | 3035 } |
3017 v40 = v12; | 3036 v40 = v12; |
3018 v39 = *(short *)&v1[2 * v10 + 42]; | 3037 v39 = v1->pSpriteIDs[v10]; |
3019 if ( v13 != 16 ) | 3038 if ( v13 != 16 ) |
3020 goto LABEL_24; | 3039 goto LABEL_24; |
3021 v14 = pSpriteFrameTable->GetFrameBy_x(v39, v12); | 3040 v14 = pSpriteFrameTable->GetFrameBy_x(v39, v12); |
3022 LABEL_25: | 3041 LABEL_25: |
3023 v62 = 0; | 3042 v62 = 0; |
3090 v28 = &pBillboardRenderList[uNumBillboardsToDraw]; | 3109 v28 = &pBillboardRenderList[uNumBillboardsToDraw]; |
3091 if ( (signed int)uNumBillboardsToDraw >= 500 ) | 3110 if ( (signed int)uNumBillboardsToDraw >= 500 ) |
3092 return result; | 3111 return result; |
3093 ++uNumBillboardsToDraw; | 3112 ++uNumBillboardsToDraw; |
3094 ++uNumSpritesDrawnThisFrame; | 3113 ++uNumSpritesDrawnThisFrame; |
3095 *(int *)(v1 - 110) |= 8u; | 3114 v1->uAttributes |= 8u; |
3096 v28->uHwSpriteID = v15->pHwSpriteIDs[v41]; | 3115 v28->uHwSpriteID = v15->pHwSpriteIDs[v41]; |
3097 v29 = v15->uPaletteIndex; | 3116 v29 = v15->uPaletteIndex; |
3098 v28->uIndoorSectorID = 0; | 3117 v28->uIndoorSectorID = 0; |
3099 v28->uPalette = v29; | 3118 v28->uPalette = v29; |
3100 v28->field_0 = (unsigned __int64)(v15->scale * (signed __int64)v58) >> 16; | 3119 v28->field_0 = (unsigned __int64)(v15->scale * (signed __int64)v58) >> 16; |
3101 v30 = *(int *)(v1 + 118) == 0; | 3120 v30 = HIDWORD(v1->pActorBuffs[3].uExpireTime) == 0; |
3102 v31 = *(int *)(v1 + 118) < 0; | 3121 v31 = SHIDWORD(v1->pActorBuffs[3].uExpireTime) < 0; |
3103 v28->field_4 = (unsigned __int64)(v15->scale * (signed __int64)v57) >> 16; | 3122 v28->field_4 = (unsigned __int64)(v15->scale * (signed __int64)v57) >> 16; |
3104 if ( v31 || v31 | v30 && *(int *)(v1 + 114) <= 0u ) | 3123 if ( v31 || v31 | v30 && LODWORD(v1->pActorBuffs[3].uExpireTime) <= 0u ) |
3105 { | 3124 { |
3106 if ( *(_QWORD *)(v1 + 226) > 0i64 ) | 3125 if ( (signed __int64)v1->pActorBuffs[10].uExpireTime > 0i64 ) |
3107 { | 3126 { |
3108 v52 = (unsigned __int64)(pGame->pStru6Instance->_4A806F((Actor *)(v1 - 146)) | 3127 v52 = (unsigned __int64)(pGame->pStru6Instance->_4A806F(v1) |
3109 * (signed __int64)v28->field_4) >> 16; | 3128 * (signed __int64)v28->field_4) >> 16; |
3110 LABEL_53: | 3129 LABEL_53: |
3111 LOWORD(v27) = v43; | 3130 LOWORD(v27) = v43; |
3112 v28->field_4 = v52; | 3131 v28->field_4 = v52; |
3113 } | 3132 } |
3114 } | 3133 } |
3115 else | 3134 else |
3116 { | 3135 { |
3117 v32 = *((short *)v1 + 61); | 3136 v32 = v1->pActorBuffs[3].uPower; |
3118 if ( v32 ) | 3137 if ( v32 ) |
3119 { | 3138 { |
3120 v33 = *((short *)v1 + 61); | 3139 v33 = v1->pActorBuffs[3].uPower; |
3121 v28->field_0 = (unsigned __int64)(65536 / (unsigned __int16)v32 * (signed __int64)v28->field_0) >> 16; | 3140 v28->field_0 = (unsigned __int64)(65536 / (unsigned __int16)v32 * (signed __int64)v28->field_0) >> 16; |
3122 v52 = (unsigned __int64)(65536 / v33 * (signed __int64)v28->field_4) >> 16; | 3141 v52 = (unsigned __int64)(65536 / v33 * (signed __int64)v28->field_4) >> 16; |
3123 goto LABEL_53; | 3142 goto LABEL_53; |
3124 } | 3143 } |
3125 } | 3144 } |
3132 LOWORD(v34) = 0; | 3151 LOWORD(v34) = 0; |
3133 v28->uPaletteSubindex = 0; | 3152 v28->uPaletteSubindex = 0; |
3134 v28->sZValue = v34 + (8 * v59 | 3); | 3153 v28->sZValue = v34 + (8 * v59 | 3); |
3135 v28->field_14 = v59; | 3154 v28->field_14 = v59; |
3136 v35 = pMonsterList->pMonsters; | 3155 v35 = pMonsterList->pMonsters; |
3137 v36 = *((short *)v1 - 25); | 3156 v36 = v1->pMonsterInfo.uID; |
3138 v37 = *(int *)(v1 + 150) == 0; | 3157 v37 = HIDWORD(v1->pActorBuffs[5].uExpireTime) == 0; |
3139 v38 = *(int *)(v1 + 150) < 0; | 3158 v38 = SHIDWORD(v1->pActorBuffs[5].uExpireTime) < 0; |
3140 v28->field_1E = v62 | 0x200; | 3159 v28->field_1E = v62 | 0x200; |
3141 v28->pSpriteFrame = v15; | 3160 v28->pSpriteFrame = v15; |
3142 v28->uTintColor = *((int *)&v35[v36] - 36); | 3161 v28->uTintColor = *((int *)&v35[v36] - 36); |
3143 if ( !v38 && (!(v38 | v37) || *(int *)(v1 + 146)) ) | 3162 if ( !v38 && (!(v38 | v37) || LODWORD(v1->pActorBuffs[5].uExpireTime)) ) |
3144 v28->field_1E = v62 | 0x200; | 3163 v28->field_1E = v62 | 0x200; |
3145 } | 3164 } |
3146 LABEL_58: | 3165 LABEL_58: |
3147 ++v59; | 3166 ++v59; |
3148 v54 += 32; | 3167 v54 += 32; |
3149 result = v59; | 3168 result = v59; |
3150 v1 += 836; | 3169 ++v1; |
3151 } | 3170 } |
3152 while ( v59 < (signed int)uNumActors ); | 3171 while ( v59 < (signed int)uNumActors ); |
3153 } | 3172 } |
3154 return result; | 3173 return result; |
3155 } | 3174 } |