Mercurial > might-and-magic-trilogy
changeset 152:e27e846bc996
28.11.12
author | Ritor1 |
---|---|
date | Wed, 28 Nov 2012 17:42:03 +0600 |
parents | a8f4a158e284 |
children | 60bb9d93c097 |
files | AudioPlayer.h Party.cpp mm7_4.cpp |
diffstat | 3 files changed, 72 insertions(+), 383 deletions(-) [+] |
line wrap: on
line diff
--- a/AudioPlayer.h Tue Nov 27 17:31:15 2012 +0600 +++ b/AudioPlayer.h Wed Nov 28 17:42:03 2012 +0600 @@ -108,6 +108,21 @@ bPlayerReady(false), b3DSoundInitialized(false), hAILRedbook(nullptr), hStream(nullptr) { + /*AudioPlayer_3DSample *v0; //ecx@1 + signed int v1; //edi@1 + + v0 = p3DSamples; + v1 = 32; + do + { + v0->field_4 = 0; + v0->field_8 = 0; + v0->field_C = 0; + v0->hSample = 0; + ++v0; + --v1; + } + while (v1);*/ uMixerChannels = 16; field_2D0_time_left = 256; uNumRedbookTracks = 0;
--- a/Party.cpp Tue Nov 27 17:31:15 2012 +0600 +++ b/Party.cpp Wed Nov 28 17:42:03 2012 +0600 @@ -377,7 +377,7 @@ uSpellBookPageCount = 0; //pMagicSkills = pPlayers[uNumPlayers].pActiveSkills[12];// Skills //while ( !*(short *)pMagicSkills ) //player[i].skillFire - for (int i = 0; i < 9; i++) + for (int i = 0; i < 9; i++)//for Magic Book { //++uSpellBookPageCount; //pMagicSkills++;
--- a/mm7_4.cpp Tue Nov 27 17:31:15 2012 +0600 +++ b/mm7_4.cpp Wed Nov 28 17:42:03 2012 +0600 @@ -5791,7 +5791,7 @@ if ( pMessageQueue_50CBD0->uNumMessages ) pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; - pAudioPlayer->SetMusicVolume((signed __int64)(pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0)); + pAudioPlayer->SetMusicVolume((signed __int64)(pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0));// ?? ++pIcons_LOD->uTexturePacksCount; if ( !pIcons_LOD->uNumPrevLoadedFiles ) pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; @@ -5812,7 +5812,7 @@ pTexture_MAKETOP = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("MAKETOP", TEXTURE_16BIT_PALETTE)]; uX = 0; pTexture_MAKESKY = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("MAKESKY", TEXTURE_16BIT_PALETTE)]; - do + do // load PlayerPortraits texture { sprintf(pTmpBuf, "%s01", pPlayerPortraitsNames[uX]); v1 = pIcons_LOD->LoadTexture(pTmpBuf, TEXTURE_16BIT_PALETTE); @@ -5847,231 +5847,30 @@ ++uControlParama; } while ( (signed int)uXa < 640 ); - pCreationUI_BtnPressLeft[0] = pGUIWindow_CurrentMenu->CreateButton(10u, 32u, 11u, 13u, 1, 0, 0xABu, 0, 0, "", pTexture_presleft, 0); - pCreationUI_BtnPressLeft[1] = pGUIWindow_CurrentMenu->CreateButton(169u, 32u, 11u, 13u, 1, 0, 0xABu, 1u, 0, "", pTexture_presleft, 0); - pCreationUI_BtnPressLeft[2] = pGUIWindow_CurrentMenu->CreateButton( - 327u, - 32u, - 11u, - 13u, - 1, - 0, - 0xABu, - 2u, - 0, - "", - pTexture_presleft, - 0); - pCreationUI_BtnPressLeft[3] = pGUIWindow_CurrentMenu->CreateButton( - 486u, - 32u, - 11u, - 13u, - 1, - 0, - 0xABu, - 3u, - 0, - "", - pTexture_presleft, - 0); - pCreationUI_BtnPressRight[0] = pGUIWindow_CurrentMenu->CreateButton( - 74u, - 32u, - 11u, - 13u, - 1, - 0, - 0xACu, - 0, - 0, - "", - pTexture_pressrigh, - 0); - pCreationUI_BtnPressRight[1] = pGUIWindow_CurrentMenu->CreateButton( - 233u, - 32u, - 11u, - 13u, - 1, - 0, - 0xACu, - 1u, - 0, - "", - pTexture_pressrigh, - 0); - pCreationUI_BtnPressRight[2] = pGUIWindow_CurrentMenu->CreateButton( - 391u, - 32u, - 11u, - 13u, - 1, - 0, - 0xACu, - 2u, - 0, - "", - pTexture_pressrigh, - 0); - pCreationUI_BtnPressRight[3] = pGUIWindow_CurrentMenu->CreateButton( - 549u, - 32u, - 11u, - 13u, - 1, - 0, - 0xACu, - 3u, - 0, - "", - pTexture_pressrigh, - 0); - pCreationUI_BtnPressLeft2[0] = pGUIWindow_CurrentMenu->CreateButton( - 10u, - 103u, - 11u, - 13u, - 1, - 0, - 0x90u, - 0, - 0, - "", - pTexture_presleft, - 0); - pCreationUI_BtnPressLeft2[1] = pGUIWindow_CurrentMenu->CreateButton( - 169u, - 103u, - 11u, - 13u, - 1, - 0, - 0x90u, - 1u, - 0, - "", - pTexture_presleft, - 0); - pCreationUI_BtnPressLeft2[2] = pGUIWindow_CurrentMenu->CreateButton( - 327u, - 103u, - 11u, - 13u, - 1, - 0, - 0x90u, - 2u, - 0, - "", - pTexture_presleft, - 0); - pCreationUI_BtnPressLeft2[3] = pGUIWindow_CurrentMenu->CreateButton( - 486u, - 103u, - 11u, - 13u, - 1, - 0, - 0x90u, - 3u, - 0, - "", - pTexture_presleft, - 0); - pCreationUI_BtnPressRight2[0] = pGUIWindow_CurrentMenu->CreateButton( - 74u, - 103u, - 11u, - 13u, - 1, - 0, - 0x91u, - 0, - 0, - "", - pTexture_pressrigh, - 0); - pCreationUI_BtnPressRight2[1] = pGUIWindow_CurrentMenu->CreateButton( - 233u, - 103u, - 11u, - 13u, - 1, - 0, - 0x91u, - 1u, - 0, - "", - pTexture_pressrigh, - 0); - pCreationUI_BtnPressRight2[2] = pGUIWindow_CurrentMenu->CreateButton( - 391u, - 103u, - 11u, - 13u, - 1, - 0, - 0x91u, - 2u, - 0, - "", - pTexture_pressrigh, - 0); - pCreationUI_BtnPressRight2[3] = pGUIWindow_CurrentMenu->CreateButton( - 549u, - 103u, - 11u, - 13u, - 1, - 0, - 0x91u, - 3u, - 0, - "", - pTexture_pressrigh, - 0); + pCreationUI_BtnPressLeft[0] = pGUIWindow_CurrentMenu->CreateButton(10, 32, 11, 13, 1, 0, 0xABu, 0, 0, "", pTexture_presleft, 0); + pCreationUI_BtnPressLeft[1] = pGUIWindow_CurrentMenu->CreateButton(169, 32, 11, 13, 1, 0, 0xABu, 1, 0, "", pTexture_presleft, 0); + pCreationUI_BtnPressLeft[2] = pGUIWindow_CurrentMenu->CreateButton(327, 32, 11, 13, 1, 0, 0xABu, 2, 0, "", pTexture_presleft, 0); + pCreationUI_BtnPressLeft[3] = pGUIWindow_CurrentMenu->CreateButton(486, 32, 11, 13, 1, 0, 0xABu, 3, 0, "", pTexture_presleft, 0); + pCreationUI_BtnPressRight[0] = pGUIWindow_CurrentMenu->CreateButton(74, 32, 11, 13, 1, 0, 0xACu, 0, 0, "", pTexture_pressrigh, 0); + pCreationUI_BtnPressRight[1] = pGUIWindow_CurrentMenu->CreateButton(233, 32, 11, 13, 1, 0, 0xACu, 1, 0, "", pTexture_pressrigh, 0); + pCreationUI_BtnPressRight[2] = pGUIWindow_CurrentMenu->CreateButton(391, 32, 11, 13, 1, 0, 0xACu, 2, 0, "", pTexture_pressrigh, 0); + pCreationUI_BtnPressRight[3] = pGUIWindow_CurrentMenu->CreateButton(549, 32, 11, 13, 1, 0, 0xACu, 3, 0, "", pTexture_pressrigh, 0); + pCreationUI_BtnPressLeft2[0] = pGUIWindow_CurrentMenu->CreateButton(10, 103, 11, 13, 1, 0, 0x90u, 0, 0, "", pTexture_presleft, 0); + pCreationUI_BtnPressLeft2[1] = pGUIWindow_CurrentMenu->CreateButton(169, 103, 11, 13, 1, 0, 0x90u, 1, 0, "", pTexture_presleft, 0); + pCreationUI_BtnPressLeft2[2] = pGUIWindow_CurrentMenu->CreateButton(327, 103, 11, 13, 1, 0, 0x90u, 2, 0, "", pTexture_presleft, 0); + pCreationUI_BtnPressLeft2[3] = pGUIWindow_CurrentMenu->CreateButton(486, 103, 11, 13, 1, 0, 0x90u, 3, 0, "", pTexture_presleft, 0); + pCreationUI_BtnPressRight2[0] = pGUIWindow_CurrentMenu->CreateButton(74, 103, 11, 13, 1, 0, 0x91u, 0, 0, "", pTexture_pressrigh, 0); + pCreationUI_BtnPressRight2[1] = pGUIWindow_CurrentMenu->CreateButton(233, 103, 11, 13, 1, 0, 0x91u, 1, 0, "", pTexture_pressrigh, 0); + pCreationUI_BtnPressRight2[2] = pGUIWindow_CurrentMenu->CreateButton(391, 103, 11, 13, 1, 0, 0x91u, 2, 0, "", pTexture_pressrigh, 0); + pCreationUI_BtnPressRight2[3] = pGUIWindow_CurrentMenu->CreateButton(549, 103, 11, 13, 1, 0, 0x91u, 3, 0, "", pTexture_pressrigh, 0); uControlParamb = 0; uXb = 8; do { - pGUIWindow_CurrentMenu->CreateButton(uXb, 308u, 150u, v0, 1, 0, 0x48u, uControlParamb, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton( - uXb, - v0 + 308, - 150u, - v0, - 1, - 0, - 0x49u, - uControlParamb, - 0, - "", - 0); - pGUIWindow_CurrentMenu->CreateButton( - uXb, - 2 * v0 + 308, - 150u, - v0, - 1, - 0, - 0x4Au, - uControlParamb, - 0, - "", - 0); - pGUIWindow_CurrentMenu->CreateButton( - uXb, - 3 * v0 + 308, - 150u, - v0, - 1, - 0, - 0x4Bu, - uControlParamb, - 0, - "", - 0); + pGUIWindow_CurrentMenu->CreateButton(uXb, 308, 150, v0, 1, 0, 0x48u, uControlParamb, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(uXb, v0 + 308, 150, v0, 1, 0, 0x49u, uControlParamb, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(uXb, 2 * v0 + 308, 150u, v0, 1, 0, 0x4Au, uControlParamb, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(uXb, 3 * v0 + 308, 150u, v0, 1, 0, 0x4Bu, uControlParamb, 0, "", 0); uXb += 158; ++uControlParamb; } @@ -6084,166 +5883,44 @@ uControlParamc = 2; do { - pGUIWindow_CurrentMenu->CreateButton(uXc, 169u, 120u, 20u, 1, 0, 0, uControlParamc - 2, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton( - uXc, - v0 + 169, - 120u, - 20u, - 1, - 0, - 0, - uControlParamc - 1, - 0, - "", - 0); - pGUIWindow_CurrentMenu->CreateButton( - uXc, - 2 * v0 + 169, - 120u, - 20u, - 1, - 0, - 0, - uControlParamc, - 0, - "", - 0); - pGUIWindow_CurrentMenu->CreateButton( - uXc, - 3 * v0 + 169, - 120u, - 20u, - 1, - 0, - 0, - uControlParamc + 1, - 0, - "", - 0); - pGUIWindow_CurrentMenu->CreateButton( - uXc, - 4 * v0 + 169, - 120u, - 20u, - 1, - 0, - 0, - uControlParamc + 2, - 0, - "", - 0); - pGUIWindow_CurrentMenu->CreateButton( - uXc, - 5 * v0 + 169, - 120u, - 20u, - 1, - 0, - 0, - uControlParamc + 3, - 0, - "", - 0); - pGUIWindow_CurrentMenu->CreateButton( - uXc, - 6 * v0 + 169, - 120u, - 20u, - 1, - 0, - 0, - uControlParamc + 4, - 0, - "", - 0); + pGUIWindow_CurrentMenu->CreateButton(uXc, 169, 120, 20, 1, 0, 0, uControlParamc - 2, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(uXc, v0 + 169, 120, 20, 1, 0, 0, uControlParamc - 1, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(uXc, 2 * v0 + 169, 120, 20, 1, 0, 0, uControlParamc, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(uXc, 3 * v0 + 169, 120, 20, 1, 0, 0, uControlParamc + 1, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(uXc, 4 * v0 + 169, 120, 20, 1, 0, 0, uControlParamc + 2, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(uXc, 5 * v0 + 169, 120, 20, 1, 0, 0, uControlParamc + 3, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(uXc, 6 * v0 + 169, 120, 20, 1, 0, 0, uControlParamc + 4, 0, "", 0); uControlParamc += 7; uXc += 158; } while ( (signed int)uControlParamc < 30 ); pGUIWindow_CurrentMenu->_41D08F(28, 0, 7, 40); - pGUIWindow_CurrentMenu->CreateButton(323u, 417u, 65u, v0, 1, 0, 0x41u, 0, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(323u, v0 + 417, 65u, v0, 1, 0, 0x41u, 0xCu, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(323u, 2 * v0 + 417, 65u, v0, 1, 0, 0x41u, 0x14u, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(388u, 417u, 65u, v0, 1, 0, 0x41u, 0x18u, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(388u, v0 + 417, 65u, v0, 1, 0, 0x41u, 0x1Cu, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(388u, 2 * v0 + 417, 65u, v0, 1, 0, 0x41u, 0x20u, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(453u, 417u, 65u, v0, 1, 0, 0x41u, 0x10u, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(453u, v0 + 417, 65u, v0, 1, 0, 0x41u, 8u, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(453u, 2 * v0 + 417, 65u, v0, 1, 0, 0x41u, 4u, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(323, 417, 65, v0, 1, 0, 0x41, 0, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(323, v0 + 417, 65, v0, 1, 0, 0x41, 0xC, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(323, 2 * v0 + 417, 65, v0, 1, 0, 0x41, 0x14, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(388, 417, 65, v0, 1, 0, 0x41, 0x18, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(388, v0 + 417, 65, v0, 1, 0, 0x41, 0x1C, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(388, 2 * v0 + 417, 65, v0, 1, 0, 0x41, 0x20, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(453, 417, 65, v0, 1, 0, 0x41, 0x10, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(453, v0 + 417, 65, v0, 1, 0, 0x41, 8, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(453, 2 * v0 + 417, 65, v0, 1, 0, 0x41, 4, 0, "", 0); uControlParamd = 0; do { uXd = -5; if ( uControlParamd <= 3 ) uXd = 0; - pGUIWindow_CurrentMenu->CreateButton( - 100 * (uControlParamd / 3) + uXd + 17, - v0 * (uControlParamd % 3) + 417, - 100u, - v0, - 1, - 0, - 0x40u, - uControlParamd, - 0, - "", - 0); + pGUIWindow_CurrentMenu->CreateButton(100 * (uControlParamd / 3) + uXd + 17, v0 * (uControlParamd % 3) + 417, 100, v0, 1, 0, 0x40, + uControlParamd, 0, "", 0); ++uControlParamd; } while ( uControlParamd < 9 ); - pPlayerCreationUI_BtnOK = pGUIWindow_CurrentMenu->CreateButton( - 580u, - 431u, - 51u, - 39u, - 1, - 0, - 0x42u, - 0, - 0xDu, - "", - (Texture *)(uTextureID_BUTTMAKE != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTMAKE] : 0), - 0); - pPlayerCreationUI_BtnReset = pGUIWindow_CurrentMenu->CreateButton( - 527u, - 431u, - 51u, - 39u, - 1, - 0, - 0x43u, - 0, - 0x43u, - "", - (Texture *)(uTextureID_BUTTMAKE2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTMAKE2] : 0), - 0); - pPlayerCreationUI_BtnMinus = pGUIWindow_CurrentMenu->CreateButton( - 523u, - 393u, - 20u, - 35u, - 1, - 0, - 0x3Fu, - 0, - 0x2Du, - "", - pTexture_buttminu, - 0); - pPlayerCreationUI_BtnPlus = pGUIWindow_CurrentMenu->CreateButton( - 613u, - 393u, - 20u, - 35u, - 1, - 0, - 0x3Eu, - 1u, - 0x2Bu, - "", - pTexture_buttplus, - 0); + pPlayerCreationUI_BtnOK = pGUIWindow_CurrentMenu->CreateButton(580, 431, 51, 39, 1, 0, 0x42, 0, 0xD, "", + (Texture *)(uTextureID_BUTTMAKE != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTMAKE] : 0), 0); + pPlayerCreationUI_BtnReset = pGUIWindow_CurrentMenu->CreateButton(527, 431, 51, 39, 1, 0, 0x43, 0, 0x43, "", + (Texture *)(uTextureID_BUTTMAKE2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTMAKE2] : 0), 0); + pPlayerCreationUI_BtnMinus = pGUIWindow_CurrentMenu->CreateButton(523, 393, 20, 35, 1, 0, 0x3F, 0, 0x2D, "", pTexture_buttminu, 0); + pPlayerCreationUI_BtnPlus = pGUIWindow_CurrentMenu->CreateButton(613, 393, 20, 35, 1, 0, 0x3E, 1, 0x2B, "", pTexture_buttplus, 0); pFontCChar = LoadFont("cchar.fnt", "FONTPAL", 0); } // 4E28F8: using guessed type int pCurrentScreen; @@ -6263,7 +5940,7 @@ unsigned int v2; // ecx@3 LONG uMouseX; // edi@6 LONG uMouseY; // eax@6 - GUIButton *v5; // edx@6 + GUIButton *pControlsHead; // edx@6 unsigned int v6; // ecx@7 int v7; // esi@12 signed int v8; // edi@30 @@ -6303,21 +5980,18 @@ pAsyncMouse->_46B736_consume_click_lists(1); uMouseX = pMouse->GetCursorPos(&v24)->x; uMouseY = pMouse->GetCursorPos(&v25)->y; - v5 = pGUIWindow_CurrentMenu->pControlsHead; - if ( v5 != (GUIButton *)v1 ) + pControlsHead = pGUIWindow_CurrentMenu->pControlsHead; + if ( pControlsHead != (GUIButton *)v1 ) { v6 = pMessageQueue_50CBD0->uNumMessages; do { - if ( uMouseX >= (signed int)v5->uX //mouse movement - && uMouseX <= (signed int)v5->uZ - && uMouseY >= (signed int)v5->uY - && uMouseY <= (signed int)v5->uW ) - { - v7 = v5->uControlParam; + if ( uMouseX >= (signed int)pControlsHead->uX && uMouseX <= (signed int)pControlsHead->uZ && uMouseY >= (signed int)pControlsHead->uY && uMouseY <= (signed int)pControlsHead->uW )//mouse movement + { + v7 = pControlsHead->uControlParam; if ( (signed int)v6 < 40 ) { - pMessageQueue_50CBD0->pMessages[v6].eType = (UIMessageType)v5->field_1C; + pMessageQueue_50CBD0->pMessages[v6].eType = (UIMessageType)pControlsHead->field_1C; v0 = &pTexture_PCX; pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v7; *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; @@ -6326,9 +6000,9 @@ } v1 = 0; } - v5 = v5->pNext; - } - while ( v5 != (GUIButton *)v1 ); + pControlsHead = pControlsHead->pNext; + } + while ( pControlsHead != (GUIButton *)v1 ); } while ( PeekMessageA(&Msg, (HWND)v1, v1, v1, PM_REMOVE) ) {