Mercurial > mm7
comparison mm7_3.cpp @ 150:d92c78ab54fe
Слияние
author | Ritor1 |
---|---|
date | Tue, 12 Feb 2013 10:17:35 +0600 |
parents | 2b0c652cc165 8b8fd4d83fdc |
children | 9abdd40a107b |
comparison
equal
deleted
inserted
replaced
149:2b0c652cc165 | 150:d92c78ab54fe |
---|---|
1481 v40 = v8; | 1481 v40 = v8; |
1482 do | 1482 do |
1483 { | 1483 { |
1484 _46E44E_collide_against_faces_and_portals(0); | 1484 _46E44E_collide_against_faces_and_portals(0); |
1485 _46E0B2_collide_against_decorations(); | 1485 _46E0B2_collide_against_decorations(); |
1486 if ( (v1->field_58 & 7) != 4 ) | 1486 if ( (v1->field_58 & 7) != OBJECT_Player) |
1487 _46EF01_collision_chech_player(1); | 1487 _46EF01_collision_chech_player(1); |
1488 v13 = v1->field_58; | 1488 v13 = v1->field_58; |
1489 v42 = v8; | 1489 v42 = v8; |
1490 if ( (v13 & 7) == 3 ) | 1490 if ( (v13 & 7) == OBJECT_Actor) |
1491 { | 1491 { |
1492 if ( (signed int)uNumActors > v8 ) | 1492 if ( (signed int)uNumActors > v8 ) |
1493 { | 1493 { |
1494 v39b = pActors;//[0].word_000086_some_monster_id; | 1494 v39b = pActors;//[0].word_000086_some_monster_id; |
1495 do | 1495 do |
1573 v1->uSectorID = LOWORD(stru_721530.uSectorID); | 1573 v1->uSectorID = LOWORD(stru_721530.uSectorID); |
1574 stru_721530.field_70 += stru_721530.field_7C; | 1574 stru_721530.field_70 += stru_721530.field_7C; |
1575 if ( v2->uFlags & 0x40 && !_46BFFA_check_object_intercept(uLayingItemID_, stru_721530.uFaceID) ) | 1575 if ( v2->uFlags & 0x40 && !_46BFFA_check_object_intercept(uLayingItemID_, stru_721530.uFaceID) ) |
1576 return; | 1576 return; |
1577 v15 = (signed int)stru_721530.uFaceID >> 3; | 1577 v15 = (signed int)stru_721530.uFaceID >> 3; |
1578 if ( (stru_721530.uFaceID & 7) == 5 ) | 1578 if ( (stru_721530.uFaceID & 7) == OBJECT_Decoration) |
1579 { | 1579 { |
1580 v40 = sub_452A9E(v1->vVelocity.x * v1->vVelocity.x + v1->vVelocity.y * v1->vVelocity.y); | 1580 v40 = sub_452A9E(v1->vVelocity.x * v1->vVelocity.x + v1->vVelocity.y * v1->vVelocity.y); |
1581 v23 = stru_5C6E00->Atan2( | 1581 v23 = stru_5C6E00->Atan2( |
1582 v1->vPosition.x - pLevelDecorations[v15].vPosition.x, | 1582 v1->vPosition.x - pLevelDecorations[v15].vPosition.x, |
1583 v1->vPosition.y - pLevelDecorations[v15].vPosition.y); | 1583 v1->vPosition.y - pLevelDecorations[v15].vPosition.y); |
1591 v41 = v26 >> 16; | 1591 v41 = v26 >> 16; |
1592 v1->vVelocity.y = WORD1(v26); | 1592 v1->vVelocity.y = WORD1(v26); |
1593 } | 1593 } |
1594 else | 1594 else |
1595 { | 1595 { |
1596 if ( (stru_721530.uFaceID & 7) != 6 ) | 1596 if ( (stru_721530.uFaceID & 7) != OBJECT_BModel) |
1597 goto LABEL_64; | 1597 goto LABEL_64; |
1598 stru_721530.field_84 = (signed int)stru_721530.uFaceID >> 3; | 1598 stru_721530.field_84 = (signed int)stru_721530.uFaceID >> 3; |
1599 v16 = &pIndoor->pFaces[v15]; | 1599 v16 = &pIndoor->pFaces[v15]; |
1600 if ( v16->uPolygonType != 3 ) | 1600 if ( v16->uPolygonType != 3 ) |
1601 { | 1601 { |
1985 v16 = WorldPosToGridCellZ(v1->vPosition.y); | 1985 v16 = WorldPosToGridCellZ(v1->vPosition.y); |
1986 v17 = v1->vPosition.x; | 1986 v17 = v1->vPosition.x; |
1987 v58 = v16; | 1987 v58 = v16; |
1988 v18 = WorldPosToGridCellX(v17); | 1988 v18 = WorldPosToGridCellX(v17); |
1989 _46E26D_collide_against_sprites(v18, v58); | 1989 _46E26D_collide_against_sprites(v18, v58); |
1990 if ( (v1->field_58 & 7) != 4 ) | 1990 if ( (v1->field_58 & 7) != OBJECT_Player) |
1991 _46EF01_collision_chech_player(0); | 1991 _46EF01_collision_chech_player(0); |
1992 if ( (v1->field_58 & 7) == 3 ) | 1992 if ( (v1->field_58 & 7) == OBJECT_Actor) |
1993 { | 1993 { |
1994 v19 = v1->field_58 >> 3; | 1994 v19 = v1->field_58 >> 3; |
1995 if ( v19 >= 0 ) | 1995 if ( v19 >= 0 ) |
1996 { | 1996 { |
1997 if ( v19 < (signed int)(uNumActors - 1) ) | 1997 if ( v19 < (signed int)(uNumActors - 1) ) |
2092 v1->vPosition.z = v54 + 1; | 2092 v1->vPosition.z = v54 + 1; |
2093 if ( !_46BFFA_check_object_intercept(uLayingItemID_, stru_721530.uFaceID) ) | 2093 if ( !_46BFFA_check_object_intercept(uLayingItemID_, stru_721530.uFaceID) ) |
2094 return; | 2094 return; |
2095 } | 2095 } |
2096 v30 = (signed int)stru_721530.uFaceID >> 3; | 2096 v30 = (signed int)stru_721530.uFaceID >> 3; |
2097 if ( (stru_721530.uFaceID & 7) == 5 ) | 2097 if ( (stru_721530.uFaceID & 7) == OBJECT_Decoration) |
2098 break; | 2098 break; |
2099 if ( (stru_721530.uFaceID & 7) == 6 ) | 2099 if ( (stru_721530.uFaceID & 7) == OBJECT_BModel) |
2100 { | 2100 { |
2101 v31 = &pOutdoor->pBModels[(signed int)stru_721530.uFaceID >> 9]; | 2101 v31 = &pOutdoor->pBModels[(signed int)stru_721530.uFaceID >> 9]; |
2102 v32 = &v31->pFaces[v30 & 0x3F]; | 2102 v32 = &v31->pFaces[v30 & 0x3F]; |
2103 if ( v32->uPolygonType != 3 ) | 2103 if ( v32->uPolygonType != 3 ) |
2104 { | 2104 { |
2812 new_party_y += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16; | 2812 new_party_y += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16; |
2813 v43 = stru_721530.uFaceID; | 2813 v43 = stru_721530.uFaceID; |
2814 uSectorID = stru_721530.uSectorID; | 2814 uSectorID = stru_721530.uSectorID; |
2815 stru_721530.field_70 += stru_721530.field_7C; | 2815 stru_721530.field_70 += stru_721530.field_7C; |
2816 auto v87 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16) + new_party_z; | 2816 auto v87 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16) + new_party_z; |
2817 if ( (stru_721530.uFaceID & 7) == 3 ) | 2817 if ( (stru_721530.uFaceID & 7) == OBJECT_Actor) |
2818 { | 2818 { |
2819 if ( SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) >= 0 | 2819 if ( SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) >= 0 |
2820 && (SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[11].uExpireTime)) ) | 2820 && (SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[11].uExpireTime)) ) |
2821 pParty->pPartyBuffs[11].Reset(); | 2821 pParty->pPartyBuffs[11].Reset(); |
2822 viewparams->bRedrawGameUI = 1; | 2822 viewparams->bRedrawGameUI = 1; |
2823 goto LABEL_152; | 2823 goto LABEL_152; |
2824 } | 2824 } |
2825 if ( (stru_721530.uFaceID & 7) == 5 ) | 2825 if ( (stru_721530.uFaceID & 7) == OBJECT_Decoration) |
2826 { | 2826 { |
2827 v53 = sub_452A9E(v2 * v2 + v1 * v1); | 2827 v53 = sub_452A9E(v2 * v2 + v1 * v1); |
2828 v80 = v53; | 2828 v80 = v53; |
2829 v54 = stru_5C6E00->Atan2( | 2829 v54 = stru_5C6E00->Atan2( |
2830 new_party_x - pLevelDecorations[stru_721530.uFaceID >> 3].vPosition.x, | 2830 new_party_x - pLevelDecorations[stru_721530.uFaceID >> 3].vPosition.x, |
2833 v55 = stru_5C6E00->SinCos(v54 - stru_5C6E00->uIntegerHalfPi); | 2833 v55 = stru_5C6E00->SinCos(v54 - stru_5C6E00->uIntegerHalfPi); |
2834 v1 = (unsigned __int64)(v55 * (signed __int64)v80) >> 16; | 2834 v1 = (unsigned __int64)(v55 * (signed __int64)v80) >> 16; |
2835 } | 2835 } |
2836 else | 2836 else |
2837 { | 2837 { |
2838 if ( (stru_721530.uFaceID & 7) == 6 ) | 2838 if ( (stru_721530.uFaceID & 7) == OBJECT_BModel) |
2839 { | 2839 { |
2840 v44 = &pIndoor->pFaces[(signed int)stru_721530.uFaceID >> 3]; | 2840 v44 = &pIndoor->pFaces[(signed int)stru_721530.uFaceID >> 3]; |
2841 v45 = v44->uPolygonType; | 2841 v45 = v44->uPolygonType; |
2842 if ( v45 == 3 ) | 2842 if ( v45 == 3 ) |
2843 { | 2843 { |
2996 { | 2996 { |
2997 //int _zero; // esi@1 | 2997 //int _zero; // esi@1 |
2998 int v1; // edi@1 | 2998 int v1; // edi@1 |
2999 int v2; // ebx@1 | 2999 int v2; // ebx@1 |
3000 int v3; // eax@14 | 3000 int v3; // eax@14 |
3001 Player **v4; // esi@21 | 3001 //Player **v4; // esi@21 |
3002 int v5; // eax@24 | 3002 //int v5; // eax@24 |
3003 int v6; // esi@45 | 3003 int v6; // esi@45 |
3004 ODMFace *v7; // ecx@45 | 3004 ODMFace *v7; // ecx@45 |
3005 //unsigned int v8; // eax@71 | 3005 //unsigned int v8; // eax@71 |
3006 //double v9; // st7@72 | 3006 //double v9; // st7@72 |
3007 //signed __int64 v10; // qax@74 | 3007 //signed __int64 v10; // qax@74 |
3024 //int v27; // eax@98 | 3024 //int v27; // eax@98 |
3025 //double v28; // st7@98 | 3025 //double v28; // st7@98 |
3026 //signed __int64 v29; // qax@98 | 3026 //signed __int64 v29; // qax@98 |
3027 //unsigned int v30; // eax@103 | 3027 //unsigned int v30; // eax@103 |
3028 int v31; // eax@130 | 3028 int v31; // eax@130 |
3029 int v32; // ecx@141 | 3029 //int v32; // ecx@141 |
3030 signed int v33; // eax@143 | 3030 signed int v33; // eax@143 |
3031 int v34; // esi@143 | 3031 int v34; // esi@143 |
3032 unsigned int v35; // esi@147 | 3032 int v35; // esi@147 |
3033 int v36; // eax@155 | 3033 int v36; // eax@155 |
3034 signed int v37; // esi@159 | 3034 signed int v37; // esi@159 |
3035 signed int v38; // eax@159 | 3035 signed int v38; // eax@159 |
3036 signed int i; // esi@159 | 3036 signed int i; // esi@159 |
3037 int v40; // esi@162 | 3037 int v40; // esi@162 |
3038 Player **v41; // esi@172 | 3038 //Player **v41; // esi@172 |
3039 bool v42; // eax@180 | 3039 bool v42; // eax@180 |
3040 signed int v43; // ecx@184 | 3040 signed int v43; // ecx@184 |
3041 signed int v44; // edx@184 | 3041 signed int v44; // edx@184 |
3042 int v45; // ecx@200 | 3042 int v45; // ecx@200 |
3043 BSPModel *v46; // eax@203 | 3043 BSPModel *v46; // eax@203 |
3181 pParty->uFallStartY = v3; | 3181 pParty->uFallStartY = v3; |
3182 else | 3182 else |
3183 v3 = pParty->uFallStartY; | 3183 v3 = pParty->uFallStartY; |
3184 if ( v3 - v123 > 512 && !bFeatherFall && v123 <= v111 + 1 ) | 3184 if ( v3 - v123 > 512 && !bFeatherFall && v123 <= v111 + 1 ) |
3185 { | 3185 { |
3186 if ( BYTE1(pParty->uFlags) & 1 ) | 3186 if (pParty->uFlags & PARTY_FLAGS_1_LANDING) |
3187 { | 3187 { |
3188 BYTE1(pParty->uFlags) &= 0xFEu; | 3188 pParty->uFlags &= ~PARTY_FLAGS_1_LANDING; |
3189 } | 3189 } |
3190 else | 3190 else for (int _i = 0; _i < 4; ++_i) // receive falling damage |
3191 { | 3191 { |
3192 v4 = &pPlayers[1]; // receive falling damage | 3192 auto player = pParty->pPlayers + _i; |
3193 do | 3193 |
3194 { | 3194 if ( !player->HasEnchantedItemEquipped(72) && !player->WearsItem(529, 8) ) |
3195 if ( !(*v4)->HasEnchantedItemEquipped(72) && !(*v4)->WearsItem(529, 8) ) | 3195 { |
3196 { | 3196 player->ReceiveDamage( |
3197 v105 = (*v4)->GetMaxHealth(); | 3197 (signed int)((pParty->uFallStartY - v123) * (unsigned __int64)(player->GetMaxHealth() / 10)) / 256, |
3198 (*v4)->ReceiveDamage( | |
3199 (signed int)((pParty->uFallStartY - v123) * (unsigned __int64)(signed __int64)((double)v105 * 0.1)) / 256, | |
3200 4); | 3198 4); |
3201 v5 = (*v4)->GetActualEndurance(); | 3199 v105 = 20 - player->_48EA1B_get_static_effect(player->GetActualEndurance()); |
3202 v105 = 20 - (*v4)->_48EA1B_get_static_effect(v5); | 3200 player->SetRecoveryTime((signed __int64)((double)v105 * flt_6BE3A4_debug_recmod1 * 2.133333333333333)); |
3203 (*v4)->SetRecoveryTime((signed __int64)((double)v105 * flt_6BE3A4_debug_recmod1 * 2.133333333333333)); | 3201 } |
3204 } | 3202 //} |
3205 ++v4; | 3203 //while ( (signed int)v4 <= (signed int)&pPlayers[4] ); |
3206 } | |
3207 while ( (signed int)v4 <= (signed int)&pPlayers[4] ); | |
3208 } | 3204 } |
3209 } | 3205 } |
3210 v109 = -1; | 3206 v109 = -1; |
3211 if ( pParty->bFlying ) | 3207 if ( pParty->bFlying ) |
3212 v109 = sub_46D8E3(v116, v117, v123 + pParty->uPartyHeight, (int)&v102); | 3208 v109 = sub_46D8E3(v116, v117, v123 + pParty->uPartyHeight, (int)&v102); |
3222 bJumping = 1; | 3218 bJumping = 1; |
3223 } | 3219 } |
3224 v101 = v123 - v111 <= 32; | 3220 v101 = v123 - v111 <= 32; |
3225 if ( bWalkSound && pParty->field_6F8 > 0 ) | 3221 if ( bWalkSound && pParty->field_6F8 > 0 ) |
3226 pParty->field_6F8 -= pEventTimer->uTimeElapsed; | 3222 pParty->field_6F8 -= pEventTimer->uTimeElapsed; |
3227 if ( !bUnderwater | 3223 if (!bUnderwater |
3228 && SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) <= 0 | 3224 && SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) <= 0 |
3229 && (SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) < 0 || LODWORD(pParty->pPartyBuffs[7].uExpireTime) <= 0) ) | 3225 && (SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) < 0 || LODWORD(pParty->pPartyBuffs[7].uExpireTime) <= 0) ) |
3230 pParty->bFlying = false; | 3226 pParty->bFlying = false; |
3231 if (!bJumping) | 3227 if (!bJumping) |
3232 { | 3228 { |
3260 /*v119 = (Player **)((unsigned __int64)(pEventTimer->dt_in_some_format | 3256 /*v119 = (Player **)((unsigned __int64)(pEventTimer->dt_in_some_format |
3261 * (signed __int64)((signed int)(pParty->field_20_prolly_turn_speed | 3257 * (signed __int64)((signed int)(pParty->field_20_prolly_turn_speed |
3262 * stru_5C6E00->uIntegerPi) | 3258 * stru_5C6E00->uIntegerPi) |
3263 / 180)) >> 16);*/ | 3259 / 180)) >> 16);*/ |
3264 __int64 dturn = (unsigned __int64)(pEventTimer->dt_in_some_format * (signed __int64)((signed int)(pParty->y_rotation_speed * stru_5C6E00->uIntegerPi) / 180)) >> 16; | 3260 __int64 dturn = (unsigned __int64)(pEventTimer->dt_in_some_format * (signed __int64)((signed int)(pParty->y_rotation_speed * stru_5C6E00->uIntegerPi) / 180)) >> 16; |
3265 while ( pPartyActionQueue->uNumActions ) | 3261 while (pPartyActionQueue->uNumActions) |
3266 { | 3262 { |
3267 switch ( pPartyActionQueue->Next() ) | 3263 switch (pPartyActionQueue->Next()) |
3268 { | 3264 { |
3269 case PARTY_FlyUp: | 3265 case PARTY_FlyUp: |
3270 { | 3266 { |
3271 if (!pParty->FlyActive() && !bUnderwater) | 3267 if (!pParty->FlyActive() && !bUnderwater) |
3272 break; | 3268 break; |
3386 break; | 3382 break; |
3387 | 3383 |
3388 case PARTY_StrafeRight: | 3384 case PARTY_StrafeRight: |
3389 { | 3385 { |
3390 *(float *)&v128 = pParty->uWalkSpeed; | 3386 *(float *)&v128 = pParty->uWalkSpeed; |
3387 | |
3391 float sin_y = sinf(2 * 3.141592653589 * _angle_y / 2048.0); | 3388 float sin_y = sinf(2 * 3.141592653589 * _angle_y / 2048.0); |
3392 int dx = sin_y * pParty->uWalkSpeed * fWalkSpeedMultiplier; | 3389 int dx = sin_y * pParty->uWalkSpeed * fWalkSpeedMultiplier; |
3393 v2 += 3 * dx / 4; | 3390 v2 += 3 * dx / 4; |
3394 | 3391 |
3395 float cos_y = cosf(2 * 3.141592653589 * _angle_y / 2048.0); | 3392 float cos_y = cosf(2 * 3.141592653589 * _angle_y / 2048.0); |
3400 v124 = 1; | 3397 v124 = 1; |
3401 } | 3398 } |
3402 break; | 3399 break; |
3403 | 3400 |
3404 case PARTY_WalkForward: | 3401 case PARTY_WalkForward: |
3405 { | 3402 { |
3406 *(float *)&v128 = _walk_speed; | 3403 *(float *)&v128 = _walk_speed; |
3407 | 3404 |
3408 float sin_y = sinf(2 * 3.141592653589 * _angle_y / 2048.0), | 3405 float sin_y = sinf(2 * 3.141592653589 * _angle_y / 2048.0), |
3409 cos_y = cosf(2 * 3.141592653589 * _angle_y / 2048.0); | 3406 cos_y = cosf(2 * 3.141592653589 * _angle_y / 2048.0); |
3410 | 3407 |
3411 int dx = cos_y * pParty->uWalkSpeed * fWalkSpeedMultiplier; | 3408 int dx = cos_y * pParty->uWalkSpeed * fWalkSpeedMultiplier; |
3412 v2 += dx; | 3409 v2 += dx; |
3413 | 3410 |
3414 int dy = sin_y * pParty->uWalkSpeed * fWalkSpeedMultiplier; | 3411 int dy = sin_y * pParty->uWalkSpeed * fWalkSpeedMultiplier; |
3415 v1 += dy; | 3412 v1 += dy; |
3413 | |
3416 v128 = v1; | 3414 v128 = v1; |
3417 v124 = 1; | 3415 v124 = 1; |
3416 } | |
3418 break; | 3417 break; |
3418 | |
3419 case PARTY_RunForward: | 3419 case PARTY_RunForward: |
3420 { | 3420 { |
3421 *(float *)&v128 = _walk_speed; | 3421 *(float *)&v128 = _walk_speed; |
3422 | 3422 |
3423 float sin_y = sinf(2 * 3.141592653589 * _angle_y / 2048.0), | 3423 float sin_y = sinf(2 * 3.141592653589 * _angle_y / 2048.0), |
3450 v114 = 1; | 3450 v114 = 1; |
3451 } | 3451 } |
3452 } | 3452 } |
3453 break; | 3453 break; |
3454 | 3454 |
3455 | |
3455 case PARTY_WalkBackward: | 3456 case PARTY_WalkBackward: |
3456 { | 3457 { |
3457 *(float *)&v128 = _walk_speed; | 3458 *(float *)&v128 = _walk_speed; |
3458 | 3459 |
3459 float sin_y = sinf(2 * 3.141592653589 * _angle_y / 2048.0), | 3460 float sin_y = sinf(2 * 3.141592653589 * _angle_y / 2048.0), |
3468 v128 = v1; | 3469 v128 = v1; |
3469 v124 = 1; | 3470 v124 = 1; |
3470 } | 3471 } |
3471 break; | 3472 break; |
3472 | 3473 |
3474 | |
3473 case PARTY_RunBackward: | 3475 case PARTY_RunBackward: |
3474 { | 3476 { |
3475 float sin_y = sinf(2 * 3.141592653589 * _angle_y / 2048.0), | 3477 float sin_y = sinf(2 * 3.141592653589 * _angle_y / 2048.0), |
3476 cos_y = cosf(2 * 3.141592653589 * _angle_y / 2048.0); | 3478 cos_y = cosf(2 * 3.141592653589 * _angle_y / 2048.0); |
3477 | 3479 |
3489 v2 -= dx; | 3491 v2 -= dx; |
3490 v1 -= dy; | 3492 v1 -= dy; |
3491 | 3493 |
3492 v128 = v1; | 3494 v128 = v1; |
3493 v124 = 1; | 3495 v124 = 1; |
3494 break; | 3496 } |
3495 } | 3497 } |
3496 v25 = stru_5C6E00->SinCos(_angle_y); | 3498 break; |
3497 v26 = (double)_walk_speed; | 3499 |
3498 v114 = v25; | 3500 |
3499 *(float *)&v128 = v26; | 3501 case PARTY_CenterView: |
3500 v129 = (unsigned __int64)(v25 | 3502 _angle_x = 0; |
3501 * (signed __int64)(signed int)(2 | 3503 break; |
3502 * (unsigned __int64)(signed __int64)(v26 | 3504 |
3503 * fWalkSpeedMultiplier))) >> 16; | |
3504 v2 += v129; | |
3505 v114 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi); | |
3506 v129 = (unsigned __int64)((signed int)v114 | |
3507 * (signed __int64)(signed int)(2 | |
3508 * (unsigned __int64)(signed __int64)(*(float *)&v128 | |
3509 * fWalkSpeedMultiplier))) >> 16; | |
3510 v1 += v129; | |
3511 v114 = 1; | |
3512 v128 = v1; | |
3513 break; | |
3514 | |
3515 case PARTY_RunBackward: | |
3516 v27 = stru_5C6E00->SinCos(_angle_y); | |
3517 v28 = (double)_walk_speed; | |
3518 v126 = v27; | |
3519 *(float *)&v128 = v28; | |
3520 v29 = (signed __int64)(v28 * fBackwardWalkSpeedMultiplier); | |
3521 if ( pParty->bFlying ) | |
3522 { | |
3523 v129 = (unsigned __int64)(v126 * (signed __int64)(4 * (signed int)v29)) >> 16; | |
3524 v2 -= v129; | |
3525 v126 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi); | |
3526 v129 = (unsigned __int64)(v126 | |
3527 * (signed __int64)(signed int)(4 | |
3528 * (unsigned __int64)(signed __int64)(*(float *)&v128 | |
3529 * fBackwardWalkSpeedMultiplier))) >> 16; | |
3530 v1 -= v129; | |
3531 LABEL_93: | |
3532 v128 = v1; | |
3533 } | |
3534 else | |
3535 { | |
3536 v129 = (unsigned __int64)(v126 * (signed __int64)(signed int)v29) >> 16; | |
3537 v2 -= v129; | |
3538 v126 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi); | |
3539 v129 = (unsigned __int64)(v126 | |
3540 * (signed __int64)(signed int)(signed __int64)(*(float *)&v128 | |
3541 * fBackwardWalkSpeedMultiplier)) >> 16; | |
3542 v1 -= v129; | |
3543 //LABEL_86: | |
3544 v128 = v1; | |
3545 v124 = 1; | |
3546 } | |
3547 break; | |
3548 case PARTY_LookUp: | 3505 case PARTY_LookUp: |
3549 _angle_x += (signed __int64)(flt_6BE150_look_up_down_dangle * 25.0); | 3506 _angle_x += (signed __int64)(flt_6BE150_look_up_down_dangle * 25.0); |
3550 if ( _angle_x > 128 ) | 3507 if ( _angle_x > 128 ) |
3551 _angle_x = 128; | 3508 _angle_x = 128; |
3552 v30 = uActiveCharacter; | 3509 if (uActiveCharacter) |
3553 if ( !uActiveCharacter ) | 3510 pPlayers[uActiveCharacter]->PlaySound(63, 0); |
3554 goto LABEL_118; | 3511 break; |
3555 v95 = 0; | 3512 |
3556 v93 = 63; | |
3557 goto _play_player_sound; | |
3558 case PARTY_LookDown: | 3513 case PARTY_LookDown: |
3559 _angle_x += (signed __int64)(flt_6BE150_look_up_down_dangle * -25.0); | 3514 _angle_x += (signed __int64)(flt_6BE150_look_up_down_dangle * -25.0); |
3560 if ( _angle_x < -128 ) | 3515 if ( _angle_x < -128 ) |
3561 _angle_x = -128; | 3516 _angle_x = -128; |
3562 v30 = uActiveCharacter; | 3517 if (uActiveCharacter) |
3563 if ( uActiveCharacter ) | 3518 pPlayers[uActiveCharacter]->PlaySound(64, 0); |
3564 { | 3519 break; |
3565 v95 = 0; | 3520 |
3566 v93 = 64; | |
3567 _play_player_sound: | |
3568 pPlayers[v30]->PlaySound(v93, v95); | |
3569 } | |
3570 goto LABEL_118; | |
3571 case PARTY_CenterView: | |
3572 _angle_x = 0; | |
3573 goto LABEL_118; | |
3574 case PARTY_Jump: | 3521 case PARTY_Jump: |
3575 if ( (!partyAtHighSlope || v108) && !bJumping && pParty->field_24 && !(pParty->uFlags & 4) && !(BYTE1(pParty->uFlags) & 2) ) | 3522 if ( (!partyAtHighSlope || v108) && !bJumping && pParty->field_24 && !(pParty->uFlags & 4) && !(BYTE1(pParty->uFlags) & 2) ) |
3576 { | 3523 { |
3577 v126 = pParty->field_24 << 6; | 3524 v126 = pParty->field_24 << 6; |
3578 bJumping = 1; | 3525 bJumping = 1; |
3579 v121 = (signed __int64)((double)(pParty->field_24 << 6) * 1.5 + (double)v121); | 3526 v121 = (signed __int64)((double)(pParty->field_24 << 6) * 1.5 + (double)v121); |
3580 } | 3527 } |
3581 goto LABEL_118; | 3528 break; |
3529 | |
3582 default: | 3530 default: |
3583 goto LABEL_118; | 3531 assert(false); |
3532 | |
3584 case PARTY_Land: | 3533 case PARTY_Land: |
3585 if ( pParty->bFlying ) | 3534 if (pParty->bFlying) |
3586 { | 3535 { |
3587 BYTE1(pParty->uFlags) |= 1u; | 3536 pParty->uFlags |= PARTY_FLAGS_1_LANDING; |
3588 pParty->uFallSpeed = 0; | 3537 pParty->uFallSpeed = 0; |
3589 } | 3538 } |
3590 pParty->bFlying = 0; | 3539 pParty->bFlying = false; |
3591 pPartyActionQueue->uNumActions = 0; | 3540 pPartyActionQueue->uNumActions = 0; |
3592 goto LABEL_123; | 3541 break; |
3593 } | 3542 } |
3594 } | 3543 } |
3544 | |
3595 LABEL_123: | 3545 LABEL_123: |
3596 pParty->sRotationY = _angle_y; | 3546 pParty->sRotationY = _angle_y; |
3597 pParty->sRotationX = _angle_x; | 3547 pParty->sRotationX = _angle_x; |
3598 if ( v123 < v111 ) | 3548 if ( v123 < v111 ) |
3599 { | 3549 { |
3604 v126 = stru_5C6E00->SinCos(v31); | 3554 v126 = stru_5C6E00->SinCos(v31); |
3605 v129 = (unsigned __int64)(4i64 * v126) >> 16; | 3555 v129 = (unsigned __int64)(4i64 * v126) >> 16; |
3606 v123 = v113 + v129; | 3556 v123 = v113 + v129; |
3607 if ( v127 ) | 3557 if ( v127 ) |
3608 v123 = v113; | 3558 v123 = v113; |
3609 if ( SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) >= 0 | 3559 if (pParty->FlyActive()) |
3610 && (SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[7].uExpireTime)) ) | |
3611 stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[7].uOverlayID + 119] &= 0xFEu; | 3560 stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[7].uOverlayID + 119] &= 0xFEu; |
3612 pParty->uFallStartY = v123; | 3561 pParty->uFallStartY = v123; |
3613 goto LABEL_141; | 3562 goto LABEL_141; |
3614 } | 3563 } |
3615 if ( v130 && v121 ) | 3564 if ( v130 && v121 ) |
3619 pParty->uFallStartY = v111; | 3568 pParty->uFallStartY = v111; |
3620 } | 3569 } |
3621 if ( pParty->bFlying ) | 3570 if ( pParty->bFlying ) |
3622 goto LABEL_130; | 3571 goto LABEL_130; |
3623 v113 = v123; | 3572 v113 = v123; |
3624 if ( SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) >= 0 | 3573 if (pParty->FlyActive()) |
3625 && (SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[7].uExpireTime)) ) | |
3626 stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[7].uOverlayID + 119] |= 1u; | 3574 stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[7].uOverlayID + 119] |= 1u; |
3575 | |
3627 LABEL_141: | 3576 LABEL_141: |
3628 v32 = 0; | 3577 if (bJumping && !pParty->bFlying) |
3629 if ( bJumping && !pParty->bFlying ) | |
3630 { | 3578 { |
3631 v33 = -(pEventTimer->uTimeElapsed * GetGravityStrength()); | 3579 v33 = -(pEventTimer->uTimeElapsed * GetGravityStrength()); |
3632 v34 = v121 + 2 * v33; | 3580 v34 = v121 + 2 * v33; |
3633 v121 += 2 * v33; | 3581 v121 += 2 * v33; |
3634 goto LABEL_149; | 3582 goto LABEL_164; |
3635 } | 3583 } |
3636 if ( !partyAtHighSlope ) | 3584 if (!partyAtHighSlope) |
3637 { | 3585 { |
3638 v34 = v121; | 3586 v34 = v121; |
3639 LABEL_149: | 3587 if (!bJumping) |
3640 if ( bJumping == v32 ) | |
3641 goto LABEL_150; | 3588 goto LABEL_150; |
3642 goto LABEL_164; | 3589 goto LABEL_164; |
3643 } | 3590 } |
3644 if ( !bJumping ) | 3591 if (!bJumping) |
3645 { | 3592 { |
3646 if ( v108 ) | 3593 if ( v108 ) |
3647 goto LABEL_150; | 3594 goto LABEL_150; |
3648 | 3595 |
3649 // rolling down the hill | 3596 // rolling down the hill |
3651 // and falling to the gravity, gradually sliding downwards. nice trick | 3598 // and falling to the gravity, gradually sliding downwards. nice trick |
3652 v123 = v111; | 3599 v123 = v111; |
3653 ODM_GetTerrainNormalAt(v116, v117, &v98); | 3600 ODM_GetTerrainNormalAt(v116, v117, &v98); |
3654 v35 = v121 + -8 * pEventTimer->uTimeElapsed * GetGravityStrength(); | 3601 v35 = v121 + -8 * pEventTimer->uTimeElapsed * GetGravityStrength(); |
3655 v129 = abs((signed __int64)v2 * v98.x + (signed __int64)v1 * v98.y + (signed __int64)v35 * v98.z) >> 16; | 3602 v129 = abs((signed __int64)v2 * v98.x + (signed __int64)v1 * v98.y + (signed __int64)v35 * v98.z) >> 16; |
3656 v127 = (BSPModel *)((unsigned __int64)(v129 * (signed __int64)v98.x) >> 16); | 3603 v2 += (unsigned __int64)(v129 * (signed __int64)v98.x) >> 16; |
3657 v2 += (int)v127; | 3604 v1 += (unsigned __int64)(v129 * (signed __int64)v98.y) >> 16; |
3658 v127 = (BSPModel *)((unsigned __int64)(v129 * (signed __int64)v98.y) >> 16); | 3605 v34 = v35 + ((unsigned __int64)(v129 * (signed __int64)v98.z) >> 16); |
3659 v1 += (int)v127; | |
3660 v128 = v1; | 3606 v128 = v1; |
3661 v127 = (BSPModel *)((unsigned __int64)(v129 * (signed __int64)v98.z) >> 16); | |
3662 v34 = (int)((char *)v127 + v35); | |
3663 v32 = 0; | |
3664 v121 = v34; | 3607 v121 = v34; |
3665 goto LABEL_149; | 3608 if (!bJumping) |
3609 goto LABEL_150; | |
3610 goto LABEL_164; | |
3666 } | 3611 } |
3667 v34 = v121; | 3612 v34 = v121; |
3613 | |
3668 LABEL_164: | 3614 LABEL_164: |
3669 if ( !bUnderwater && v34 <= v32 ) | 3615 if ( !bUnderwater && v34 <= 0) |
3670 { | 3616 { |
3671 if ( v34 < -500 | 3617 if ( v34 < -500 |
3672 && !pParty->bFlying | 3618 && !pParty->bFlying |
3673 && pParty->vPosition.z - v111 > 1000 | 3619 && pParty->vPosition.z - v111 > 1000 |
3674 && SHIDWORD(pParty->pPartyBuffs[5].uExpireTime) <= 0 | 3620 && !pParty->FeatherFallActive()) |
3675 && (SHIDWORD(pParty->pPartyBuffs[5].uExpireTime) < 0 || !LODWORD(pParty->pPartyBuffs[5].uExpireTime)) ) | 3621 { // falling scream |
3676 { | 3622 for (int i = 0; i < 4; ++i) |
3677 v41 = &pPlayers[1]; | 3623 { |
3678 do | 3624 auto player = pParty->pPlayers + i; |
3679 { | 3625 if (!player->HasEnchantedItemEquipped(72) && !player->WearsItem(529, 8) && player->CanAct()) |
3680 if ( !(*v41)->HasEnchantedItemEquipped(72) && !(*v41)->WearsItem(529, 8) && (*v41)->CanAct() ) | 3626 player->PlaySound(66, 0); |
3681 (*v41)->PlaySound(66, 0); | 3627 } |
3682 ++v41; | 3628 } |
3683 } | 3629 } |
3684 while ( (signed int)v41 <= (signed int)&pPlayers[4] ); | 3630 else |
3685 } | 3631 { |
3686 goto LABEL_151; | |
3687 } | |
3688 LABEL_150: | 3632 LABEL_150: |
3689 pParty->uFallStartY = v123; | 3633 pParty->uFallStartY = v123; |
3690 LABEL_151: | 3634 } |
3635 | |
3691 if ( v2 * v2 + v1 * v1 < 400 && !partyAtHighSlope ) | 3636 if ( v2 * v2 + v1 * v1 < 400 && !partyAtHighSlope ) |
3692 { | 3637 { |
3693 *(float *)&v128 = 0.0; | 3638 *(float *)&v128 = 0.0; |
3694 v2 = 0; | 3639 v2 = 0; |
3695 } | 3640 } |
3798 stru_721530.field_70 += stru_721530.field_7C; | 3743 stru_721530.field_70 += stru_721530.field_7C; |
3799 v116 = _angle_x; | 3744 v116 = _angle_x; |
3800 v117 = _angle_y; | 3745 v117 = _angle_y; |
3801 v45 = stru_721530.uFaceID; | 3746 v45 = stru_721530.uFaceID; |
3802 v123 = v40; | 3747 v123 = v40; |
3803 if ( (stru_721530.uFaceID & 7) == 3 ) | 3748 if ( (stru_721530.uFaceID & 7) == OBJECT_Actor) |
3804 { | 3749 { |
3805 if ( SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) >= 0 | 3750 if (pParty->Invisible()) |
3806 && (SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[11].uExpireTime)) ) | 3751 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset(); |
3807 pParty->pPartyBuffs[11].Reset(); | 3752 |
3808 viewparams->bRedrawGameUI = 1; | 3753 viewparams->bRedrawGameUI = 1; |
3809 goto LABEL_234; | 3754 goto LABEL_234; |
3810 } | 3755 } |
3811 if ( (stru_721530.uFaceID & 7) == 5 ) | 3756 if ( (stru_721530.uFaceID & 7) == OBJECT_Decoration) |
3812 { | 3757 { |
3813 v56 = sub_452A9E(v2 * v2 + v128 * v128); | 3758 v56 = sub_452A9E(v2 * v2 + v128 * v128); |
3814 v118 = v56; | 3759 v118 = v56; |
3815 v57 = stru_5C6E00->Atan2( | 3760 v57 = stru_5C6E00->Atan2( |
3816 _angle_x - pLevelDecorations[(signed int)stru_721530.uFaceID >> 3].vPosition.x, | 3761 _angle_x - pLevelDecorations[(signed int)stru_721530.uFaceID >> 3].vPosition.x, |
3827 v122 = v61 >> 16; | 3772 v122 = v61 >> 16; |
3828 v128 = v61 >> 16; | 3773 v128 = v61 >> 16; |
3829 } | 3774 } |
3830 else | 3775 else |
3831 { | 3776 { |
3832 if ( (stru_721530.uFaceID & 7) == 6 ) | 3777 if ( (stru_721530.uFaceID & 7) == OBJECT_BModel) |
3833 { | 3778 { |
3834 pParty->bFlying = 0; | 3779 pParty->bFlying = 0; |
3835 v46 = &pOutdoor->pBModels[(signed int)stru_721530.uFaceID >> 9]; | 3780 v46 = &pOutdoor->pBModels[(signed int)stru_721530.uFaceID >> 9]; |
3836 v127 = v46; | 3781 v127 = v46; |
3837 v47 = &v46->pFaces[((signed int)stru_721530.uFaceID >> 3) & 0x3F]; | 3782 v47 = &v46->pFaces[((signed int)stru_721530.uFaceID >> 3) & 0x3F]; |
13610 } | 13555 } |
13611 | 13556 |
13612 | 13557 |
13613 | 13558 |
13614 //----- (00441D38) -------------------------------------------------------- | 13559 //----- (00441D38) -------------------------------------------------------- |
13615 void GameUI_DrawMinimap(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW, unsigned int uZoom, unsigned int flags) | 13560 void GameUI_DrawMinimap(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW, unsigned int uZoom, unsigned int bRedrawOdmMinimap) |
13616 { | 13561 { |
13617 int uHeight; // ebx@6 | 13562 int uHeight; // ebx@6 |
13618 //unsigned int v9; // edx@9 | |
13619 //unsigned int v10; // ebx@10 | |
13620 __int16 v11; // cx@11 | 13563 __int16 v11; // cx@11 |
13621 //BLVFace *v12; // ecx@17 | |
13622 //unsigned int v13; // ecx@21 | |
13623 unsigned int v14; // ebx@23 | 13564 unsigned int v14; // ebx@23 |
13624 int v15; // eax@23 | 13565 int v15; // eax@23 |
13625 //unsigned int *v16; // ecx@28 | |
13626 __int16 v17; // di@30 | 13566 __int16 v17; // di@30 |
13627 double v18; // st7@30 | 13567 double v18; // st7@30 |
13628 float v19; // ST38_4@30 | 13568 float v19; // ST38_4@30 |
13629 double v20; // st7@30 | 13569 double v20; // st7@30 |
13630 double v21; // st6@30 | 13570 double v21; // st6@30 |
13631 double v22; // st5@33 | 13571 double v22; // st5@33 |
13632 //unsigned __int16 *v26; // edx@37 | |
13633 signed int v27; // eax@37 | 13572 signed int v27; // eax@37 |
13634 unsigned __int16 *v28; // ecx@37 | 13573 unsigned __int16 *v28; // ecx@37 |
13635 signed int v29; // edi@40 | 13574 signed int v29; // edi@40 |
13636 //int v30; // eax@42 | |
13637 //unsigned __int16 *v31; // ebx@43 | |
13638 //signed int v32; // edi@46 | |
13639 signed int v33; // ebx@50 | 13575 signed int v33; // ebx@50 |
13640 unsigned int v34; // eax@50 | 13576 unsigned int v34; // eax@50 |
13641 signed int v35; // ecx@50 | 13577 signed int v35; // ecx@50 |
13642 unsigned __int16 v36; // di@66 | 13578 unsigned __int16 v36; // di@66 |
13643 int v37; // edi@72 | 13579 int v37; // edi@72 |
13651 char *v45; // ebx@106 | 13587 char *v45; // ebx@106 |
13652 int v46; // edi@108 | 13588 int v46; // edi@108 |
13653 int v47; // eax@108 | 13589 int v47; // eax@108 |
13654 unsigned int v48; // ebx@114 | 13590 unsigned int v48; // ebx@114 |
13655 unsigned int v49; // ST64_4@114 | 13591 unsigned int v49; // ST64_4@114 |
13656 //double v50; // ST20_8@117 | |
13657 unsigned int v51; // [sp-10h] [bp-64h]@79 | 13592 unsigned int v51; // [sp-10h] [bp-64h]@79 |
13658 unsigned int v52; // [sp-10h] [bp-64h]@100 | 13593 unsigned int v52; // [sp-10h] [bp-64h]@100 |
13659 unsigned int v53; // [sp-Ch] [bp-60h]@79 | 13594 unsigned int v53; // [sp-Ch] [bp-60h]@79 |
13660 unsigned int v54; // [sp-Ch] [bp-60h]@100 | 13595 unsigned int v54; // [sp-Ch] [bp-60h]@100 |
13661 unsigned int v55; // [sp-8h] [bp-5Ch]@77 | 13596 unsigned int v55; // [sp-8h] [bp-5Ch]@77 |
13663 signed int v57; // [sp-4h] [bp-58h]@54 | 13598 signed int v57; // [sp-4h] [bp-58h]@54 |
13664 unsigned __int16 v58; // [sp-4h] [bp-58h]@77 | 13599 unsigned __int16 v58; // [sp-4h] [bp-58h]@77 |
13665 unsigned __int16 v59; // [sp-4h] [bp-58h]@100 | 13600 unsigned __int16 v59; // [sp-4h] [bp-58h]@100 |
13666 unsigned __int16 v60; // [sp+10h] [bp-44h]@66 | 13601 unsigned __int16 v60; // [sp+10h] [bp-44h]@66 |
13667 unsigned int v61; // [sp+10h] [bp-44h]@85 | 13602 unsigned int v61; // [sp+10h] [bp-44h]@85 |
13668 //unsigned __int16 *v62; // [sp+14h] [bp-40h]@30 | |
13669 unsigned int v63; // [sp+14h] [bp-40h]@85 | 13603 unsigned int v63; // [sp+14h] [bp-40h]@85 |
13670 //int v64; // [sp+18h] [bp-3Ch]@39 | |
13671 unsigned int v65; // [sp+18h] [bp-3Ch]@85 | 13604 unsigned int v65; // [sp+18h] [bp-3Ch]@85 |
13672 unsigned int lPitch; // [sp+20h] [bp-34h]@1 | 13605 unsigned int lPitch; // [sp+20h] [bp-34h]@1 |
13673 unsigned int lPitcha; // [sp+20h] [bp-34h]@23 | 13606 unsigned int lPitcha; // [sp+20h] [bp-34h]@23 |
13674 char *lPitchb; // [sp+20h] [bp-34h]@106 | 13607 char *lPitchb; // [sp+20h] [bp-34h]@106 |
13675 unsigned int v69; // [sp+24h] [bp-30h]@23 | 13608 unsigned int v69; // [sp+24h] [bp-30h]@23 |
13676 signed int v70; // [sp+24h] [bp-30h]@37 | 13609 signed int v70; // [sp+24h] [bp-30h]@37 |
13677 unsigned __int16 uBlue; // [sp+28h] [bp-2Ch]@1 | 13610 unsigned __int16 uBlue; // [sp+28h] [bp-2Ch]@1 |
13678 signed int uBluea; // [sp+28h] [bp-2Ch]@37 | 13611 signed int uBluea; // [sp+28h] [bp-2Ch]@37 |
13679 int v73; // [sp+2Ch] [bp-28h]@30 | 13612 int v73; // [sp+2Ch] [bp-28h]@30 |
13680 //unsigned __int8 *v74; // [sp+30h] [bp-24h]@30 | |
13681 int v76; // [sp+34h] [bp-20h]@91 | 13613 int v76; // [sp+34h] [bp-20h]@91 |
13682 int v77; // [sp+34h] [bp-20h]@108 | 13614 int v77; // [sp+34h] [bp-20h]@108 |
13683 //signed int v78; // [sp+38h] [bp-1Ch]@37 | |
13684 int v79; // [sp+38h] [bp-1Ch]@72 | 13615 int v79; // [sp+38h] [bp-1Ch]@72 |
13685 //signed int a2b; // [sp+40h] [bp-14h]@41 | |
13686 char *a2c; // [sp+40h] [bp-14h]@68 | 13616 char *a2c; // [sp+40h] [bp-14h]@68 |
13687 //int a3a; // [sp+44h] [bp-10h]@40 | |
13688 signed int uCenterY; // [sp+48h] [bp-Ch]@1 | 13617 signed int uCenterY; // [sp+48h] [bp-Ch]@1 |
13689 signed int uCenterX; // [sp+4Ch] [bp-8h]@1 | 13618 signed int uCenterX; // [sp+4Ch] [bp-8h]@1 |
13690 //signed int uZb; // [sp+5Ch] [bp+8h]@27 | |
13691 signed int uWidth; // [sp+5Ch] [bp+8h]@30 | 13619 signed int uWidth; // [sp+5Ch] [bp+8h]@30 |
13692 //signed int uZd; // [sp+5Ch] [bp+8h]@45 | |
13693 signed int uZe; // [sp+5Ch] [bp+8h]@67 | 13620 signed int uZe; // [sp+5Ch] [bp+8h]@67 |
13694 signed int uZf; // [sp+5Ch] [bp+8h]@85 | 13621 signed int uZf; // [sp+5Ch] [bp+8h]@85 |
13695 signed int uZg; // [sp+5Ch] [bp+8h]@105 | 13622 signed int uZg; // [sp+5Ch] [bp+8h]@105 |
13696 unsigned int uWa; // [sp+60h] [bp+Ch]@23 | 13623 unsigned int uWa; // [sp+60h] [bp+Ch]@23 |
13697 float uWb; // [sp+60h] [bp+Ch]@30 | 13624 float uWb; // [sp+60h] [bp+Ch]@30 |
13698 //unsigned __int16 *uWc; // [sp+60h] [bp+Ch]@37 | |
13699 unsigned int uWd; // [sp+60h] [bp+Ch]@95 | 13625 unsigned int uWd; // [sp+60h] [bp+Ch]@95 |
13700 float uZooma; // [sp+64h] [bp+10h]@117 | 13626 float uZooma; // [sp+64h] [bp+10h]@117 |
13701 //signed int flagsa; // [sp+68h] [bp+14h]@42 | |
13702 unsigned int flagsb; // [sp+68h] [bp+14h]@66 | 13627 unsigned int flagsb; // [sp+68h] [bp+14h]@66 |
13703 Actor *flagsc; // [sp+68h] [bp+14h]@86 | 13628 Actor *flagsc; // [sp+68h] [bp+14h]@86 |
13704 unsigned int flagsd; // [sp+68h] [bp+14h]@105 | 13629 unsigned int flagsd; // [sp+68h] [bp+14h]@105 |
13705 | 13630 |
13706 //a3 = uY; | |
13707 //a2 = uX; | |
13708 uCenterX = (uX + uZ) / 2; | 13631 uCenterX = (uX + uZ) / 2; |
13709 uCenterY = (uY + uW) / 2; | 13632 uCenterY = (uY + uW) / 2; |
13710 lPitch = pRenderer->uTargetSurfacePitch; | 13633 lPitch = pRenderer->uTargetSurfacePitch; |
13711 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0); | 13634 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0); |
13712 uBlue = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0xFFu); | 13635 uBlue = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0xFFu); |
13758 } | 13681 } |
13759 break; | 13682 break; |
13760 | 13683 |
13761 default: assert(false); | 13684 default: assert(false); |
13762 } | 13685 } |
13763 //LABEL_37: | 13686 assert(sizeof(pOdmMinimap) == 137 * 117 * sizeof(short)); |
13764 //v23 = v20 * 65536.0; | 13687 |
13765 //v24 = v23 + 6.7553994e15; | |
13766 v70 = floorf(v20 * 65536.0 + 0.5f);//LODWORD(v24); | 13688 v70 = floorf(v20 * 65536.0 + 0.5f);//LODWORD(v24); |
13767 //uWe = uWb * 65536.0; | |
13768 //v25 = uWe + 6.7553994e15; | |
13769 //v78 = v70; | |
13770 uBluea = floorf(uWb * 65536.0 + 0.5f);//LODWORD(v25); | 13689 uBluea = floorf(uWb * 65536.0 + 0.5f);//LODWORD(v25); |
13771 v27 = uBluea >> 16; | 13690 v27 = uBluea >> 16; |
13772 v28 = &pRenderer->pTargetSurface[uX + uY * lPitch]; | 13691 v28 = &pRenderer->pTargetSurface[uX + uY * lPitch]; |
13773 if ( flags && pMapLod0) | 13692 if (pMapLod0 && bRedrawOdmMinimap) |
13774 { | 13693 { |
13775 auto pMinimap = (unsigned __int16 *)_56EFD8_minimap; | 13694 assert(uWidth == 137 && uHeight == 117); |
13776 //if ( v74 ) | 13695 //auto pMinimap = (unsigned __int16 *)pOdmMinimap; |
13777 //{ | 13696 |
13778 auto mapWidth = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uTextureWidth; | 13697 auto mapWidth = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uTextureWidth; |
13779 //if ( uHeight > 0 ) | 13698 |
13780 //{ | |
13781 //a3a = uHeight; | |
13782 v29 = v70 >> 16; | 13699 v29 = v70 >> 16; |
13783 //do | 13700 |
13784 for (int y = 0; y < uHeight; ++y) | 13701 for (int y = 0; y < uHeight; ++y) |
13785 { | 13702 { |
13786 //a2b = 0; | |
13787 //if ( uWidth > 0 ) | |
13788 //{ | |
13789 auto pMapLod0Line = &pMapLod0[v27 * mapWidth]; | 13703 auto pMapLod0Line = &pMapLod0[v27 * mapWidth]; |
13790 //flagsa = uWidth; | |
13791 //a2b = uWidth; | |
13792 for (int x = 0; x < uWidth; ++x) | 13704 for (int x = 0; x < uWidth; ++x) |
13793 //do | |
13794 { | 13705 { |
13795 //v31 = uWc; | 13706 //*pMinimap++ = pPal[pMapLod0Line[v29]]; |
13796 //++uWc; | 13707 pOdmMinimap[y][x] = pPal[pMapLod0Line[v29]]; |
13797 *pMinimap++ = pPal[pMapLod0Line[v29]]; | |
13798 //v78 += v73; | |
13799 v29 = (v70 + x * v73) >> 16; | 13708 v29 = (v70 + x * v73) >> 16; |
13800 //--flagsa; | |
13801 } | 13709 } |
13802 //while ( flagsa ); | 13710 |
13803 //} | |
13804 //v78 = v70; | |
13805 v29 = v70 >> 16; | 13711 v29 = v70 >> 16; |
13806 v28 += 137 - uWidth; | 13712 v28 += 137 - uWidth; |
13807 uBluea += v73; | 13713 uBluea += v73; |
13808 v27 = uBluea >> 16; | 13714 v27 = uBluea >> 16; |
13809 //--a3a; | |
13810 } | 13715 } |
13811 //while ( a3a ); | 13716 } |
13812 //} | 13717 |
13813 //} | |
13814 } | |
13815 | |
13816 auto pMinimap = (unsigned __int16 *)_56EFD8_minimap; | |
13817 //uZd = 117; | |
13818 //do | |
13819 for (int y = 0; y < 117; ++y) | 13718 for (int y = 0; y < 117; ++y) |
13820 { | 13719 { |
13821 //v32 = 137; | |
13822 //do | |
13823 for (int x = 0; x < 137; ++x) | 13720 for (int x = 0; x < 137; ++x) |
13824 { | 13721 { |
13825 *v28++ = *pMinimap++; | 13722 *v28++ = pOdmMinimap[y][x]; |
13826 //++v28; | 13723 } |
13827 //++v26; | |
13828 //--v32; | |
13829 } | |
13830 //while ( v32 ); | |
13831 v28 += lPitch - 137; | 13724 v28 += lPitch - 137; |
13832 //--uZd; | 13725 } |
13833 } | |
13834 //while ( uZd ); | |
13835 uNumBlueFacesInBLVMinimap = 0; | 13726 uNumBlueFacesInBLVMinimap = 0; |
13836 } | 13727 } |
13837 else | 13728 else |
13838 { | 13729 { |
13839 pRenderer->FillRectFast(uX, uY, uZ - uX, uHeight, 0xF); | 13730 pRenderer->FillRectFast(uX, uY, uZ - uX, uHeight, 0xF); |
16390 v55 = (unsigned short *)&pActors[0].uAIState; | 16281 v55 = (unsigned short *)&pActors[0].uAIState; |
16391 *(int *)v54 = uNumActors; | 16282 *(int *)v54 = uNumActors; |
16392 do | 16283 do |
16393 { | 16284 { |
16394 v30 = *v55; | 16285 v30 = *v55; |
16395 if ( *v55 == 5 || v30 == 11 || v30 == 19 || (v31 = *((int *)v55 + 159)) != 0 && (v31 & 7) == 4 ) | 16286 if ( *v55 == Dead || v30 == Removed || v30 == Disabled || (v31 = *((int *)v55 + 159)) != 0 && (v31 & 7) == OBJECT_Player) |
16396 ++pInString; | 16287 ++pInString; |
16397 v55 += 418; | 16288 v55 += 418; |
16398 --*(int *)v54; | 16289 --*(int *)v54; |
16399 } | 16290 } |
16400 while ( *(int *)v54 ); | 16291 while ( *(int *)v54 ); |
20490 Actor::_401221(uActorID, &dword_4F6E08[uActorID], 1u); | 20381 Actor::_401221(uActorID, &dword_4F6E08[uActorID], 1u); |
20491 if ( v21->pMonsterInfo.uHostilityType && !*v20 ) | 20382 if ( v21->pMonsterInfo.uHostilityType && !*v20 ) |
20492 v21->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly; | 20383 v21->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly; |
20493 a2 = *v20; | 20384 a2 = *v20; |
20494 v76 = a2 & 7; | 20385 v76 = a2 & 7; |
20495 if ( (a2 & 7) == 3 ) | 20386 if ( (a2 & 7) == OBJECT_Actor) |
20496 v80 = 0.5; | 20387 v80 = 0.5; |
20497 else | 20388 else |
20498 v80 = 1.0; | 20389 v80 = 1.0; |
20499 v22 = v21->uAIState; | 20390 v22 = v21->uAIState; |
20500 if ( v22 == 4 || v22 == 5 || v22 == 11 || v22 == 19 || v22 == 17 ) | 20391 if ( v22 == Dying || v22 == Dead || v22 == Removed || v22 == Disabled || v22 == Summoned) |
20501 goto LABEL_254; | 20392 goto LABEL_254; |
20502 if ( !v21->sCurrentHP ) | 20393 if ( !v21->sCurrentHP ) |
20503 Actor::Die(uActorID); | 20394 Actor::Die(uActorID); |
20504 if ( (signed __int64)v21->pActorBuffs[3].uExpireTime <= 0 ) | 20395 if ( (signed __int64)v21->pActorBuffs[3].uExpireTime <= 0 ) |
20505 { | 20396 { |
21013 if ( this->uActorQueueSize > 0 ) | 20904 if ( this->uActorQueueSize > 0 ) |
21014 { | 20905 { |
21015 v2 = this->pQueue; | 20906 v2 = this->pQueue; |
21016 do | 20907 do |
21017 { | 20908 { |
21018 if ( (v2->uPackedID & 7) == 3 ) | 20909 if ( (v2->uPackedID & 7) == OBJECT_Actor ) |
21019 { | 20910 { |
21020 v3 = &pActors[v2->uPackedID >> 3]; | 20911 v3 = &pActors[v2->uPackedID >> 3]; |
21021 v4 = &pActors[v2->uPackedID >> 3]; | 20912 v4 = &pActors[v2->uPackedID >> 3]; |
21022 LOBYTE(v4->uAttributes) |= 0x80u; | 20913 LOBYTE(v4->uAttributes) |= 0x80u; |
21023 if ( !v4->CanAct() ) | 20914 if ( !v4->CanAct() ) |
21025 --v19; | 20916 --v19; |
21026 v2->field_4 = 1001; | 20917 v2->field_4 = 1001; |
21027 LOBYTE(v3->uAttributes) &= 0x7Fu; | 20918 LOBYTE(v3->uAttributes) &= 0x7Fu; |
21028 } | 20919 } |
21029 } | 20920 } |
21030 if ( (v2->uPackedID & 7) == 4 ) | 20921 if ( (v2->uPackedID & 7) == OBJECT_Player) |
21031 { | 20922 { |
21032 v5 = &pParty->pPlayers[v2->uPackedID >> 3]; | 20923 v5 = &pParty->pPlayers[v2->uPackedID >> 3]; |
21033 if ( v5->pConditions[14] | 20924 if ( v5->pConditions[14] |
21034 || v5->pConditions[16] | 20925 || v5->pConditions[16] |
21035 || v5->pConditions[15] | 20926 || v5->pConditions[15] |
21061 { | 20952 { |
21062 v9 = v8->field_4; | 20953 v9 = v8->field_4; |
21063 v10 = v7->field_4; | 20954 v10 = v7->field_4; |
21064 if ( v9 < v10 | 20955 if ( v9 < v10 |
21065 || v9 == v10 | 20956 || v9 == v10 |
21066 && ((v11 = v8->uPackedID & 7, v11 == 4) && (v7->uPackedID & 7) == 3 | 20957 && ((v11 = v8->uPackedID & 7, v11 == OBJECT_Player) && (v7->uPackedID & 7) == OBJECT_Actor |
21067 || v11 == (v7->uPackedID & 7) && (v8->uPackedID & 0xFFFFFFF8) < (v7->uPackedID & 0xFFFFFFF8)) ) | 20958 || v11 == (v7->uPackedID & 7) && (v8->uPackedID & 0xFFFFFFF8) < (v7->uPackedID & 0xFFFFFFF8)) ) |
21068 { | 20959 { |
21069 v12 = v7->uPackedID; | 20960 v12 = v7->uPackedID; |
21070 v13 = v7->field_4; | 20961 v13 = v7->field_4; |
21071 v14 = v7->uActionLength; | 20962 v14 = v7->uActionLength; |
21090 } | 20981 } |
21091 while ( v21 - 1 < v6 ); | 20982 while ( v21 - 1 < v6 ); |
21092 } | 20983 } |
21093 v1->uActorQueueSize = v19; | 20984 v1->uActorQueueSize = v19; |
21094 result = v1->pQueue[0].uPackedID; | 20985 result = v1->pQueue[0].uPackedID; |
21095 if ( (v1->pQueue[0].uPackedID & 7) == 4 ) | 20986 if ( (v1->pQueue[0].uPackedID & 7) == OBJECT_Player) |
21096 { | 20987 { |
21097 result = (result >> 3) + 1; | 20988 result = (result >> 3) + 1; |
21098 uActiveCharacter = result; | 20989 uActiveCharacter = result; |
21099 v1->field_18 |= 4u; | 20990 v1->field_18 |= 4u; |
21100 } | 20991 } |
21107 if ( v1->uActorQueueSize > 0 ) | 20998 if ( v1->uActorQueueSize > 0 ) |
21108 { | 20999 { |
21109 v17 = v1->pQueue; | 21000 v17 = v1->pQueue; |
21110 do | 21001 do |
21111 { | 21002 { |
21112 if ( (v17->uPackedID & 7) == 4 ) | 21003 if ( (v17->uPackedID & 7) == OBJECT_Player) |
21113 pParty->pPlayers[v17->uPackedID >> 3].uTimeToRecovery = (signed __int64)((double)v17->field_4 * 0.46875); | 21004 pParty->pPlayers[v17->uPackedID >> 3].uTimeToRecovery = (signed __int64)((double)v17->field_4 * 0.46875); |
21114 ++v22; | 21005 ++v22; |
21115 ++v17; | 21006 ++v17; |
21116 result = v22; | 21007 result = v22; |
21117 } | 21008 } |