Mercurial > mm7
changeset 560:4f14053d6105
Merge
author | Gloval |
---|---|
date | Tue, 05 Mar 2013 01:08:14 +0400 |
parents | 09108e73f2f4 (current diff) 81856e97664f (diff) |
children | b23f19fc0d1b |
files | |
diffstat | 12 files changed, 771 insertions(+), 684 deletions(-) [+] |
line wrap: on
line diff
--- a/Actor.cpp Tue Mar 05 01:08:01 2013 +0400 +++ b/Actor.cpp Tue Mar 05 01:08:14 2013 +0400 @@ -3882,6 +3882,9 @@ uCurrentActionAnimation = ANIM_Dead; break; + case Removed: + return; + default: assert(false); }
--- a/GUIWindow.cpp Tue Mar 05 01:08:01 2013 +0400 +++ b/GUIWindow.cpp Tue Mar 05 01:08:14 2013 +0400 @@ -203,10 +203,7 @@ uFramesetID = 1; if ( pPlayer->expression == CHARACTER_EXPRESSION_21) { - v15 = pPlayerFrameTable->GetFrameBy_y( - &pPlayer->field_1AA8, - &pPlayer->field_1AA4, - pMiscTimer->uTimeElapsed); + v15 = pPlayerFrameTable->GetFrameBy_y(&pPlayer->_expression21_frameset, &pPlayer->_expression21_animtime, pMiscTimer->uTimeElapsed); } else {
--- a/GameUIs.cpp Tue Mar 05 01:08:01 2013 +0400 +++ b/GameUIs.cpp Tue Mar 05 01:08:14 2013 +0400 @@ -189,7 +189,7 @@ for (uint i = 0; i < 40; ++i) { v3 = pSavegameList->pFileList[i].pSaveFileName; - if ( !pSavegameList->pFileList[i].pSaveFileName ) + if ( !*pSavegameList->pFileList[i].pSaveFileName ) v3 = "1.mm7"; sprintf(pTmpBuf, "saves\\%s", v3); if ( _access(pTmpBuf, 0) || _access(pTmpBuf, 6) )
--- a/Indoor.cpp Tue Mar 05 01:08:01 2013 +0400 +++ b/Indoor.cpp Tue Mar 05 01:08:14 2013 +0400 @@ -2679,28 +2679,28 @@ j += pSector->uNumFloors; pSector->pWalls = ptr_0002B0_sector_rdata + j; - j += pSector->field_C; + j += pSector->uNumWalls; pSector->pCeilings = ptr_0002B0_sector_rdata + j; - j += pSector->field_14; + j += pSector->uNumCeilings; pSector->pFluids = ptr_0002B0_sector_rdata + j; - j += pSector->field_1C; + j += pSector->uNumFluids; pSector->pPortals = ptr_0002B0_sector_rdata + j; j += pSector->uNumPortals; pSector->pFaceIDs = ptr_0002B0_sector_rdata + j; - j += pSector->field_2C; + j += pSector->uNumFaces; pSector->pCogs = ptr_0002B0_sector_rdata + j; - j += pSector->field_3C; + j += pSector->uNumCogs; pSector->pDecorationIDs = ptr_0002B0_sector_rdata + j; j += pSector->uNumDecorations; pSector->pMarkers = ptr_0002B0_sector_rdata + j; - j += pSector->field_4C; + j += pSector->uNumMarkers; //do @@ -2758,8 +2758,8 @@ for (uint i = 0, j = 0; i < uNumSectors; ++i) { - pSectors->pLights = (unsigned __int16 *)(ptr_0002B8_sector_lrdata + j); - j += pSectors->uNumLights; + pSectors[i].pLights = ptr_0002B8_sector_lrdata + j; + j += pSectors[i].uNumLights; } pGameLoadingUI_ProgressBar->Progress(); @@ -3712,8 +3712,7 @@ v25 = abs(v15->pFacePlane_old.vNormal.z); //v26 = v87; if ( v24 > v25 ) - Abortf( - "Door Error\ndoor id: %i\nfacet no: %i\n\nOverflow dividing facet->d [%i] by facet->nz [%i]", + Abortf("Door Error\ndoor id: %i\nfacet no: %i\n\nOverflow dividing facet->d [%i] by facet->nz [%i]", door->uDoorID, door->pFaceIDs[v88], v15->pFacePlane_old.dist, @@ -3886,7 +3885,9 @@ } //v2 = v87; } - LOWORD(v39) = v84 + ((signed __int16)v39 != -1 ? pBitmaps_LOD->pTextures[(signed __int16)v39].uTextureWidth : 24); + LOWORD(v39) = v84; + if (v15->uBitmapID != -1) + LOWORD(v39) += pBitmaps_LOD->pTextures[v15->uBitmapID].uTextureWidth; LABEL_50: v28->sTextureDeltaU -= v39; goto LABEL_51;
--- a/Indoor.h Tue Mar 05 01:08:01 2013 +0400 +++ b/Indoor.h Tue Mar 05 01:08:14 2013 +0400 @@ -347,34 +347,34 @@ unsigned __int16 uNumFloors; __int16 field_6; unsigned __int16 *pFloors; - __int16 field_C; + unsigned __int16 uNumWalls; __int16 field_E; unsigned __int16 *pWalls; - __int16 field_14; + unsigned __int16 uNumCeilings; __int16 field_16; unsigned __int16 *pCeilings; - __int16 field_1C; + unsigned __int16 uNumFluids; __int16 field_1E; unsigned __int16 *pFluids; __int16 uNumPortals; __int16 field_26; unsigned __int16 *pPortals; - __int16 field_2C; - __int16 uNumNonBSPFaces; + unsigned __int16 uNumFaces; + unsigned __int16 uNumNonBSPFaces; unsigned __int16 *pFaceIDs; - __int16 uNumCylinderFaces; + unsigned __int16 uNumCylinderFaces; __int16 field_36; int pCylinderFaces; - __int16 field_3C; + unsigned __int16 uNumCogs; __int16 field_3E; unsigned __int16 *pCogs; unsigned __int16 uNumDecorations; __int16 field_46; unsigned __int16 *pDecorationIDs; - __int16 field_4C; + unsigned __int16 uNumMarkers; __int16 field_4E; unsigned __int16 *pMarkers; - __int16 uNumLights; + unsigned __int16 uNumLights; __int16 field_56; unsigned __int16 *pLights; __int16 uWaterLevel;
--- a/Player.cpp Tue Mar 05 01:08:01 2013 +0400 +++ b/Player.cpp Tue Mar 05 01:08:14 2013 +0400 @@ -2298,6 +2298,9 @@ field_100 = 0; field_104 = 0; + _expression21_animtime = 0; + _expression21_frameset = 0; + lastOpenedSpellbookPage = 0; }
--- a/Player.h Tue Mar 05 01:08:01 2013 +0400 +++ b/Player.h Tue Mar 05 01:08:14 2013 +0400 @@ -717,8 +717,8 @@ unsigned __int16 uExpressionTimePassed; unsigned __int16 uExpressionTimeLength; __int16 field_1AA2; - int field_1AA4; - int field_1AA8; + int _expression21_animtime; + int _expression21_frameset; LloydBeacon pInstalledBeacons[5]; char uNumDivineInterventionCastsThisDay; char uNumArmageddonCasts;
--- a/SaveLoad.cpp Tue Mar 05 01:08:01 2013 +0400 +++ b/SaveLoad.cpp Tue Mar 05 01:08:14 2013 +0400 @@ -611,7 +611,7 @@ { unsigned int v1; // esi@1 int v2; // esi@2 - RGBTexture *v3; // ebx@3 + //RGBTexture *v3; // ebx@3 int bNotArena; // [sp+2Ch] [bp-8h]@1 unsigned int v6; // [sp+30h] [bp-4h]@1 @@ -638,14 +638,13 @@ GUI_UpdateWindows(); pGUIWindow_CurrentMenu->Release(); pCurrentScreen = SCREEN_GAME; - v3 = pSavegameThumbnails; + //v3 = pSavegameThumbnails; viewparams->bRedrawGameUI = 1; - do + for(int i=0;i<45;i++) { - v3->Release(); - ++v3; + pSavegameThumbnails[i].Release(); } - while ( (signed int)v3 < (signed int)&unk_6A0758 ); + //while ( (signed int)v3 < (signed int)&unk_6A0758 ); if ( bNotArena ) pNew_LOD->_4621A7(); else
--- a/mm7_2.cpp Tue Mar 05 01:08:01 2013 +0400 +++ b/mm7_2.cpp Tue Mar 05 01:08:14 2013 +0400 @@ -1098,65 +1098,62 @@ v101.uFrameZ = 334; v105 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); v104 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); - if ( dword_F8B19C > 5 ) - { - if ( dword_F8B19C == 94 ) - { - draw_leather(); - CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); - pShopOptions[0] = pGlobalTXT_LocalizationStrings[200]; - pShopOptions[1] = pGlobalTXT_LocalizationStrings[113]; - pShopOptions[2] = pGlobalTXT_LocalizationStrings[179]; - v65 = 0; - v66 = pShopOptions; - do - { - v67 = pFontArrus->CalcTextHeight(*v66, &v101, 0, 0); - ++v66; - v65 += v67; - } - while ( (signed int)v66 < (signed int)&pShopOptions[3] ); - v68 = pDialogueWindow; - v109 = (const char **)((174 - v65) / 3); - result = (char *)pDialogueWindow->pStartingPosActiveItem; - v69 = (int)&result[pDialogueWindow->pNumPresenceButton]; - v70 = (3 * (58 - (signed int)v109) - v65) / 2 - (174 - v65) / 3 / 2 + 138; - v20 = -pDialogueWindow->pNumPresenceButton < 0; - v106.y = pDialogueWindow->pStartingPosActiveItem; - if ( v20 ^ __OFSUB__((int)result, (int)v69) ) - { - _this = (Player *)2; - v108 = (int)pShopOptions; - do - { - v71 = v68->GetControl(v106.y); - v72 = (const char **)v108; - v71->uY = (unsigned int)((char *)v109 + v70); - v73 = pFontArrus->CalcTextHeight(*v72, &v101, 0, 0); - v74 = v71->uY; - v75 = _this; - v71->uHeight = v73; - v70 = v73 + v74 - 1; - v71->uW = v70; - v76 = v104; - if ( (Player *)pDialogueWindow->pCurrentPosActiveItem != v75 ) - v76 = v105; - v101.DrawTitleText(pFontArrus, 0, v74, v76, *(const char **)v108, 3u); - v68 = pDialogueWindow; - _this = (Player *)((char *)_this + 1); - v108 += 4; - ++v106.y; - result = (char *)(pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem); - } - while ( v106.y < (signed int)result ); - } - return result; - } - if ( dword_F8B19C != 95 ) - { - result = (char *)(dword_F8B19C - 96); - if ( dword_F8B19C == 96 ) - { + switch(dword_F8B19C) + { + case 94: + { + draw_leather(); + CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); + pShopOptions[0] = pGlobalTXT_LocalizationStrings[200]; + pShopOptions[1] = pGlobalTXT_LocalizationStrings[113]; + pShopOptions[2] = pGlobalTXT_LocalizationStrings[179]; + v65 = 0; + v66 = pShopOptions; + do + { + v67 = pFontArrus->CalcTextHeight(*v66, &v101, 0, 0); + ++v66; + v65 += v67; + } + while ( (signed int)v66 < (signed int)&pShopOptions[3] ); + v68 = pDialogueWindow; + v109 = (const char **)((174 - v65) / 3); + result = (char *)pDialogueWindow->pStartingPosActiveItem; + v69 = (int)&result[pDialogueWindow->pNumPresenceButton]; + v70 = (3 * (58 - (signed int)v109) - v65) / 2 - (174 - v65) / 3 / 2 + 138; + v20 = -pDialogueWindow->pNumPresenceButton < 0; + v106.y = pDialogueWindow->pStartingPosActiveItem; + if ( v20 ^ __OFSUB__((int)result, (int)v69) ) + { + _this = (Player *)2; + v108 = (int)pShopOptions; + do + { + v71 = v68->GetControl(v106.y); + v72 = (const char **)v108; + v71->uY = (unsigned int)((char *)v109 + v70); + v73 = pFontArrus->CalcTextHeight(*v72, &v101, 0, 0); + v74 = v71->uY; + v75 = _this; + v71->uHeight = v73; + v70 = v73 + v74 - 1; + v71->uW = v70; + v76 = v104; + if ( (Player *)pDialogueWindow->pCurrentPosActiveItem != v75 ) + v76 = v105; + v101.DrawTitleText(pFontArrus, 0, v74, v76, *(const char **)v108, 3u); + v68 = pDialogueWindow; + _this = (Player *)((char *)_this + 1); + v108 += 4; + ++v106.y; + result = (char *)(pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem); + } + while ( v106.y < (signed int)result ); + } + break; + } + case 96: + { result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); if ( result ) { @@ -1173,7 +1170,20 @@ v34 = v33 + v30->pNumPresenceButton; v109 = 0; if ( (signed int)v33 >= v34 ) - goto LABEL_105; + { + sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], _this->pName, pClassNames[_this->classType]); + strcat(pTmpBuf, "\n \n"); + strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]); + v7 = pTmpBuf; + v86 = 3; + v84 = pTmpBuf; + v82 = v104; + v80 = 0; + v78 = 0; + v77 = &v101; + v8 = pFontArrus->CalcTextHeight(v7, v77, v78, v80); + return v101.DrawTitleText(pFontArrus, v3, (174 - v8) / 2 + 138, v82, v84, v86); + } do { v35 = v30->GetControl(v33)->uControlParam - 36; @@ -1188,7 +1198,7 @@ while ( (signed int)v33 < v30->pNumPresenceButton + v30->pStartingPosActiveItem ); if ( !v109 ) { -LABEL_105: +//LABEL_105: sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], _this->pName, pClassNames[_this->classType]); strcat(pTmpBuf, "\n \n"); strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]); @@ -1199,7 +1209,8 @@ v80 = 0; v78 = 0; v77 = &v101; - goto LABEL_15; + v8 = pFontArrus->CalcTextHeight(v7, v77, v78, v80); + return v101.DrawTitleText(pFontArrus, v3, (174 - v8) / 2 + 138, v82, v84, v86); } sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v108); v101.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u); @@ -1249,115 +1260,232 @@ while ( v106.y < (signed int)result ); } } - } - return result; - } - } - else - { - if ( dword_F8B19C == 5 ) - { - draw_leather(); - CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); - DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0); - result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); - if ( result ) - { - v27 = pMouse->GetCursorPos(&v99)->x - 14; - v106.x = (v27 >> 5) + 14 * ((pMouse->GetCursorPos(&v97)->y - 17) >> 5); - result = (char *)pMouse->GetCursorPos(&v95); - if ( *(int *)result > 13 ) - { - result = (char *)pMouse->GetCursorPos(&v93); - if ( *(int *)result < 462 ) - { - result = (char *)v0->GetItemIDAtInventoryIndex((int *)&v106.x); - v3 = 0; - if ( result ) - { - result = (char *)(9 * (int)result); - if ( _this->field_1F5[4 * (int)result + 15] & 2 ) - { - v85 = 0; - v83 = 5; - v81 = window_SpeakInHouse->ptr_1C; - v79 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * (int)result + 5]; - v28 = (int)window_SpeakInHouse->ptr_1C; - v110 = uActiveCharacter - 1; - v29 = _this->_490EEE( - (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * (int)result + 5], - 1, - v28, - 5); - v6 = v110; - v5 = (char *)pMerchantsRepairPhrases[v29]; - goto LABEL_14; - } - } - } - } - } - return result; - } - if ( dword_F8B19C == 1 ) - { - result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); - if ( result ) - { - pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; - pShopOptions[1] = pGlobalTXT_LocalizationStrings[152]; - pShopOptions[2] = pGlobalTXT_LocalizationStrings[159]; - v14 = 0; - pShopOptions[3] = pGlobalTXT_LocalizationStrings[160]; - v15 = pShopOptions; - do - { - v16 = pFontArrus->CalcTextHeight(*v15, &v101, 0, 0); - ++v15; - v14 += v16; - } - while ( (signed int)v15 < (signed int)&unk_F8B1C8 ); - v17 = pDialogueWindow; - v103 = (174 - v14) / 4; - result = (char *)pDialogueWindow->pStartingPosActiveItem; - v18 = (int)&result[pDialogueWindow->pNumPresenceButton]; - v19 = (174 - 4 * (174 - v14) / 4 - v14) / 2 - (174 - v14) / 4 / 2 + 138; - v20 = -pDialogueWindow->pNumPresenceButton < 0; - _this = (Player *)pDialogueWindow->pStartingPosActiveItem; - if ( v20 ^ __OFSUB__((int)result, v18) ) - { - v108 = 2; - v109 = (const char **)pShopOptions; - do - { - v21 = v17->GetControl((unsigned int)_this); - v22 = v109; - v21->uY = v103 + v19; - v23 = pFontArrus->CalcTextHeight(*v22, &v101, 0, 0); - v24 = v21->uY; - v25 = v108; - v21->uHeight = v23; - v19 = v24 + v23 - 1; - v21->uW = v19; - v26 = v104; - if ( pDialogueWindow->pCurrentPosActiveItem != v25 ) - v26 = v105; - v101.DrawTitleText(pFontArrus, 0, v24, v26, *v109, 3u); - v17 = pDialogueWindow; - ++v108; - ++v109; - _this = (Player *)((char *)_this + 1); - result = (char *)(pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem); - } - while ( (signed int)_this < (signed int)result ); - } - } - return result; - } - if ( dword_F8B19C != 2 ) - { - if ( dword_F8B19C == 3 ) - { + break; + } + case 95: + { + pRenderer->DrawTextureIndexed(8u, 8u, ShopTexture); + v3 = 0; + v109 = 0; + v108 = 0; + do + { + // if ( pParty->field_C59C[9 * (int)&v109[3 * (unsigned int)window_SpeakInHouse->ptr_1C] + 724] ) + if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v109].uItemID) + { + v52 = word_F8B158[(signed int)v109] + 30; + v53 = ItemsInShopTexture[(signed int)v109]; + v54 = 60 - ((signed int)v53->uTextureWidth >> 1); + pRenderer->DrawTextureTransparent(v54 + v108, word_F8B158[(signed int)v109] + 30, v53); + sub_40F92A( + &pRenderer->pActiveZBuffer[v54 + v108 + 640 * v52], + ItemsInShopTexture[(signed int)v109], + (int)((char *)v109 + 1)); + } + v109 = (const char **)((char *)v109 + 1); + v108 += 70; + } + while ( (signed int)v109 < 6 ); + result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); + if ( result ) + { + v55 = 0; + v106.x = 0; + do + { + // if ( pParty->field_C59C[9 * (v55 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] ) + if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v55].uItemID) + ++v106.x; + ++v55; + } + while ( v55 < 6 ); + v56 = GetAsyncKeyState(17); + v57 = _this->CanSteal(); + Str = (char *)v57; + if ( v56 && v57 ) + { + v58 = pGlobalTXT_LocalizationStrings[185]; + } + else + { + v58 = pGlobalTXT_LocalizationStrings[195]; + if ( dword_F8B19C != 2 ) + v58 = pGlobalTXT_LocalizationStrings[196]; + } + DrawTextAtStatusBar(v58, 0); + if ( v106.x ) + { + v59 = pMouse->GetCursorPos(&v91); + result = (char *)(v59->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v89)->y]); + if ( pRenderer->pActiveZBuffer[(int)result] & 0xFFFF ) + { + v60 = (pRenderer->pActiveZBuffer[(int)result] & 0xFFFF) - 1; + v106.x = v60; + v61 = (int)window_SpeakInHouse->ptr_1C; + // v62 = 9 * (v60 + 12 * v61); + v63 = (ItemGen *)&pParty->StandartItemsInShops[(int)v61][v60]; + if ( dword_F8B19C != 2 ) + v63 = &pParty->SpecialItemsInShops[(int)v61][v60];//v63 = (ItemGen *)&pParty->field_C59C[v62 + 724]; + if ( !v56 || !Str ) + { + v85 = 0; + v83 = 2; + v81 = window_SpeakInHouse->ptr_1C; + v79 = v63; + v110 = uActiveCharacter - 1; + v64 = _this->_490EEE(v63, 1, v61, 2); + v6 = v110; + v5 = (char *)pMerchantsBuyPhrases[v64]; + v7 = BuilDialogueString(v5, v6, v79, (char *)v81, v83, v85); + v86 = 3; + v84 = v7; + v82 = v105; + v80 = v3; + v78 = v3; + v77 = &v101; + v8 = pFontArrus->CalcTextHeight(v7, v77, v78, v80); + return v101.DrawTitleText(pFontArrus, v3, (174 - v8) / 2 + 138, v82, v84, v86); + } + v5 = pGlobalTXT_LocalizationStrings[181]; + v85 = 0; + v83 = 2; + v81 = window_SpeakInHouse->ptr_1C; + v79 = v63; + v6 = uActiveCharacter - 1; + v7 = BuilDialogueString(v5, v6, v79, (char *)v81, v83, v85); + v86 = 3; + v84 = v7; + v82 = v105; + v80 = v3; + v78 = v3; + v77 = &v101; + v8 = pFontArrus->CalcTextHeight(v7, v77, v78, v80); + return v101.DrawTitleText(pFontArrus, v3, (174 - v8) / 2 + 138, v82, v84, v86); + } + } + else + { + v101.DrawCurrentTime( pParty->field_3C.field_50[(unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed); + result =0; //added + } + } + break; + } + case 2: + { + pRenderer->DrawTextureIndexed(8u, 8u, ShopTexture); + v3 = 0; + v48 = 0; + v108 = 0; + v109 = 0; + do + { + // if ( pParty->field_777C[9 * (int)&v48[3 * (unsigned int)window_SpeakInHouse->ptr_1C]] ) + if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(int)v48].uItemID); + { + v49 = word_F8B158[(signed int)v48]; + v50 = ItemsInShopTexture[(signed int)v48]; + v49 += 30; + v51 = 60 - ((signed int)v50->uTextureWidth >> 1); + pRenderer->DrawTextureTransparent(v51 + v108, v49, v50); + sub_40F92A( + &pRenderer->pActiveZBuffer[v51 + v108 + 640 * v49], + ItemsInShopTexture[(signed int)v109], + (int)((char *)v109 + 1)); + v48 = v109; + } + v108 += 70; + v48 = (const char **)((char *)v48 + 1); + v109 = v48; + } + while ( (signed int)v48 < 6 ); + result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); + if ( result ) + { + v55 = 0; + v106.x = 0; + v106.x = 0; + do + { + if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v55].uItemID);//9 * (v55 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] ) + ++v106.x; + ++v55; + } + while ( v55 < 6 ); + v56 = GetAsyncKeyState(17); + v57 = _this->CanSteal(); + Str = (char *)v57; + if ( v56 && v57 ) + { + v58 = pGlobalTXT_LocalizationStrings[185]; + } + else + { + v58 = pGlobalTXT_LocalizationStrings[195]; + if ( dword_F8B19C != 2 ) + v58 = pGlobalTXT_LocalizationStrings[196]; + } + DrawTextAtStatusBar(v58, 0); + if ( v106.x ) + { + v59 = pMouse->GetCursorPos(&v91); + result = (char *)(v59->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v89)->y]); + if ( pRenderer->pActiveZBuffer[(int)result] & 0xFFFF ) + { + v60 = (pRenderer->pActiveZBuffer[(int)result] & 0xFFFF) - 1; + v106.x = v60; + v61 = (int)window_SpeakInHouse->ptr_1C; + // v62 = 9 * (v60 + 12 * v61); + v63 = (ItemGen *)&pParty->StandartItemsInShops[(int)v61][v60]; + if ( dword_F8B19C != 2 ) + v63 = &pParty->SpecialItemsInShops[(int)v61][v60];//v63 = (ItemGen *)&pParty->field_C59C[v62 + 724]; + if ( !v56 || !Str ) + { + v85 = 0; + v83 = 2; + v81 = window_SpeakInHouse->ptr_1C; + v79 = v63; + v110 = uActiveCharacter - 1; + v64 = _this->_490EEE(v63, 1, v61, 2); + v6 = v110; + v5 = (char *)pMerchantsBuyPhrases[v64]; + v7 = BuilDialogueString(v5, v6, v79, (char *)v81, v83, v85); + v86 = 3; + v84 = v7; + v82 = v105; + v80 = v3; + v78 = v3; + v77 = &v101; + v8 = pFontArrus->CalcTextHeight(v7, v77, v78, v80); + return v101.DrawTitleText(pFontArrus, v3, (174 - v8) / 2 + 138, v82, v84, v86); + } + v5 = pGlobalTXT_LocalizationStrings[181]; + v85 = 0; + v83 = 2; + v81 = window_SpeakInHouse->ptr_1C; + v79 = v63; + v6 = uActiveCharacter - 1; + v7 = BuilDialogueString(v5, v6, v79, (char *)v81, v83, v85); + v86 = 3; + v84 = v7; + v82 = v105; + v80 = v3; + v78 = v3; + v77 = &v101; + v8 = pFontArrus->CalcTextHeight(v7, v77, v78, v80); + return v101.DrawTitleText(pFontArrus, v3, (174 - v8) / 2 + 138, v82, v84, v86); + } + } + else + { + v101.DrawCurrentTime( pParty->field_3C.field_50[(unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed); + result =0; //added + } + } + break; + } + case 3: + { draw_leather(); CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0); @@ -1385,205 +1513,148 @@ v13 = _this->_490EEE(v79, 1, v12, 3); v6 = v110; v5 = (char *)pMerchantsSellPhrases[v13]; - goto LABEL_14; - } - } - } - } - } - else - { - result = (char *)(dword_F8B19C - 4); - if ( dword_F8B19C == 4 ) - { - draw_leather(); - CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); - DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0); - result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); - if ( result ) - { - v2 = pMouse->GetCursorPos(&a2)->x - 14; - v106.x = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v87)->y - 17) >> 5); - result = (char *)pMouse->GetCursorPos(&v100); - if ( *(int *)result > 13 ) - { - result = (char *)pMouse->GetCursorPos(&v92); - if ( *(int *)result < 462 ) - { - result = (char *)v0->GetItemIDAtInventoryIndex((int *)&v106.x); - v3 = 0; - if ( result ) - { - v85 = 0; - v83 = 4; - v4 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * (int)result + 5]; - if (!v4->Identified()) - { - v81 = window_SpeakInHouse->ptr_1C; - v79 = v4; - v9 = (int)window_SpeakInHouse->ptr_1C; - v110 = uActiveCharacter - 1; - v10 = _this->_490EEE(v4, 1, v9, 4); - v6 = v110; - v5 = (char *)pMerchantsIdentifyPhrases[v10]; - goto LABEL_14; - } - v81 = window_SpeakInHouse->ptr_1C; - v5 = "%24"; - v79 = v4; -LABEL_13: - v6 = uActiveCharacter - 1; -LABEL_14: - v7 = BuilDialogueString(v5, v6, v79, (char *)v81, v83, v85); - v86 = 3; - v84 = v7; - v82 = v105; - v80 = v3; - v78 = v3; - v77 = &v101; -LABEL_15: - v8 = pFontArrus->CalcTextHeight(v7, v77, v78, v80); - return v101.DrawTitleText(pFontArrus, v3, (174 - v8) / 2 + 138, v82, v84, v86); - } + v7 = BuilDialogueString(v5, v6, v79, (char *)v81, v83, v85); + v86 = 3; + v84 = v7; + v82 = v105; + v80 = v3; + v78 = v3; + v77 = &v101; + v8 = pFontArrus->CalcTextHeight(v7, v77, v78, v80); + return v101.DrawTitleText(pFontArrus, v3, (174 - v8) / 2 + 138, v82, v84, v86); } } } } - } - return result; - } - } - pRenderer->DrawTextureIndexed(8u, 8u, ShopTexture); - v3 = 0; - if ( dword_F8B19C == 2 ) - { - v48 = 0; - v108 = 0; - v109 = 0; - do - { - // if ( pParty->field_777C[9 * (int)&v48[3 * (unsigned int)window_SpeakInHouse->ptr_1C]] ) - if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(int)v48].uItemID); - { - v49 = word_F8B158[(signed int)v48]; - v50 = ItemsInShopTexture[(signed int)v48]; - v49 += 30; - v51 = 60 - ((signed int)v50->uTextureWidth >> 1); - pRenderer->DrawTextureTransparent(v51 + v108, v49, v50); - sub_40F92A( - &pRenderer->pActiveZBuffer[v51 + v108 + 640 * v49], - ItemsInShopTexture[(signed int)v109], - (int)((char *)v109 + 1)); - v48 = v109; - } - v108 += 70; - v48 = (const char **)((char *)v48 + 1); - v109 = v48; - } - while ( (signed int)v48 < 6 ); - } - else - { - v109 = 0; - v108 = 0; - do - { - // if ( pParty->field_C59C[9 * (int)&v109[3 * (unsigned int)window_SpeakInHouse->ptr_1C] + 724] ) - if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v109].uItemID) - { - v52 = word_F8B158[(signed int)v109] + 30; - v53 = ItemsInShopTexture[(signed int)v109]; - v54 = 60 - ((signed int)v53->uTextureWidth >> 1); - pRenderer->DrawTextureTransparent(v54 + v108, word_F8B158[(signed int)v109] + 30, v53); - sub_40F92A( - &pRenderer->pActiveZBuffer[v54 + v108 + 640 * v52], - ItemsInShopTexture[(signed int)v109], - (int)((char *)v109 + 1)); - } - v109 = (const char **)((char *)v109 + 1); - v108 += 70; - } - while ( (signed int)v109 < 6 ); - } - result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); - if ( result ) - { - v55 = 0; - v106.x = 0; - if ( dword_F8B19C == 2 ) - { - v106.x = 0; - do - { - if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v55].uItemID);//9 * (v55 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] ) - ++v106.x; - ++v55; - } - while ( v55 < 6 ); - } - else - { - do - { - // if ( pParty->field_C59C[9 * (v55 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] ) - if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v55].uItemID) - ++v106.x; - ++v55; - } - while ( v55 < 6 ); - } - v56 = GetAsyncKeyState(17); - v57 = _this->CanSteal(); - Str = (char *)v57; - if ( v56 && v57 ) - { - v58 = pGlobalTXT_LocalizationStrings[185]; - } - else - { - v58 = pGlobalTXT_LocalizationStrings[195]; - if ( dword_F8B19C != 2 ) - v58 = pGlobalTXT_LocalizationStrings[196]; - } - DrawTextAtStatusBar(v58, 0); - if ( v106.x ) - { - v59 = pMouse->GetCursorPos(&v91); - result = (char *)(v59->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v89)->y]); - if ( pRenderer->pActiveZBuffer[(int)result] & 0xFFFF ) - { - v60 = (pRenderer->pActiveZBuffer[(int)result] & 0xFFFF) - 1; - v106.x = v60; - v61 = (int)window_SpeakInHouse->ptr_1C; - // v62 = 9 * (v60 + 12 * v61); - v63 = (ItemGen *)&pParty->StandartItemsInShops[(int)v61][v60]; - if ( dword_F8B19C != 2 ) - v63 = &pParty->SpecialItemsInShops[(int)v61][v60];//v63 = (ItemGen *)&pParty->field_C59C[v62 + 724]; - if ( !v56 || !Str ) - { - v85 = 0; - v83 = 2; - v81 = window_SpeakInHouse->ptr_1C; - v79 = v63; - v110 = uActiveCharacter - 1; - v64 = _this->_490EEE(v63, 1, v61, 2); - v6 = v110; - v5 = (char *)pMerchantsBuyPhrases[v64]; - goto LABEL_14; - } - v5 = pGlobalTXT_LocalizationStrings[181]; - v85 = 0; - v83 = 2; - v81 = window_SpeakInHouse->ptr_1C; - v79 = v63; - goto LABEL_13; - } - } - else - { - v101.DrawCurrentTime( pParty->field_3C.field_50[(unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed); - result =0; //added - } + break; + } + case 4: + { + draw_leather(); + CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); + DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0); + result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); + if ( result ) + { + v2 = pMouse->GetCursorPos(&a2)->x - 14; + v106.x = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v87)->y - 17) >> 5); + result = (char *)pMouse->GetCursorPos(&v100); + if ( *(int *)result > 13 ) + { + result = (char *)pMouse->GetCursorPos(&v92); + if ( *(int *)result < 462 ) + { + result = (char *)v0->GetItemIDAtInventoryIndex((int *)&v106.x); + v3 = 0; + if ( result ) + { + v85 = 0; + v83 = 4; + v4 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * (int)result + 5]; + if (!v4->Identified()) + { + v81 = window_SpeakInHouse->ptr_1C; + v79 = v4; + v9 = (int)window_SpeakInHouse->ptr_1C; + v110 = uActiveCharacter - 1; + v10 = _this->_490EEE(v4, 1, v9, 4); + v6 = v110; + v5 = (char *)pMerchantsIdentifyPhrases[v10]; + v7 = BuilDialogueString(v5, v6, v79, (char *)v81, v83, v85); + v86 = 3; + v84 = v7; + v82 = v105; + v80 = v3; + v78 = v3; + v77 = &v101; + v8 = pFontArrus->CalcTextHeight(v7, v77, v78, v80); + return v101.DrawTitleText(pFontArrus, v3, (174 - v8) / 2 + 138, v82, v84, v86); + } + v81 = window_SpeakInHouse->ptr_1C; + v5 = "%24"; + v79 = v4; + //LABEL_13: + v6 = uActiveCharacter - 1; + //LABEL_14: + v7 = BuilDialogueString(v5, v6, v79, (char *)v81, v83, v85); + v86 = 3; + v84 = v7; + v82 = v105; + v80 = v3; + v78 = v3; + v77 = &v101; + //LABEL_15: + v8 = pFontArrus->CalcTextHeight(v7, v77, v78, v80); + return v101.DrawTitleText(pFontArrus, v3, (174 - v8) / 2 + 138, v82, v84, v86); + } + } + } + } + break; + } + case 1: + { + result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); + if ( result ) + { + pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; + pShopOptions[1] = pGlobalTXT_LocalizationStrings[152]; + pShopOptions[2] = pGlobalTXT_LocalizationStrings[159]; + v14 = 0; + pShopOptions[3] = pGlobalTXT_LocalizationStrings[160]; + v15 = pShopOptions; + do + { + v16 = pFontArrus->CalcTextHeight(*v15, &v101, 0, 0); + ++v15; + v14 += v16; + } + while ( (signed int)v15 < (signed int)&unk_F8B1C8 ); + v17 = pDialogueWindow; + v103 = (174 - v14) / 4; + result = (char *)pDialogueWindow->pStartingPosActiveItem; + v18 = (int)&result[pDialogueWindow->pNumPresenceButton]; + v19 = (174 - 4 * (174 - v14) / 4 - v14) / 2 - (174 - v14) / 4 / 2 + 138; + v20 = -pDialogueWindow->pNumPresenceButton < 0; + _this = (Player *)pDialogueWindow->pStartingPosActiveItem; + if ( v20 ^ __OFSUB__((int)result, v18) ) + { + v108 = 2; + v109 = (const char **)pShopOptions; + do + { + v21 = v17->GetControl((unsigned int)_this); + v22 = v109; + v21->uY = v103 + v19; + v23 = pFontArrus->CalcTextHeight(*v22, &v101, 0, 0); + v24 = v21->uY; + v25 = v108; + v21->uHeight = v23; + v19 = v24 + v23 - 1; + v21->uW = v19; + v26 = v104; + if ( pDialogueWindow->pCurrentPosActiveItem != v25 ) + v26 = v105; + v101.DrawTitleText(pFontArrus, 0, v24, v26, *v109, 3u); + v17 = pDialogueWindow; + ++v108; + ++v109; + _this = (Player *)((char *)_this + 1); + result = (char *)(pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem); + } + while ( (signed int)_this < (signed int)result ); + } + } + break; + } + default: + { + if( dword_F8B19C > 5 ) + result = (char *)(dword_F8B19C - 96); + else + result = (char *)(dword_F8B19C - 4); + break; + } } return result; } @@ -13349,7 +13420,7 @@ assert(sizeof(GUIProgressBar) == 0x1B8); assert(sizeof(GUIFont) == 0x1020); assert(sizeof(stru262_TurnBased) == 0x40); - assert(sizeof(ArcomageGame) == 0xFA); + assert(sizeof(ArcomageGame) == 0xFB); assert(sizeof(stru277) == 0x14); assert(sizeof(ArcomageCard) == 0x6C); assert(sizeof(stru320) == 0x3FC);
--- a/mm7_3.cpp Tue Mar 05 01:08:01 2013 +0400 +++ b/mm7_3.cpp Tue Mar 05 01:08:14 2013 +0400 @@ -125,7 +125,7 @@ { v9 = &pIndoor->pSectors[v33[result]]; v10 = 0; - v32 = v9->uNumFloors + v9->field_C + v9->field_14; + v32 = v9->uNumFloors + v9->uNumWalls + v9->uNumCeilings; v26 = 0; if ( v32 > 0 ) break; @@ -1526,7 +1526,6 @@ int v7; // [sp+10h] [bp-8h]@1 signed int v8; // [sp+14h] [bp-4h]@1 - __debugbreak(); v5 = x - 2; v7 = x; v8 = y; @@ -1650,10 +1649,10 @@ v80 = _46ED1B_collide_against_floor(new_party_x, new_party_y, party_z + 40, &uSectorID, &uFaceID); if ( pParty->bFlying ) { - pParty->bFlying = 0; - __debugbreak(); + pParty->bFlying = false; if (pParty->FlyActive()) - stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[7].uOverlayID + 119] |= 1u;// 005E4D58 pOtherOverlayList [negindexing] + pOtherOverlayList->pOverlays[pParty->pPartyBuffs[PARTY_BUFF_FLY].uOverlayID - 1].field_E |= 1; + //stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[PARTY_BUFF_FLY].uOverlayID + 119] |= 1u;// 005E4D58 pOtherOverlayList [negindexing] } if ( v80 == -30000 ) {
--- a/mm7_4.cpp Tue Mar 05 01:08:01 2013 +0400 +++ b/mm7_4.cpp Tue Mar 05 01:08:14 2013 +0400 @@ -3210,7 +3210,7 @@ if ( v7 == 0 ) v7 = 1; if (pPlayer->expression == CHARACTER_EXPRESSION_21) - pFrame = pPlayerFrameTable->GetFrameBy_y(&pPlayer->field_1AA8, &pPlayer->field_1AA4, pMiscTimer->uTimeElapsed); + pFrame = pPlayerFrameTable->GetFrameBy_y(&pPlayer->_expression21_frameset, &pPlayer->_expression21_animtime, pMiscTimer->uTimeElapsed); else pFrame = pPlayerFrameTable->GetFrameBy_x(v7, pPlayer->uExpressionTimePassed); if (pPlayer->field_1AA2 != pFrame->uTextureID - 1 || v22 ) @@ -4335,25 +4335,25 @@ } //----- (00494B5E) -------------------------------------------------------- -PlayerFrame *PlayerFrameTable::GetFrameBy_y(int *a2, int *a3, int a4) +PlayerFrame *PlayerFrameTable::GetFrameBy_y(int *pFramesetID, int *pAnimTime, int a4) { PlayerFrameTable *v4; // edi@1 int v5; // esi@1 int v6; // eax@2 v4 = this; - v5 = a4 + *a3; - if ( v5 < 8 * this->pFrames[*a2].uAnimTime ) - { - *a3 = v5; + v5 = a4 + *pAnimTime; + if ( v5 < 8 * this->pFrames[*pFramesetID].uAnimTime ) + { + *pAnimTime = v5; } else { v6 = rand() % 4 + 21; - *a2 = v6; - *a3 = 8 * v5 % v4->pFrames[v6].uAnimTime; - } - return &v4->pFrames[*a2]; + *pFramesetID = v6; + *pAnimTime = 8 * v5 % v4->pFrames[v6].uAnimTime; + } + return &v4->pFrames[*pFramesetID]; } //----- (00494BC3) --------------------------------------------------------
--- a/mm7_5.cpp Tue Mar 05 01:08:01 2013 +0400 +++ b/mm7_5.cpp Tue Mar 05 01:08:14 2013 +0400 @@ -11561,7 +11561,7 @@ v61 = 116 * v59; sDepthb = 0; for ( i = 116 * v59; - sDepthb < *(__int16 *)((char *)&pIndoor->pSectors->field_C + v61) + sDepthb < *(__int16 *)((char *)&pIndoor->pSectors->uNumWalls + v61) + 2 * *(__int16 *)((char *)&pIndoor->pSectors->uNumFloors + v61); ++sDepthb ) { @@ -11715,7 +11715,7 @@ v89 = 116 * v87; v162 = 0; v112 = v89; - if ( *(__int16 *)((char *)&pIndoor->pSectors->field_C + v89) + if ( *(__int16 *)((char *)&pIndoor->pSectors->uNumWalls + v89) + 2 * *(__int16 *)((char *)&pIndoor->pSectors->uNumFloors + v89) > 0 ) break; LABEL_148: @@ -11795,7 +11795,7 @@ LABEL_145: v88 = pIndoor->pSectors; ++v162; - if ( v162 >= *(__int16 *)((char *)&pIndoor->pSectors->field_C + v89) + if ( v162 >= *(__int16 *)((char *)&pIndoor->pSectors->uNumWalls + v89) + 2 * *(__int16 *)((char *)&pIndoor->pSectors->uNumFloors + v89) ) goto LABEL_148; } @@ -16248,79 +16248,161 @@ } pEventTimer->Pause(); - if ( pCurrentScreen <= SCREEN_CHEST ) - { - if ( pCurrentScreen == SCREEN_CHEST ) - { - // __debugbreak(); - if ( !pPlayers[uActiveCharacter]->CanAct() ) - { - sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[427],//%s не в состоянии %s - pPlayers[uActiveCharacter]->pName, pGlobalTXT_LocalizationStrings[541]);//Опознать предметы - pWindow.Hint = pTmpBuf; - pWindow.uFrameWidth = 384; - pWindow.uFrameHeight = 180; - pWindow.uFrameY = 40; - if ( (signed int)pX <= 320 ) - v10 = pX + 30; - else - v10 = pX - 414; - pWindow.uFrameX = v10; - pWindow.DrawMessageBox(0); - goto LABEL_132; - } - v9 = pX + pSRZBufferLineOffsets[pY]; - if ( !(pRenderer->pActiveZBuffer[v9] & 0xFFFF) ) - goto LABEL_132; - v8 = (ItemGen *)(&pOtherOverlayList->pOverlays[49].field_4 + 2662 * (unsigned int)pChestWindow->ptr_1C + 18* *((short *)&pChests[0].igChestItems[139].uExpireTime - + (pRenderer->pActiveZBuffer[v9] & 0xFFFF) + 2662 * (unsigned int)pChestWindow->ptr_1C + 3)); - } - else - { - if ( pCurrentScreen ) - { - if ( pCurrentScreen != SCREEN_BOOKS ) - { - if ( pCurrentScreen != SCREEN_CHARACTERS ) - { - if ( pCurrentScreen == SCREEN_SPELL_BOOK ) - { - if ( dword_507B00_spell_info_to_draw_in_popup ) - DrawSpellDescriptionPopup(dword_507B00_spell_info_to_draw_in_popup - 1); - } - goto LABEL_132; - } -LABEL_119: - if ( (signed int)pX > 467 && pCurrentScreen != SCREEN_E ) - { - identify_item(); - goto LABEL_132; - } - if ( (signed int)pY >= 345 ) - goto LABEL_132; - if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 100 )//2DEvent - CharacerScreenStats - { - CharacterUI_StatsTab_ShowHint(); - goto LABEL_132; - } - if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 101 )//2DEvent - CharacerScreenSkills - { - CharacterUI_SkillsTab_ShowHint(); - goto LABEL_132; - } - v11 = pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 103;//2DEvent - CharacerScreenInventory - if ( !v11 ) - goto LABEL_132; - identify_item(); - goto LABEL_132; - } + + switch(pCurrentScreen) + { + case SCREEN_CASTING: + { + identify_item(); + break; + } + + case SCREEN_CHEST: + { + if ( !pPlayers[uActiveCharacter]->CanAct() ) + { + sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[427],//%s не в состоянии %s + pPlayers[uActiveCharacter]->pName, pGlobalTXT_LocalizationStrings[541]);//Опознать предметы + pWindow.Hint = pTmpBuf; + pWindow.uFrameWidth = 384; + pWindow.uFrameHeight = 180; + pWindow.uFrameY = 40; + if ( (signed int)pX <= 320 ) + v10 = pX + 30; + else + v10 = pX - 414; + pWindow.uFrameX = v10; + pWindow.DrawMessageBox(0); + } + else + { + v9 = pX + pSRZBufferLineOffsets[pY]; + if ( pRenderer->pActiveZBuffer[v9] & 0xFFFF ) + { + v8 = (ItemGen *)(&pOtherOverlayList->pOverlays[49].field_4 + 2662 * (unsigned int)pChestWindow->ptr_1C + 18* *((short *)&pChests[0].igChestItems[139].uExpireTime + + (pRenderer->pActiveZBuffer[v9] & 0xFFFF) + 2662 * (unsigned int)pChestWindow->ptr_1C + 3)); + GameUI_DrawItemInfo(v8); + } + } + break; + } + case SCREEN_GAME: + { + if (GetCurrentMenuID() > 0) + break; + + if ( (signed int)pY > (signed int)pViewport->uViewportW ) + { + pWindow.ptr_1C = (void *)((signed int)pX / 118); + if ( (signed int)pX / 118 < 4 ) + { + pWindow.Hint = 0; + pWindow.uFrameWidth = 400; + pWindow.uFrameHeight = 200; + pWindow.uFrameX = 38; + pWindow.uFrameY = 60; + pAudioPlayer->StopChannels(-1, -1); + pWindow.DrawQuickCharRecord(); + } + } + else if ( (signed int)pX > (signed int)pViewport->uViewportZ ) + { + if ( (signed int)pY >= 130 ) + { + if ( (signed int)pX >= 476 && (signed int)pX <= 636 && (signed int)pY >= 240 && (signed int)pY <= 300 ) + { + pWindow.Hint = 0; + pWindow.uFrameWidth = 400; + pWindow.uFrameHeight = 200; + pWindow.uFrameX = 38; + pWindow.uFrameY = 60; + pAudioPlayer->StopChannels(-1, -1); + pWindow._41D73D_draw_buff_tooltip(); + } + else if ( (signed int)pX < 485 || (signed int)pX > 548 || (signed int)pY < 156 || (signed int)pY > 229 ) + { + if (!( (signed int)pX < 566 || (signed int)pX > 629 || (signed int)pY < 156 || (signed int)pY > 229 )) + { + pAudioPlayer->StopChannels(-1, -1); + v3 = (void *)1; + } + else + { + sub_416B01(v3); + } + } + else + { + pAudioPlayer->StopChannels(-1, -1); + v3 = 0; + sub_416B01(v3); + } + } + else + { + pWindow.Hint = _4443D5_GetMinimapRightClickText(); + pWindow.uFrameWidth = 256; + pWindow.uFrameX = 130; + pWindow.uFrameY = 140; + pWindow.uFrameHeight = 64; + pAudioPlayer->StopChannels(-1, -1); + pWindow.DrawMessageBox(0); + } + } + else + { + pWindow.Hint = 0; + pWindow.uFrameWidth = 320; + pWindow.uFrameHeight = 320; + v4 = pX - 350; + if ( (signed int)pX <= 320 ) + v4 = pX + 30; + pWindow.uFrameX = v4; + pWindow.uFrameY = 40; + if ( pRenderer->pRenderD3D ) + LOWORD(v5) = pGame->pVisInstance->get_picked_object_zbuf_val(); + else + v5 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; + v6 = (unsigned __int16)v5; + if ( (v6 & 7) != OBJECT_Item) + { + if ( (v6 & 7) == OBJECT_Actor) + { + if ( pRenderer->uNumSceneBegins ) + { + pWindow.DrawMessageBox(1); + MonsterPopup_Draw(v6 >> 3, &pWindow); + } + else + { + pRenderer->BeginScene(); + pWindow.DrawMessageBox(1); + MonsterPopup_Draw(v6 >> 3, &pWindow); + pRenderer->EndScene(); + } + } + } + else + { + v7 = v6 >> 3; + if ( ! (pObjectList->pObjects[pSpriteObjects[v7].uObjectDescID].uFlags & 0x10 ) ) + { + v8 = &pSpriteObjects[v7].stru_24; + GameUI_DrawItemInfo(v8); + } + } + } + break; + } + case SCREEN_BOOKS: + { if ( !dword_506364 || (signed int)pX < (signed int)pViewport->uViewportX || (signed int)pX > (signed int)pViewport->uViewportZ || (signed int)pY < (signed int)pViewport->uViewportY || (signed int)pY > (signed int)pViewport->uViewportW || (v2 = (char *)sub_444564(), (pWindow.Hint = v2) == 0) ) - goto LABEL_132; + break; v30 = (double)(pFontArrus->GetLineWidth(v2) + 32); v27 = v30 + 6.7553994e15; v29 = (char *)LODWORD(v27); @@ -16330,205 +16412,137 @@ pWindow.uFrameHeight = 64; pAudioPlayer->StopChannels(-1, -1); pWindow.DrawMessageBox(0); - goto LABEL_132; - } - if (GetCurrentMenuID() > 0) - goto LABEL_132; - - if ( (signed int)pY > (signed int)pViewport->uViewportW ) - { - pWindow.ptr_1C = (void *)((signed int)pX / 118); - if ( (signed int)pX / 118 < 4 ) - { - pWindow.Hint = 0; - pWindow.uFrameWidth = 400; - pWindow.uFrameHeight = 200; - pWindow.uFrameX = 38; - pWindow.uFrameY = 60; - pAudioPlayer->StopChannels(-1, -1); - pWindow.DrawQuickCharRecord(); - } - goto LABEL_132; - } - if ( (signed int)pX > (signed int)pViewport->uViewportZ ) - { - if ( (signed int)pY >= 130 ) - { - if ( (signed int)pX >= 476 && (signed int)pX <= 636 && (signed int)pY >= 240 && (signed int)pY <= 300 ) - { - pWindow.Hint = 0; - pWindow.uFrameWidth = 400; - pWindow.uFrameHeight = 200; - pWindow.uFrameX = 38; - pWindow.uFrameY = 60; - pAudioPlayer->StopChannels(-1, -1); - pWindow._41D73D_draw_buff_tooltip(); - goto LABEL_132; - } - if ( (signed int)pX < 485 || (signed int)pX > 548 || (signed int)pY < 156 || (signed int)pY > 229 ) - { - if ( (signed int)pX < 566 || (signed int)pX > 629 || (signed int)pY < 156 || (signed int)pY > 229 ) - goto LABEL_132; - pAudioPlayer->StopChannels(-1, -1); - v3 = (void *)1; - } - else - { - pAudioPlayer->StopChannels(-1, -1); - v3 = 0; - } - sub_416B01(v3); - goto LABEL_132; - } - pWindow.Hint = _4443D5_GetMinimapRightClickText(); - pWindow.uFrameWidth = 256; - pWindow.uFrameX = 130; - pWindow.uFrameY = 140; - pWindow.uFrameHeight = 64; - pAudioPlayer->StopChannels(-1, -1); - pWindow.DrawMessageBox(0); - goto LABEL_132; - } - pWindow.Hint = 0; - pWindow.uFrameWidth = 320; - pWindow.uFrameHeight = 320; - v4 = pX - 350; - if ( (signed int)pX <= 320 ) - v4 = pX + 30; - pWindow.uFrameX = v4; - pWindow.uFrameY = 40; - if ( pRenderer->pRenderD3D ) - LOWORD(v5) = pGame->pVisInstance->get_picked_object_zbuf_val(); - else - v5 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; - v6 = (unsigned __int16)v5; - if ( (v6 & 7) != OBJECT_Item) - { - if ( (v6 & 7) == OBJECT_Actor) - { - if ( pRenderer->uNumSceneBegins ) - { - pWindow.DrawMessageBox(1); - MonsterPopup_Draw(v6 >> 3, &pWindow); - } - else - { - pRenderer->BeginScene(); - pWindow.DrawMessageBox(1); - MonsterPopup_Draw(v6 >> 3, &pWindow); - pRenderer->EndScene(); - } - } - goto LABEL_132; - } - v7 = v6 >> 3; - if ( pObjectList->pObjects[pSpriteObjects[v7].uObjectDescID].uFlags & 0x10 ) - goto LABEL_132; - v8 = &pSpriteObjects[v7].stru_24; - } - GameUI_DrawItemInfo(v8); - goto LABEL_132; - } - if ( pCurrentScreen == SCREEN_HOUSE ) - { - if ( (signed int)pY < 345 && (signed int)pX < 469 ) - sub_4B1A2D();//identify item in inventory - goto LABEL_132; - } - if ( pCurrentScreen <= SCREEN_HOUSE ) - goto LABEL_132; - if ( pCurrentScreen <= SCREEN_F ) - goto LABEL_119; - if ( pCurrentScreen != SCREEN_PARTY_CREATION ) - { - v11 = pCurrentScreen == SCREEN_CASTING; - if ( !v11 ) - goto LABEL_132; - identify_item(); - goto LABEL_132; - } - pWindow.Hint = 0; - pStr = 0; - for ( pButton = pGUIWindow_CurrentMenu->pControlsHead; pButton; pButton = pButton->pNext) - { - if ( pButton->uButtonType == 1 && pButton->uButtonType != 3 && (signed int)pX > (signed int)pButton->uX && (signed int)pX < (signed int)pButton->uZ - && (signed int)pY > (signed int)pButton->uY && (signed int)pY < (signed int)pButton->uW ) - { - pControlID = pButton->uControlID; - switch ( pControlID ) - { - case 0: //stats info - pWindow.Hint = pAttributeDescriptions[(signed int)pButton->uControlParam % 7]; - pStr = aAttributeNames[(signed int)pButton->uControlParam % 7]; - break; - case 62: //Plus button info - pStr = pGlobalTXT_LocalizationStrings[670];//Добавить - pWindow.Hint = pGlobalTXT_LocalizationStrings[671];//"Добавляет очко к выделенному навыку, забирая его из накопителя очков" - break; - case 63: //Minus button info - pStr = pGlobalTXT_LocalizationStrings[668];//Вычесть - pWindow.Hint = pGlobalTXT_LocalizationStrings[669];//"Вычитает очко из выделенного навыка, возвращая его в накопитель очков" - break; - case 64: //Available skill button info - v18 = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(pButton->uControlParam + 4); - pStr = pSkillNames[v18]; - pWindow.Hint = pSkillDesc[v18]; - break; - case 65: //Available Class Info - pWindow.Hint = pClassDescriptions[pButton->uControlParam]; - pStr = pClassNames[pButton->uControlParam]; - break; - case 66: //OK Info - pWindow.Hint = pGlobalTXT_LocalizationStrings[664];//Щелкните здесь для утверждения состава отряда и продолжения игры. - pStr = pGlobalTXT_LocalizationStrings[665];//Кнопка ОК - break; - case 67: //Clear info - pWindow.Hint = pGlobalTXT_LocalizationStrings[666];//Сбрасывает все параметры и навыки отряда. - pStr = pGlobalTXT_LocalizationStrings[667];//Кнопка Очистить - break; - case 118: // Character info - pStr = pParty->pPlayers[pButton->uControlParam].pName; - pWindow.Hint = pClassDescriptions[pParty->pPlayers[pButton->uControlParam].classType]; - break; - } - if ( pControlID > 68 && pControlID <= 75 ) //Sellected skills info - { - pSkillId = pParty->pPlayers[pButton->uControlParam].GetSkillIdxByOrder(pControlID - 72); - pY = 0; - if ( (signed int)pSkillId < 37 ) - { - pSkillInfo = CharacterUI_GetSkillDescText(pButton->uControlParam, (enum PLAYER_SKILL_TYPE)pSkillId); - strcpy(pTmpBuf2, pSkillInfo); - pWindow.Hint = pTmpBuf2; - pStr = pSkillNames[pSkillId]; - } - } - } - } - if ( pWindow.Hint ) - { - pHint = pWindow.Hint; - pWindow.Hint = 0; - pWindow.uFrameWidth = 384; - pWindow.uFrameHeight = 256; - pWindow.uFrameX = 128; - pWindow.uFrameY = 40; - pWindow.uFrameHeight = pFontSmallnum->CalcTextHeight(pHint, &pWindow, 24, 0) + 2 * LOBYTE(pFontLucida->uFontHeight) + 24; - pWindow.uFrameZ = pWindow.uFrameX + pWindow.uFrameWidth - 1; - pWindow.uFrameW = pWindow.uFrameY + pWindow.uFrameHeight - 1; - pWindow.DrawMessageBox(0); - pWindow.uFrameX += 12; - pWindow.uFrameWidth -= 24; - pWindow.uFrameY += 12; - pWindow.uFrameHeight -= 12; - pWindow.uFrameZ = pWindow.uFrameX + pWindow.uFrameWidth - 1; - pWindow.uFrameW = pWindow.uFrameY + pWindow.uFrameHeight - 1; - pColor = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFF, 0xFF, 0x9B); - sprintf(pTmpBuf, format_4E2D80, pColor, pStr);//"\f%05d%s\f00000\n" - pWindow.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf, 3); - pWindow.DrawText(pFontSmallnum, 1, pFontLucida->uFontHeight, 0, pHint, 0, 0, 0); - } -LABEL_132: + break; + } + case SCREEN_CHARACTERS: + case SCREEN_E: + case SCREEN_F: + { + if ( (signed int)pX > 467 && pCurrentScreen != SCREEN_E ) + { + identify_item(); + } + else if ( (signed int)pY >= 345 ) + break; + else if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 100 )//2DEvent - CharacerScreenStats + { + CharacterUI_StatsTab_ShowHint(); + } + else if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 101 )//2DEvent - CharacerScreenSkills + { + CharacterUI_SkillsTab_ShowHint(); + } + else + { + v11 = pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 103;//2DEvent - CharacerScreenInventory + if ( v11 ) + identify_item(); + } + break; + } + case SCREEN_SPELL_BOOK: + { + if ( dword_507B00_spell_info_to_draw_in_popup ) + DrawSpellDescriptionPopup(dword_507B00_spell_info_to_draw_in_popup - 1); + break; + } + case SCREEN_HOUSE: + { + if ( (signed int)pY < 345 && (signed int)pX < 469 ) + sub_4B1A2D();//identify item in inventory + break; + } + + case SCREEN_PARTY_CREATION: + { + pWindow.Hint = 0; + pStr = 0; + for ( pButton = pGUIWindow_CurrentMenu->pControlsHead; pButton; pButton = pButton->pNext) + { + if ( pButton->uButtonType == 1 && pButton->uButtonType != 3 && (signed int)pX > (signed int)pButton->uX && (signed int)pX < (signed int)pButton->uZ + && (signed int)pY > (signed int)pButton->uY && (signed int)pY < (signed int)pButton->uW ) + { + pControlID = pButton->uControlID; + switch ( pControlID ) + { + case 0: //stats info + pWindow.Hint = pAttributeDescriptions[(signed int)pButton->uControlParam % 7]; + pStr = aAttributeNames[(signed int)pButton->uControlParam % 7]; + break; + case 62: //Plus button info + pStr = pGlobalTXT_LocalizationStrings[670];//Добавить + pWindow.Hint = pGlobalTXT_LocalizationStrings[671];//"Добавляет очко к выделенному навыку, забирая его из накопителя очков" + break; + case 63: //Minus button info + pStr = pGlobalTXT_LocalizationStrings[668];//Вычесть + pWindow.Hint = pGlobalTXT_LocalizationStrings[669];//"Вычитает очко из выделенного навыка, возвращая его в накопитель очков" + break; + case 64: //Available skill button info + v18 = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(pButton->uControlParam + 4); + pStr = pSkillNames[v18]; + pWindow.Hint = pSkillDesc[v18]; + break; + case 65: //Available Class Info + pWindow.Hint = pClassDescriptions[pButton->uControlParam]; + pStr = pClassNames[pButton->uControlParam]; + break; + case 66: //OK Info + pWindow.Hint = pGlobalTXT_LocalizationStrings[664];//Щелкните здесь для утверждения состава отряда и продолжения игры. + pStr = pGlobalTXT_LocalizationStrings[665];//Кнопка ОК + break; + case 67: //Clear info + pWindow.Hint = pGlobalTXT_LocalizationStrings[666];//Сбрасывает все параметры и навыки отряда. + pStr = pGlobalTXT_LocalizationStrings[667];//Кнопка Очистить + break; + case 118: // Character info + pStr = pParty->pPlayers[pButton->uControlParam].pName; + pWindow.Hint = pClassDescriptions[pParty->pPlayers[pButton->uControlParam].classType]; + break; + } + if ( pControlID > 68 && pControlID <= 75 ) //Sellected skills info + { + pSkillId = pParty->pPlayers[pButton->uControlParam].GetSkillIdxByOrder(pControlID - 72); + pY = 0; + if ( (signed int)pSkillId < 37 ) + { + pSkillInfo = CharacterUI_GetSkillDescText(pButton->uControlParam, (enum PLAYER_SKILL_TYPE)pSkillId); + strcpy(pTmpBuf2, pSkillInfo); + pWindow.Hint = pTmpBuf2; + pStr = pSkillNames[pSkillId]; + } + } + } + } + if ( pWindow.Hint ) + { + pHint = pWindow.Hint; + pWindow.Hint = 0; + pWindow.uFrameWidth = 384; + pWindow.uFrameHeight = 256; + pWindow.uFrameX = 128; + pWindow.uFrameY = 40; + pWindow.uFrameHeight = pFontSmallnum->CalcTextHeight(pHint, &pWindow, 24, 0) + 2 * LOBYTE(pFontLucida->uFontHeight) + 24; + pWindow.uFrameZ = pWindow.uFrameX + pWindow.uFrameWidth - 1; + pWindow.uFrameW = pWindow.uFrameY + pWindow.uFrameHeight - 1; + pWindow.DrawMessageBox(0); + pWindow.uFrameX += 12; + pWindow.uFrameWidth -= 24; + pWindow.uFrameY += 12; + pWindow.uFrameHeight -= 12; + pWindow.uFrameZ = pWindow.uFrameX + pWindow.uFrameWidth - 1; + pWindow.uFrameW = pWindow.uFrameY + pWindow.uFrameHeight - 1; + pColor = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFF, 0xFF, 0x9B); + sprintf(pTmpBuf, format_4E2D80, pColor, pStr);//"\f%05d%s\f00000\n" + pWindow.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf, 3); + pWindow.DrawText(pFontSmallnum, 1, pFontLucida->uFontHeight, 0, pHint, 0, 0, 0); + } + break; + } + default: + { + break; + } + } dword_507BF0_is_there_popup_onscreen = 1; viewparams->bRedrawGameUI = 1; }