comparison mm7_3.cpp @ 1225:42b41aaecd87

Слияние
author Ritor1
date Wed, 05 Jun 2013 21:00:45 +0600
parents 15ad868d972f
children 0dbf6c4dd029
comparison
equal deleted inserted replaced
1224:23632c91ed0a 1225:42b41aaecd87
1 #ifdef _MSC_VER
2 #define _CRT_SECURE_NO_WARNINGS
3 #endif
4
1 #include <assert.h> 5 #include <assert.h>
2 6
3 7
4 #include "VideoPlayer.h" 8 #include "VideoPlayer.h"
5 #include "Sprites.h" 9 #include "Sprites.h"
1204 { 1208 {
1205 v38 = stru_721530.uFaceID; 1209 v38 = stru_721530.uFaceID;
1206 Actor::AI_FaceObject(v75, v38, 0, (AIDirection *)0); 1210 Actor::AI_FaceObject(v75, v38, 0, (AIDirection *)0);
1207 break; 1211 break;
1208 } 1212 }
1209 //v52 = HIDWORD(pParty->pPartyBuffs[11].uExpireTime) == 0; 1213 //v52 = HIDWORD(pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime) == 0;
1210 //v53 = SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) < 0; 1214 //v53 = SHIDWORD(pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime) < 0;
1211 v0->vVelocity.y = 0; 1215 v0->vVelocity.y = 0;
1212 v0->vVelocity.x = 0; 1216 v0->vVelocity.x = 0;
1213 //if ( !v53 && (!(v53 | v52) || LODWORD(pParty->pPartyBuffs[11].uExpireTime) > 0) ) 1217 //if ( !v53 && (!(v53 | v52) || LODWORD(pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime) > 0) )
1214 if ( (signed __int64)pParty->pPartyBuffs[11].uExpireTime < 0) 1218 if ( (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime < 0)
1215 pParty->pPartyBuffs[11].Reset(); 1219 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset();
1216 viewparams->bRedrawGameUI = 1; 1220 viewparams->bRedrawGameUI = 1;
1217 break; 1221 break;
1218 case OBJECT_Decoration: 1222 case OBJECT_Decoration:
1219 v47 = integer_sqrt(v0->vVelocity.x * v0->vVelocity.x + v0->vVelocity.y * v0->vVelocity.y); 1223 v47 = integer_sqrt(v0->vVelocity.x * v0->vVelocity.x + v0->vVelocity.y * v0->vVelocity.y);
1220 v48 = stru_5C6E00->Atan2( 1224 v48 = stru_5C6E00->Atan2(
1912 uSectorID = stru_721530.uSectorID; 1916 uSectorID = stru_721530.uSectorID;
1913 stru_721530.field_70 += stru_721530.field_7C; 1917 stru_721530.field_70 += stru_721530.field_7C;
1914 auto v87 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16) + new_party_z; 1918 auto v87 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16) + new_party_z;
1915 if ( PID_TYPE(stru_721530.uFaceID) == OBJECT_Actor) 1919 if ( PID_TYPE(stru_721530.uFaceID) == OBJECT_Actor)
1916 { 1920 {
1917 if ( SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) >= 0 1921 if ( SHIDWORD(pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime) >= 0
1918 && (SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[11].uExpireTime)) ) 1922 && (SHIDWORD(pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime)) )
1919 pParty->pPartyBuffs[11].Reset(); 1923 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset();
1920 viewparams->bRedrawGameUI = 1; 1924 viewparams->bRedrawGameUI = 1;
1921 goto LABEL_152; 1925 goto LABEL_152;
1922 } 1926 }
1923 if ( PID_TYPE(stru_721530.uFaceID) == OBJECT_Decoration) 1927 if ( PID_TYPE(stru_721530.uFaceID) == OBJECT_Decoration)
1924 { 1928 {
2273 pParty->uFlags &= ~PARTY_FLAGS_1_STANDING_ON_WATER; 2277 pParty->uFlags &= ~PARTY_FLAGS_1_STANDING_ON_WATER;
2274 if (pParty->WaterWalkActive()) 2278 if (pParty->WaterWalkActive())
2275 { 2279 {
2276 //LOBYTE(pParty->uFlags) &= 0x7Fu; 2280 //LOBYTE(pParty->uFlags) &= 0x7Fu;
2277 bWaterWalk = 1; 2281 bWaterWalk = 1;
2278 *(short *)&stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[18].uOverlayID + 119] |= 1u; 2282 *(short *)&stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uOverlayID + 119] |= 1u;
2279 if (!(pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uFlags & 1) && 2283 if (!(pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uFlags & 1) &&
2280 pParty->pPlayers[pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uCaster-1].sMana <= 0 ) 2284 pParty->pPlayers[pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uCaster-1].sMana <= 0 )
2281 //*(int *)&pParty->pArtifactsFound[6972 * pParty->pPartyBuffs[18].uCaster + 10] <= 0 ) 2285 //*(int *)&pParty->pArtifactsFound[6972 * pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uCaster + 10] <= 0 )
2282 bWaterWalk = 0; 2286 bWaterWalk = 0;
2283 } 2287 }
2284 v3 = ODM_GetFloorLevel(pX, pY, pZ, pParty->uPartyHeight, &v130, &v108, bWaterWalk); 2288 v3 = ODM_GetFloorLevel(pX, pY, pZ, pParty->uPartyHeight, &v130, &v108, bWaterWalk);
2285 v111 = v3; 2289 v111 = v3;
2286 if ( bFeatherFall ) 2290 if ( bFeatherFall )
2329 if (pParty->walk_sound_timer >= pEventTimer->uTimeElapsed) 2333 if (pParty->walk_sound_timer >= pEventTimer->uTimeElapsed)
2330 pParty->walk_sound_timer -= pEventTimer->uTimeElapsed; 2334 pParty->walk_sound_timer -= pEventTimer->uTimeElapsed;
2331 else pParty->walk_sound_timer = 0; 2335 else pParty->walk_sound_timer = 0;
2332 } 2336 }
2333 if (!bUnderwater 2337 if (!bUnderwater
2334 && SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) <= 0 2338 && SHIDWORD(pParty->pPartyBuffs[PARTY_BUFF_FLY].uExpireTime) <= 0
2335 && (SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) < 0 || LODWORD(pParty->pPartyBuffs[7].uExpireTime) <= 0) ) 2339 && (SHIDWORD(pParty->pPartyBuffs[PARTY_BUFF_FLY].uExpireTime) < 0 || LODWORD(pParty->pPartyBuffs[PARTY_BUFF_FLY].uExpireTime) <= 0) )
2336 pParty->bFlying = false; 2340 pParty->bFlying = false;
2337 if (!bJumping) 2341 if (!bJumping)
2338 { 2342 {
2339 if ( pParty->floor_face_pid != PID(OBJECT_BModel, v108) ) 2343 if ( pParty->floor_face_pid != PID(OBJECT_BModel, v108) )
2340 { 2344 {
2418 case PARTY_FlyDown: 2422 case PARTY_FlyDown:
2419 if (pParty->FlyActive() || bUnderwater) 2423 if (pParty->FlyActive() || bUnderwater)
2420 { 2424 {
2421 pParty->bFlying = 0; 2425 pParty->bFlying = 0;
2422 if ( bUnderwater 2426 if ( bUnderwater
2423 || pParty->pPartyBuffs[7].uFlags & 1 2427 || pParty->pPartyBuffs[PARTY_BUFF_FLY].uFlags & 1
2424 || pParty->pPlayers[pParty->pPartyBuffs[7].uCaster - 1].sMana > 0 )//*(int *)&pParty->pArtifactsFound[6972 * pParty->pPartyBuffs[7].uCaster + 10] > 0 ) 2428 || pParty->pPlayers[pParty->pPartyBuffs[PARTY_BUFF_FLY].uCaster - 1].sMana > 0 )//*(int *)&pParty->pArtifactsFound[6972 * pParty->pPartyBuffs[PARTY_BUFF_FLY].uCaster + 10] > 0 )
2425 { 2429 {
2426 pZ -= 30; 2430 pZ -= 30;
2427 v113 -= 30; 2431 v113 -= 30;
2428 pParty->uFallSpeed = 0; 2432 pParty->uFallSpeed = 0;
2429 v121 = 0; 2433 v121 = 0;
2665 v129 = (unsigned __int64)(4i64 * v126) >> 16; 2669 v129 = (unsigned __int64)(4i64 * v126) >> 16;
2666 pZ = v113 + v129; 2670 pZ = v113 + v129;
2667 if ( v127 ) 2671 if ( v127 )
2668 pZ = v113; 2672 pZ = v113;
2669 if (pParty->FlyActive()) 2673 if (pParty->FlyActive())
2670 stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[7].uOverlayID + 119] &= 0xFEu; 2674 stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[PARTY_BUFF_FLY].uOverlayID + 119] &= 0xFEu;
2671 pParty->uFallStartY = pZ; 2675 pParty->uFallStartY = pZ;
2672 //goto LABEL_141; 2676 //goto LABEL_141;
2673 } 2677 }
2674 else 2678 else
2675 { 2679 {
2678 v121 = 0; 2682 v121 = 0;
2679 pZ = v111; 2683 pZ = v111;
2680 pParty->uFallStartY = v111; 2684 pParty->uFallStartY = v111;
2681 v113 = pZ; 2685 v113 = pZ;
2682 if (pParty->FlyActive()) 2686 if (pParty->FlyActive())
2683 stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[7].uOverlayID + 119] |= 1u; 2687 stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[PARTY_BUFF_FLY].uOverlayID + 119] |= 1u;
2684 2688
2685 } 2689 }
2686 } 2690 }
2687 else 2691 else
2688 { 2692 {
2689 v113 = pZ; 2693 v113 = pZ;
2690 if (pParty->FlyActive()) 2694 if (pParty->FlyActive())
2691 stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[7].uOverlayID + 119] |= 1u; 2695 stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[PARTY_BUFF_FLY].uOverlayID + 119] |= 1u;
2692 } 2696 }
2693 //LABEL_141: 2697 //LABEL_141:
2694 if (bJumping && !pParty->bFlying) 2698 if (bJumping && !pParty->bFlying)
2695 { 2699 {
2696 v33 = -(pEventTimer->uTimeElapsed * GetGravityStrength()); 2700 v33 = -(pEventTimer->uTimeElapsed * GetGravityStrength());
3205 if ( v78 || v77) 3209 if ( v78 || v77)
3206 { 3210 {
3207 if ( bWaterWalk ) 3211 if ( bWaterWalk )
3208 { 3212 {
3209 pParty->uFlags &= ~PARTY_FLAGS_1_STANDING_ON_WATER; 3213 pParty->uFlags &= ~PARTY_FLAGS_1_STANDING_ON_WATER;
3210 //v79 = 20 * pParty->pPartyBuffs[18].uOverlayID + 6180178; 3214 //v79 = 20 * pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uOverlayID + 6180178;
3211 //*(short *)&stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[18].uOverlayID + 119] |= 1u; 3215 //*(short *)&stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uOverlayID + 119] |= 1u;
3212 v79 = (int)&stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[18].uOverlayID + 119]; 3216 v79 = (int)&stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uOverlayID + 119];
3213 *(short *)v79 |= 1u; 3217 *(short *)v79 |= 1u;
3214 if ( !v122 || !v69 ) 3218 if ( !v122 || !v69 )
3215 { 3219 {
3216 if ( !v76 ) 3220 if ( !v76 )
3217 { 3221 {
5582 bool Skybox_Initialize(const wchar_t *skybox_name) 5586 bool Skybox_Initialize(const wchar_t *skybox_name)
5583 { 5587 {
5584 wchar_t xn_filename[1024], xp_filename[1024], 5588 wchar_t xn_filename[1024], xp_filename[1024],
5585 yn_filename[1024], yp_filename[1024], 5589 yn_filename[1024], yp_filename[1024],
5586 zn_filename[1024], zp_filename[1024]; 5590 zn_filename[1024], zp_filename[1024];
5587 swprintf(xn_filename, L"%s_xn.tga", skybox_name); swprintf(xp_filename, L"%s_xp.tga", skybox_name); 5591 swprintf(xn_filename, wcslen(L"%s_xn.tga"), L"%s_xn.tga", skybox_name); swprintf(xp_filename, wcslen(L"%s_xp.tga"), L"%s_xp.tga", skybox_name);
5588 swprintf(yn_filename, L"%s_yn.tga", skybox_name); swprintf(yp_filename, L"%s_yp.tga", skybox_name); 5592 swprintf(yn_filename, wcslen(L"%s_yn.tga"), L"%s_yn.tga", skybox_name); swprintf(yp_filename, wcslen(L"%s_yp.tga"), L"%s_yp.tga", skybox_name);
5589 swprintf(zn_filename, L"%s_zn.tga", skybox_name); swprintf(zp_filename, L"%s_zp.tga", skybox_name); 5593 swprintf(zn_filename, wcslen(L"%s_zn.tga"), L"%s_zn.tga", skybox_name); swprintf(zp_filename, wcslen(L"%s_zp.tga"), L"%s_zp.tga", skybox_name);
5590 5594
5591 int xn_width, xn_height; 5595 int xn_width, xn_height;
5592 skybox_xn = LoadTgaTexture(xn_filename, &xn_width, &xn_height); 5596 skybox_xn = LoadTgaTexture(xn_filename, &xn_width, &xn_height);
5593 if (!skybox_xn) 5597 if (!skybox_xn)
5594 return false; 5598 return false;
6810 } 6814 }
6811 v6 = 0; 6815 v6 = 0;
6812 if (pWeather->bNight) 6816 if (pWeather->bNight)
6813 { 6817 {
6814 v8 = 67108864; 6818 v8 = 67108864;
6815 if ( (signed __int64)pParty->pPartyBuffs[16].uExpireTime > 0 ) 6819 if ( (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_TORCHLIGHT].uExpireTime > 0 )
6816 v8 = pParty->pPartyBuffs[16].uPower << 26; 6820 v8 = pParty->pPartyBuffs[PARTY_BUFF_TORCHLIGHT].uPower << 26;
6817 if ( a3 <= v8 ) 6821 if ( a3 <= v8 )
6818 { 6822 {
6819 if ( a3 > 0 ) 6823 if ( a3 > 0 )
6820 { 6824 {
6821 LODWORD(v9) = a3 << 16; 6825 LODWORD(v9) = a3 << 16;
6979 { 6983 {
6980 v12 = 0; 6984 v12 = 0;
6981 } 6985 }
6982 else 6986 else
6983 { 6987 {
6984 if ( (signed __int64)pParty->pPartyBuffs[16].uExpireTime > 0 ) 6988 if ( (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_TORCHLIGHT].uExpireTime > 0 )
6985 { 6989 {
6986 if ( (signed __int64)pParty->pPartyBuffs[16].uExpireTime <= 0 ) 6990 if ( (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_TORCHLIGHT].uExpireTime <= 0 )
6987 v11 = 0; 6991 v11 = 0;
6988 else 6992 else
6989 v11 = pParty->pPartyBuffs[16].uPower; 6993 v11 = pParty->pPartyBuffs[PARTY_BUFF_TORCHLIGHT].uPower;
6990 } 6994 }
6991 v12 = v11 << 26; 6995 v12 = v11 << 26;
6992 } 6996 }
6993 if ( a4 ) 6997 if ( a4 )
6994 goto LABEL_24; 6998 goto LABEL_24;
13083 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 0); 13087 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 0);
13084 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 1u); 13088 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 1u);
13085 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 2u); 13089 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 2u);
13086 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 3u); 13090 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 3u);
13087 v39 = (signed __int64)((double)(v42 << 7) * 0.033333335); 13091 v39 = (signed __int64)((double)(v42 << 7) * 0.033333335);
13088 v37 = &pParty->pPartyBuffs[2]; 13092 v37 = &pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS];
13089 v36 = pParty->uTimePlayed + v39; 13093 v36 = pParty->uTimePlayed + v39;
13090 v37->Apply(v36, a7b, v43, 0, 0); 13094 v37->Apply(v36, a7b, v43, 0, 0);
13091 goto LABEL_139; 13095 goto LABEL_139;
13092 } 13096 }
13093 if ( v41 == 1 ) 13097 if ( v41 == 1 )
13097 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 0); 13101 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 0);
13098 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 1u); 13102 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 1u);
13099 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 2u); 13103 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 2u);
13100 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 3u); 13104 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 3u);
13101 v39 = (signed __int64)((double)(v42 << 7) * 0.033333335); 13105 v39 = (signed __int64)((double)(v42 << 7) * 0.033333335);
13102 v37 = &pParty->pPartyBuffs[2]; 13106 v37 = &pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS];
13103 v36 = pParty->uTimePlayed + v39; 13107 v36 = pParty->uTimePlayed + v39;
13104 v37->Apply(v36, a7b, v43, 0, 0); 13108 v37->Apply(v36, a7b, v43, 0, 0);
13105 goto LABEL_139; 13109 goto LABEL_139;
13106 } 13110 }
13107 } 13111 }
13110 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 0); 13114 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 0);
13111 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 1u); 13115 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 1u);
13112 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 2u); 13116 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 2u);
13113 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 3u); 13117 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 3u);
13114 v39 = (signed __int64)((double)(v42 << 7) * 0.033333335); 13118 v39 = (signed __int64)((double)(v42 << 7) * 0.033333335);
13115 v37 = &pParty->pPartyBuffs[2]; 13119 v37 = &pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS];
13116 v36 = pParty->uTimePlayed + v39; 13120 v36 = pParty->uTimePlayed + v39;
13117 v37->Apply(v36, a7b, v43, 0, 0); 13121 v37->Apply(v36, a7b, v43, 0, 0);
13118 goto LABEL_139; 13122 goto LABEL_139;
13119 } 13123 }
13120 if ( spellnum != 58 ) 13124 if ( spellnum != 58 )
13560 v52 = 0; 13564 v52 = 0;
13561 v50 = 0; 13565 v50 = 0;
13562 v48 = uSkill; 13566 v48 = uSkill;
13563 v46 = v15; 13567 v46 = v15;
13564 v39 = (signed __int64)((double)(v38 << 7) * 0.033333335); 13568 v39 = (signed __int64)((double)(v38 << 7) * 0.033333335);
13565 v37 = &pParty->pPartyBuffs[10]; 13569 v37 = &pParty->pPartyBuffs[PARTY_BUFF_IMMOLATION];
13566 v36 = pParty->uTimePlayed + v39; 13570 v36 = pParty->uTimePlayed + v39;
13567 v37->Apply(v36, v46, v48, v50, v52); 13571 v37->Apply(v36, v46, v48, v50, v52);
13568 goto LABEL_139; 13572 goto LABEL_139;
13569 case 3: 13573 case 3:
13570 case 14: 13574 case 14:
13891 else 13895 else
13892 pArray[v3 / 8] &= ~set_bit; 13896 pArray[v3 / 8] &= ~set_bit;
13893 } 13897 }
13894 13898
13895 //----- (0044C175) -------------------------------------------------------- 13899 //----- (0044C175) --------------------------------------------------------
13896 void __fastcall ShowStatusBarString(const char *pString, unsigned int uNumSeconds) 13900 void ShowStatusBarString( const char *pString, unsigned int uNumSeconds )
13897 { 13901 {
13898 unsigned int v2; // esi@1 13902 unsigned int v2; // esi@1
13899 int i; // eax@1 13903 int i; // eax@1
13900 13904
13901 v2 = uNumSeconds; 13905 v2 = uNumSeconds;
13902 strcpy(GameUI_Footer_TimedString, pString); 13906 strcpy(GameUI_Footer_TimedString, pString);