mirror of
https://git.rip/DMCA_FUCKER/re3.git
synced 2024-12-24 02:00:00 +00:00
removed some goto
This commit is contained in:
parent
1d22c78f9f
commit
b3cbe3d338
|
@ -3072,9 +3072,8 @@ void cAudioManager::ProcessCarHeli(cVehicleParams* params)
|
|||
CBoat* boat; // [esp+1Ch] [ebp-C0h]
|
||||
|
||||
signed int volume; // ebx
|
||||
float volumeTmp; // st5
|
||||
unsigned int freqModifier; // eax
|
||||
signed int v30; // ebx
|
||||
signed int volume; // ebx
|
||||
uint32 freq_6; // eax
|
||||
signed int volume_3; // ebx
|
||||
|
||||
|
@ -3104,13 +3103,16 @@ void cAudioManager::ProcessCarHeli(cVehicleParams* params)
|
|||
|
||||
const float CarHeliDistance = 250.0f;
|
||||
|
||||
boat = 0;
|
||||
hunterBool = 0;
|
||||
automobile = 0;
|
||||
boat = nil;
|
||||
hunterBool = false;
|
||||
automobile = nil;
|
||||
cameraMatrix.m_attachment = 0;
|
||||
cameraMatrix.m_hasRwMatrix = 0;
|
||||
|
||||
if (params->m_fDistance < SQR(CarHeliDistance)) {//!!
|
||||
if (params->m_fDistance >= SQR(CarHeliDistance)) {//!!
|
||||
cameraMatrix.~CMatrix();
|
||||
return;
|
||||
}
|
||||
playerVeh = FindPlayerVehicle();
|
||||
veh = params->m_pVehicle;
|
||||
if (playerVeh == veh) {
|
||||
|
@ -3123,31 +3125,33 @@ void cAudioManager::ProcessCarHeli(cVehicleParams* params)
|
|||
cameraMatrix = TheCamera.m_matrix;
|
||||
vehAtYAbs = Abs(veh->m_matrix.GetUp().y);
|
||||
vehCameraDot = (DotProduct(veh->m_matrix.GetForward(), cameraMatrix.GetForward()) + 1.0f) / 2.0f;
|
||||
|
||||
//123-139
|
||||
if (veh->m_modelIndex == MI_SKIMMER) {//!!
|
||||
boat = (CBoat*)params->m_pVehicle;
|
||||
speedMultiplied = boat->m_fMovingSpeed * 50.0f / 11.0f;
|
||||
} else if (params->m_VehicleType == VEHICLE_TYPE_HELI) {//!!
|
||||
speedMultiplied = 1.0;
|
||||
speedMultiplied = 1.0f;
|
||||
} else {
|
||||
automobile = (CAutomobile*)params->m_pVehicle;
|
||||
speedMultiplied = automobile->m_aWheelSpeed[1] * 50.0f / 11.0f;
|
||||
}
|
||||
//140-162
|
||||
if (0.0 == speedMultiplied) {//??
|
||||
if (speedMultiplied == 0.0f) {//??
|
||||
cameraMatrix.~CMatrix();
|
||||
return;
|
||||
}
|
||||
speedMultiplied = Min(1.0f, speedMultiplied);
|
||||
CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance);
|
||||
//163-
|
||||
if (m_sQueueSample.m_fDistance >= 40.0f) {//??
|
||||
volumeTmp = speedMultiplied * 75.0f;
|
||||
} else {
|
||||
if (m_sQueueSample.m_fDistance >= 25.0f) {//!!
|
||||
|
||||
|
||||
if (m_sQueueSample.m_fDistance >= 40.0f)
|
||||
volume = speedMultiplied * 75.0f;
|
||||
else if (m_sQueueSample.m_fDistance >= 25.0f)
|
||||
volume = 0;
|
||||
LABEL_34:
|
||||
else
|
||||
volume = (m_sQueueSample.m_fDistance - 25.0f) * 0.06666667f * (75.0f * speedMultiplied);
|
||||
|
||||
|
||||
|
||||
|
||||
//173-243
|
||||
if (volume != 0) {//!!
|
||||
m_sQueueSample.m_nVolume = cAudioManager::ComputeVolume(volume, 250.0f, m_sQueueSample.m_fDistance);
|
||||
|
@ -3194,9 +3198,14 @@ void cAudioManager::ProcessCarHeli(cVehicleParams* params)
|
|||
} else {
|
||||
pos = m_sQueueSample.m_vecPos;
|
||||
}
|
||||
|
||||
|
||||
//263-270
|
||||
if (params->m_fDistance >= 19600.0f) //??
|
||||
goto LABEL_EXIT;
|
||||
if (params->m_fDistance >= 19600.0f) { //??
|
||||
cameraMatrix.~CMatrix();
|
||||
return;
|
||||
}
|
||||
|
||||
if (speedMultiplied >= 0.4f) //??
|
||||
volumeModifier = (speedMultiplied - 0.4f) * 5.0f / 3.0f;
|
||||
else
|
||||
|
@ -3209,7 +3218,6 @@ void cAudioManager::ProcessCarHeli(cVehicleParams* params)
|
|||
if (veh->m_modelIndex == MI_HUNTER) //!!
|
||||
hunterBool = true;
|
||||
}
|
||||
|
||||
volume_1 = (1.0f - vehCameraDot) * volumeModifier * 127.0f;
|
||||
//288-339
|
||||
if (boat) { //!!
|
||||
|
@ -3239,35 +3247,35 @@ void cAudioManager::ProcessCarHeli(cVehicleParams* params)
|
|||
m_sQueueSample.m_nVolume = ComputeVolume(volume_1, 140.0f, m_sQueueSample.m_fDistance);
|
||||
if (!m_sQueueSample.m_nVolume) { //!!
|
||||
LABEL_105:
|
||||
if (!boat && params->m_VehicleType != VEHICLE_TYPE_HELI && m_sQueueSample.m_fDistance >= 30.0) { //!!
|
||||
if (!boat && params->m_VehicleType != VEHICLE_TYPE_HELI && m_sQueueSample.m_fDistance >= 30.0f) { //!!
|
||||
if (automobile->bEngineOn) {
|
||||
if (speedMultiplied >= 1.0) {
|
||||
v30 = (signed int)((1.0 - 0.5 * speedMultiplied) * 70.0f);
|
||||
m_sQueueSample.m_nVolume = ComputeVolume(v30, 30.0, m_sQueueSample.m_fDistance);
|
||||
if (speedMultiplied >= 1.0f) {
|
||||
volume = (1.0f - 0.5f * speedMultiplied) * 70.0f;
|
||||
m_sQueueSample.m_nVolume = ComputeVolume(volume, 30.0, m_sQueueSample.m_fDistance);
|
||||
if (m_sQueueSample.m_nVolume) {
|
||||
if (hunterBool) {
|
||||
m_sQueueSample.m_nSampleIndex = 456;
|
||||
m_sQueueSample.m_nBankIndex = 0;
|
||||
freq_6 = 3000.0 * speedMultiplied + 30000;
|
||||
m_sQueueSample.m_nSampleIndex = SFX_HELI_APACHE_4;
|
||||
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
|
||||
freq_6 = 3000.0f * speedMultiplied + 30000;
|
||||
} else {
|
||||
m_sQueueSample.m_nSampleIndex = 11;
|
||||
m_sQueueSample.m_nBankIndex = 0;
|
||||
freq_6 = 3000.0 * speedMultiplied + 6000;
|
||||
m_sQueueSample.m_nSampleIndex = SFX_CAR_HELI_STA;
|
||||
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
|
||||
freq_6 = 3000.0f * speedMultiplied + 6000;
|
||||
}
|
||||
m_sQueueSample.m_nFrequency = freq_6;
|
||||
m_sQueueSample.m_nCounter = 12;
|
||||
m_sQueueSample.m_bIs2D = 0;
|
||||
m_sQueueSample.m_bIs2D = false;
|
||||
m_sQueueSample.m_nReleasingVolumeModificator = 1;
|
||||
m_sQueueSample.m_nLoopCount = 0;
|
||||
m_sQueueSample.m_nEmittingVolume = v30;
|
||||
m_sQueueSample.m_nEmittingVolume = volume;
|
||||
m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex);
|
||||
m_sQueueSample.m_nLoopEnd = SampleManager.GetSampleLoopEndOffset(m_sQueueSample.m_nSampleIndex);
|
||||
m_sQueueSample.m_fSpeedMultiplier = 6.0;
|
||||
m_sQueueSample.m_fSoundIntensity = 30.0;
|
||||
m_sQueueSample.m_bReleasingSoundFlag = 0;
|
||||
m_sQueueSample.m_fSpeedMultiplier = 6.0f;
|
||||
m_sQueueSample.m_fSoundIntensity = 30.0f;
|
||||
m_sQueueSample.m_bReleasingSoundFlag = false;
|
||||
m_sQueueSample.m_nReleasingVolumeDivider = 30;
|
||||
m_sQueueSample.m_bReverbFlag = 1;
|
||||
m_sQueueSample.m_bRequireReflection = 0;
|
||||
m_sQueueSample.m_bReverbFlag = true;
|
||||
m_sQueueSample.m_bRequireReflection = false;
|
||||
AddSampleToRequestedQueue();
|
||||
}
|
||||
}
|
||||
|
@ -3384,16 +3392,13 @@ void cAudioManager::ProcessCarHeli(cVehicleParams* params)
|
|||
params->m_bDistanceCalculated = distCalcBool;
|
||||
params->m_fDistance = distance_3;
|
||||
}
|
||||
LABEL_EXIT:
|
||||
cameraMatrix.~CMatrix();
|
||||
return;
|
||||
}
|
||||
m_sQueueSample.m_nSampleIndex = 9;
|
||||
m_sQueueSample.m_nSampleIndex = SFX_CAR_HELI_MAI2;
|
||||
}
|
||||
m_sQueueSample.m_nBankIndex = 0;
|
||||
m_sQueueSample.m_nFrequency = (unsigned __int64)(signed __int64)(16000.0 * volumeModifier)
|
||||
+ 16000;
|
||||
m_sQueueSample.m_nFrequency += freqModifier_2;
|
||||
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
|
||||
m_sQueueSample.m_nFrequency = (volumeModifier + 1) * 16000 + freqModifier_2;
|
||||
goto LABEL_146;
|
||||
}
|
||||
|
||||
|
@ -3426,8 +3431,7 @@ void cAudioManager::ProcessCarHeli(cVehicleParams* params)
|
|||
m_sQueueSample.m_nSampleIndex = 8;
|
||||
}
|
||||
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
|
||||
m_sQueueSample.m_nFrequency = (16000.0 * volumeModifier) + 16000;
|
||||
m_sQueueSample.m_nFrequency += freqModifier_2;
|
||||
m_sQueueSample.m_nFrequency = (volumeModifier + 1) * 16000 + freqModifier_2;
|
||||
//goto LABEL_104;
|
||||
m_sQueueSample.m_bIs2D = false;
|
||||
m_sQueueSample.m_nReleasingVolumeModificator = 1;
|
||||
|
@ -3443,13 +3447,8 @@ void cAudioManager::ProcessCarHeli(cVehicleParams* params)
|
|||
m_sQueueSample.m_bRequireReflection = false;
|
||||
AddSampleToRequestedQueue();
|
||||
goto LABEL_105;
|
||||
}
|
||||
volumeTmp = (m_sQueueSample.m_fDistance - 25.0) * 0.06666667 * (75.0 * speedMultiplied);
|
||||
}
|
||||
volume = (signed int)volumeTmp;
|
||||
goto LABEL_34;
|
||||
}
|
||||
cameraMatrix.~CMatrix();
|
||||
|
||||
|
||||
}
|
||||
|
||||
//TODO use it in ProcessVehicle
|
||||
|
|
Loading…
Reference in a new issue