Mercurial > might-and-magic-trilogy
diff mm7_4.cpp @ 27:be2066176d89
On level initialization
author | Nomad |
---|---|
date | Tue, 16 Oct 2012 01:31:05 +0200 |
parents | 93bf1d5f6a6d |
children | 4723e86bc51c |
line wrap: on
line diff
--- a/mm7_4.cpp Tue Oct 16 00:05:53 2012 +0200 +++ b/mm7_4.cpp Tue Oct 16 01:31:05 2012 +0200 @@ -2910,52 +2910,38 @@ //----- (00491CB5) -------------------------------------------------------- void __cdecl LoadPlayerPortraintsAndVoices() { - Texture **v0; // ebx@1 - int v1; // eax@2 - int v2; // edi@3 + //Texture **v0; // ebx@1 + //int v1; // eax@2 + //int v2; // edi@3 char *v3; // esi@5 char *v4; // [sp+10h] [bp-4h]@1 pIcons_LOD->dword_011BA0 = pIcons_LOD->uNumLoadedFiles; - v0 = (Texture **)pTextures_PlayerFaces; - v4 = (char *)&pParty->pPlayers[0].uFace; - do - { - v1 = 0; - do - { - v2 = v1 + 1; - sprintfex(pTmpBuf, "%s%02d", pPlayerPortraitsNames[*v4], v1 + 1); - *v0 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pTmpBuf, TEXTURE_16BIT_PALETTE)]; - v1 = v2; - ++v0; - } - while ( v2 < 56 ); - v4 += 6972; - } - while ( (signed int)v4 < (signed int)((char *)&pParty->pPickedItem.uExpireTime + 6) ); - pTexture_PlayerFaceEradicated = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("ERADCATE", TEXTURE_16BIT_PALETTE)]; - pTexture_PlayerFaceDead = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("DEAD", TEXTURE_16BIT_PALETTE)]; - v3 = (char *)&pParty->pPlayers[0].uVoiceID; - pTexture_PlayerFaceMask = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("FACEMASK", TEXTURE_16BIT_PALETTE)]; - do - { - if ( byte_4ED498 ) - { - pSoundList->_4A9A67(2 * ((unsigned __int8)byte_4ED498 + 50 * *(int *)v3) + 4998, 0); - pSoundList->_4A9A67(2 * ((unsigned __int8)byte_4ED498 + 50 * *(int *)v3) + 4999, 0); - } - v3 += 6972; - } - while ( (signed int)v3 < (signed int)&pParty->field_871C[560] ); -} -// 4ED498: using guessed type char byte_4ED498; + + for (uint i = 0; i < 4; ++i) + for (uint j = 0; j < 56; ++j) + { + sprintf(pTmpBuf, "%s%02d", pPlayerPortraitsNames[pParty->pPlayers[i].uFace], j + 1); + pTextures_PlayerFaces[i][j] = pIcons_LOD->LoadTexturePtr(pTmpBuf, TEXTURE_16BIT_PALETTE); + } + + pTexture_PlayerFaceEradicated = pIcons_LOD->LoadTexturePtr("ERADCATE", TEXTURE_16BIT_PALETTE); + pTexture_PlayerFaceDead = pIcons_LOD->LoadTexturePtr("DEAD", TEXTURE_16BIT_PALETTE); + pTexture_PlayerFaceMask = pIcons_LOD->LoadTexturePtr("FACEMASK", TEXTURE_16BIT_PALETTE); + + if (byte_4ED498) + for (uint i = 0; i < 4; ++i) + { + pSoundList->_4A9A67(2 * (byte_4ED498 + 50 * pParty->pPlayers[i].uVoiceID) + 4998, 0); + pSoundList->_4A9A67(2 * (byte_4ED498 + 50 * pParty->pPlayers[i].uVoiceID) + 4999, 0); + } +} //----- (00491DE7) -------------------------------------------------------- int __fastcall ReloadPlayerPortraits(int a1, int a2) { int result; // eax@1 - char **v3; // ebp@1 + const char **v3; // ebp@1 Texture **v4; // ebx@1 int v5; // esi@2 @@ -2973,7 +2959,7 @@ while ( v5 < 56 ); return result; } -// 491DE7: using guessed type int __fastcall ReloadPlayerPortraits(int, int); + //----- (00491E3A) -------------------------------------------------------- void __cdecl sub_491E3A() @@ -15031,7 +15017,7 @@ //----- (00405CFF) -------------------------------------------------------- -void stru262_TurnBased::End(unsigned int bPlaySound) +void stru262_TurnBased::End(bool bPlaySound) { stru262_TurnBased *v2; // edi@1 int v3; // ebx@1