comparison mm7_3.cpp @ 609:42d5777c2f47

Слияние
author Ritor1
date Wed, 06 Mar 2013 18:22:25 +0600
parents 653724e9c234 bcae3e06cadb
children 5bf285f56fa8
comparison
equal deleted inserted replaced
608:653724e9c234 609:42d5777c2f47
123 { 123 {
124 while ( 1 ) 124 while ( 1 )
125 { 125 {
126 v9 = &pIndoor->pSectors[v33[result]]; 126 v9 = &pIndoor->pSectors[v33[result]];
127 v10 = 0; 127 v10 = 0;
128 v32 = v9->uNumFloors + v9->field_C + v9->field_14; 128 v32 = v9->uNumFloors + v9->uNumWalls + v9->uNumCeilings;
129 v26 = 0; 129 v26 = 0;
130 if ( v32 > 0 ) 130 if ( v32 > 0 )
131 break; 131 break;
132 LABEL_46: 132 LABEL_46:
133 result = v29++ + 1; 133 result = v29++ + 1;
1524 signed int v5; // ebx@1 1524 signed int v5; // ebx@1
1525 int result; // eax@1 1525 int result; // eax@1
1526 int v7; // [sp+10h] [bp-8h]@1 1526 int v7; // [sp+10h] [bp-8h]@1
1527 signed int v8; // [sp+14h] [bp-4h]@1 1527 signed int v8; // [sp+14h] [bp-4h]@1
1528 1528
1529 __debugbreak();
1530 v5 = x - 2; 1529 v5 = x - 2;
1531 v7 = x; 1530 v7 = x;
1532 v8 = y; 1531 v8 = y;
1533 *pSectorID = pIndoor->GetSector(x - 2, y, z + 40); 1532 *pSectorID = pIndoor->GetSector(x - 2, y, z + 40);
1534 result = _46ED1B_collide_against_floor(v5, v8, z + 40, pSectorID, pFaceID); 1533 result = _46ED1B_collide_against_floor(v5, v8, z + 40, pSectorID, pFaceID);
1648 v71 = 0; 1647 v71 = 0;
1649 bJumping = 0; 1648 bJumping = 0;
1650 v80 = _46ED1B_collide_against_floor(new_party_x, new_party_y, party_z + 40, &uSectorID, &uFaceID); 1649 v80 = _46ED1B_collide_against_floor(new_party_x, new_party_y, party_z + 40, &uSectorID, &uFaceID);
1651 if ( pParty->bFlying ) 1650 if ( pParty->bFlying )
1652 { 1651 {
1653 pParty->bFlying = 0; 1652 pParty->bFlying = false;
1654 __debugbreak();
1655 if (pParty->FlyActive()) 1653 if (pParty->FlyActive())
1656 stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[7].uOverlayID + 119] |= 1u;// 005E4D58 pOtherOverlayList [negindexing] 1654 pOtherOverlayList->pOverlays[pParty->pPartyBuffs[PARTY_BUFF_FLY].uOverlayID - 1].field_E |= 1;
1655 //stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[PARTY_BUFF_FLY].uOverlayID + 119] |= 1u;// 005E4D58 pOtherOverlayList [negindexing]
1657 } 1656 }
1658 if ( v80 == -30000 ) 1657 if ( v80 == -30000 )
1659 { 1658 {
1660 v80 = _47272C_collide_agains_some_secotors_floors(new_party_x, new_party_y, party_z + 40, &uSectorID, &uFaceID); 1659 v80 = _47272C_collide_agains_some_secotors_floors(new_party_x, new_party_y, party_z + 40, &uSectorID, &uFaceID);
1661 if ( v80 == -30000 ) 1660 if ( v80 == -30000 )
1701 pParty->uFallStartY = v80; 1700 pParty->uFallStartY = v80;
1702 } 1701 }
1703 LABEL_20: 1702 LABEL_20:
1704 if ( v6 - party_z > 512 && !bFeatherFall && party_z <= v80 + 1 ) 1703 if ( v6 - party_z > 512 && !bFeatherFall && party_z <= v80 + 1 )
1705 { 1704 {
1706 if ( BYTE1(pParty->uFlags) & 1 ) 1705 if (pParty->uFlags & PARTY_FLAGS_1_LANDING)
1707 { 1706 {
1708 BYTE1(pParty->uFlags) &= 0xFEu; 1707 pParty->uFlags &= ~PARTY_FLAGS_1_LANDING;
1709 } 1708 }
1710 else for (uint i = 0; i < 4; ++i) 1709 else for (uint i = 0; i < 4; ++i)
1711 { // receive falling damage 1710 { // receive falling damage
1712 auto pPlayer = pParty->pPlayers + i; 1711 auto pPlayer = pParty->pPlayers + i;
1713 1712
1926 if ( pIndoor->pFaces[v68].pFacePlane_old.vNormal.z < 32768 ) 1925 if ( pIndoor->pFaces[v68].pFacePlane_old.vNormal.z < 32768 )
1927 { 1926 {
1928 v89 -= pEventTimer->uTimeElapsed * GetGravityStrength(); 1927 v89 -= pEventTimer->uTimeElapsed * GetGravityStrength();
1929 goto LABEL_92; 1928 goto LABEL_92;
1930 } 1929 }
1931 if ( BYTE1(pParty->uFlags) & 1 ) 1930 if (pParty->uFlags & PARTY_FLAGS_1_LANDING)
1932 goto LABEL_92; 1931 goto LABEL_92;
1933 v89 = 0; 1932 v89 = 0;
1934 } 1933 }
1935 if ( bJumping != v36 && v89 <= v36 ) 1934 if ( bJumping != v36 && v89 <= v36 )
1936 { 1935 {
2180 pAudioPlayer->_4AA258(804); 2179 pAudioPlayer->_4AA258(804);
2181 pParty->field_6F8 = 64; 2180 pParty->field_6F8 = 64;
2182 } 2181 }
2183 } 2182 }
2184 if ( !bJumping || bFeatherFall ) 2183 if ( !bJumping || bFeatherFall )
2185 pParty->uFlags &= 0xFFFFFFF7u; 2184 pParty->uFlags &= ~PARTY_FLAGS_1_FALLING;
2186 else 2185 else
2187 pParty->uFlags |= 8u; 2186 pParty->uFlags |= PARTY_FLAGS_1_FALLING;
2188 BYTE1(pParty->uFlags) &= 0xFDu; 2187 pParty->uFlags &= ~0x200;
2189 pParty->vPosition.x = new_party_x; 2188 pParty->vPosition.x = new_party_x;
2190 pParty->vPosition.z = new_party_z; 2189 pParty->vPosition.z = new_party_z;
2191 pParty->vPosition.y = new_party_y; 2190 pParty->vPosition.y = new_party_y;
2192 pParty->uFallSpeed = v89; 2191 pParty->uFallSpeed = v89;
2193 if ( !bJumping && BYTE3(pIndoor->pFaces[uFaceID].uAttributes) & 0x40 ) 2192 if ( !bJumping && BYTE3(pIndoor->pFaces[uFaceID].uAttributes) & 0x40 )
2194 BYTE1(pParty->uFlags) |= 2u; 2193 pParty->uFlags |= 0x200;
2195 if (uFaceEvent) 2194 if (uFaceEvent)
2196 EventProcessor(uFaceEvent, 0, 1); 2195 EventProcessor(uFaceEvent, 0, 1);
2197 } 2196 }
2198 2197
2199 2198
2369 break; 2368 break;
2370 } 2369 }
2371 } 2370 }
2372 // bFeatherFall = 1; 2371 // bFeatherFall = 1;
2373 //LABEL_9: 2372 //LABEL_9:
2374 LOBYTE(pParty->uFlags) &= 0x7Fu; 2373 pParty->uFlags &= ~PARTY_FLAGS_1_STANDING_ON_WATER;
2375 if (pParty->WaterWalkActive()) 2374 if (pParty->WaterWalkActive())
2376 { 2375 {
2377 //LOBYTE(pParty->uFlags) &= 0x7Fu; 2376 //LOBYTE(pParty->uFlags) &= 0x7Fu;
2378 bWaterWalk = 1; 2377 bWaterWalk = 1;
2379 *(short *)&stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[18].uOverlayID + 119] |= 1u; 2378 *(short *)&stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[18].uOverlayID + 119] |= 1u;
2475 break; 2474 break;
2476 2475
2477 pParty->bFlying = false; 2476 pParty->bFlying = false;
2478 if (bUnderwater || 2477 if (bUnderwater ||
2479 pParty->pPartyBuffs[PARTY_BUFF_FLY].uFlags & 1 || 2478 pParty->pPartyBuffs[PARTY_BUFF_FLY].uFlags & 1 ||
2480 pParty->pPlayers[pParty->pPartyBuffs[PARTY_BUFF_FLY].uCaster - 1].sMana <= 0 ) 2479 pParty->pPlayers[pParty->pPartyBuffs[PARTY_BUFF_FLY].uCaster - 1].sMana > 0 )
2481 { 2480 {
2482 if ( pParty->vPosition.z < 4000 || bJumping ) 2481 if ( pParty->vPosition.z < 4000 || bJumping )
2483 { 2482 {
2484 v123 += 30; 2483 v123 += 30;
2485 v113 += 30; 2484 v113 += 30;
2496 if ( v102 && v123 < v109 && (signed int)(pParty->uPartyHeight + v123) >= v109 ) 2495 if ( v102 && v123 < v109 && (signed int)(pParty->uPartyHeight + v123) >= v109 )
2497 { 2496 {
2498 pParty->field_6E0 = 0; 2497 pParty->field_6E0 = 0;
2499 pParty->field_6E4 = 0; 2498 pParty->field_6E4 = 0;
2500 pPartyActionQueue->uNumActions = 0; 2499 pPartyActionQueue->uNumActions = 0;
2501 BYTE1(pParty->uFlags) |= 1u; 2500 pParty->uFlags |= PARTY_FLAGS_1_LANDING;
2502 pParty->vPosition.z = v109 - pParty->uPartyHeight - 31; 2501 pParty->vPosition.z = v109 - pParty->uPartyHeight - 31;
2503 pParty->field_6F0 = v123; 2502 pParty->field_6F0 = v123;
2504 pParty->bFlying = 0; 2503 pParty->bFlying = 0;
2505 v123 = v109 - pParty->uPartyHeight - 31; 2504 v123 = v109 - pParty->uPartyHeight - 31;
2506 v113 = pParty->field_6F0; 2505 v113 = pParty->field_6F0;
2516 if (pParty->FlyActive() || bUnderwater) 2515 if (pParty->FlyActive() || bUnderwater)
2517 { 2516 {
2518 pParty->bFlying = 0; 2517 pParty->bFlying = 0;
2519 if ( bUnderwater 2518 if ( bUnderwater
2520 || pParty->pPartyBuffs[7].uFlags & 1 2519 || pParty->pPartyBuffs[7].uFlags & 1
2521 || pParty->pPlayers[pParty->pPartyBuffs[7].uCaster-1].sMana <= 0 )//*(int *)&pParty->pArtifactsFound[6972 * pParty->pPartyBuffs[7].uCaster + 10] > 0 ) 2520 || pParty->pPlayers[pParty->pPartyBuffs[7].uCaster - 1].sMana > 0 )//*(int *)&pParty->pArtifactsFound[6972 * pParty->pPartyBuffs[7].uCaster + 10] > 0 )
2522 { 2521 {
2523 v123 -= 30; 2522 v123 -= 30;
2524 v113 -= 30; 2523 v113 -= 30;
2525 pParty->uFallSpeed = 0; 2524 pParty->uFallSpeed = 0;
2526 v121 = 0; 2525 v121 = 0;
3146 pAudioPlayer->_4AA258(804); 3145 pAudioPlayer->_4AA258(804);
3147 pParty->field_6F8 = 64; 3146 pParty->field_6F8 = 64;
3148 } 3147 }
3149 } 3148 }
3150 if ( !bJumping || v101 ) 3149 if ( !bJumping || v101 )
3151 pParty->uFlags &= 0xFFFFFFF7u; 3150 pParty->uFlags &= ~PARTY_FLAGS_1_FALLING;
3152 else 3151 else
3153 pParty->uFlags |= 8u; 3152 pParty->uFlags |= PARTY_FLAGS_1_FALLING;
3154 v126 = WorldPosToGridCellX(pParty->vPosition.x); 3153 v126 = WorldPosToGridCellX(pParty->vPosition.x);
3155 v65 = WorldPosToGridCellZ(pParty->vPosition.y) - 1; 3154 v65 = WorldPosToGridCellZ(pParty->vPosition.y) - 1;
3156 v114 = WorldPosToGridCellX(v116); 3155 v114 = WorldPosToGridCellX(v116);
3157 v66 = WorldPosToGridCellZ(v117) - 1; 3156 v66 = WorldPosToGridCellZ(v117) - 1;
3158 v127 = (BSPModel *)(((unsigned int)~pOutdoor->ActuallyGetSomeOtherTileInfo(v126, v65) >> 1) & 1); 3157 v127 = (BSPModel *)(((unsigned int)~pOutdoor->ActuallyGetSomeOtherTileInfo(v126, v65) >> 1) & 1);
3191 pParty->uFallSpeed = 0; 3190 pParty->uFallSpeed = 0;
3192 v73 = v105; 3191 v73 = v105;
3193 pParty->vPosition.z = v105; 3192 pParty->vPosition.z = v105;
3194 if ( pParty->uFallStartY - v70 > 512 && !bFeatherFall && v70 <= v105 && !bUnderwater ) 3193 if ( pParty->uFallStartY - v70 > 512 && !bFeatherFall && v70 <= v105 && !bUnderwater )
3195 { 3194 {
3196 if ( pParty->uFlags & 0x100 ) 3195 if ( pParty->uFlags & PARTY_FLAGS_1_LANDING )
3197 { 3196 {
3198 BYTE1(pParty->uFlags) &= 0xFEu; 3197 pParty->uFlags &= ~PARTY_FLAGS_1_LANDING;
3199 } 3198 }
3200 else 3199 else
3201 { 3200 {
3202 v74 = &pPlayers[1]; 3201 v74 = &pPlayers[1];
3203 do 3202 do
3224 { 3223 {
3225 pParty->vPosition.z = v109 - pParty->uPartyHeight - 1; 3224 pParty->vPosition.z = v109 - pParty->uPartyHeight - 1;
3226 pParty->field_6F0 = v109 - pParty->uPartyHeight - 1; 3225 pParty->field_6F0 = v109 - pParty->uPartyHeight - 1;
3227 } 3226 }
3228 } 3227 }
3229 LOWORD(pParty->uFlags) &= 0xFDFBu; 3228 pParty->uFlags &= ~0x204;
3230 } 3229 }
3231 return; 3230 return;
3232 } 3231 }
3233 v76 = pParty->bFlying; 3232 v76 = pParty->bFlying;
3234 if ( pParty->bFlying || v101 == 0 || bWaterWalk || !v127 ) 3233 if ( pParty->bFlying || v101 == 0 || bWaterWalk || !v127 )
3259 LABEL_312: 3258 LABEL_312:
3260 pParty->vPosition.y = v117; 3259 pParty->vPosition.y = v117;
3261 LABEL_313: 3260 LABEL_313:
3262 if ( bWaterWalk ) 3261 if ( bWaterWalk )
3263 { 3262 {
3264 LOBYTE(pParty->uFlags) &= 0x7Fu; 3263 pParty->uFlags &= ~PARTY_FLAGS_1_STANDING_ON_WATER;
3265 v79 = 20 * pParty->pPartyBuffs[18].uOverlayID + 6180178; 3264 //v79 = 20 * pParty->pPartyBuffs[18].uOverlayID + 6180178;
3266 *(short *)&stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[18].uOverlayID + 119] |= 1u; 3265 //*(short *)&stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[18].uOverlayID + 119] |= 1u;
3266 v79 = (int)&stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[18].uOverlayID + 119];
3267 *(short *)v79 |= 1u;
3267 if ( !v122 || !v69 ) 3268 if ( !v122 || !v69 )
3268 { 3269 {
3269 if ( !v76 ) 3270 if ( !v76 )
3270 { 3271 {
3271 v80 = *(short *)v79; 3272 v80 = *(short *)v79;
3272 LOBYTE(pParty->uFlags) |= 0x80u; 3273 pParty->uFlags |= PARTY_FLAGS_1_STANDING_ON_WATER;
3273 *(short *)v79 = v80 & 0xFFFE; 3274 *(short *)v79 = v80 & 0xFFFE;
3274 } 3275 }
3275 } 3276 }
3276 } 3277 }
3277 goto LABEL_318; 3278 goto LABEL_318;
3311 v82 = v105; 3312 v82 = v105;
3312 pParty->uFallSpeed = 0; 3313 pParty->uFallSpeed = 0;
3313 pParty->vPosition.z = v105; 3314 pParty->vPosition.z = v105;
3314 if ( pParty->uFallStartY - v81 > 512 && !bFeatherFall && v81 <= v105 && !bUnderwater ) 3315 if ( pParty->uFallStartY - v81 > 512 && !bFeatherFall && v81 <= v105 && !bUnderwater )
3315 { 3316 {
3316 if ( pParty->uFlags & 0x100 ) 3317 if ( pParty->uFlags & PARTY_FLAGS_1_LANDING )
3317 { 3318 {
3318 BYTE1(pParty->uFlags) &= 0xFEu; 3319 pParty->uFlags &= ~PARTY_FLAGS_1_LANDING;
3319 } 3320 }
3320 else 3321 else
3321 { 3322 {
3322 v84 = &pPlayers[1]; 3323 v84 = &pPlayers[1];
3323 do 3324 do
6163 array_50AC10[2].vWorldViewProjY = pViewport->uViewportY; 6164 array_50AC10[2].vWorldViewProjY = pViewport->uViewportY;
6164 6165
6165 array_50AC10[3].vWorldViewProjX = pViewport->uViewportZ; 6166 array_50AC10[3].vWorldViewProjX = pViewport->uViewportZ;
6166 array_50AC10[3].vWorldViewProjY = v38; 6167 array_50AC10[3].vWorldViewProjY = v38;
6167 6168
6168 v36 = (double)(pViewport->uViewportZ - pViewport->uViewportX) * 0.5; 6169 /*v36 = (double)(pViewport->uViewportZ - pViewport->uViewportX) * 0.5;
6169 v33 = 65536 / (signed int)(v36 / tan(0.6457717418670654) + 0.5); 6170 v33 = 65536 / (signed int)(v36 / tan(0.6457717418670654) + 0.5);
6170 6171
6171 for (int i = 0; i < _this.uNumVertices; ++i) 6172 for (int i = 0; i < _this.uNumVertices; ++i)
6172 { 6173 {
6173 v29 = floorf(array_50AC10[i].vWorldViewProjY + 0.5f); 6174 v29 = floorf(array_50AC10[i].vWorldViewProjY + 0.5f);
6174 v39 = (unsigned __int64)(_this.ptr_38->field_14 * v33 * (v30 - v29)) / 65536; 6175 v39 = (unsigned __int64)(_this.ptr_38->field_14 * v33 * (v30 - v29)) / 65536;
6175 v8 = v39 + _this.ptr_38->field_C; 6176 v8 = v39 + _this.ptr_38->field_C;
6176 6177
6177 v39 = (unsigned __int64)(_this.ptr_38->field_20 * v33 * (v30 - v29)) / 65536; 6178 v39 = (unsigned __int64)(_this.ptr_38->field_20 * v33 * (v30 - v29)) / 65536;
6178 v36 = v39 + _this.ptr_38->field_18; 6179 v36 = v39 + _this.ptr_38->field_18;
6179 6180
6180 v9 = (unsigned __int64)(_this.v_18.z * v33 * (v30 - v29)) / 65536; 6181 v9 = (unsigned __int64)(_this.v_18.z * v33 * (v30 - v29)) / 65536;
6181 v10 = _this.v_18.x + v9; 6182 v10 = _this.v_18.x + v9;
6182 v39 = _this.v_18.x + v9; 6183 v39 = _this.v_18.x + v9;
6183 if ( _this.v_18.x + v9 > 0 ) 6184 if ( _this.v_18.x + v9 > 0 )
6184 { 6185 {
6185 v10 = 0; 6186 v10 = 0;
6186 v39 = 0; 6187 v39 = 0;
6187 } 6188 }
6188 v11 = (signed __int64)array_50AC10[i].vWorldViewProjX; 6189 v11 = (signed __int64)array_50AC10[i].vWorldViewProjX;
6189 v38 = v10; 6190 v38 = v10;
6190 v12 = array_50AC10[i].vWorldViewProjY - 1.0; 6191 v12 = array_50AC10[i].vWorldViewProjY - 1.0;
6191 v13 = v33 * (pViewport->uScreenCenterX - v11); 6192 v13 = v33 * (pViewport->uScreenCenterX - v11);
6192 v34 = -_this.field_24; 6193 v34 = -_this.field_24;
6193 v32 = (signed __int64)v12; 6194 v32 = (signed __int64)v12;
6194 v14 = v33 * (v30 - v32); 6195 v14 = v33 * (v30 - v32);
6195 while ( 1 ) 6196 while ( 1 )
6196 { 6197 {
6197 v40 = v14; 6198 //v40 = v14;
6198 if ( !v10 ) 6199 if ( !v10 )
6199 goto LABEL_12; 6200 {
6200 v37 = abs(v34 >> 14);
6201 v15 = abs(v10);
6202 if ( v37 <= v15 || v32 <= pViewport->uViewportY )
6203 {
6204 if ( v39 <= 0 )
6205 break;
6206 }
6207 v14 = v40;
6208 LABEL_12:
6209 v37 = _this.v_18.z; 6201 v37 = _this.v_18.z;
6210 v16 = (unsigned __int64)(_this.v_18.z * (signed __int64)v14) >> 16; 6202 v16 = (unsigned __int64)(_this.v_18.z * (signed __int64)v14) >> 16;
6211 --v32; 6203 --v32;
6212 v14 += v33; 6204 v14 += v33;
6213 v10 = _this.v_18.x + v16; 6205 v10 = _this.v_18.x + v16;
6214 v39 = _this.v_18.x + v16; 6206 v39 = _this.v_18.x + v16;
6215 v38 = _this.v_18.x + v16; 6207 v38 = _this.v_18.x + v16;
6216 break; 6208 break;
6217 } 6209 }
6218 LODWORD(v17) = v34 << 16; 6210 v37 = abs(v34 >> 14);
6219 HIDWORD(v17) = v34 >> 16; 6211 v15 = abs(v10);
6220 v18 = v17 / v38; 6212 if ( v37 <= v15 || v32 <= pViewport->uViewportY )
6221 if ( v18 < 0 ) 6213 {
6222 v18 = pOutdoorCamera->shading_dist_mist; 6214 if ( v39 <= 0 )
6223 6215 break;
6224 v37 += ((unsigned __int64)(_this.ptr_38->field_10 * v13) >> 16); 6216 }
6225 v36 += ((unsigned __int64)(_this.ptr_38->field_1C * v13) >> 16); 6217 //v14 = v40;
6226 v35 = 224 * pMiscTimer->uTotalGameTimeElapsed + (signed int)((unsigned __int64)(v37 * v18) >> 16) / 8; 6218 v37 = _this.v_18.z;
6227 v36 = 224 * pMiscTimer->uTotalGameTimeElapsed + (signed int)((unsigned __int64)(v36 * v18) >> 16) / 8; 6219 v16 = (unsigned __int64)(_this.v_18.z * v14) >> 16;
6228 6220 --v32;
6229 array_50AC10[i].vWorldViewPosition.x = pOutdoorCamera->shading_dist_mist; 6221 v14 += v33;
6230 array_50AC10[i]._rhw = 1.0 / (double)(v17 / 65536); 6222 v10 = _this.v_18.x + v16;
6231 array_50AC10[i].u = (double)v35 / (65536.0 * pBitmaps_LOD->pTextures[pOutdoor->uSky_TextureID].uTextureWidth); 6223 v39 = _this.v_18.x + v16;
6232 array_50AC10[i].v = (double)v36 / (65536.0 * pBitmaps_LOD->pTextures[pOutdoor->uSky_TextureID].uTextureWidth); 6224 v38 = _this.v_18.x + v16;
6233 } 6225 break;
6234 6226 }
6235 float t = (GetTickCount() % 96000) / 96000.0f; 6227 LODWORD(v17) = v34 << 16;
6236 6228 HIDWORD(v17) = v34 >> 16;
6237 array_50AC10[0].vWorldViewPosition.x = pOutdoorCamera->shading_dist_mist; 6229 v18 = v17 / v38;
6238 array_50AC10[0]._rhw = 1; 6230 if ( v18 < 0 )
6239 array_50AC10[0].u = 0; 6231 v18 = pOutdoorCamera->shading_dist_mist;
6240 array_50AC10[0].v = 0 + t; 6232
6241 6233 v37 += ((unsigned __int64)(_this.ptr_38->field_10 * v13) >> 16);
6242 array_50AC10[1].vWorldViewPosition.x = pOutdoorCamera->shading_dist_mist; 6234 v36 += ((unsigned __int64)(_this.ptr_38->field_1C * v13) >> 16);
6243 array_50AC10[1]._rhw = 1; 6235 v35 = 224 * pMiscTimer->uTotalGameTimeElapsed + (signed int)((unsigned __int64)(v37 * v18) >> 16) / 8;
6244 array_50AC10[1].u = 0; 6236 v36 = 224 * pMiscTimer->uTotalGameTimeElapsed + (signed int)((unsigned __int64)(v36 * v18) >> 16) / 8;
6245 array_50AC10[1].v = 1 + t; 6237 */
6246 6238 //array_50AC10[i].vWorldViewPosition.x = pOutdoorCamera->shading_dist_mist;
6247 array_50AC10[2].vWorldViewPosition.x = pOutdoorCamera->shading_dist_mist; 6239 //array_50AC10[i]._rhw = 1;
6248 array_50AC10[2]._rhw = 1; 6240 //array_50AC10[i].u = (double)v35 / (65536.0 * pBitmaps_LOD->pTextures[pOutdoor->uSky_TextureID].uTextureWidth);
6249 array_50AC10[2].u = 1; 6241 //array_50AC10[i].v = (double)v36 / (65536.0 * pBitmaps_LOD->pTextures[pOutdoor->uSky_TextureID].uTextureWidth);
6250 array_50AC10[2].v = 0 + t; 6242 //}
6251 6243 if ( _this.uNumVertices > 0)
6252 array_50AC10[3].vWorldViewPosition.x = pOutdoorCamera->shading_dist_mist; 6244 {
6253 array_50AC10[3]._rhw = 1; 6245 float t = (GetTickCount() % 96000) / 96000.0f;
6254 array_50AC10[3].u = 1; 6246
6255 array_50AC10[3].v = 1 + t; 6247 array_50AC10[0].vWorldViewPosition.x = pOutdoorCamera->shading_dist_mist;
6256 pRenderer->DrawStrip(_this.uNumVertices, &_this, pBitmaps_LOD->pHardwareTextures[_this.uTileBitmapID]); 6248 array_50AC10[0]._rhw = 1;
6257 return; 6249 array_50AC10[0].u = 0;
6250 array_50AC10[0].v = 0 + t;
6251
6252 array_50AC10[1].vWorldViewPosition.x = pOutdoorCamera->shading_dist_mist;
6253 array_50AC10[1]._rhw = 1;
6254 array_50AC10[1].u = 0;
6255 array_50AC10[1].v = 1 + t;
6256
6257 array_50AC10[2].vWorldViewPosition.x = pOutdoorCamera->shading_dist_mist;
6258 array_50AC10[2]._rhw = 1;
6259 array_50AC10[2].u = 1;
6260 array_50AC10[2].v = 0 + t;
6261
6262 array_50AC10[3].vWorldViewPosition.x = pOutdoorCamera->shading_dist_mist;
6263 array_50AC10[3]._rhw = 1;
6264 array_50AC10[3].u = 1;
6265 array_50AC10[3].v = 1 + t;
6266 pRenderer->DrawStrip(_this.uNumVertices, &_this, pBitmaps_LOD->pHardwareTextures[_this.uTileBitmapID]);
6267 return;
6268 //}
6269 }
6258 } 6270 }
6259 6271
6260 6272
6261 //----- (00479A53) -------------------------------------------------------- 6273 //----- (00479A53) --------------------------------------------------------
6262 void __fastcall _479A53_draw_some_blv_poly(unsigned int uNumVertices, unsigned int uFaceID) 6274 void __fastcall _479A53_draw_some_blv_poly(unsigned int uNumVertices, unsigned int uFaceID)
11651 } 11663 }
11652 11664
11653 //----- (0044100D) -------------------------------------------------------- 11665 //----- (0044100D) --------------------------------------------------------
11654 bool __cdecl sub_44100D() 11666 bool __cdecl sub_44100D()
11655 { 11667 {
11656 return pCurrentScreen == SCREEN_NPC_DIALOGUE 11668 return pCurrentScreen == SCREEN_NPC_DIALOGUE || pCurrentScreen == SCREEN_CHARACTERS ||
11657 || pCurrentScreen == SCREEN_CHARACTERS 11669 pCurrentScreen > SCREEN_LOADGAME && pCurrentScreen <= SCREEN_E ||
11658 || pCurrentScreen > SCREEN_LOADGAME 11670 pCurrentScreen > SCREEN_VIDEO && pCurrentScreen <= SCREEN_INPUT_BLV || pCurrentScreen == SCREEN_CASTING;
11659 && (pCurrentScreen <= SCREEN_E
11660 || pCurrentScreen > SCREEN_VIDEO
11661 && (pCurrentScreen <= SCREEN_INPUT_BLV
11662 || pCurrentScreen == SCREEN_CASTING));
11663 } 11671 }
11664 // 4E28F8: using guessed type int pCurrentScreen; 11672 // 4E28F8: using guessed type int pCurrentScreen;
11665 11673
11666 //----- (00441498) -------------------------------------------------------- 11674 //----- (00441498) --------------------------------------------------------
11667 void __cdecl GameUI_DrawTorchlightAndWizardEye() 11675 void __cdecl GameUI_DrawTorchlightAndWizardEye()
11668 { 11676 {
11669 unsigned int v0; // eax@15 11677 if (pCurrentScreen == SCREEN_GAME
11670 IconFrame *v1; // eax@15
11671 unsigned int v2; // eax@19
11672 IconFrame *v3; // eax@19
11673
11674 if ( !pCurrentScreen
11675 || pCurrentScreen == SCREEN_MENU 11678 || pCurrentScreen == SCREEN_MENU
11676 || pCurrentScreen == SCREEN_OPTIONS 11679 || pCurrentScreen == SCREEN_OPTIONS
11677 || pCurrentScreen == SCREEN_REST 11680 || pCurrentScreen == SCREEN_REST
11678 || pCurrentScreen == SCREEN_SPELL_BOOK 11681 || pCurrentScreen == SCREEN_SPELL_BOOK
11679 || pCurrentScreen == SCREEN_CHEST 11682 || pCurrentScreen == SCREEN_CHEST
11681 || pCurrentScreen == SCREEN_LOADGAME 11684 || pCurrentScreen == SCREEN_LOADGAME
11682 || pCurrentScreen == SCREEN_F 11685 || pCurrentScreen == SCREEN_F
11683 || pCurrentScreen == SCREEN_BOOKS 11686 || pCurrentScreen == SCREEN_BOOKS
11684 || pCurrentScreen == SCREEN_BRANCHLESS_NPC_DIALOG ) 11687 || pCurrentScreen == SCREEN_BRANCHLESS_NPC_DIALOG )
11685 { 11688 {
11686 if ( SHIDWORD(pParty->pPartyBuffs[16].uExpireTime) >= 0 11689 if (pParty->TorchlightActive())
11687 && (SHIDWORD(pParty->pPartyBuffs[16].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[16].uExpireTime)) ) 11690 {
11688 { 11691 auto icon = pIconsFrameTable->GetFrame((signed __int16)pUIAnum_Torchlight->uIconID, pEventTimer->Time());
11689 v0 = pEventTimer->Time(); 11692 pRenderer->DrawTextureTransparent(pUIAnum_Torchlight->x, pUIAnum_Torchlight->y, pIcons_LOD->GetTexture(icon->uTextureID));
11690 v1 = pIconsFrameTable->GetFrame((signed __int16)pUIAnum_Torchlight->uIconID, v0); 11693 }
11691 pRenderer->DrawTextureTransparent( 11694 if (pParty->WizardEyeActive())
11692 pUIAnum_Torchlight->x, 11695 {
11693 pUIAnum_Torchlight->y, 11696 auto icon = pIconsFrameTable->GetFrame((signed __int16)pUIAnim_WizardEye->uIconID, pEventTimer->Time());
11694 &pIcons_LOD->pTextures[v1->uTextureID]); 11697 pRenderer->DrawTextureTransparent(pUIAnim_WizardEye->x, pUIAnim_WizardEye->y, pIcons_LOD->GetTexture(icon->uTextureID));
11695 }
11696 if ( SHIDWORD(pParty->pPartyBuffs[19].uExpireTime) >= 0
11697 && (SHIDWORD(pParty->pPartyBuffs[19].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[19].uExpireTime)) )
11698 {
11699 v2 = pEventTimer->Time();
11700 v3 = pIconsFrameTable->GetFrame((signed __int16)pUIAnim_WizardEye->uIconID, v2);
11701 pRenderer->DrawTextureTransparent(
11702 pUIAnim_WizardEye->x,
11703 pUIAnim_WizardEye->y,
11704 &pIcons_LOD->pTextures[v3->uTextureID]);
11705 } 11698 }
11706 } 11699 }
11707 } 11700 }
11708 // 4E28F8: using guessed type int pCurrentScreen; 11701 // 4E28F8: using guessed type int pCurrentScreen;
11709 11702
11717 &pIcons_LOD->pTextures[dword_50C98C]); 11710 &pIcons_LOD->pTextures[dword_50C98C]);
11718 } 11711 }
11719 11712
11720 11713
11721 //----- (004415C5) -------------------------------------------------------- 11714 //----- (004415C5) --------------------------------------------------------
11722 void __cdecl Load_isn_spells_21_27() 11715 void LoadPartyBuffIcons()
11723 { 11716 {
11724 signed int v0; // esi@1 11717 for (uint i = 0; i < 14; ++i)
11725 char pContainer[120]; // [sp+8h] [bp-20h]@2 11718 {
11726 11719 char filename[200];
11727 v0 = 0; 11720 sprintf(filename, "isn-%02d", i + 1);
11728 do 11721 pTextureIDs_PartyBuffIcons[i] = pIcons_LOD->LoadTexture(filename, TEXTURE_16BIT_PALETTE);
11729 { 11722 }
11730 sprintf(pContainer, "isn-%02d", v0 + 1); 11723
11731 pTextureIDs_isns[v0++] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); 11724 uIconIdx_FlySpell = pIconsFrameTable->FindIcon("spell21");
11732 } 11725 uIconIdx_WaterWalk = pIconsFrameTable->FindIcon("spell27");
11733 while ( v0 < 14 );
11734 uIconIdx_Spell21 = pIconsFrameTable->FindIcon("spell21");
11735 uIconIdx_Spell27 = pIconsFrameTable->FindIcon("spell27");
11736 } 11726 }
11737 11727
11738 //----- (0044162D) -------------------------------------------------------- 11728 //----- (0044162D) --------------------------------------------------------
11739 void __cdecl GameUI_DrawPartySpells() 11729 void __cdecl GameUI_DrawPartySpells()
11740 { 11730 {
11741 unsigned int v0; // ebp@1 11731 unsigned int v0; // ebp@1
11742 signed int v1; // edi@1 11732 //signed int v1; // edi@1
11743 int v2; // eax@2 11733 //int v2; // eax@2
11744 int v3; // ecx@5 11734 //int v3; // ecx@5
11745 __int16 *v4; // ebx@25 11735 //__int16 *v4; // ebx@25
11746 Player *v5; // edi@26 11736 //Player *v5; // edi@26
11747 unsigned int v6; // [sp-4h] [bp-1Ch]@11 11737 //unsigned int v6; // [sp-4h] [bp-1Ch]@11
11748 Texture *v7; // [sp-4h] [bp-1Ch]@12 11738 Texture *v7; // [sp-4h] [bp-1Ch]@12
11749 unsigned int v8; // [sp-4h] [bp-1Ch]@20 11739 //unsigned int v8; // [sp-4h] [bp-1Ch]@20
11750 Texture *v9; // [sp-4h] [bp-1Ch]@21 11740 Texture *v9; // [sp-4h] [bp-1Ch]@21
11751 Player **v10; // [sp+10h] [bp-8h]@25 11741 //Player **v10; // [sp+10h] [bp-8h]@25
11752 11742
11753 v0 = (signed __int64)((double)GetTickCount() * 0.050000001); 11743 v0 = (signed __int64)((double)GetTickCount() * 0.050000001);
11754 v1 = 0; 11744 //v1 = 0;
11755 do 11745 for (uint i = 0; i < 14; ++i)
11756 { 11746 {
11757 v2 = (unsigned __int8)byte_4E5DD8[v1]; 11747 //v2 = byte_4E5DD8[v1];
11758 if ( SHIDWORD(pParty->pPartyBuffs[v2].uExpireTime) >= 0 11748 if (pParty->pPartyBuffs[byte_4E5DD8[i]].uExpireTime)
11759 && (SHIDWORD(pParty->pPartyBuffs[v2].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[v2].uExpireTime) > 0) ) 11749 {
11760 { 11750 auto tex = pIcons_LOD->GetTexture(pTextureIDs_PartyBuffIcons[i]);
11761 v3 = pTextureIDs_isns[v1]; 11751 //v3 = pTextureIDs_PartyBuffIcons[i];
11762 pRenderer->_4A65CC( 11752 if (tex)
11763 pPartySpellbuffsUI_XYs[v1][0], 11753 pRenderer->_4A65CC(pPartySpellbuffsUI_XYs[i][0],
11764 pPartySpellbuffsUI_XYs[v1][1], 11754 pPartySpellbuffsUI_XYs[i][1], tex, tex,
11765 (Texture *)(v3 != -1 ? &pIcons_LOD->pTextures[v3] : 0), 11755 v0 + 20 * pPartySpellbuffsUI_smthns[i], 0, 63);
11766 (Texture *)(v3 != -1 ? &pIcons_LOD->pTextures[v3] : 0), 11756 }
11767 v0 + 20 * pPartySpellbuffsUI_smthns[v1], 11757 //++v1;
11768 0, 11758 }
11769 63); 11759 //while ( v1 < 14 );
11770 } 11760
11771 ++v1; 11761 if (pCurrentScreen == SCREEN_GAME || pCurrentScreen == SCREEN_NPC_DIALOGUE)
11772 } 11762 {
11773 while ( v1 < 14 ); 11763 if (pParty->FlyActive())
11774 if ( !pCurrentScreen
11775 || pCurrentScreen == SCREEN_NPC_DIALOGUE )
11776 {
11777 if ( (signed __int64)pParty->pPartyBuffs[7].uExpireTime > 0 )
11778 { 11764 {
11779 if ( pParty->bFlying ) 11765 if ( pParty->bFlying )
11780 v6 = v0; 11766 v7 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_FlySpell, v0)->uTextureID];
11781 else 11767 else
11782 v6 = 0; 11768 v7 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_FlySpell, 0)->uTextureID];
11783 v7 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_Spell21, v6)->uTextureID];
11784 if ( pRenderer->pRenderD3D ) 11769 if ( pRenderer->pRenderD3D )
11785 pRenderer->DrawTextureIndexed(8u, 8u, v7); 11770 pRenderer->DrawTextureIndexed(8u, 8u, v7);
11786 else 11771 else
11787 pRenderer->DrawTextureTransparent(8u, 8u, v7); 11772 pRenderer->DrawTextureTransparent(8u, 8u, v7);
11788 } 11773 }
11789 if ( SHIDWORD(pParty->pPartyBuffs[18].uExpireTime) >= 0 11774 if (pParty->WaterWalkActive())
11790 && (SHIDWORD(pParty->pPartyBuffs[18].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[18].uExpireTime)) ) 11775 {
11791 { 11776 if ( pParty->uFlags & PARTY_FLAGS_1_STANDING_ON_WATER)
11792 if ( pParty->uFlags & 0x80 ) 11777 v9 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_WaterWalk, v0)->uTextureID];
11793 v8 = v0;
11794 else 11778 else
11795 v8 = 0; 11779 v9 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_WaterWalk, 0)->uTextureID];
11796 v9 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_Spell27, v8)->uTextureID];
11797 if ( pRenderer->pRenderD3D ) 11780 if ( pRenderer->pRenderD3D )
11798 pRenderer->DrawTextureIndexed(396u, 8u, v9); 11781 pRenderer->DrawTextureIndexed(396u, 8u, v9);
11799 else 11782 else
11800 pRenderer->DrawTextureTransparent(396u, 8u, v9); 11783 pRenderer->DrawTextureTransparent(396u, 8u, v9);
11801 } 11784 }
11802 } 11785 }
11803 11786
11804 uint _it = 0; 11787 for (uint i = 0; i < 4; ++i)
11805 v10 = &pPlayers[1]; 11788 {
11806 v4 = pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing; 11789 auto player = pParty->pPlayers + i;
11807 do 11790
11808 { 11791 if (player->pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].uExpireTime)
11809 v5 = *v10; 11792 pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 427, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Hammerhands));
11810 if ( (signed __int64)(*v10)->pPlayerBuffs[6].uExpireTime > 0 ) 11793 if (player->pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime)
11811 pRenderer->DrawTextureIndexed( 11794 pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 393, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Bless));
11812 *v4 + 72, 11795 if (player->pPlayerBuffs[PLAYER_BUFF_PRESERVATION].uExpireTime)
11813 0x1ABu, 11796 pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 410, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Preservation));
11814 (Texture *)(dword_507964 != -1 ? &pIcons_LOD->pTextures[dword_507964] : 0)); 11797 if (player->pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].uExpireTime)
11815 if ( (signed __int64)v5->pPlayerBuffs[1].uExpireTime > 0 ) 11798 pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 444, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_PainReflection));
11816 pRenderer->DrawTextureIndexed( 11799 }
11817 *v4 + 72,
11818 0x189u,
11819 (Texture *)(dword_50796C != -1 ? &pIcons_LOD->pTextures[dword_50796C] : 0));
11820 if ( (signed __int64)v5->pPlayerBuffs[11].uExpireTime > 0 )
11821 pRenderer->DrawTextureIndexed(
11822 *v4 + 72,
11823 0x19Au,
11824 (Texture *)(dword_507968 != -1 ? &pIcons_LOD->pTextures[dword_507968] : 0));
11825 if ( (signed __int64)v5->pPlayerBuffs[10].uExpireTime > 0 )
11826 pRenderer->DrawTextureIndexed(
11827 *v4 + 72,
11828 0x1BCu,
11829 (Texture *)(dword_507960 != -1 ? &pIcons_LOD->pTextures[dword_507960] : 0));
11830 ++v10;
11831 ++v4;
11832 }
11833 //while ( (signed int)v4 < (signed int)pBaseHealthByClass );
11834 while (++_it != 4);
11835 } 11800 }
11836 11801
11837 //----- (00441A4E) -------------------------------------------------------- 11802 //----- (00441A4E) --------------------------------------------------------
11838 __int16 __fastcall sub_441A4E(int a1) 11803 __int16 __fastcall sub_441A4E(int a1)
11839 { 11804 {
15520 unsigned __int16 v27; // ax@59 15485 unsigned __int16 v27; // ax@59
15521 int j; // esi@60 15486 int j; // esi@60
15522 signed int v29; // edx@66 15487 signed int v29; // edx@66
15523 char *v30; // ecx@67 15488 char *v30; // ecx@67
15524 unsigned __int16 v31; // ax@70 15489 unsigned __int16 v31; // ax@70
15525 Player *v32; // eax@80 15490 //Player *v32; // eax@80
15526 unsigned __int16 v33; // si@85 15491 //unsigned __int16 v33; // si@85
15527 int v34; // eax@96 15492 int v34; // eax@96
15528 int v35; // eax@97 15493 int v35; // eax@97
15529 unsigned __int64 v36; // qax@99 15494 unsigned __int64 v36; // qax@99
15530 SpellBuff *v37; // ecx@99 15495 SpellBuff *v37; // ecx@99
15531 int v38; // esi@103 15496 int v38; // esi@103
15533 int v40; // ebx@108 15498 int v40; // ebx@108
15534 int v41; // ebx@109 15499 int v41; // ebx@109
15535 int v42; // esi@111 15500 int v42; // esi@111
15536 int v43; // ebx@111 15501 int v43; // ebx@111
15537 int v44; // eax@117 15502 int v44; // eax@117
15538 unsigned __int16 v45; // si@137 15503 //unsigned __int16 v45; // si@137
15539 unsigned __int16 v46; // [sp-8h] [bp-BCh]@99 15504 unsigned __int16 v46; // [sp-8h] [bp-BCh]@99
15540 int v47; // [sp-4h] [bp-B8h]@35 15505 int v47; // [sp-4h] [bp-B8h]@35
15541 unsigned __int16 v48; // [sp-4h] [bp-B8h]@99 15506 unsigned __int16 v48; // [sp-4h] [bp-B8h]@99
15542 int v49; // [sp+0h] [bp-B4h]@35 15507 int v49; // [sp+0h] [bp-B4h]@35
15543 int v50; // [sp+0h] [bp-B4h]@99 15508 int v50; // [sp+0h] [bp-B4h]@99
15549 unsigned int yaw; // [sp+30h] [bp-84h]@7 15514 unsigned int yaw; // [sp+30h] [bp-84h]@7
15550 int pitch; // [sp+34h] [bp-80h]@7 15515 int pitch; // [sp+34h] [bp-80h]@7
15551 //SpriteObject a1; // [sp+38h] [bp-7Ch]@12 15516 //SpriteObject a1; // [sp+38h] [bp-7Ch]@12
15552 int v59; // [sp+A8h] [bp-Ch]@1 15517 int v59; // [sp+A8h] [bp-Ch]@1
15553 int v60; // [sp+ACh] [bp-8h]@1 15518 int v60; // [sp+ACh] [bp-8h]@1
15554 int spellnum_; // [sp+B0h] [bp-4h]@1 15519 //int spellnum_; // [sp+B0h] [bp-4h]@1
15555 signed int levela; // [sp+BCh] [bp+8h]@80 15520 //signed int levela; // [sp+BCh] [bp+8h]@80
15556 int a6_4; // [sp+C8h] [bp+14h]@117 15521 int a6_4; // [sp+C8h] [bp+14h]@117
15557 float a7a; // [sp+CCh] [bp+18h]@6 15522 float a7a; // [sp+CCh] [bp+18h]@6
15558 signed int a7b; // [sp+CCh] [bp+18h]@12 15523 signed int a7b; // [sp+CCh] [bp+18h]@12
15559 int a7c; // [sp+CCh] [bp+18h]@29 15524 int a7c; // [sp+CCh] [bp+18h]@29
15560 int a7d; // [sp+CCh] [bp+18h]@55 15525 int a7d; // [sp+CCh] [bp+18h]@55
15563 int a8c; // [sp+D0h] [bp+1Ch]@55 15528 int a8c; // [sp+D0h] [bp+1Ch]@55
15564 float toza; // [sp+D4h] [bp+20h]@6 15529 float toza; // [sp+D4h] [bp+20h]@6
15565 15530
15566 v9 = 0; 15531 v9 = 0;
15567 v59 = rank + 1; 15532 v59 = rank + 1;
15568 spellnum_ = spellnum; 15533 //spellnum_ = spellnum;
15569 v60 = 0; 15534 v60 = 0;
15570 if ( tox || toy || toz ) 15535 if ( tox || toy || toz )
15571 { 15536 {
15572 v10 = (double)tox - (double)fromx; 15537 v10 = (double)tox - (double)fromx;
15573 v53 = v10; 15538 v53 = v10;
15606 a7b = v15; 15571 a7b = v15;
15607 15572
15608 SpriteObject a1; // [sp+38h] [bp-7Ch]@12 15573 SpriteObject a1; // [sp+38h] [bp-7Ch]@12
15609 //SpriteObject::SpriteObject(&a1); 15574 //SpriteObject::SpriteObject(&a1);
15610 15575
15611 a1.uType = stru_4E3ACC[spellnum_].field_0; 15576 a1.uType = stru_4E3ACC[spellnum].field_0;
15612 if ( spellnum_ > 58 ) 15577 if ( spellnum > 58 )
15613 { 15578 {
15614 if ( spellnum_ == 69 ) 15579 if ( spellnum == 69 )
15615 goto LABEL_117; 15580 goto LABEL_117;
15616 if ( spellnum_ != 83 ) 15581 if ( spellnum != 83 )
15617 return; 15582 return;
15618 v40 = v15 - 2; 15583 v40 = v15 - 2;
15619 if ( v40 ) 15584 if ( v40 )
15620 { 15585 {
15621 v41 = v40 - 1; 15586 v41 = v40 - 1;
15649 v36 = pParty->uTimePlayed + v39; 15614 v36 = pParty->uTimePlayed + v39;
15650 LABEL_116: 15615 LABEL_116:
15651 v37->Apply(v36, v46, v48, v50, v52); 15616 v37->Apply(v36, v46, v48, v50, v52);
15652 goto LABEL_139; 15617 goto LABEL_139;
15653 } 15618 }
15654 if ( spellnum_ != 58 ) 15619 if ( spellnum != 58 )
15655 { 15620 {
15656 switch ( spellnum_ ) 15621 switch ( spellnum )
15657 { 15622 {
15658 case 2: 15623 case 2:
15659 case 6: 15624 case 6:
15660 case 18: 15625 case 18:
15661 case 26: 15626 case 26:
15663 case 32: 15628 case 32:
15664 case 39: 15629 case 39:
15665 case 41: 15630 case 41:
15666 a1.stru_24.Reset(); 15631 a1.stru_24.Reset();
15667 v16 = 0; 15632 v16 = 0;
15668 a1.field_48 = spellnum_; 15633 a1.field_48 = spellnum;
15669 a1.field_4C = level; 15634 a1.field_4C = level;
15670 a1.field_50 = v15; 15635 a1.field_50 = v15;
15671 if ( (signed int)pObjectList->uNumObjects <= 0 ) 15636 if ( (signed int)pObjectList->uNumObjects <= 0 )
15672 goto LABEL_34; 15637 goto LABEL_34;
15673 v17 = (char *)&pObjectList->pObjects->uObjectID; 15638 v17 = (char *)&pObjectList->pObjects->uObjectID;
15701 if ( v60 != 1 ) 15666 if ( v60 != 1 )
15702 { 15667 {
15703 a8b = a7c / (v60 - 1); 15668 a8b = a7c / (v60 - 1);
15704 a1.stru_24.Reset(); 15669 a1.stru_24.Reset();
15705 v21 = 0; 15670 v21 = 0;
15706 a1.field_48 = spellnum_; 15671 a1.field_48 = spellnum;
15707 a1.field_4C = level; 15672 a1.field_4C = level;
15708 a1.field_50 = v15; 15673 a1.field_50 = v15;
15709 if ( (signed int)pObjectList->uNumObjects <= 0 ) 15674 if ( (signed int)pObjectList->uNumObjects <= 0 )
15710 { 15675 {
15711 LABEL_41: 15676 LABEL_41:
15744 } 15709 }
15745 goto LABEL_139; 15710 goto LABEL_139;
15746 } 15711 }
15747 a1.stru_24.Reset(); 15712 a1.stru_24.Reset();
15748 v16 = 0; 15713 v16 = 0;
15749 a1.field_48 = spellnum_; 15714 a1.field_48 = spellnum;
15750 a1.field_4C = level; 15715 a1.field_4C = level;
15751 a1.field_50 = v15; 15716 a1.field_50 = v15;
15752 if ( (signed int)pObjectList->uNumObjects <= 0 ) 15717 if ( (signed int)pObjectList->uNumObjects <= 0 )
15753 goto LABEL_34; 15718 goto LABEL_34;
15754 v19 = (char *)&pObjectList->pObjects->uObjectID; 15719 v19 = (char *)&pObjectList->pObjects->uObjectID;
15797 } 15762 }
15798 a7d = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360; 15763 a7d = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360;
15799 a8c = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (v60 - 1); 15764 a8c = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (v60 - 1);
15800 a1.stru_24.Reset(); 15765 a1.stru_24.Reset();
15801 v25 = 0; 15766 v25 = 0;
15802 a1.field_48 = spellnum_; 15767 a1.field_48 = spellnum;
15803 a1.field_4C = level; 15768 a1.field_4C = level;
15804 a1.field_50 = v15; 15769 a1.field_50 = v15;
15805 if ( (signed int)pObjectList->uNumObjects <= 0 ) 15770 if ( (signed int)pObjectList->uNumObjects <= 0 )
15806 goto LABEL_59; 15771 goto LABEL_59;
15807 v26 = (char *)&pObjectList->pObjects->uObjectID; 15772 v26 = (char *)&pObjectList->pObjects->uObjectID;
15841 case 43: 15806 case 43:
15842 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) 15807 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
15843 return; 15808 return;
15844 a1.stru_24.Reset(); 15809 a1.stru_24.Reset();
15845 v29 = 0; 15810 v29 = 0;
15846 a1.field_48 = spellnum_; 15811 a1.field_48 = spellnum;
15847 a1.field_4C = level; 15812 a1.field_4C = level;
15848 a1.field_50 = v15; 15813 a1.field_50 = v15;
15849 if ( (signed int)pObjectList->uNumObjects <= 0 ) 15814 if ( (signed int)pObjectList->uNumObjects <= 0 )
15850 goto LABEL_70; 15815 goto LABEL_70;
15851 v30 = (char *)&pObjectList->pObjects->uObjectID; 15816 v30 = (char *)&pObjectList->pObjects->uObjectID;
15852 break; 15817 break;
15853 case 5: 15818
15819 case SPELL_FIRE_HASTE:
15854 if ( v15 > 0 ) 15820 if ( v15 > 0 )
15855 { 15821 {
15856 if ( v15 <= 2 ) 15822 if ( v15 <= 2 )
15857 { 15823 {
15858 v9 = 60 * (level + 60); 15824 v9 = 60 * (level + 60);
15868 if ( v15 == 4 ) 15834 if ( v15 == 4 )
15869 v9 = 240 * (level + 15); 15835 v9 = 240 * (level + 15);
15870 } 15836 }
15871 } 15837 }
15872 } 15838 }
15873 levela = 1; 15839 //levela = 1;
15874 v32 = pParty->pPlayers;//[0].pConditions[1]; 15840 //v32 = pParty->pPlayers;//[0].pConditions[1];
15875 do 15841 //do
15876 { 15842 for (uint i = 0; i < 4; ++i)
15877 if ( v32->pConditions[1] ) 15843 if (pParty->pPlayers[i].pConditions[Player::Condition_Weak])
15878 levela = 0; 15844 return;
15879 ++v32; 15845 //while ( v32 <= &pParty->pPlayers[3] );
15880 } 15846 //if ( !levela )
15881 while ( v32 <= &pParty->pPlayers[3] ); 15847 // return;
15882 if ( !levela ) 15848 pParty->pPartyBuffs[PARTY_BUFF_HASTE].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(v9 * 128) * 0.033333335),
15883 return;
15884 pParty->pPartyBuffs[8].Apply(
15885 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v9 << 7) * 0.033333335),
15886 v15, 15849 v15,
15887 0, 15850 0,
15888 0, 15851 0,
15889 0); 15852 0);
15890 v33 = spellnum_; 15853 //v33 = spellnum_;
15891 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 0); 15854 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 0);
15892 pGame->pStru6Instance->SetPlayerBuffAnim(v33, 1u); 15855 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 1);
15893 pGame->pStru6Instance->SetPlayerBuffAnim(v33, 2u); 15856 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 2);
15894 pGame->pStru6Instance->SetPlayerBuffAnim(v33, 3u); 15857 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 3);
15895 goto LABEL_138; 15858 goto LABEL_138;
15896 case 17: 15859 case 17:
15897 case 38: 15860 case 38:
15898 case 51: 15861 case 51:
15899 switch ( v15 ) 15862 switch ( v15 )
15907 break; 15870 break;
15908 case 4: 15871 case 4:
15909 v9 = 3600 * (level + 1); 15872 v9 = 3600 * (level + 1);
15910 break; 15873 break;
15911 } 15874 }
15912 switch ( spellnum_ ) 15875 switch ( spellnum )
15913 { 15876 {
15914 case 17: 15877 case 17:
15915 v60 = 0; 15878 v60 = 0;
15916 level = 14; 15879 level = 14;
15917 break; 15880 break;
15924 v34 = level + 5; 15887 v34 = level + 5;
15925 level = 9; 15888 level = 9;
15926 v60 = v34; 15889 v60 = v34;
15927 break; 15890 break;
15928 } 15891 }
15929 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 0); 15892 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 0);
15930 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 1u); 15893 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 1);
15931 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 2u); 15894 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 2);
15932 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 3u); 15895 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 3);
15933 v52 = 0; 15896 v52 = 0;
15934 v50 = 0; 15897 v50 = 0;
15935 v48 = v60; 15898 v48 = v60;
15936 v46 = v15; 15899 v46 = v15;
15937 v36 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(v9 << 7) * 0.033333335); 15900 v36 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(v9 << 7) * 0.033333335);
15940 case 8: 15903 case 8:
15941 if ( v15 == 2 || v15 == 3 || v15 != 4 ) 15904 if ( v15 == 2 || v15 == 3 || v15 != 4 )
15942 v38 = 60 * level; 15905 v38 = 60 * level;
15943 else 15906 else
15944 v38 = 600 * level; 15907 v38 = 600 * level;
15945 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 0); 15908 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 0);
15946 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 1u); 15909 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 1);
15947 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 2u); 15910 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 2);
15948 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 3u); 15911 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 3);
15949 v52 = 0; 15912 v52 = 0;
15950 v50 = 0; 15913 v50 = 0;
15951 v48 = level; 15914 v48 = level;
15952 v46 = v15; 15915 v46 = v15;
15953 v39 = (signed __int64)((double)(v38 << 7) * 0.033333335); 15916 v39 = (signed __int64)((double)(v38 << 7) * 0.033333335);
16015 { 15978 {
16016 v44 = 4 * level; 15979 v44 = 4 * level;
16017 goto LABEL_124; 15980 goto LABEL_124;
16018 } 15981 }
16019 LABEL_125: 15982 LABEL_125:
16020 switch ( spellnum_ ) 15983 switch ( spellnum )
16021 { 15984 {
16022 case 3: 15985 case 3:
16023 level = 6; 15986 level = 6;
16024 break; 15987 break;
16025 case 14: 15988 case 14:
16036 break; 15999 break;
16037 case 69: 16000 case 69:
16038 level = 1; 16001 level = 1;
16039 break; 16002 break;
16040 } 16003 }
16041 v45 = spellnum_; 16004 //v45 = spellnum_;
16042 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 0); 16005 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 0);
16043 pGame->pStru6Instance->SetPlayerBuffAnim(v45, 1u); 16006 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 1);
16044 pGame->pStru6Instance->SetPlayerBuffAnim(v45, 2u); 16007 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 2);
16045 pGame->pStru6Instance->SetPlayerBuffAnim(v45, 3u); 16008 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 3);
16046 pParty->pPartyBuffs[level].Apply( 16009 pParty->pPartyBuffs[level].Apply(
16047 pParty->uTimePlayed + (signed int)(signed __int64)((double)a6_4 * 4.2666669), 16010 pParty->uTimePlayed + (signed int)(signed __int64)((double)a6_4 * 4.2666669),
16048 v15, 16011 v15,
16049 v60, 16012 v60,
16050 0, 16013 0,
16051 0); 16014 0);
16052 levela = 1; 16015 //levela = 1;
16053 LABEL_138: 16016 LABEL_138:
16054 if ( levela ) 16017 //if ( levela )
16055 LABEL_139: 16018 LABEL_139:
16056 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[spellnum_], 0, 0, fromx, fromy, 0, 0, 0); 16019 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[spellnum], 0, 0, fromx, fromy, 0, 0, 0);
16057 } 16020 }
16058 // 4EE088: using guessed type __int16 word_4EE088_sound_ids[]; 16021 // 4EE088: using guessed type __int16 word_4EE088_sound_ids[];
16059 16022
16060 //----- (0044987B) -------------------------------------------------------- 16023 //----- (0044987B) --------------------------------------------------------
16061 char *__fastcall sub_44987B(const char *pMapName, unsigned int uStartingPointType) 16024 char *__fastcall sub_44987B(const char *pMapName, unsigned int uStartingPointType)