comparison AudioPlayer.cpp @ 153:86a2637ba125

UpdateActors
author Ritor1
date Tue, 12 Feb 2013 16:54:25 +0600
parents d92c78ab54fe
children e50a81060654 8113753ed2ae
comparison
equal deleted inserted replaced
152:796b79187c27 153:86a2637ba125
88 v2 = 1; 88 v2 = 1;
89 //while ( 1 ) 89 //while ( 1 )
90 do 90 do
91 { 91 {
92 sprintf(pSoundName, "%s", pSounds[v2].pSoundName); 92 sprintf(pSoundName, "%s", pSounds[v2].pSoundName);
93 // pSoundList->pSounds[v2].pSoundData[0] = ::LoadSound(pSoundName, (SoundData *)0xFFFFFFFF, pSounds[v2].uSoundID); Ritor1: it's error - result: no sound 93 // pSoundList->pSounds[v2].pSoundData[0] = ::LoadSound(pSoundName, (SoundData *)0xFFFFFFFF, pSounds[v2].uSoundID); //Ritor1: it's error - result: no sound
94 pSoundDesc = &pSoundList->pSounds[v2]; 94 pSoundDesc = &pSoundList->pSounds[v2];
95 if ( pSoundList->pSounds[v2].eType != SOUND_DESC_SYSTEM || (sprintf(pSoundName, "%s", pSounds[v2].pSoundName), 95 if ( pSoundList->pSounds[v2].eType != SOUND_DESC_SYSTEM || (sprintf(pSoundName, "%s", pSounds[v2].pSoundName),
96 pSoundList->pSounds[v2].pSoundData[0] = ::LoadSound(pSoundName, (SoundData *)0xFFFFFFFF, pSounds[v2].uSoundID), 96 pSoundList->pSounds[v2].pSoundData[0] = ::LoadSound(pSoundName, (SoundData *)0xFFFFFFFF, pSounds[v2].uSoundID),
97 !pAudioPlayer->b3DSoundInitialized) 97 !pAudioPlayer->b3DSoundInitialized)
98 || (pSoundDesc = &pSoundList->pSounds[v2], !(pSoundDesc->uFlags & 2)) 98 || (pSoundDesc = &pSoundList->pSounds[v2], !(pSoundDesc->uFlags & 2))
868 AIL_set_sample_volume(pMixerChannel5->hSample, v84); 868 AIL_set_sample_volume(pMixerChannel5->hSample, v84);
869 v76 = a3; 869 v76 = a3;
870 goto LABEL_184; 870 goto LABEL_184;
871 } 871 }
872 v76 = a3; 872 v76 = a3;
873 if ( (a3 & 7) == OBJECT_BLVDoor) 873 if ( (a3 & 7) == 1 )
874 { 874 {
875 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor ) 875 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor )
876 goto LABEL_184; 876 goto LABEL_184;
877 pBLVDoor2 = &pIndoor->pDoors[a3 >> 3]; 877 pBLVDoor2 = &pIndoor->pDoors[a3 >> 3];
878 if ( !pBLVDoor2->uDoorID ) 878 if ( !pBLVDoor2->uDoorID )
888 //goto LABEL_167; 888 //goto LABEL_167;
889 v80 = sub_4AB66C(pPosX, pPosY); 889 v80 = sub_4AB66C(pPosX, pPosY);
890 AIL_set_sample_pan(pMixerChannel5->hSample, v80); 890 AIL_set_sample_pan(pMixerChannel5->hSample, v80);
891 goto LABEL_184; 891 goto LABEL_184;
892 } 892 }
893 if ( (a3 & 7) == OBJECT_Item) 893 if ( (a3 & 7) == 2 )
894 { 894 {
895 pLayingItem4 = &pLayingItems[a3 >> 3]; 895 pLayingItem4 = &pLayingItems[a3 >> 3];
896 if ( !GetSoundStrengthByDistanceFromParty(pLayingItem4->vPosition.x, pLayingItem4->vPosition.y, pLayingItem4->vPosition.z) ) 896 if ( !GetSoundStrengthByDistanceFromParty(pLayingItem4->vPosition.x, pLayingItem4->vPosition.y, pLayingItem4->vPosition.z) )
897 return; 897 return;
898 } 898 }
899 else 899 else
900 { 900 {
901 if ( (a3 & 7) == OBJECT_Actor) 901 if ( (a3 & 7) == 3 )
902 { 902 {
903 pActor3 = &pActors[a3 >> 3]; 903 pActor3 = &pActors[a3 >> 3];
904 if ( !GetSoundStrengthByDistanceFromParty(pActor3->vPosition.x, pActor3->vPosition.y, pActor3->vPosition.z) ) 904 if ( !GetSoundStrengthByDistanceFromParty(pActor3->vPosition.x, pActor3->vPosition.y, pActor3->vPosition.z) )
905 return; 905 return;
906 pPosY = pActor3->vPosition.y; 906 pPosY = pActor3->vPosition.y;
908 //goto LABEL_167; 908 //goto LABEL_167;
909 v80 = sub_4AB66C(pPosX, pPosY); 909 v80 = sub_4AB66C(pPosX, pPosY);
910 AIL_set_sample_pan(pMixerChannel5->hSample, v80); 910 AIL_set_sample_pan(pMixerChannel5->hSample, v80);
911 goto LABEL_184; 911 goto LABEL_184;
912 } 912 }
913 if ( (a3 & 7) != OBJECT_Decoration) 913 if ( (a3 & 7) != 5 )
914 { 914 {
915 LABEL_184: 915 LABEL_184:
916 if ( uNumRepeats ) 916 if ( uNumRepeats )
917 AIL_set_sample_loop_count(pMixerChannel5->hSample, uNumRepeats - 1); 917 AIL_set_sample_loop_count(pMixerChannel5->hSample, uNumRepeats - 1);
918 v85 = pMixerChannel5->hSample; 918 v85 = pMixerChannel5->hSample;
920 pMixerChannel5->dword_000004 = v76; 920 pMixerChannel5->dword_000004 = v76;
921 pMixerChannel5->uSourceTrackID = eSoundID; 921 pMixerChannel5->uSourceTrackID = eSoundID;
922 AIL_start_sample(v85); 922 AIL_start_sample(v85);
923 if ( sPlaybackRate ) 923 if ( sPlaybackRate )
924 AIL_set_sample_playback_rate(pMixerChannel5->hSample, sPlaybackRate); 924 AIL_set_sample_playback_rate(pMixerChannel5->hSample, sPlaybackRate);
925 if ( (v76 & 7) == OBJECT_Player) 925 if ( (v76 & 7) == 4 )
926 AIL_sample_ms_position(pMixerChannel5->hSample, &sLastTrackLengthMS, 0); 926 AIL_sample_ms_position(pMixerChannel5->hSample, &sLastTrackLengthMS, 0);
927 return; 927 return;
928 } 928 }
929 pLayingItem4 = (LayingItem *)&pLevelDecorations[a3 >> 3]; 929 pLayingItem4 = (LayingItem *)&pLevelDecorations[a3 >> 3];
930 if ( !GetSoundStrengthByDistanceFromParty(pLayingItem4->vPosition.x, pLayingItem4->vPosition.y, pLayingItem4->vPosition.z) ) 930 if ( !GetSoundStrengthByDistanceFromParty(pLayingItem4->vPosition.x, pLayingItem4->vPosition.y, pLayingItem4->vPosition.z) )
976 pMixerChannel4 = &pAudioPlayer->pMixerChannels[v62]; 976 pMixerChannel4 = &pAudioPlayer->pMixerChannels[v62];
977 AIL_end_sample(pMixerChannel4->hSample); 977 AIL_end_sample(pMixerChannel4->hSample);
978 _4ABE55(pMixerChannel4); 978 _4ABE55(pMixerChannel4);
979 goto LABEL_150; 979 goto LABEL_150;
980 } 980 }
981 if ( (a3 & 7) == OBJECT_Item) 981 if ( (a3 & 7) == 2 )
982 { 982 {
983 varC = 5; 983 varC = 5;
984 v96 = 7; 984 v96 = 7;
985 pLayingItem3 = &pLayingItems[a3 >> 3]; 985 pLayingItem3 = &pLayingItems[a3 >> 3];
986 } 986 }
987 else 987 else
988 { 988 {
989 if ( (a3 & 7) == OBJECT_Actor) 989 if ( (a3 & 7) == 3 )
990 { 990 {
991 *(float *)&varC = 0.0; 991 *(float *)&varC = 0.0;
992 pActor2 = &pActors[a3 >> 3]; 992 pActor2 = &pActors[a3 >> 3];
993 v96 = 3; 993 v96 = 3;
994 v58 = pActor2->vPosition.y; 994 v58 = pActor2->vPosition.y;
998 LODWORD(v93) = GetSoundStrengthByDistanceFromParty(v59, /*(int)pSoundDesc*/ v58, v87); 998 LODWORD(v93) = GetSoundStrengthByDistanceFromParty(v59, /*(int)pSoundDesc*/ v58, v87);
999 if ( v93 == 0.0 ) 999 if ( v93 == 0.0 )
1000 return; 1000 return;
1001 goto LABEL_123; 1001 goto LABEL_123;
1002 } 1002 }
1003 if ( (a3 & 7) != OBJECT_Decoration) 1003 if ( (a3 & 7) != 5 )
1004 { 1004 {
1005 if ( (a3 & 7) == OBJECT_BModel) 1005 if ( (a3 & 7) == 6 )
1006 { 1006 {
1007 varC = 8; 1007 varC = 8;
1008 v96 = 9; 1008 v96 = 9;
1009 } 1009 }
1010 else 1010 else
1046 pRenderVertexSoft.vWorldPosition.x = (double)pParty->vPosition.x; 1046 pRenderVertexSoft.vWorldPosition.x = (double)pParty->vPosition.x;
1047 pRenderVertexSoft.vWorldPosition.y = (double)pParty->vPosition.y; 1047 pRenderVertexSoft.vWorldPosition.y = (double)pParty->vPosition.y;
1048 v21 = (double)pParty->sEyelevel + (double)pParty->vPosition.z; 1048 v21 = (double)pParty->sEyelevel + (double)pParty->vPosition.z;
1049 goto LABEL_47; 1049 goto LABEL_47;
1050 } 1050 }
1051 if ( (a3 & 7) == OBJECT_Item) 1051 if ( (a3 & 7) == 2 )
1052 { 1052 {
1053 v22 = pAudioPlayer->uNum3DSamples; 1053 v22 = pAudioPlayer->uNum3DSamples;
1054 if ( v22 < 16 ) 1054 if ( v22 < 16 )
1055 { 1055 {
1056 v12 = 5 * v22 / 16; 1056 v12 = 5 * v22 / 16;
1063 } 1063 }
1064 pLayingItem = &pLayingItems[a3 >> 3]; 1064 pLayingItem = &pLayingItems[a3 >> 3];
1065 } 1065 }
1066 else 1066 else
1067 { 1067 {
1068 if ( (a3 & 7) == OBJECT_Actor) 1068 if ( (a3 & 7) == 3 )
1069 { 1069 {
1070 v18 = pAudioPlayer->uNum3DSamples; 1070 v18 = pAudioPlayer->uNum3DSamples;
1071 v12 = 0; 1071 v12 = 0;
1072 if ( v18 < 16 ) 1072 if ( v18 < 16 )
1073 v96 = 3 * v18 / 16; 1073 v96 = 3 * v18 / 16;
1079 v100 = pActor1->vPosition.z; 1079 v100 = pActor1->vPosition.z;
1080 pRenderVertexSoft.vWorldPosition.y = (double)v20; 1080 pRenderVertexSoft.vWorldPosition.y = (double)v20;
1081 v21 = (double)v100; 1081 v21 = (double)v100;
1082 goto LABEL_47; 1082 goto LABEL_47;
1083 } 1083 }
1084 if ( (a3 & 7) != OBJECT_Decoration) 1084 if ( (a3 & 7) != 5 )
1085 { 1085 {
1086 v13 = pAudioPlayer->uNum3DSamples; 1086 v13 = pAudioPlayer->uNum3DSamples;
1087 if ( (a3 & 7) == OBJECT_BModel) 1087 if ( (a3 & 7) == 6 )
1088 { 1088 {
1089 if ( v13 >= 16 ) 1089 if ( v13 >= 16 )
1090 { 1090 {
1091 v96 = 9; 1091 v96 = 9;
1092 v12 = 8; 1092 v12 = 8;
1254 else 1254 else
1255 v86 = 1; 1255 v86 = 1;
1256 AIL_set_3D_sample_loop_count(*(int *)v42, v86); 1256 AIL_set_3D_sample_loop_count(*(int *)v42, v86);
1257 if ( PartyX == -1 ) 1257 if ( PartyX == -1 )
1258 { 1258 {
1259 if ( (a3 & 7) == OBJECT_BLVDoor) 1259 if ( (a3 & 7) == 1 )
1260 { 1260 {
1261 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) 1261 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
1262 { 1262 {
1263 //goto LABEL_103; 1263 //goto LABEL_103;
1264 pBLVDoor = &pIndoor->pDoors[a3 >> 3]; 1264 pBLVDoor = &pIndoor->pDoors[a3 >> 3];
1304 AIL_end_3D_sample(*(int **)v42); 1304 AIL_end_3D_sample(*(int **)v42);
1305 pAudioPlayer->_4ABF23((AudioPlayer_3DSample *)(v41 + 20)); 1305 pAudioPlayer->_4ABF23((AudioPlayer_3DSample *)(v41 + 20));
1306 } 1306 }
1307 return; 1307 return;
1308 } 1308 }
1309 if ( (a3 & 7) == OBJECT_Item) 1309 if ( (a3 & 7) == 2 )
1310 { 1310 {
1311 pLayingItem2 = &pLayingItems[a3 >> 3]; 1311 pLayingItem2 = &pLayingItems[a3 >> 3];
1312 } 1312 }
1313 else 1313 else
1314 { 1314 {
1315 if ( (a3 & 7) == OBJECT_Actor) 1315 if ( (a3 & 7) == 3 )
1316 { 1316 {
1317 pActor = &pActors[a3 >> 3]; 1317 pActor = &pActors[a3 >> 3];
1318 v46 = pActor->vPosition.y; 1318 v46 = pActor->vPosition.y;
1319 pRenderVertexSoft.vWorldPosition.x = (double)pActor->vPosition.x; 1319 pRenderVertexSoft.vWorldPosition.x = (double)pActor->vPosition.x;
1320 uNumRepeatsb = pActor->vPosition.z; 1320 uNumRepeatsb = pActor->vPosition.z;
1321 pRenderVertexSoft.vWorldPosition.y = (double)v46; 1321 pRenderVertexSoft.vWorldPosition.y = (double)v46;
1322 v47 = (double)uNumRepeatsb; 1322 v47 = (double)uNumRepeatsb;
1323 goto LABEL_101; 1323 goto LABEL_101;
1324 } 1324 }
1325 if ( (a3 & 7) != OBJECT_Decoration) 1325 if ( (a3 & 7) != 5 )
1326 { 1326 {
1327 pRenderVertexSoft.vWorldPosition.x = (double)pParty->vPosition.x; 1327 pRenderVertexSoft.vWorldPosition.x = (double)pParty->vPosition.x;
1328 v43 = (double)pParty->vPosition.y; 1328 v43 = (double)pParty->vPosition.y;
1329 LABEL_100: 1329 LABEL_100:
1330 pRenderVertexSoft.vWorldPosition.y = v43; 1330 pRenderVertexSoft.vWorldPosition.y = v43;
1601 { 1601 {
1602 v30 = pAudioPlayer->pMixerChannels; 1602 v30 = pAudioPlayer->pMixerChannels;
1603 while ( 1 ) 1603 while ( 1 )
1604 { 1604 {
1605 v31 = v30->dword_000004; 1605 v31 = v30->dword_000004;
1606 if ( (v30->dword_000004 & 7) == OBJECT_BLVDoor) 1606 if ( (v30->dword_000004 & 7) == 1 )
1607 { 1607 {
1608 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) 1608 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
1609 { 1609 {
1610 v39 = &pIndoor->pDoors[v31 >> 3]; 1610 v39 = &pIndoor->pDoors[v31 >> 3];
1611 if ( !v39->uDoorID ) 1611 if ( !v39->uDoorID )
1631 goto LABEL_61; 1631 goto LABEL_61;
1632 } 1632 }
1633 } 1633 }
1634 else 1634 else
1635 { 1635 {
1636 if ( (v30->dword_000004 & 7) == OBJECT_Item) 1636 if ( (v30->dword_000004 & 7) == 2 )
1637 { 1637 {
1638 v32 = &pLayingItems[v31 >> 3]; 1638 v32 = &pLayingItems[v31 >> 3];
1639 goto LABEL_53; 1639 goto LABEL_53;
1640 } 1640 }
1641 if ( (v30->dword_000004 & 7) == OBJECT_Actor) 1641 if ( (v30->dword_000004 & 7) == 3 )
1642 { 1642 {
1643 v33 = &pActors[v31 >> 3]; 1643 v33 = &pActors[v31 >> 3];
1644 v34 = GetSoundStrengthByDistanceFromParty(v33->vPosition.x, v33->vPosition.y, v33->vPosition.z); 1644 v34 = GetSoundStrengthByDistanceFromParty(v33->vPosition.x, v33->vPosition.y, v33->vPosition.z);
1645 if ( !v34 ) 1645 if ( !v34 )
1646 goto LABEL_58; 1646 goto LABEL_58;