comparison Player.cpp @ 203:0c64754c7fd4

Voices work (at least in party creation screen)
author Nomad
date Sun, 17 Feb 2013 05:27:56 +0200
parents 30aa44013f7a
children 1bd823f52e3a
comparison
equal deleted inserted replaced
201:30aa44013f7a 203:0c64754c7fd4
574 void Player::PlaySound(PlayerSpeech speech, int a3) 574 void Player::PlaySound(PlayerSpeech speech, int a3)
575 { 575 {
576 //Player *pPlayer; // edi@1 576 //Player *pPlayer; // edi@1
577 //int v4; // eax@4 577 //int v4; // eax@4
578 signed int v5; // esi@4 578 signed int v5; // esi@4
579 char *v6; // ebx@4 579 unsigned char *v6; // ebx@4
580 signed int v7; // ecx@5 580 signed int v7; // ecx@5
581 unsigned __int8 v8; // al@6 581 unsigned __int8 v8; // al@6
582 int v9; // eax@10 582 int v9; // eax@10
583 //unsigned int pVoiceID; // ecx@10 583 //unsigned int pVoiceID; // ecx@10
584 int v11; // esi@10 584 int v11; // esi@10
606 } 606 }
607 607
608 //v4 = a2;//102 608 //v4 = a2;//102
609 v5 = 0; 609 v5 = 0;
610 pSoundId = 0; 610 pSoundId = 0;
611 v6 = (char *)&SoundSetAction[4 * speech];//byte_4ED280 &byte_4ED3D8[4 * v4] ??? 611 v6 = SoundSetAction[speech];//byte_4ED280 &byte_4ED3D8[4 * v4] ???
612 if ( uVoicesVolumeMultiplier ) 612 if (uVoicesVolumeMultiplier)
613 { 613 {
614 v7 = 0; 614 v7 = 0;
615 do 615 do
616 { 616 {
617 v8 = v6[v7]; 617 v8 = v6[v7];
623 if ( v5 ) 623 if ( v5 )
624 { 624 {
625 v9 = rand(); 625 v9 = rand();
626 //pVoiceID = uVoiceID; 626 //pVoiceID = uVoiceID;
627 v11 = v20[v9 % v5]; 627 v11 = v20[v9 % v5];
628 if ( LOBYTE((&(&dlhu_texnames_by_face[19])[25 * v11 + 3])[uVoiceID]) ) 628
629 { 629 if (int _v1 = byte_4ECF08[v11 - 1][uVoiceID])
630 pSoundId = rand() % SLOBYTE((&(&dlhu_texnames_by_face[19])[25 * v11 + 3])[uVoiceID]) 630 {
631 + 2 * (v11 + 50 * uVoiceID) 631 pSoundId = rand() % _v1 + 2 * (v11 + 50 * uVoiceID) + 4998;
632 + 4998; 632 v12 = (8 * pPlayerNum + 312) | OBJECT_Player;
633 v12 = 8 * pPlayerNum + 312;
634 LOBYTE(v12) = v12 | OBJECT_Player;
635 pAudioPlayer->PlaySound((SoundID)pSoundId, v12, 0, -1, 0, 0, (pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0), 0); 633 pAudioPlayer->PlaySound((SoundID)pSoundId, v12, 0, -1, 0, 0, (pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0), 0);
636 } 634 }
637 } 635 }
638 } 636 }
637
639 v13 = 0; 638 v13 = 0;
640 v14 = (int)(v6 + 3); 639 v14 = (int)(v6 + 3);
641 do 640 do
642 { 641 {
643 if ( *(char *)v14 ) 642 if ( *(char *)v14 )
1372 Player *v11; // [sp+Ch] [bp-4h]@1 1371 Player *v11; // [sp+Ch] [bp-4h]@1
1373 unsigned int uItemIDa; // [sp+1Ch] [bp+Ch]@1 1372 unsigned int uItemIDa; // [sp+1Ch] [bp+Ch]@1
1374 1373
1375 v11 = this; 1374 v11 = this;
1376 v3 = pIcons_LOD->LoadTexture(pItemsTable->pItems[uItemID].pIconName, TEXTURE_16BIT_PALETTE); 1375 v3 = pIcons_LOD->LoadTexture(pItemsTable->pItems[uItemID].pIconName, TEXTURE_16BIT_PALETTE);
1377 v4 = (Texture *)(v3 != -1 ? (int)&pIcons_LOD->pTextures[v3] : 0); 1376 v4 = (Texture *)(v3 != -1 ? &pIcons_LOD->pTextures[v3] : 0);
1378 v5 = GetSizeInInventorySlots(v3 != -1 ? pIcons_LOD->pTextures[v3].uTextureWidth : 24); 1377 v5 = GetSizeInInventorySlots(v3 != -1 ? pIcons_LOD->pTextures[v3].uTextureWidth : 24);
1379 uItemIDa = GetSizeInInventorySlots(v4->uTextureHeight); 1378 uItemIDa = GetSizeInInventorySlots(v4->uTextureHeight);
1380 if ( !areWeLoadingTexture ) 1379 if ( !areWeLoadingTexture )
1381 { 1380 {
1382 v4->Release(); 1381 v4->Release();