# HG changeset patch # User Ritor1 # Date 1356324615 -21600 # Node ID 222a09fccca1e5f8cb1ecfe6ae4bc2958f3ab80c # Parent 269ca53dae41aa54536a2c91602553a4ba734007# Parent d7bd52a35e520977cd95def6fc5a5a3ae0ce4fd4 Слияние diff -r 269ca53dae41 -r 222a09fccca1 Party.cpp --- a/Party.cpp Mon Dec 24 10:50:04 2012 +0600 +++ b/Party.cpp Mon Dec 24 10:50:15 2012 +0600 @@ -405,60 +405,76 @@ { case PLAYER_SKILL_STAFF: v15 = ITEM_STAFF_1; - goto wear_item; + pCharacter->WearItem(v15); + break; case PLAYER_SKILL_SWORD: v15 = ITEM_LONGSWORD_1; - goto wear_item; + pCharacter->WearItem(v15); + break; case PLAYER_SKILL_DAGGER: v15 = ITEM_DAGGER_1; - goto wear_item; + pCharacter->WearItem(v15); + break; case PLAYER_SKILL_AXE: v15 = ITEM_AXE_1; - goto wear_item; + pCharacter->WearItem(v15); + break; case PLAYER_SKILL_SPEAR: v15 = ITEM_SPEAR_1; - goto wear_item; + pCharacter->WearItem(v15); + break; case PLAYER_SKILL_BOW: v15 = ITEM_CROSSBOW_1; - goto wear_item; + pCharacter->WearItem(v15); + break; case PLAYER_SKILL_MACE: v15 = ITEM_MACE_1; - goto wear_item; + pCharacter->WearItem(v15); + break; case PLAYER_SKILL_SHIELD: v15 = ITEM_BUCKLER_1; - goto wear_item; + pCharacter->WearItem(v15); + break; case PLAYER_SKILL_LEATHER: v15 = ITEM_LEATHER_1; - goto wear_item; + pCharacter->WearItem(v15); + break; case PLAYER_SKILL_CHAIN: v15 = ITEM_CHAINMAIL_1; - goto wear_item; + pCharacter->WearItem(v15); + break; case PLAYER_SKILL_PLATE: v15 = ITEM_PLATE_1; -wear_item: pCharacter->WearItem(v15); break; case PLAYER_SKILL_FIRE: v16 = ITEM_SPELLBOOK_FIRE_STRIKE; - goto add_item; + pCharacter->AddItem(-1, v16); + break; case PLAYER_SKILL_AIR: v16 = ITEM_SPELLBOOK_AIR_FEATHER_FALL; - goto add_item; + pCharacter->AddItem(-1, v16); + break; case PLAYER_SKILL_WATER: v16 = ITEM_SPELLBOOK_WATER_POISON_SPRAY; - goto add_item; + pCharacter->AddItem(-1, v16); + break; case PLAYER_SKILL_EARTH: v16 = ITEM_SPELLBOOK_EARTH_SLOW; - goto add_item; + pCharacter->AddItem(-1, v16); + break; case PLAYER_SKILL_SPIRIT: v16 = ITEM_SPELLBOOK_SPIRIT_BLESS; - goto add_item; + pCharacter->AddItem(-1, v16); + break; case PLAYER_SKILL_MIND: v16 = ITEM_SPELLBOOK_MIND_MIND_BLAST; - goto add_item; + pCharacter->AddItem(-1, v16); + break; case PLAYER_SKILL_BODY: v16 = ITEM_SPELLBOOK_BODY_FIRST_AID; - goto add_item; + pCharacter->AddItem(-1, v16); + break; case PLAYER_SKILL_ITEM_ID: case PLAYER_SKILL_REPAIR: case PLAYER_SKILL_MEDITATION: @@ -468,13 +484,14 @@ case PLAYER_SKILL_LEARNING: pCharacter->AddItem(-1, ITEM_POTION_BOTTLE); v16 = 5 * (rand() % 3 + 40); // simple reagent - goto add_item; + pCharacter->AddItem(-1, v16); + break; case PLAYER_SKILL_DODGE: v16 = ITEM_BOOTS_1; - goto add_item; + pCharacter->AddItem(-1, v16); + break; case PLAYER_SKILL_UNARMED: v16 = ITEM_GAUNTLETS_1; -add_item: pCharacter->AddItem(-1, v16); break; default: diff -r 269ca53dae41 -r 222a09fccca1 Player.cpp --- a/Player.cpp Mon Dec 24 10:50:04 2012 +0600 +++ b/Player.cpp Mon Dec 24 10:50:15 2012 +0600 @@ -589,7 +589,7 @@ int v20[5]; // [sp+Ch] [bp-1Ch]@7 Player *pPlayer2; // [sp+20h] [bp-8h]@1 int pPlayerNum; // [sp+24h] [bp-4h]@1 - int v23; // [sp+30h] [bp+8h]@4 + int pSoundId; // [sp+30h] [bp+8h]@4 pPlayer = this; pPlayer2 = this; @@ -603,8 +603,8 @@ while ( pPlayerNum <= 4 ); v4 = a2;//102 v5 = 0; - v23 = 0; - v6 = &byte_4ED3D8[8 * v4]; + pSoundId = 0; + v6 = &byte_4ED3D8[8 * v4];//byte_4ED280 if ( uVoicesVolumeMultiplier ) { v7 = 0; @@ -623,12 +623,12 @@ v11 = v20[v9 % v5]; if ( LOBYTE((&(&dlhu_texnames_by_face[19])[25 * v11 + 3])[pVoiceID]) ) { - v23 = rand() % SLOBYTE((&(&dlhu_texnames_by_face[19])[25 * v11 + 3])[pVoiceID]) + pSoundId = rand() % SLOBYTE((&(&dlhu_texnames_by_face[19])[25 * v11 + 3])[pVoiceID]) + 2 * (v11 + 50 * pPlayer2->uVoiceID) + 4998; v12 = 8 * pPlayerNum + 312; LOBYTE(v12) = v12 | 4; - pAudioPlayer->PlaySound((SoundID)v23, v12, 0, -1, 0, 0, (signed __int64)(pSoundVolumeLevels[(char)uVoicesVolumeMultiplier] * 128.0), 0); + pAudioPlayer->PlaySound((SoundID)pSoundId, v12, 0, -1, 0, 0, (signed __int64)(pSoundVolumeLevels[(char)uVoicesVolumeMultiplier] * 128.0), 0); } } } @@ -646,7 +646,7 @@ v15 = rand(); pPlayerNum = 0; pExpression = v20[v15 % v13]; - if ( pExpression == 21 && v23 ) + if ( pExpression == 21 && pSoundId ) { v17 = 0; if ( (signed int)pSoundList->uNumSounds <= 0 ) @@ -657,7 +657,7 @@ else { pSoundID = (char *)&pSoundList->pSounds->uSoundID; - while ( *(int *)pSoundID != v23 ) + while ( *(int *)pSoundID != pSoundId ) { ++v17; pSoundID += 120; diff -r 269ca53dae41 -r 222a09fccca1 Render.cpp --- a/Render.cpp Mon Dec 24 10:50:04 2012 +0600 +++ b/Render.cpp Mon Dec 24 10:50:15 2012 +0600 @@ -11090,11 +11090,8 @@ SetBillboardBlendOptions(p->uOpacity); ErrD3D(pRenderer->pRenderD3D->pDevice->SetTexture(0, p->pTexture)); - ErrD3D(pRenderer->pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLEFAN, - D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1, - p->pQuards, - p->uNumVertices, - D3DDP_DONOTLIGHT | D3DDP_DONOTUPDATEEXTENTS)); + ErrD3D(pRenderer->pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLEFAN, D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1, + p->pQuards, p->uNumVertices, D3DDP_DONOTLIGHT | D3DDP_DONOTUPDATEEXTENTS)); } if (pRenderer->bFogEnabled) diff -r 269ca53dae41 -r 222a09fccca1 VideoPlayer.cpp --- a/VideoPlayer.cpp Mon Dec 24 10:50:04 2012 +0600 +++ b/VideoPlayer.cpp Mon Dec 24 10:50:15 2012 +0600 @@ -995,7 +995,6 @@ } } - //----- (004BF3F9) -------------------------------------------------------- bool VideoPlayer::AnyMovieLoaded() { diff -r 269ca53dae41 -r 222a09fccca1 mm7_2.cpp --- a/mm7_2.cpp Mon Dec 24 10:50:04 2012 +0600 +++ b/mm7_2.cpp Mon Dec 24 10:50:15 2012 +0600 @@ -11419,9 +11419,9 @@ char v12; // di@10 unsigned __int64 v13; // qtt@10 unsigned int v14; // ecx@10 - __int64 v15; // qax@10 + __int64 pOurHour; // qax@10 int v16; // edi@10 - signed int v17; // ebx@22 + signed int pHour; // ebx@22 //const char *v18; // ST14_4@32 int v19; // eax@32 const char *v20; // ST18_4@32 @@ -11437,12 +11437,13 @@ int v29; // [sp+18h] [bp-6Ch]@8 unsigned int v30; // [sp+1Ch] [bp-68h]@8 unsigned int v31; // [sp+20h] [bp-64h]@8*/ - __int64 v32; // [sp+60h] [bp-24h]@10 - int v33; // [sp+68h] [bp-1Ch]@10 + int pMinutes; // [sp+60h] [bp-24h]@10 + int pMonthNum; // [sp+68h] [bp-1Ch]@10 unsigned int pSaveFiles; // [sp+70h] [bp-14h]@10 - __int64 v35; // [sp+74h] [bp-10h]@10 - int pFilesID; // [sp+7Ch] [bp-8h]@10 + __int64 pAMPM2; // [sp+74h] [bp-10h]@10 + int pYear; // [sp+7Ch] [bp-8h]@10 int a4; // [sp+80h] [bp-4h]@1 + int pFilesID; v1 = 255; a4 = a1; @@ -11488,50 +11489,50 @@ pMapID = pMapStats->GetMapInfo(pSavegameHeader[v6].pLocationName); pWindow.DrawTitleText(pFontSmallnum, 0, 0, 0, pMapStats->pInfos[pMapID].pName, 3); v8 = (signed __int64)(pSavegameHeader[uLoadGameUI_SelectedSlot].uWordTime * 0.234375) / 60; - HIDWORD(v32) = (unsigned __int64)((signed __int64)(pSavegameHeader[uLoadGameUI_SelectedSlot].uWordTime * 0.234375) / 60) >> 32; + pMinutes = (int)((signed __int64)(pSavegameHeader[uLoadGameUI_SelectedSlot].uWordTime * 0.234375) / 60) >> 32; v9 = v8; v8 /= 60i64; - v35 = v8; + pAMPM2 = v8; v10 = (unsigned int)v8 / 24; pSaveFiles = v10; v11 = (unsigned int)(v10 / 7); v12 = v11; LODWORD(v13) = (unsigned int)v11 >> 2; HIDWORD(v13) = HIDWORD(v11); - v33 = v13 % 12; - pFilesID = v13 / 12; - v32 = (signed __int64)__PAIR__(HIDWORD(v32), v9) % 60; - v15 = v35 % 24; - v14 = (unsigned __int64)(v35 % 24) >> 32; - LODWORD(v35) = v35 % 24; - HIDWORD(v15) = pSaveFiles % 28; - pFilesID += 1168; + pMonthNum = v13 % 12; + pYear = v13 / 12; + pMinutes = (int)__PAIR__(pMinutes, v9) % 60; + pOurHour = pAMPM2 % 24; + v14 = (unsigned __int64)(pAMPM2 % 24) >> 32; + LODWORD(pAMPM2) = pAMPM2 % 24; + HIDWORD(pOurHour) = pSaveFiles % 28; + pYear += 1168;// v16 = v12 & 3; pWindow.uFrameY = pGUIWindow_CurrentMenu->uFrameY + 261; - HIDWORD(v35) = (v14 & 0x80000000u) == 0 && ((signed int)v14 > 0 || (unsigned int)v15 >= 12) - && (signed int)v14 <= 0 && ((v14 & 0x80000000u) != 0 || (unsigned int)v15 < 24); - if ( (v14 & 0x80000000u) != 0 || (signed int)v14 <= 0 && (unsigned int)v15 <= 12 ) - { - if ( !(v14 | (unsigned int)v15) ) + HIDWORD(pAMPM2) = v14 == 0 && ((signed int)v14 > 0 || (unsigned int)pOurHour >= 12) + && (signed int)v14 <= 0 && (v14 != 0 || (unsigned int)pOurHour < 24); + if ( v14 != 0 || (signed int)v14 <= 0 && (unsigned int)pOurHour <= 12 ) + { + if ( !(v14 | (unsigned int)pOurHour) ) { pSaveFiles = 0; - v17 = 12; + pHour = 12; goto LABEL_23; } } else { - v14 = (__PAIR__(v14, (unsigned int)v15) - 12) >> 32; - LODWORD(v15) = v15 - 12; - } - v17 = v15; + v14 = (__PAIR__(v14, (unsigned int)pOurHour) - 12) >> 32; + LODWORD(pOurHour) = pOurHour - 12; + } + pHour = pOurHour; pSaveFiles = v14; LABEL_23: - auto _d = aDayNames[HIDWORD(v15) % 7]; - auto _a = aAMPMNames[HIDWORD(v35)]; - auto _m = aMonthNames[v33]; - sprintf(pTmpBuf, "%s %d:%02d%s\n%d %s %d", _d, v17, (int)32, _a, 3, _m, pFilesID); - sprintf(pTmpBuf, "%s %d:%02d%s\n%d %s %d", _d, v17, (int)v32, _a, 7 * v16 + HIDWORD(v15) % 7 + 1, _m, pFilesID); + auto day = aDayNames[HIDWORD(pOurHour) % 7]; + auto ampm = aAMPMNames[HIDWORD(pAMPM2)]; + auto month = aMonthNames[pMonthNum]; + //sprintf(pTmpBuf, "%s %d:%02d%s\n%d %s %d", _d, v17, (int)32, _a, 3, _m, pFilesID); + sprintf(pTmpBuf, "%s %d:%02d%s\n%d %s %d", day, pHour, pMinutes, ampm, 7 * v16 + HIDWORD(pOurHour) % 7 + 1, month, pYear); pWindow.DrawTitleText(pFontSmallnum, 0, 0, 0, pTmpBuf, 3u); v1 = 255; } @@ -11578,7 +11579,7 @@ if ( pFilesID >= (signed int)pSaveFiles ) break; short clr; - HIDWORD(v35) = clr = (pFilesID == uLoadGameUI_SelectedSlot ? GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v1, v1, 0x64) : 0); + HIDWORD(pAMPM2) = clr = (pFilesID == uLoadGameUI_SelectedSlot ? GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v1, v1, 0x64) : 0); if ( pGUIWindow_CurrentMenu->field_40 != 1 || pFilesID != uLoadGameUI_SelectedSlot ) { pGUIWindow_CurrentMenu->DrawTextInRect(pFontSmallnum, 0x1B, a4, clr, pSlotName, 185, 0);