Fixes for Serge's review
This commit is contained in:
parent
7c425ac4ac
commit
8f01eab5ab
@ -183,8 +183,8 @@ RpAnimBlendClumpGetMainAssociation(RpClump *clump, CAnimBlendAssociation **assoc
|
|||||||
|
|
||||||
CAnimBlendAssociation *mainAssoc = nil;
|
CAnimBlendAssociation *mainAssoc = nil;
|
||||||
CAnimBlendAssociation *secondAssoc = nil;
|
CAnimBlendAssociation *secondAssoc = nil;
|
||||||
float mainBlend = 0.0;
|
float mainBlend = 0.0f;
|
||||||
float secondBlend = 0.0;
|
float secondBlend = 0.0f;
|
||||||
for(CAnimBlendLink *link = clumpData->link.next; link; link = link->next){
|
for(CAnimBlendLink *link = clumpData->link.next; link; link = link->next){
|
||||||
CAnimBlendAssociation *assoc = CAnimBlendAssociation::FromLink(link);
|
CAnimBlendAssociation *assoc = CAnimBlendAssociation::FromLink(link);
|
||||||
|
|
||||||
@ -215,7 +215,7 @@ RpAnimBlendClumpGetMainPartialAssociation(RpClump *clump)
|
|||||||
if(clumpData == nil) return nil;
|
if(clumpData == nil) return nil;
|
||||||
|
|
||||||
CAnimBlendAssociation *mainAssoc = nil;
|
CAnimBlendAssociation *mainAssoc = nil;
|
||||||
float mainBlend = 0.0;
|
float mainBlend = 0.0f;
|
||||||
for(CAnimBlendLink *link = clumpData->link.next; link; link = link->next){
|
for(CAnimBlendLink *link = clumpData->link.next; link; link = link->next){
|
||||||
CAnimBlendAssociation *assoc = CAnimBlendAssociation::FromLink(link);
|
CAnimBlendAssociation *assoc = CAnimBlendAssociation::FromLink(link);
|
||||||
|
|
||||||
|
@ -2394,7 +2394,7 @@ cAudioManager::GetVehicleNonDriveWheelSkidValue(uint8 wheel, CAutomobile *automo
|
|||||||
if(automobile->m_aWheelState[wheel] == 2) {
|
if(automobile->m_aWheelState[wheel] == 2) {
|
||||||
relativeVelChange = min(1.0f, Abs(velocityChange) / transmission->fMaxVelocity);
|
relativeVelChange = min(1.0f, Abs(velocityChange) / transmission->fMaxVelocity);
|
||||||
} else {
|
} else {
|
||||||
relativeVelChange = 0.0;
|
relativeVelChange = 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
return max(relativeVelChange, min(1.0f, Abs(automobile->m_vecTurnSpeed.z) * 20.0f));
|
return max(relativeVelChange, min(1.0f, Abs(automobile->m_vecTurnSpeed.z) * 20.0f));
|
||||||
@ -2505,7 +2505,7 @@ cAudioManager::PlayOneShot(int32 index, int16 sound, float vol)
|
|||||||
if(entity.m_bIsUsed) {
|
if(entity.m_bIsUsed) {
|
||||||
if(sound < SOUND_TOTAL_SOUNDS) {
|
if(sound < SOUND_TOTAL_SOUNDS) {
|
||||||
if(entity.m_nType == AUDIOTYPE_SCRIPTOBJECT) {
|
if(entity.m_nType == AUDIOTYPE_SCRIPTOBJECT) {
|
||||||
if(m_nScriptObjectEntityTotal < 40) {
|
if(m_nScriptObjectEntityTotal < ARRAY_SIZE(m_anScriptObjectEntityIndices)) {
|
||||||
entity.m_awAudioEvent[0] = sound;
|
entity.m_awAudioEvent[0] = sound;
|
||||||
entity.m_AudioEvents = 1;
|
entity.m_AudioEvents = 1;
|
||||||
m_anScriptObjectEntityIndices[m_nScriptObjectEntityTotal++] =
|
m_anScriptObjectEntityIndices[m_nScriptObjectEntityTotal++] =
|
||||||
@ -2515,7 +2515,7 @@ cAudioManager::PlayOneShot(int32 index, int16 sound, float vol)
|
|||||||
int32 i = 0;
|
int32 i = 0;
|
||||||
while(true) {
|
while(true) {
|
||||||
if(i >= entity.m_AudioEvents) {
|
if(i >= entity.m_AudioEvents) {
|
||||||
if(entity.m_AudioEvents < 4) {
|
if(entity.m_AudioEvents < ARRAY_SIZE(entity.m_awAudioEvent)) {
|
||||||
entity.m_awAudioEvent[i] = sound;
|
entity.m_awAudioEvent[i] = sound;
|
||||||
entity.m_afVolume[i] = vol;
|
entity.m_afVolume[i] = vol;
|
||||||
++entity.m_AudioEvents;
|
++entity.m_AudioEvents;
|
||||||
@ -2535,7 +2535,7 @@ cAudioManager::PlayOneShot(int32 index, int16 sound, float vol)
|
|||||||
}
|
}
|
||||||
entity.m_awAudioEvent[i] = sound;
|
entity.m_awAudioEvent[i] = sound;
|
||||||
entity.m_afVolume[i] = vol;
|
entity.m_afVolume[i] = vol;
|
||||||
if(entity.m_AudioEvents < 4) ++entity.m_AudioEvents;
|
if(entity.m_AudioEvents < ARRAY_SIZE(entity.m_awAudioEvent)) ++entity.m_AudioEvents;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3199,8 +3199,8 @@ cAudioManager::ProcessCesna(cVehicleParams *params)
|
|||||||
if(m_sQueueSample.m_bVolume) {
|
if(m_sQueueSample.m_bVolume) {
|
||||||
m_sQueueSample.m_counter = 52;
|
m_sQueueSample.m_counter = 52;
|
||||||
m_sQueueSample.m_nSampleIndex = SFX_CESNA_IDLE;
|
m_sQueueSample.m_nSampleIndex = SFX_CESNA_IDLE;
|
||||||
m_sQueueSample.m_bBankIndex = 0;
|
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
|
||||||
m_sQueueSample.m_bIsDistant = 0;
|
m_sQueueSample.m_bIsDistant = false;
|
||||||
m_sQueueSample.field_16 = 0;
|
m_sQueueSample.field_16 = 0;
|
||||||
m_sQueueSample.m_nFrequency = 12500;
|
m_sQueueSample.m_nFrequency = 12500;
|
||||||
m_sQueueSample.m_nLoopCount = 0;
|
m_sQueueSample.m_nLoopCount = 0;
|
||||||
@ -3209,11 +3209,11 @@ cAudioManager::ProcessCesna(cVehicleParams *params)
|
|||||||
m_sQueueSample.m_nLoopStart =
|
m_sQueueSample.m_nLoopStart =
|
||||||
SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex);
|
SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex);
|
||||||
m_sQueueSample.m_nLoopEnd = SampleManager.GetSampleLoopEndOffset(m_sQueueSample.m_nSampleIndex);
|
m_sQueueSample.m_nLoopEnd = SampleManager.GetSampleLoopEndOffset(m_sQueueSample.m_nSampleIndex);
|
||||||
m_sQueueSample.field_48 = 8.0;
|
m_sQueueSample.field_48 = 8.0f;
|
||||||
m_sQueueSample.m_fSoundIntensity = 200.0f;
|
m_sQueueSample.m_fSoundIntensity = 200.0f;
|
||||||
m_sQueueSample.field_56 = 0;
|
m_sQueueSample.field_56 = 0;
|
||||||
m_sQueueSample.m_bReverbFlag = 1;
|
m_sQueueSample.m_bReverbFlag = true;
|
||||||
m_sQueueSample.m_bRequireReflection = 0;
|
m_sQueueSample.m_bRequireReflection = false;
|
||||||
AddSampleToRequestedQueue();
|
AddSampleToRequestedQueue();
|
||||||
}
|
}
|
||||||
if(params->m_fDistance < 8100.f) {
|
if(params->m_fDistance < 8100.f) {
|
||||||
@ -3221,8 +3221,8 @@ cAudioManager::ProcessCesna(cVehicleParams *params)
|
|||||||
if(m_sQueueSample.m_bVolume) {
|
if(m_sQueueSample.m_bVolume) {
|
||||||
m_sQueueSample.m_counter = 2;
|
m_sQueueSample.m_counter = 2;
|
||||||
m_sQueueSample.m_nSampleIndex = SFX_CESNA_REV;
|
m_sQueueSample.m_nSampleIndex = SFX_CESNA_REV;
|
||||||
m_sQueueSample.m_bBankIndex = 0;
|
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
|
||||||
m_sQueueSample.m_bIsDistant = 0;
|
m_sQueueSample.m_bIsDistant = false;
|
||||||
m_sQueueSample.field_16 = 0;
|
m_sQueueSample.field_16 = 0;
|
||||||
m_sQueueSample.m_nFrequency = 25000;
|
m_sQueueSample.m_nFrequency = 25000;
|
||||||
m_sQueueSample.m_nLoopCount = 0;
|
m_sQueueSample.m_nLoopCount = 0;
|
||||||
@ -3232,11 +3232,11 @@ cAudioManager::ProcessCesna(cVehicleParams *params)
|
|||||||
SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex);
|
SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex);
|
||||||
m_sQueueSample.m_nLoopEnd =
|
m_sQueueSample.m_nLoopEnd =
|
||||||
SampleManager.GetSampleLoopEndOffset(m_sQueueSample.m_nSampleIndex);
|
SampleManager.GetSampleLoopEndOffset(m_sQueueSample.m_nSampleIndex);
|
||||||
m_sQueueSample.field_48 = 8.0;
|
m_sQueueSample.field_48 = 8.0f;
|
||||||
m_sQueueSample.m_fSoundIntensity = 90.0f;
|
m_sQueueSample.m_fSoundIntensity = 90.0f;
|
||||||
m_sQueueSample.field_56 = 0;
|
m_sQueueSample.field_56 = 0;
|
||||||
m_sQueueSample.m_bReverbFlag = 1;
|
m_sQueueSample.m_bReverbFlag = true;
|
||||||
m_sQueueSample.m_bRequireReflection = 0;
|
m_sQueueSample.m_bRequireReflection = false;
|
||||||
AddSampleToRequestedQueue();
|
AddSampleToRequestedQueue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3313,8 +3313,8 @@ cAudioManager::ProcessCrane()
|
|||||||
if(m_sQueueSample.m_bVolume) {
|
if(m_sQueueSample.m_bVolume) {
|
||||||
m_sQueueSample.m_counter = 0;
|
m_sQueueSample.m_counter = 0;
|
||||||
m_sQueueSample.m_nSampleIndex = SFX_CRANE_MAGNET;
|
m_sQueueSample.m_nSampleIndex = SFX_CRANE_MAGNET;
|
||||||
m_sQueueSample.m_bBankIndex = 0;
|
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
|
||||||
m_sQueueSample.m_bIsDistant = 0;
|
m_sQueueSample.m_bIsDistant = false;
|
||||||
m_sQueueSample.field_16 = 2;
|
m_sQueueSample.field_16 = 2;
|
||||||
m_sQueueSample.m_nFrequency = 6000;
|
m_sQueueSample.m_nFrequency = 6000;
|
||||||
m_sQueueSample.m_nLoopCount = 0;
|
m_sQueueSample.m_nLoopCount = 0;
|
||||||
@ -3327,8 +3327,8 @@ cAudioManager::ProcessCrane()
|
|||||||
m_sQueueSample.m_fSoundIntensity = 80.0f;
|
m_sQueueSample.m_fSoundIntensity = 80.0f;
|
||||||
m_sQueueSample.field_56 = 0;
|
m_sQueueSample.field_56 = 0;
|
||||||
m_sQueueSample.field_76 = 3;
|
m_sQueueSample.field_76 = 3;
|
||||||
m_sQueueSample.m_bReverbFlag = 1;
|
m_sQueueSample.m_bReverbFlag = true;
|
||||||
m_sQueueSample.m_bRequireReflection = 0;
|
m_sQueueSample.m_bRequireReflection = false;
|
||||||
AddSampleToRequestedQueue();
|
AddSampleToRequestedQueue();
|
||||||
}
|
}
|
||||||
if(m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_AudioEvents) {
|
if(m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_AudioEvents) {
|
||||||
@ -3338,7 +3338,7 @@ cAudioManager::ProcessCrane()
|
|||||||
SampleManager.GetSampleBaseFrequency(SFX_COL_CAR_2);
|
SampleManager.GetSampleBaseFrequency(SFX_COL_CAR_2);
|
||||||
m_sQueueSample.m_nLoopCount = 1;
|
m_sQueueSample.m_nLoopCount = 1;
|
||||||
m_sQueueSample.field_56 = 1;
|
m_sQueueSample.field_56 = 1;
|
||||||
m_sQueueSample.m_bReverbFlag = 1;
|
m_sQueueSample.m_bReverbFlag = true;
|
||||||
m_sQueueSample.m_bRequireReflection = 1;
|
m_sQueueSample.m_bRequireReflection = 1;
|
||||||
AddSampleToRequestedQueue();
|
AddSampleToRequestedQueue();
|
||||||
}
|
}
|
||||||
@ -3680,7 +3680,7 @@ void cAudioManager::ProcessFires(int32)
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
maxDist = 2500.f;
|
maxDist = 2500.f;
|
||||||
m_sQueueSample.m_fSoundIntensity = 50.0;
|
m_sQueueSample.m_fSoundIntensity = 50.0f;
|
||||||
m_sQueueSample.m_nSampleIndex = SFX_CAR_ON_FIRE;
|
m_sQueueSample.m_nSampleIndex = SFX_CAR_ON_FIRE;
|
||||||
m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CAR_ON_FIRE);
|
m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CAR_ON_FIRE);
|
||||||
m_sQueueSample.m_nFrequency += i * ((uint32)m_sQueueSample.m_nFrequency >> 6);
|
m_sQueueSample.m_nFrequency += i * ((uint32)m_sQueueSample.m_nFrequency >> 6);
|
||||||
@ -3695,10 +3695,10 @@ void cAudioManager::ProcessFires(int32)
|
|||||||
m_sQueueSample.m_fDistance);
|
m_sQueueSample.m_fDistance);
|
||||||
if(m_sQueueSample.m_bVolume) {
|
if(m_sQueueSample.m_bVolume) {
|
||||||
m_sQueueSample.m_counter = i;
|
m_sQueueSample.m_counter = i;
|
||||||
m_sQueueSample.m_bBankIndex = 0;
|
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
|
||||||
m_sQueueSample.field_48 = 2.0;
|
m_sQueueSample.field_48 = 2.0f;
|
||||||
m_sQueueSample.field_76 = 10;
|
m_sQueueSample.field_76 = 10;
|
||||||
m_sQueueSample.m_bIsDistant = 0;
|
m_sQueueSample.m_bIsDistant = false;
|
||||||
m_sQueueSample.m_nLoopCount = 0;
|
m_sQueueSample.m_nLoopCount = 0;
|
||||||
m_sQueueSample.field_56 = 0;
|
m_sQueueSample.field_56 = 0;
|
||||||
m_sQueueSample.m_bEmittingVolume = emittingVol;
|
m_sQueueSample.m_bEmittingVolume = emittingVol;
|
||||||
@ -3706,8 +3706,8 @@ void cAudioManager::ProcessFires(int32)
|
|||||||
SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex);
|
SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex);
|
||||||
m_sQueueSample.m_nLoopEnd =
|
m_sQueueSample.m_nLoopEnd =
|
||||||
SampleManager.GetSampleLoopEndOffset(m_sQueueSample.m_nSampleIndex);
|
SampleManager.GetSampleLoopEndOffset(m_sQueueSample.m_nSampleIndex);
|
||||||
m_sQueueSample.m_bReverbFlag = 1;
|
m_sQueueSample.m_bReverbFlag = true;
|
||||||
m_sQueueSample.m_bRequireReflection = 0;
|
m_sQueueSample.m_bRequireReflection = false;
|
||||||
AddSampleToRequestedQueue();
|
AddSampleToRequestedQueue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3886,6 +3886,50 @@ cAudioManager::ProcessGarages()
|
|||||||
|
|
||||||
static uint8 iSound = 32;
|
static uint8 iSound = 32;
|
||||||
|
|
||||||
|
#define LOOP_HELPER \
|
||||||
|
for(j = 0; j < m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_AudioEvents; ++j) { \
|
||||||
|
switch(m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_awAudioEvent[j]) { \
|
||||||
|
case SOUND_GARAGE_DOOR_CLOSED: \
|
||||||
|
case SOUND_GARAGE_DOOR_OPENED: \
|
||||||
|
if(distSquared < 6400.f) { \
|
||||||
|
CalculateDistance(distCalculated, distSquared); \
|
||||||
|
m_sQueueSample.m_bVolume = ComputeVolume(60, 80.f, m_sQueueSample.m_fDistance); \
|
||||||
|
if(m_sQueueSample.m_bVolume) { \
|
||||||
|
if(CGarages::Garages[i].m_eGarageType == GARAGE_CRUSHER) { \
|
||||||
|
m_sQueueSample.m_nSampleIndex = SFX_COL_CAR_PANEL_2; \
|
||||||
|
m_sQueueSample.m_nFrequency = 6735; \
|
||||||
|
} else if(m_asAudioEntities[m_sQueueSample.m_nEntityIndex] \
|
||||||
|
.m_awAudioEvent[j] == 69) { \
|
||||||
|
m_sQueueSample.m_nSampleIndex = SFX_COL_CAR_PANEL_2; \
|
||||||
|
m_sQueueSample.m_nFrequency = 22000; \
|
||||||
|
} else { \
|
||||||
|
m_sQueueSample.m_nSampleIndex = SFX_COL_GARAGE_DOOR_1; \
|
||||||
|
m_sQueueSample.m_nFrequency = 18000; \
|
||||||
|
} \
|
||||||
|
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN; \
|
||||||
|
m_sQueueSample.field_16 = 4; \
|
||||||
|
m_sQueueSample.m_bEmittingVolume = 60; \
|
||||||
|
m_sQueueSample.field_48 = 0.0f; \
|
||||||
|
m_sQueueSample.m_fSoundIntensity = 80.0f; \
|
||||||
|
m_sQueueSample.field_16 = 4; \
|
||||||
|
m_sQueueSample.m_bReverbFlag = true; \
|
||||||
|
/*m_sQueueSample.m_bReverbFlag = true;*/ \
|
||||||
|
m_sQueueSample.m_bIsDistant = false; \
|
||||||
|
m_sQueueSample.field_56 = 1; \
|
||||||
|
m_sQueueSample.m_nLoopCount = 1; \
|
||||||
|
m_sQueueSample.m_nLoopStart = 0; \
|
||||||
|
m_sQueueSample.m_nLoopEnd = -1; \
|
||||||
|
m_sQueueSample.m_counter = iSound++; \
|
||||||
|
if(iSound < 32) iSound = 32; \
|
||||||
|
m_sQueueSample.m_bRequireReflection = 1; \
|
||||||
|
AddSampleToRequestedQueue(); \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
break; \
|
||||||
|
default: continue; \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
for(uint32 i = 0; i < CGarages::NumGarages; ++i) {
|
for(uint32 i = 0; i < CGarages::NumGarages; ++i) {
|
||||||
if(CGarages::Garages[i].m_eGarageType == GARAGE_NONE) continue;
|
if(CGarages::Garages[i].m_eGarageType == GARAGE_NONE) continue;
|
||||||
entity = CGarages::Garages[i].m_pDoor1;
|
entity = CGarages::Garages[i].m_pDoor1;
|
||||||
@ -3902,104 +3946,14 @@ cAudioManager::ProcessGarages()
|
|||||||
if(CGarages::Garages[i].m_eGarageType == GARAGE_CRUSHER) {
|
if(CGarages::Garages[i].m_eGarageType == GARAGE_CRUSHER) {
|
||||||
if(CGarages::Garages[i].m_eGarageState == GS_AFTERDROPOFF) {
|
if(CGarages::Garages[i].m_eGarageState == GS_AFTERDROPOFF) {
|
||||||
if(!(m_FrameCounter & 1)) {
|
if(!(m_FrameCounter & 1)) {
|
||||||
for(j = 0;
|
LOOP_HELPER
|
||||||
j < m_asAudioEntities[m_sQueueSample.m_nEntityIndex]
|
|
||||||
.m_AudioEvents;
|
|
||||||
++j) {
|
|
||||||
switch(m_asAudioEntities[m_sQueueSample
|
|
||||||
.m_nEntityIndex]
|
|
||||||
.m_awAudioEvent[j]) {
|
|
||||||
case SOUND_GARAGE_DOOR_CLOSED:
|
|
||||||
case SOUND_GARAGE_DOOR_OPENED:
|
|
||||||
if(distSquared < 6400.f) {
|
|
||||||
CalculateDistance(
|
|
||||||
distCalculated,
|
|
||||||
distSquared);
|
|
||||||
m_sQueueSample
|
|
||||||
.m_bVolume = ComputeVolume(
|
|
||||||
60, 80.f,
|
|
||||||
m_sQueueSample.m_fDistance);
|
|
||||||
if(m_sQueueSample.m_bVolume) {
|
|
||||||
if(CGarages::Garages[i]
|
|
||||||
.m_eGarageType ==
|
|
||||||
GARAGE_CRUSHER) {
|
|
||||||
m_sQueueSample
|
|
||||||
.m_nSampleIndex =
|
|
||||||
SFX_COL_CAR_PANEL_2;
|
|
||||||
m_sQueueSample
|
|
||||||
.m_nFrequency =
|
|
||||||
6735;
|
|
||||||
} else if(
|
|
||||||
m_asAudioEntities
|
|
||||||
[m_sQueueSample
|
|
||||||
.m_nEntityIndex]
|
|
||||||
.m_awAudioEvent
|
|
||||||
[j] ==
|
|
||||||
69) {
|
|
||||||
m_sQueueSample
|
|
||||||
.m_nSampleIndex =
|
|
||||||
SFX_COL_CAR_PANEL_2;
|
|
||||||
m_sQueueSample
|
|
||||||
.m_nFrequency =
|
|
||||||
22000;
|
|
||||||
} else {
|
|
||||||
m_sQueueSample
|
|
||||||
.m_nSampleIndex =
|
|
||||||
SFX_COL_GARAGE_DOOR_1;
|
|
||||||
m_sQueueSample
|
|
||||||
.m_nFrequency =
|
|
||||||
18000;
|
|
||||||
}
|
|
||||||
m_sQueueSample
|
|
||||||
.m_bBankIndex = 0;
|
|
||||||
m_sQueueSample
|
|
||||||
.field_16 = 4;
|
|
||||||
m_sQueueSample
|
|
||||||
.m_bEmittingVolume =
|
|
||||||
60;
|
|
||||||
m_sQueueSample
|
|
||||||
.field_48 = 0.0;
|
|
||||||
m_sQueueSample
|
|
||||||
.m_fSoundIntensity =
|
|
||||||
80.0f;
|
|
||||||
m_sQueueSample
|
|
||||||
.field_16 = 4;
|
|
||||||
m_sQueueSample
|
|
||||||
.m_bReverbFlag = 1;
|
|
||||||
//m_sQueueSample
|
|
||||||
// .m_bReverbFlag = 1;
|
|
||||||
m_sQueueSample
|
|
||||||
.m_bIsDistant = 0;
|
|
||||||
m_sQueueSample
|
|
||||||
.field_56 = 1;
|
|
||||||
m_sQueueSample
|
|
||||||
.m_nLoopCount = 1;
|
|
||||||
m_sQueueSample
|
|
||||||
.m_nLoopStart = 0;
|
|
||||||
m_sQueueSample
|
|
||||||
.m_nLoopEnd = -1;
|
|
||||||
m_sQueueSample
|
|
||||||
.m_counter =
|
|
||||||
iSound++;
|
|
||||||
if(iSound < 32)
|
|
||||||
iSound = 32;
|
|
||||||
m_sQueueSample
|
|
||||||
.m_bRequireReflection =
|
|
||||||
1;
|
|
||||||
AddSampleToRequestedQueue();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default: continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if(m_anRandomTable[1] & 1) {
|
if(m_anRandomTable[1] & 1) {
|
||||||
sampleIndex = m_anRandomTable[2] % 5u + SFX_COL_CAR_1;
|
sampleIndex = m_anRandomTable[2] % 5 + SFX_COL_CAR_1;
|
||||||
} else {
|
} else {
|
||||||
sampleIndex =
|
sampleIndex =
|
||||||
m_anRandomTable[2] % 6u + SFX_COL_CAR_PANEL_1;
|
m_anRandomTable[2] % 6 + SFX_COL_CAR_PANEL_1;
|
||||||
}
|
}
|
||||||
m_sQueueSample.m_nSampleIndex = sampleIndex;
|
m_sQueueSample.m_nSampleIndex = sampleIndex;
|
||||||
m_sQueueSample.m_nFrequency =
|
m_sQueueSample.m_nFrequency =
|
||||||
@ -4012,8 +3966,8 @@ cAudioManager::ProcessGarages()
|
|||||||
m_sQueueSample.field_56 = 1;
|
m_sQueueSample.field_56 = 1;
|
||||||
m_sQueueSample.m_counter = iSound++;
|
m_sQueueSample.m_counter = iSound++;
|
||||||
if(iSound < 32u) iSound = 32;
|
if(iSound < 32u) iSound = 32;
|
||||||
m_sQueueSample.m_bBankIndex = 0;
|
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
|
||||||
m_sQueueSample.m_bIsDistant = 0;
|
m_sQueueSample.m_bIsDistant = false;
|
||||||
m_sQueueSample.field_16 = 3;
|
m_sQueueSample.field_16 = 3;
|
||||||
m_sQueueSample.m_bEmittingVolume = 90;
|
m_sQueueSample.m_bEmittingVolume = 90;
|
||||||
m_sQueueSample.m_nLoopStart =
|
m_sQueueSample.m_nLoopStart =
|
||||||
@ -4022,84 +3976,12 @@ cAudioManager::ProcessGarages()
|
|||||||
m_sQueueSample.m_nLoopEnd =
|
m_sQueueSample.m_nLoopEnd =
|
||||||
SampleManager.GetSampleLoopEndOffset(
|
SampleManager.GetSampleLoopEndOffset(
|
||||||
m_sQueueSample.m_nSampleIndex);
|
m_sQueueSample.m_nSampleIndex);
|
||||||
m_sQueueSample.field_48 = 2.0;
|
m_sQueueSample.field_48 = 2.0f;
|
||||||
m_sQueueSample.m_fSoundIntensity = 80.0f;
|
m_sQueueSample.m_fSoundIntensity = 80.0f;
|
||||||
m_sQueueSample.m_bReverbFlag = 1;
|
m_sQueueSample.m_bReverbFlag = true;
|
||||||
m_sQueueSample.m_bRequireReflection = 0;
|
m_sQueueSample.m_bRequireReflection = false;
|
||||||
AddSampleToRequestedQueue();
|
AddSampleToRequestedQueue();
|
||||||
for(j = 0; j < m_asAudioEntities[m_sQueueSample.m_nEntityIndex]
|
LOOP_HELPER
|
||||||
.m_AudioEvents;
|
|
||||||
++j) {
|
|
||||||
switch(m_asAudioEntities[m_sQueueSample.m_nEntityIndex]
|
|
||||||
.m_awAudioEvent[j]) {
|
|
||||||
case SOUND_GARAGE_DOOR_CLOSED:
|
|
||||||
case SOUND_GARAGE_DOOR_OPENED:
|
|
||||||
if(distSquared < 6400.f) {
|
|
||||||
CalculateDistance(distCalculated,
|
|
||||||
distSquared);
|
|
||||||
m_sQueueSample.m_bVolume =
|
|
||||||
ComputeVolume(
|
|
||||||
60, 80.f,
|
|
||||||
m_sQueueSample.m_fDistance);
|
|
||||||
if(m_sQueueSample.m_bVolume) {
|
|
||||||
if(CGarages::Garages[i]
|
|
||||||
.m_eGarageType ==
|
|
||||||
GARAGE_CRUSHER) {
|
|
||||||
m_sQueueSample
|
|
||||||
.m_nSampleIndex =
|
|
||||||
SFX_COL_CAR_PANEL_2;
|
|
||||||
m_sQueueSample
|
|
||||||
.m_nFrequency =
|
|
||||||
6735;
|
|
||||||
} else if(
|
|
||||||
m_asAudioEntities
|
|
||||||
[m_sQueueSample
|
|
||||||
.m_nEntityIndex]
|
|
||||||
.m_awAudioEvent
|
|
||||||
[j] == 69) {
|
|
||||||
m_sQueueSample
|
|
||||||
.m_nSampleIndex =
|
|
||||||
SFX_COL_CAR_PANEL_2;
|
|
||||||
m_sQueueSample
|
|
||||||
.m_nFrequency =
|
|
||||||
22000;
|
|
||||||
} else {
|
|
||||||
m_sQueueSample
|
|
||||||
.m_nSampleIndex =
|
|
||||||
SFX_COL_GARAGE_DOOR_1;
|
|
||||||
m_sQueueSample
|
|
||||||
.m_nFrequency =
|
|
||||||
18000;
|
|
||||||
}
|
|
||||||
m_sQueueSample.m_bBankIndex = 0;
|
|
||||||
m_sQueueSample.field_16 = 4;
|
|
||||||
m_sQueueSample
|
|
||||||
.m_bEmittingVolume = 60;
|
|
||||||
m_sQueueSample.field_48 = 0.0;
|
|
||||||
m_sQueueSample
|
|
||||||
.m_fSoundIntensity = 80.0f;
|
|
||||||
m_sQueueSample.field_16 = 4;
|
|
||||||
m_sQueueSample.m_bReverbFlag =
|
|
||||||
1;
|
|
||||||
//m_sQueueSample.m_bReverbFlag =
|
|
||||||
// 1;
|
|
||||||
m_sQueueSample.m_bIsDistant = 0;
|
|
||||||
m_sQueueSample.field_56 = 1;
|
|
||||||
m_sQueueSample.m_nLoopCount = 1;
|
|
||||||
m_sQueueSample.m_nLoopStart = 0;
|
|
||||||
m_sQueueSample.m_nLoopEnd = -1;
|
|
||||||
m_sQueueSample.m_counter =
|
|
||||||
iSound++;
|
|
||||||
if(iSound < 32) iSound = 32;
|
|
||||||
m_sQueueSample
|
|
||||||
.m_bRequireReflection = 1;
|
|
||||||
AddSampleToRequestedQueue();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default: continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
m_sQueueSample.m_nSampleIndex = SFX_FISHING_BOAT_IDLE;
|
m_sQueueSample.m_nSampleIndex = SFX_FISHING_BOAT_IDLE;
|
||||||
@ -4112,73 +3994,25 @@ cAudioManager::ProcessGarages()
|
|||||||
m_sQueueSample.m_nLoopCount = 0;
|
m_sQueueSample.m_nLoopCount = 0;
|
||||||
m_sQueueSample.field_76 = 3;
|
m_sQueueSample.field_76 = 3;
|
||||||
m_sQueueSample.field_56 = 0;
|
m_sQueueSample.field_56 = 0;
|
||||||
m_sQueueSample.m_bBankIndex = 0;
|
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
|
||||||
m_sQueueSample.m_bIsDistant = 0;
|
m_sQueueSample.m_bIsDistant = false;
|
||||||
m_sQueueSample.field_16 = 3;
|
m_sQueueSample.field_16 = 3;
|
||||||
m_sQueueSample.m_bEmittingVolume = 90;
|
m_sQueueSample.m_bEmittingVolume = 90;
|
||||||
m_sQueueSample.m_nLoopStart =
|
m_sQueueSample.m_nLoopStart =
|
||||||
SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex);
|
SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex);
|
||||||
m_sQueueSample.m_nLoopEnd =
|
m_sQueueSample.m_nLoopEnd =
|
||||||
SampleManager.GetSampleLoopEndOffset(m_sQueueSample.m_nSampleIndex);
|
SampleManager.GetSampleLoopEndOffset(m_sQueueSample.m_nSampleIndex);
|
||||||
m_sQueueSample.field_48 = 2.0;
|
m_sQueueSample.field_48 = 2.0f;
|
||||||
m_sQueueSample.m_fSoundIntensity = 80.0f;
|
m_sQueueSample.m_fSoundIntensity = 80.0f;
|
||||||
m_sQueueSample.m_bReverbFlag = 1;
|
m_sQueueSample.m_bReverbFlag = true;
|
||||||
m_sQueueSample.m_bRequireReflection = 0;
|
m_sQueueSample.m_bRequireReflection = false;
|
||||||
AddSampleToRequestedQueue();
|
AddSampleToRequestedQueue();
|
||||||
for(j = 0; j < m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_AudioEvents;
|
LOOP_HELPER
|
||||||
++j) {
|
|
||||||
switch(m_asAudioEntities[m_sQueueSample.m_nEntityIndex]
|
|
||||||
.m_awAudioEvent[j]) {
|
|
||||||
case SOUND_GARAGE_DOOR_CLOSED:
|
|
||||||
case SOUND_GARAGE_DOOR_OPENED:
|
|
||||||
if(distSquared < 6400.f) {
|
|
||||||
CalculateDistance(distCalculated, distSquared);
|
|
||||||
m_sQueueSample.m_bVolume =
|
|
||||||
ComputeVolume(60, 80.f, m_sQueueSample.m_fDistance);
|
|
||||||
if(m_sQueueSample.m_bVolume) {
|
|
||||||
if(CGarages::Garages[i].m_eGarageType ==
|
|
||||||
GARAGE_CRUSHER) {
|
|
||||||
m_sQueueSample.m_nSampleIndex =
|
|
||||||
SFX_COL_CAR_PANEL_2;
|
|
||||||
m_sQueueSample.m_nFrequency = 6735;
|
|
||||||
} else if(m_asAudioEntities[m_sQueueSample
|
|
||||||
.m_nEntityIndex]
|
|
||||||
.m_awAudioEvent[j] == 69) {
|
|
||||||
m_sQueueSample.m_nSampleIndex =
|
|
||||||
SFX_COL_CAR_PANEL_2;
|
|
||||||
m_sQueueSample.m_nFrequency = 22000;
|
|
||||||
} else {
|
|
||||||
m_sQueueSample.m_nSampleIndex =
|
|
||||||
SFX_COL_GARAGE_DOOR_1;
|
|
||||||
m_sQueueSample.m_nFrequency = 18000;
|
|
||||||
}
|
|
||||||
m_sQueueSample.m_bBankIndex = 0;
|
|
||||||
m_sQueueSample.field_16 = 4;
|
|
||||||
m_sQueueSample.m_bEmittingVolume = 60;
|
|
||||||
m_sQueueSample.field_48 = 0.0;
|
|
||||||
m_sQueueSample.m_fSoundIntensity = 80.0f;
|
|
||||||
m_sQueueSample.field_16 = 4;
|
|
||||||
m_sQueueSample.m_bReverbFlag = 1;
|
|
||||||
//m_sQueueSample.m_bReverbFlag = 1;
|
|
||||||
m_sQueueSample.m_bIsDistant = 0;
|
|
||||||
m_sQueueSample.field_56 = 1;
|
|
||||||
m_sQueueSample.m_nLoopCount = 1;
|
|
||||||
m_sQueueSample.m_nLoopStart = 0;
|
|
||||||
m_sQueueSample.m_nLoopEnd = -1;
|
|
||||||
m_sQueueSample.m_counter = iSound++;
|
|
||||||
if(iSound < 32) iSound = 32;
|
|
||||||
m_sQueueSample.m_bRequireReflection = 1;
|
|
||||||
AddSampleToRequestedQueue();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default: continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#undef LOOP_HELPER
|
||||||
}
|
}
|
||||||
|
|
||||||
struct tHelicopterSampleData {
|
struct tHelicopterSampleData {
|
||||||
@ -5120,7 +4954,7 @@ cAudioManager::ProcessMissionAudio()
|
|||||||
static uint8 nFramesForPretendPlaying = 0;
|
static uint8 nFramesForPretendPlaying = 0;
|
||||||
|
|
||||||
if(m_bIsInitialised) {
|
if(m_bIsInitialised) {
|
||||||
if(m_sMissionAudio.m_nSampleIndex != 3033) {
|
if(m_sMissionAudio.m_nSampleIndex != NO_SAMPLE) {
|
||||||
switch(m_sMissionAudio.m_bLoadingStatus) {
|
switch(m_sMissionAudio.m_bLoadingStatus) {
|
||||||
case 0:
|
case 0:
|
||||||
SampleManager.PreloadStreamedFile(m_sMissionAudio.m_nSampleIndex, 1);
|
SampleManager.PreloadStreamedFile(m_sMissionAudio.m_nSampleIndex, 1);
|
||||||
@ -5141,7 +4975,7 @@ cAudioManager::ProcessMissionAudio()
|
|||||||
m_sMissionAudio.m_bPlayStatus = 1;
|
m_sMissionAudio.m_bPlayStatus = 1;
|
||||||
} else {
|
} else {
|
||||||
m_sMissionAudio.m_bPlayStatus = 2;
|
m_sMissionAudio.m_bPlayStatus = 2;
|
||||||
m_sMissionAudio.m_nSampleIndex = 3033;
|
m_sMissionAudio.m_nSampleIndex = NO_SAMPLE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -5161,7 +4995,7 @@ cAudioManager::ProcessMissionAudio()
|
|||||||
2 ||
|
2 ||
|
||||||
m_sMissionAudio.field_24-- == 0) {
|
m_sMissionAudio.field_24-- == 0) {
|
||||||
m_sMissionAudio.m_bPlayStatus = 2;
|
m_sMissionAudio.m_bPlayStatus = 2;
|
||||||
m_sMissionAudio.m_nSampleIndex = 3033;
|
m_sMissionAudio.m_nSampleIndex = NO_SAMPLE;
|
||||||
SampleManager.StopStreamedFile(1);
|
SampleManager.StopStreamedFile(1);
|
||||||
m_sMissionAudio.field_24 = 0;
|
m_sMissionAudio.field_24 = 0;
|
||||||
}
|
}
|
||||||
@ -5175,7 +5009,7 @@ cAudioManager::ProcessMissionAudio()
|
|||||||
SampleManager.PauseStream(0, 1);
|
SampleManager.PauseStream(0, 1);
|
||||||
} else {
|
} else {
|
||||||
m_sMissionAudio.m_bPlayStatus = 2;
|
m_sMissionAudio.m_bPlayStatus = 2;
|
||||||
m_sMissionAudio.m_nSampleIndex = 3033;
|
m_sMissionAudio.m_nSampleIndex = NO_SAMPLE;
|
||||||
SampleManager.StopStreamedFile(1);
|
SampleManager.StopStreamedFile(1);
|
||||||
m_sMissionAudio.field_24 = 0;
|
m_sMissionAudio.field_24 = 0;
|
||||||
}
|
}
|
||||||
@ -6978,7 +6812,7 @@ cAudioManager::ProcessProjectiles()
|
|||||||
case WEAPONTYPE_ROCKETLAUNCHER:
|
case WEAPONTYPE_ROCKETLAUNCHER:
|
||||||
emittingVol = maxVolume;
|
emittingVol = maxVolume;
|
||||||
maxDist = 8100.f;
|
maxDist = 8100.f;
|
||||||
m_sQueueSample.m_fSoundIntensity = 90.0;
|
m_sQueueSample.m_fSoundIntensity = 90.0f;
|
||||||
m_sQueueSample.m_nSampleIndex = 81;
|
m_sQueueSample.m_nSampleIndex = 81;
|
||||||
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
|
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
|
||||||
m_sQueueSample.m_nFrequency =
|
m_sQueueSample.m_nFrequency =
|
||||||
@ -6988,7 +6822,7 @@ cAudioManager::ProcessProjectiles()
|
|||||||
case WEAPONTYPE_MOLOTOV:
|
case WEAPONTYPE_MOLOTOV:
|
||||||
emittingVol = 50;
|
emittingVol = 50;
|
||||||
maxDist = 900.f;
|
maxDist = 900.f;
|
||||||
m_sQueueSample.m_fSoundIntensity = 30.0;
|
m_sQueueSample.m_fSoundIntensity = 30.0f;
|
||||||
m_sQueueSample.m_nSampleIndex = SFX_PED_ON_FIRE;
|
m_sQueueSample.m_nSampleIndex = SFX_PED_ON_FIRE;
|
||||||
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
|
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
|
||||||
m_sQueueSample.m_nFrequency =
|
m_sQueueSample.m_nFrequency =
|
||||||
@ -6997,7 +6831,7 @@ cAudioManager::ProcessProjectiles()
|
|||||||
break;
|
break;
|
||||||
default: return;
|
default: return;
|
||||||
}
|
}
|
||||||
m_sQueueSample.field_48 = 4.0;
|
m_sQueueSample.field_48 = 4.0f;
|
||||||
m_sQueueSample.field_76 = 3;
|
m_sQueueSample.field_76 = 3;
|
||||||
m_sQueueSample.m_vecPos = CProjectileInfo::ms_apProjectile[i]->GetPosition();
|
m_sQueueSample.m_vecPos = CProjectileInfo::ms_apProjectile[i]->GetPosition();
|
||||||
float distSquared = GetDistanceSquared(&m_sQueueSample.m_vecPos);
|
float distSquared = GetDistanceSquared(&m_sQueueSample.m_vecPos);
|
||||||
@ -7373,7 +7207,7 @@ cAudioManager::ProcessVehicle(CVehicle *veh)
|
|||||||
params.m_pVehicle = veh;
|
params.m_pVehicle = veh;
|
||||||
params.m_pTransmission = nil;
|
params.m_pTransmission = nil;
|
||||||
params.m_nIndex = 0;
|
params.m_nIndex = 0;
|
||||||
params.m_fVelocityChange = 0.0;
|
params.m_fVelocityChange = 0.0f;
|
||||||
|
|
||||||
if(handling) params.m_pTransmission = &handling->Transmission;
|
if(handling) params.m_pTransmission = &handling->Transmission;
|
||||||
|
|
||||||
@ -7534,8 +7368,8 @@ cAudioManager::ProcessVehicleHorn(cVehicleParams *params)
|
|||||||
m_sQueueSample.m_nSampleIndex);
|
m_sQueueSample.m_nSampleIndex);
|
||||||
m_sQueueSample.m_nLoopEnd =
|
m_sQueueSample.m_nLoopEnd =
|
||||||
SampleManager.GetSampleLoopEndOffset(m_sQueueSample.m_nSampleIndex);
|
SampleManager.GetSampleLoopEndOffset(m_sQueueSample.m_nSampleIndex);
|
||||||
m_sQueueSample.field_48 = 5.0;
|
m_sQueueSample.field_48 = 5.0f;
|
||||||
m_sQueueSample.m_fSoundIntensity = 40.0;
|
m_sQueueSample.m_fSoundIntensity = 40.0f;
|
||||||
m_sQueueSample.field_56 = 0;
|
m_sQueueSample.field_56 = 0;
|
||||||
m_sQueueSample.field_76 = 3;
|
m_sQueueSample.field_76 = 3;
|
||||||
m_sQueueSample.m_bReverbFlag = true;
|
m_sQueueSample.m_bReverbFlag = true;
|
||||||
@ -7547,7 +7381,7 @@ cAudioManager::ProcessVehicleHorn(cVehicleParams *params)
|
|||||||
if(automobile->m_nCarHornTimer > 44) automobile->m_nCarHornTimer = 44;
|
if(automobile->m_nCarHornTimer > 44) automobile->m_nCarHornTimer = 44;
|
||||||
if(automobile->m_nCarHornTimer == 44)
|
if(automobile->m_nCarHornTimer == 44)
|
||||||
automobile->field_22D =
|
automobile->field_22D =
|
||||||
(LOBYTE(m_FrameCounter) + LOBYTE(m_sQueueSample.m_nEntityIndex)) & 7;
|
(uint8(m_FrameCounter) + uint8(m_sQueueSample.m_nEntityIndex)) & 7;
|
||||||
if(hornPatternsArray[automobile->field_22D][44 - automobile->m_nCarHornTimer]) {
|
if(hornPatternsArray[automobile->field_22D][44 - automobile->m_nCarHornTimer]) {
|
||||||
CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance);
|
CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance);
|
||||||
m_sQueueSample.m_bVolume = ComputeVolume(80, 40.f, m_sQueueSample.m_fDistance);
|
m_sQueueSample.m_bVolume = ComputeVolume(80, 40.f, m_sQueueSample.m_fDistance);
|
||||||
@ -7566,8 +7400,8 @@ cAudioManager::ProcessVehicleHorn(cVehicleParams *params)
|
|||||||
m_sQueueSample.m_nSampleIndex);
|
m_sQueueSample.m_nSampleIndex);
|
||||||
m_sQueueSample.m_nLoopEnd =
|
m_sQueueSample.m_nLoopEnd =
|
||||||
SampleManager.GetSampleLoopEndOffset(m_sQueueSample.m_nSampleIndex);
|
SampleManager.GetSampleLoopEndOffset(m_sQueueSample.m_nSampleIndex);
|
||||||
m_sQueueSample.field_48 = 5.0;
|
m_sQueueSample.field_48 = 5.0f;
|
||||||
m_sQueueSample.m_fSoundIntensity = 40.0;
|
m_sQueueSample.m_fSoundIntensity = 40.0f;
|
||||||
m_sQueueSample.field_56 = 0;
|
m_sQueueSample.field_56 = 0;
|
||||||
m_sQueueSample.field_76 = 3;
|
m_sQueueSample.field_76 = 3;
|
||||||
m_sQueueSample.m_bReverbFlag = true;
|
m_sQueueSample.m_bReverbFlag = true;
|
||||||
@ -7812,8 +7646,8 @@ cAudioManager::ProcessVehicleSkidding(cVehicleParams *params)
|
|||||||
m_sQueueSample.m_nLoopStart =
|
m_sQueueSample.m_nLoopStart =
|
||||||
SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex);
|
SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex);
|
||||||
m_sQueueSample.m_nLoopEnd = SampleManager.GetSampleLoopEndOffset(m_sQueueSample.m_nSampleIndex);
|
m_sQueueSample.m_nLoopEnd = SampleManager.GetSampleLoopEndOffset(m_sQueueSample.m_nSampleIndex);
|
||||||
m_sQueueSample.field_48 = 3.0;
|
m_sQueueSample.field_48 = 3.0f;
|
||||||
m_sQueueSample.m_fSoundIntensity = 40.0;
|
m_sQueueSample.m_fSoundIntensity = 40.0f;
|
||||||
m_sQueueSample.field_56 = 0;
|
m_sQueueSample.field_56 = 0;
|
||||||
m_sQueueSample.field_76 = 3;
|
m_sQueueSample.field_76 = 3;
|
||||||
m_sQueueSample.m_bReverbFlag = true;
|
m_sQueueSample.m_bReverbFlag = true;
|
||||||
@ -8225,27 +8059,27 @@ cAudioManager::SetSpeakerConfig(int32 conf) const
|
|||||||
bool
|
bool
|
||||||
cAudioManager::SetupJumboEngineSound(uint8 vol, int32 freq)
|
cAudioManager::SetupJumboEngineSound(uint8 vol, int32 freq)
|
||||||
{
|
{
|
||||||
if(m_sQueueSample.m_fDistance >= 180.f) return 0;
|
if(m_sQueueSample.m_fDistance >= 180.f) return false;
|
||||||
|
|
||||||
uint8 emittingVol = vol - gJumboVolOffsetPercentage / 100;
|
uint8 emittingVol = vol - gJumboVolOffsetPercentage / 100;
|
||||||
m_sQueueSample.m_bVolume = ComputeVolume(emittingVol, 180.f, m_sQueueSample.m_fDistance);
|
m_sQueueSample.m_bVolume = ComputeVolume(emittingVol, 180.f, m_sQueueSample.m_fDistance);
|
||||||
if(m_sQueueSample.m_bVolume) {
|
if(m_sQueueSample.m_bVolume) {
|
||||||
m_sQueueSample.m_counter = 3;
|
m_sQueueSample.m_counter = 3;
|
||||||
m_sQueueSample.m_nSampleIndex = SFX_JUMBO_ENGINE;
|
m_sQueueSample.m_nSampleIndex = SFX_JUMBO_ENGINE;
|
||||||
m_sQueueSample.m_bBankIndex = 0;
|
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
|
||||||
m_sQueueSample.m_bIsDistant = 0;
|
m_sQueueSample.m_bIsDistant = false;
|
||||||
m_sQueueSample.field_16 = 1;
|
m_sQueueSample.field_16 = 1;
|
||||||
m_sQueueSample.m_nFrequency = freq;
|
m_sQueueSample.m_nFrequency = freq;
|
||||||
m_sQueueSample.m_nLoopCount = 0;
|
m_sQueueSample.m_nLoopCount = 0;
|
||||||
m_sQueueSample.m_bEmittingVolume = emittingVol;
|
m_sQueueSample.m_bEmittingVolume = emittingVol;
|
||||||
m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex);
|
m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex);
|
||||||
m_sQueueSample.m_nLoopEnd = SampleManager.GetSampleLoopEndOffset(m_sQueueSample.m_nSampleIndex);
|
m_sQueueSample.m_nLoopEnd = SampleManager.GetSampleLoopEndOffset(m_sQueueSample.m_nSampleIndex);
|
||||||
m_sQueueSample.field_48 = 4.0;
|
m_sQueueSample.field_48 = 4.0f;
|
||||||
m_sQueueSample.m_fSoundIntensity = 180.0f;
|
m_sQueueSample.m_fSoundIntensity = 180.0f;
|
||||||
m_sQueueSample.field_56 = 0;
|
m_sQueueSample.field_56 = 0;
|
||||||
m_sQueueSample.field_76 = 4;
|
m_sQueueSample.field_76 = 4;
|
||||||
m_sQueueSample.m_bReverbFlag = 1;
|
m_sQueueSample.m_bReverbFlag = true;
|
||||||
m_sQueueSample.m_bRequireReflection = 0;
|
m_sQueueSample.m_bRequireReflection = false;
|
||||||
AddSampleToRequestedQueue();
|
AddSampleToRequestedQueue();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -24,7 +24,7 @@ uint32& CBridge::TimeOfBridgeBecomingOperational = *(uint32*)0x8F2BC0;
|
|||||||
void CBridge::Init()
|
void CBridge::Init()
|
||||||
{
|
{
|
||||||
FindBridgeEntities();
|
FindBridgeEntities();
|
||||||
OldLift = -1.0;
|
OldLift = -1.0f;
|
||||||
if (pLiftPart && pWeight)
|
if (pLiftPart && pWeight)
|
||||||
{
|
{
|
||||||
DefaultZLiftPart = pLiftPart->GetPosition().z;
|
DefaultZLiftPart = pLiftPart->GetPosition().z;
|
||||||
@ -60,32 +60,32 @@ void CBridge::Update()
|
|||||||
if (timeElapsed < 10000)
|
if (timeElapsed < 10000)
|
||||||
{
|
{
|
||||||
State = STATE_LIFT_PART_MOVING_DOWN;
|
State = STATE_LIFT_PART_MOVING_DOWN;
|
||||||
liftHeight = 25.0 - timeElapsed / 10000.0 * 25.0;
|
liftHeight = 25.0 - timeElapsed / 10000.0 * 25.0f;
|
||||||
}
|
}
|
||||||
else if (timeElapsed < 40000)
|
else if (timeElapsed < 40000)
|
||||||
{
|
{
|
||||||
liftHeight = 0.0;
|
liftHeight = 0.0f;
|
||||||
State = STATE_LIFT_PART_IS_DOWN;
|
State = STATE_LIFT_PART_IS_DOWN;
|
||||||
}
|
}
|
||||||
else if (timeElapsed < 50000)
|
else if (timeElapsed < 50000)
|
||||||
{
|
{
|
||||||
liftHeight = 0.0;
|
liftHeight = 0.0f;
|
||||||
State = STATE_LIFT_PART_ABOUT_TO_MOVE_UP;
|
State = STATE_LIFT_PART_ABOUT_TO_MOVE_UP;
|
||||||
}
|
}
|
||||||
else if (timeElapsed < 60000)
|
else if (timeElapsed < 60000)
|
||||||
{
|
{
|
||||||
State = STATE_LIFT_PART_MOVING_UP;
|
State = STATE_LIFT_PART_MOVING_UP;
|
||||||
liftHeight = (timeElapsed - 50000) / 10000.0 * 25.0;
|
liftHeight = (timeElapsed - 50000) / 10000.0 * 25.0f;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
liftHeight = 25.0;
|
liftHeight = 25.0f;
|
||||||
State = STATE_LIFT_PART_IS_UP;
|
State = STATE_LIFT_PART_IS_UP;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
liftHeight = 25.0;
|
liftHeight = 25.0f;
|
||||||
TimeOfBridgeBecomingOperational = 0;
|
TimeOfBridgeBecomingOperational = 0;
|
||||||
State = STATE_BRIDGE_LOCKED;
|
State = STATE_BRIDGE_LOCKED;
|
||||||
}
|
}
|
||||||
|
@ -991,7 +991,7 @@ float
|
|||||||
CPathFind::FindNodeOrientationForCarPlacement(int32 nodeId)
|
CPathFind::FindNodeOrientationForCarPlacement(int32 nodeId)
|
||||||
{
|
{
|
||||||
if(m_pathNodes[nodeId].numLinks == 0)
|
if(m_pathNodes[nodeId].numLinks == 0)
|
||||||
return 0.0;
|
return 0.0f;
|
||||||
CVector dir = m_pathNodes[m_connections[m_pathNodes[nodeId].firstLink]].pos - m_pathNodes[nodeId].pos;
|
CVector dir = m_pathNodes[m_connections[m_pathNodes[nodeId].firstLink]].pos - m_pathNodes[nodeId].pos;
|
||||||
dir.z = 0.0f;
|
dir.z = 0.0f;
|
||||||
dir.Normalise();
|
dir.Normalise();
|
||||||
@ -1008,7 +1008,7 @@ CPathFind::FindNodeOrientationForCarPlacementFacingDestination(int32 nodeId, flo
|
|||||||
CVector dir;
|
CVector dir;
|
||||||
|
|
||||||
if(m_pathNodes[nodeId].numLinks == 0)
|
if(m_pathNodes[nodeId].numLinks == 0)
|
||||||
return 0.0;
|
return 0.0f;
|
||||||
|
|
||||||
int bestNode = m_connections[m_pathNodes[nodeId].firstLink];
|
int bestNode = m_connections[m_pathNodes[nodeId].firstLink];
|
||||||
#ifdef FIX_BUGS
|
#ifdef FIX_BUGS
|
||||||
|
@ -704,7 +704,7 @@ CPickups::DoPickUpEffects(CEntity *entity)
|
|||||||
aWeaponReds[colorId] * colorModifier, aWeaponGreens[colorId] * colorModifier, aWeaponBlues[colorId] * colorModifier,
|
aWeaponReds[colorId] * colorModifier, aWeaponGreens[colorId] * colorModifier, aWeaponBlues[colorId] * colorModifier,
|
||||||
4.0f, 1.0f, 40.0f, false, 0.0f);
|
4.0f, 1.0f, 40.0f, false, 0.0f);
|
||||||
|
|
||||||
float radius = (double)(rand() & 0xF) * 0.1 + 3.0;
|
float radius = (double)(rand() & 0xF) * 0.1 + 3.0f;
|
||||||
CPointLights::AddLight(CPointLights::LIGHT_POINT, pos, CVector(0.0f, 0.0f, 0.0f), radius, aWeaponReds[colorId] * modifiedSin / 256.0f, aWeaponGreens[colorId] * modifiedSin / 256.0f, aWeaponBlues[colorId] * modifiedSin / 256.0f, CPointLights::FOG_NONE, true);
|
CPointLights::AddLight(CPointLights::LIGHT_POINT, pos, CVector(0.0f, 0.0f, 0.0f), radius, aWeaponReds[colorId] * modifiedSin / 256.0f, aWeaponGreens[colorId] * modifiedSin / 256.0f, aWeaponBlues[colorId] * modifiedSin / 256.0f, CPointLights::FOG_NONE, true);
|
||||||
float size = (double)(rand() & 0xF) * 0.0005 + 0.6;
|
float size = (double)(rand() & 0xF) * 0.0005 + 0.6;
|
||||||
CCoronas::RegisterCorona( (uintptr)entity,
|
CCoronas::RegisterCorona( (uintptr)entity,
|
||||||
|
@ -174,7 +174,7 @@ void CMissionCleanup::Process()
|
|||||||
{
|
{
|
||||||
CPopulation::m_AllRandomPedsThisType = -1;
|
CPopulation::m_AllRandomPedsThisType = -1;
|
||||||
CPopulation::PedDensityMultiplier = 1.0f;
|
CPopulation::PedDensityMultiplier = 1.0f;
|
||||||
CCarCtrl::CarDensityMultiplier = 1.0;
|
CCarCtrl::CarDensityMultiplier = 1.0f;
|
||||||
FindPlayerPed()->m_pWanted->m_fCrimeSensitivity = 1.0f;
|
FindPlayerPed()->m_pWanted->m_fCrimeSensitivity = 1.0f;
|
||||||
TheCamera.Restore();
|
TheCamera.Restore();
|
||||||
TheCamera.SetWideScreenOff();
|
TheCamera.SetWideScreenOff();
|
||||||
|
@ -416,17 +416,17 @@ CCam::Process_FollowPed(const CVector &CameraTarget, float TargetOrientation, fl
|
|||||||
// BUG? is this ever used?
|
// BUG? is this ever used?
|
||||||
// The values seem to be roughly m_fPedZoomValueSmooth + 1.85
|
// The values seem to be roughly m_fPedZoomValueSmooth + 1.85
|
||||||
if(ResetStatics){
|
if(ResetStatics){
|
||||||
if(TheCamera.PedZoomIndicator == 1.0) m_fRealGroundDist = 2.090556f;
|
if(TheCamera.PedZoomIndicator == 1.0f) m_fRealGroundDist = 2.090556f;
|
||||||
if(TheCamera.PedZoomIndicator == 2.0) m_fRealGroundDist = 3.34973f;
|
if(TheCamera.PedZoomIndicator == 2.0f) m_fRealGroundDist = 3.34973f;
|
||||||
if(TheCamera.PedZoomIndicator == 3.0) m_fRealGroundDist = 4.704914f;
|
if(TheCamera.PedZoomIndicator == 3.0f) m_fRealGroundDist = 4.704914f;
|
||||||
if(TheCamera.PedZoomIndicator == 4.0) m_fRealGroundDist = 2.090556f;
|
if(TheCamera.PedZoomIndicator == 4.0f) m_fRealGroundDist = 2.090556f;
|
||||||
}
|
}
|
||||||
// And what is this? It's only used for collision and rotation it seems
|
// And what is this? It's only used for collision and rotation it seems
|
||||||
float RealGroundDist;
|
float RealGroundDist;
|
||||||
if(TheCamera.PedZoomIndicator == 1.0) RealGroundDist = 2.090556f;
|
if(TheCamera.PedZoomIndicator == 1.0f) RealGroundDist = 2.090556f;
|
||||||
if(TheCamera.PedZoomIndicator == 2.0) RealGroundDist = 3.34973f;
|
if(TheCamera.PedZoomIndicator == 2.0f) RealGroundDist = 3.34973f;
|
||||||
if(TheCamera.PedZoomIndicator == 3.0) RealGroundDist = 4.704914f;
|
if(TheCamera.PedZoomIndicator == 3.0f) RealGroundDist = 4.704914f;
|
||||||
if(TheCamera.PedZoomIndicator == 4.0) RealGroundDist = 2.090556f;
|
if(TheCamera.PedZoomIndicator == 4.0f) RealGroundDist = 2.090556f;
|
||||||
if(m_fCloseInPedHeightOffset > 0.00001f)
|
if(m_fCloseInPedHeightOffset > 0.00001f)
|
||||||
RealGroundDist = 1.7016;
|
RealGroundDist = 1.7016;
|
||||||
|
|
||||||
@ -1344,30 +1344,30 @@ CCamera::SetCamCutSceneOffSet(const CVector &pos)
|
|||||||
void
|
void
|
||||||
CCamera::TakeControlWithSpline(short nSwitch)
|
CCamera::TakeControlWithSpline(short nSwitch)
|
||||||
{
|
{
|
||||||
m_iModeToGoTo = CCam::MODE_FLYBY;
|
m_iModeToGoTo = CCam::MODE_FLYBY;
|
||||||
m_bLookingAtPlayer = false;
|
m_bLookingAtPlayer = false;
|
||||||
m_bLookingAtVector = false;
|
m_bLookingAtVector = false;
|
||||||
m_bcutsceneFinished = false;
|
m_bcutsceneFinished = false;
|
||||||
m_iTypeOfSwitch = nSwitch;
|
m_iTypeOfSwitch = nSwitch;
|
||||||
m_bStartInterScript = true;
|
m_bStartInterScript = true;
|
||||||
|
|
||||||
//FindPlayerPed(); // unused
|
//FindPlayerPed(); // unused
|
||||||
};
|
};
|
||||||
|
|
||||||
void CCamera::SetCameraDirectlyInFrontForFollowPed_CamOnAString()
|
void CCamera::SetCameraDirectlyInFrontForFollowPed_CamOnAString()
|
||||||
{
|
{
|
||||||
m_bCamDirectlyInFront = true;
|
m_bCamDirectlyInFront = true;
|
||||||
CPlayerPed *player = FindPlayerPed();
|
CPlayerPed *player = FindPlayerPed();
|
||||||
if (player)
|
if (player)
|
||||||
m_PedOrientForBehindOrInFront = CGeneral::GetATanOfXY(player->GetForward().x, player->GetForward().y);
|
m_PedOrientForBehindOrInFront = CGeneral::GetATanOfXY(player->GetForward().x, player->GetForward().y);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCamera::SetCameraDirectlyBehindForFollowPed_CamOnAString()
|
void CCamera::SetCameraDirectlyBehindForFollowPed_CamOnAString()
|
||||||
{
|
{
|
||||||
m_bCamDirectlyBehind = true;
|
m_bCamDirectlyBehind = true;
|
||||||
CPlayerPed *player = FindPlayerPed();
|
CPlayerPed *player = FindPlayerPed();
|
||||||
if (player)
|
if (player)
|
||||||
m_PedOrientForBehindOrInFront = CGeneral::GetATanOfXY(player->GetForward().x, player->GetForward().y);
|
m_PedOrientForBehindOrInFront = CGeneral::GetATanOfXY(player->GetForward().x, player->GetForward().y);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -1382,80 +1382,80 @@ CCamera::SetWideScreenOff(void)
|
|||||||
m_bWantsToSwitchWidescreenOff = m_WideScreenOn;
|
m_bWantsToSwitchWidescreenOff = m_WideScreenOn;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CCamera::SetNewPlayerWeaponMode(int16 mode, int16 minZoom, int16 maxZoom)
|
CCamera::SetNewPlayerWeaponMode(int16 mode, int16 minZoom, int16 maxZoom)
|
||||||
{
|
{
|
||||||
PlayerWeaponMode.Mode = mode;
|
PlayerWeaponMode.Mode = mode;
|
||||||
PlayerWeaponMode.MaxZoom = maxZoom;
|
PlayerWeaponMode.MaxZoom = maxZoom;
|
||||||
PlayerWeaponMode.MinZoom = minZoom;
|
PlayerWeaponMode.MinZoom = minZoom;
|
||||||
PlayerWeaponMode.Duration = 0.0f;
|
PlayerWeaponMode.Duration = 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CCamera::UpdateAimingCoors(CVector const &coors)
|
CCamera::UpdateAimingCoors(CVector const &coors)
|
||||||
{
|
{
|
||||||
m_cvecAimingTargetCoors = coors;
|
m_cvecAimingTargetCoors = coors;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CCamera::SetCamPositionForFixedMode(const CVector &Source, const CVector &UpOffSet)
|
CCamera::SetCamPositionForFixedMode(const CVector &Source, const CVector &UpOffSet)
|
||||||
{
|
{
|
||||||
m_vecFixedModeSource = Source;
|
m_vecFixedModeSource = Source;
|
||||||
m_vecFixedModeUpOffSet = UpOffSet;
|
m_vecFixedModeUpOffSet = UpOffSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CCamera::SetRwCamera(RwCamera *cam)
|
CCamera::SetRwCamera(RwCamera *cam)
|
||||||
{
|
{
|
||||||
m_pRwCamera = cam;
|
m_pRwCamera = cam;
|
||||||
m_viewMatrix.Attach(&m_pRwCamera->viewMatrix, false);
|
m_viewMatrix.Attach(&m_pRwCamera->viewMatrix, false);
|
||||||
CMBlur::MotionBlurOpen(m_pRwCamera);
|
CMBlur::MotionBlurOpen(m_pRwCamera);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32
|
uint32
|
||||||
CCamera::GetCutSceneFinishTime(void)
|
CCamera::GetCutSceneFinishTime(void)
|
||||||
{
|
{
|
||||||
int cam = ActiveCam;
|
int cam = ActiveCam;
|
||||||
if (Cams[cam].Mode == CCam::MODE_FLYBY)
|
if (Cams[cam].Mode == CCam::MODE_FLYBY)
|
||||||
return Cams[cam].m_uiFinishTime;
|
return Cams[cam].m_uiFinishTime;
|
||||||
cam = (cam + 1) % 2;
|
cam = (cam + 1) % 2;
|
||||||
if (Cams[cam].Mode == CCam::MODE_FLYBY)
|
if (Cams[cam].Mode == CCam::MODE_FLYBY)
|
||||||
return Cams[cam].m_uiFinishTime;
|
return Cams[cam].m_uiFinishTime;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CCamera::FinishCutscene(void)
|
CCamera::FinishCutscene(void)
|
||||||
{
|
{
|
||||||
SetPercentAlongCutScene(100.0f);
|
SetPercentAlongCutScene(100.0f);
|
||||||
m_fPositionAlongSpline = 1.0f;
|
m_fPositionAlongSpline = 1.0f;
|
||||||
m_bcutsceneFinished = true;
|
m_bcutsceneFinished = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CCamera::SetZoomValueFollowPedScript(int16 mode)
|
CCamera::SetZoomValueFollowPedScript(int16 mode)
|
||||||
{
|
{
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case 0: m_fPedZoomValueScript = 0.25f; break;
|
case 0: m_fPedZoomValueScript = 0.25f; break;
|
||||||
case 1: m_fPedZoomValueScript = 1.5f; break;
|
case 1: m_fPedZoomValueScript = 1.5f; break;
|
||||||
case 2: m_fPedZoomValueScript = 2.9f; break;
|
case 2: m_fPedZoomValueScript = 2.9f; break;
|
||||||
default: m_fPedZoomValueScript = m_fPedZoomValueScript; break;
|
default: m_fPedZoomValueScript = m_fPedZoomValueScript; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_bUseScriptZoomValuePed = true;
|
m_bUseScriptZoomValuePed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CCamera::SetZoomValueCamStringScript(int16 mode)
|
CCamera::SetZoomValueCamStringScript(int16 mode)
|
||||||
{
|
{
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case 0: m_fCarZoomValueScript = 0.05f; break;
|
case 0: m_fCarZoomValueScript = 0.05f; break;
|
||||||
case 1: m_fCarZoomValueScript = 1.9f; break;
|
case 1: m_fCarZoomValueScript = 1.9f; break;
|
||||||
case 2: m_fCarZoomValueScript = 3.9f; break;
|
case 2: m_fCarZoomValueScript = 3.9f; break;
|
||||||
default: m_fCarZoomValueScript = m_fCarZoomValueScript; break;
|
default: m_fCarZoomValueScript = m_fCarZoomValueScript; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_bUseScriptZoomValueCar = true;
|
m_bUseScriptZoomValueCar = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ void CTimer::Update(void)
|
|||||||
{
|
{
|
||||||
m_snTimeInMilliseconds = m_snTimeInMilliseconds + upd;
|
m_snTimeInMilliseconds = m_snTimeInMilliseconds + upd;
|
||||||
m_snTimeInMillisecondsNonClipped = m_snTimeInMillisecondsNonClipped + upd;
|
m_snTimeInMillisecondsNonClipped = m_snTimeInMillisecondsNonClipped + upd;
|
||||||
ms_fTimeStep = updInCyclesScaled / (double)_nCyclesPerMS / 20.0;
|
ms_fTimeStep = updInCyclesScaled / (double)_nCyclesPerMS / 20.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
#define _USE_MATH_DEFINES
|
#define _USE_MATH_DEFINES
|
||||||
#pragma warning(disable: 4244) // int to float
|
#pragma warning(disable: 4244) // int to float
|
||||||
#pragma warning(disable: 4800) // int to bool
|
#pragma warning(disable: 4800) // int to bool
|
||||||
#pragma warning(disable: 4305) // double to float
|
|
||||||
#pragma warning(disable: 4838) // narrowing conversion
|
#pragma warning(disable: 4838) // narrowing conversion
|
||||||
#pragma warning(disable: 4996) // POSIX names
|
#pragma warning(disable: 4996) // POSIX names
|
||||||
|
|
||||||
|
@ -216,7 +216,7 @@ Idle(void *arg)
|
|||||||
RenderEffects();
|
RenderEffects();
|
||||||
|
|
||||||
if((TheCamera.m_BlurType == MBLUR_NONE || TheCamera.m_BlurType == MBLUR_NORMAL) &&
|
if((TheCamera.m_BlurType == MBLUR_NONE || TheCamera.m_BlurType == MBLUR_NORMAL) &&
|
||||||
TheCamera.m_ScreenReductionPercentage > 0.0)
|
TheCamera.m_ScreenReductionPercentage > 0.0f)
|
||||||
TheCamera.SetMotionBlurAlpha(150);
|
TheCamera.SetMotionBlurAlpha(150);
|
||||||
TheCamera.RenderMotionBlur();
|
TheCamera.RenderMotionBlur();
|
||||||
|
|
||||||
|
@ -1831,7 +1831,7 @@ CPhysical::ProcessCollision(void)
|
|||||||
|
|
||||||
if(IsPed() && (distSq >= sq(0.2f) || ped->IsPlayer())){
|
if(IsPed() && (distSq >= sq(0.2f) || ped->IsPlayer())){
|
||||||
if(ped->IsPlayer())
|
if(ped->IsPlayer())
|
||||||
n = max(NUMSTEPS(0.2f), 2.0);
|
n = max(NUMSTEPS(0.2f), 2.0f);
|
||||||
else
|
else
|
||||||
n = NUMSTEPS(0.3f);
|
n = NUMSTEPS(0.3f);
|
||||||
step = savedTimeStep / n;
|
step = savedTimeStep / n;
|
||||||
|
@ -90,7 +90,7 @@ CObjectData::SetObjectData(int32 modelId, CObject &object)
|
|||||||
object.m_nCollisionDamageEffect = objinfo->m_nCollisionDamageEffect;
|
object.m_nCollisionDamageEffect = objinfo->m_nCollisionDamageEffect;
|
||||||
object.m_nSpecialCollisionResponseCases = objinfo->m_nSpecialCollisionResponseCases;
|
object.m_nSpecialCollisionResponseCases = objinfo->m_nSpecialCollisionResponseCases;
|
||||||
object.m_bCameraToAvoidThisObject = objinfo->m_bCameraToAvoidThisObject;
|
object.m_bCameraToAvoidThisObject = objinfo->m_bCameraToAvoidThisObject;
|
||||||
if(object.m_fMass >= 99998.0){
|
if(object.m_fMass >= 99998.0f){
|
||||||
object.bInfiniteMass = true;
|
object.bInfiniteMass = true;
|
||||||
object.bAffectedByGravity = false;
|
object.bAffectedByGravity = false;
|
||||||
object.bExplosionProof = true;
|
object.bExplosionProof = true;
|
||||||
|
@ -7642,21 +7642,21 @@ CPed::Flee(void)
|
|||||||
else if (PI + angleToFleeEntity < angleToFleeDamagingThing)
|
else if (PI + angleToFleeEntity < angleToFleeDamagingThing)
|
||||||
angleToFleeDamagingThing -= TWOPI;
|
angleToFleeDamagingThing -= TWOPI;
|
||||||
|
|
||||||
if (damagingThingPriorityMult <= 1.0) {
|
if (damagingThingPriorityMult <= 1.0f) {
|
||||||
// Range [0.0, 1.0]
|
// Range [0.0, 1.0]
|
||||||
|
|
||||||
double angleToFleeBoth = (angleToFleeDamagingThing + angleToFleeEntity) * 0.5;
|
float angleToFleeBoth = (angleToFleeDamagingThing + angleToFleeEntity) * 0.5f;
|
||||||
|
|
||||||
if (m_fRotationDest - PI > angleToFleeBoth)
|
if (m_fRotationDest - PI > angleToFleeBoth)
|
||||||
angleToFleeBoth += TWOPI;
|
angleToFleeBoth += TWOPI;
|
||||||
else if (PI + m_fRotationDest < angleToFleeBoth)
|
else if (PI + m_fRotationDest < angleToFleeBoth)
|
||||||
angleToFleeBoth -= TWOPI;
|
angleToFleeBoth -= TWOPI;
|
||||||
|
|
||||||
m_fRotationDest = (1.0 - damagingThingPriorityMult) * m_fRotationDest + damagingThingPriorityMult * angleToFleeBoth;
|
m_fRotationDest = (1.0f - damagingThingPriorityMult) * m_fRotationDest + damagingThingPriorityMult * angleToFleeBoth;
|
||||||
} else {
|
} else {
|
||||||
// Range (1.0, 1.5]
|
// Range (1.0, 1.5]
|
||||||
|
|
||||||
double adjustedMult = (damagingThingPriorityMult - 1.0) * 2.0;
|
double adjustedMult = (damagingThingPriorityMult - 1.0f) * 2.0f;
|
||||||
m_fRotationDest = angleToFleeEntity * (1.0 - adjustedMult) + adjustedMult * angleToFleeDamagingThing;
|
m_fRotationDest = angleToFleeEntity * (1.0 - adjustedMult) + adjustedMult * angleToFleeDamagingThing;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -17676,4 +17676,4 @@ STARTPATCHES
|
|||||||
InjectHook(0x4E52A0, &CPed::WarpPedToNearLeaderOffScreen, PATCH_JUMP);
|
InjectHook(0x4E52A0, &CPed::WarpPedToNearLeaderOffScreen, PATCH_JUMP);
|
||||||
InjectHook(0x4E0220, &CPed::SetCarJack, PATCH_JUMP);
|
InjectHook(0x4E0220, &CPed::SetCarJack, PATCH_JUMP);
|
||||||
InjectHook(0x4D6780, &CPed::Solicit, PATCH_JUMP);
|
InjectHook(0x4D6780, &CPed::Solicit, PATCH_JUMP);
|
||||||
ENDPATCHES
|
ENDPATCHES
|
||||||
|
@ -1170,4 +1170,4 @@ STARTPATCHES
|
|||||||
InjectHook(0x4F4690, &CPopulation::TestRoomForDummyObject, PATCH_JUMP);
|
InjectHook(0x4F4690, &CPopulation::TestRoomForDummyObject, PATCH_JUMP);
|
||||||
InjectHook(0x4F45A0, &CPopulation::ConvertToDummyObject, PATCH_JUMP);
|
InjectHook(0x4F45A0, &CPopulation::ConvertToDummyObject, PATCH_JUMP);
|
||||||
InjectHook(0x4F4410, &CPopulation::ConvertAllObjectsToDummyObjects, PATCH_JUMP);
|
InjectHook(0x4F4410, &CPopulation::ConvertAllObjectsToDummyObjects, PATCH_JUMP);
|
||||||
ENDPATCHES
|
ENDPATCHES
|
||||||
|
@ -457,7 +457,7 @@ CCoronas::RenderReflections(void)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Don't draw if reflection is too high
|
// Don't draw if reflection is too high
|
||||||
if(aCoronas[i].heightAboveRoad < 20.0){
|
if(aCoronas[i].heightAboveRoad < 20.0f){
|
||||||
// don't draw if camera is below road
|
// don't draw if camera is below road
|
||||||
if(CCoronas::aCoronas[i].coors.z - aCoronas[i].heightAboveRoad > TheCamera.GetPosition().z)
|
if(CCoronas::aCoronas[i].coors.z - aCoronas[i].heightAboveRoad > TheCamera.GetPosition().z)
|
||||||
continue;
|
continue;
|
||||||
|
@ -84,7 +84,7 @@ CFont::Initialise(void)
|
|||||||
Sprite[2].SetTexture("font1", "font1_mask");
|
Sprite[2].SetTexture("font1", "font1_mask");
|
||||||
SetScale(1.0f, 1.0f);
|
SetScale(1.0f, 1.0f);
|
||||||
SetSlantRefPoint(SCREEN_WIDTH, 0.0f);
|
SetSlantRefPoint(SCREEN_WIDTH, 0.0f);
|
||||||
SetSlant(0.0);
|
SetSlant(0.0f);
|
||||||
SetColor(CRGBA(0xFF, 0xFF, 0xFF, 0));
|
SetColor(CRGBA(0xFF, 0xFF, 0xFF, 0));
|
||||||
SetJustifyOff();
|
SetJustifyOff();
|
||||||
SetCentreOff();
|
SetCentreOff();
|
||||||
@ -95,7 +95,7 @@ CFont::Initialise(void)
|
|||||||
SetBackGroundOnlyTextOff();
|
SetBackGroundOnlyTextOff();
|
||||||
SetPropOn();
|
SetPropOn();
|
||||||
SetFontStyle(0);
|
SetFontStyle(0);
|
||||||
SetRightJustifyWrap(0.0);
|
SetRightJustifyWrap(0.0f);
|
||||||
SetAlphaFade(255.0f);
|
SetAlphaFade(255.0f);
|
||||||
SetDropShadowPosition(0);
|
SetDropShadowPosition(0);
|
||||||
CTxdStore::PopCurrentTxd();
|
CTxdStore::PopCurrentTxd();
|
||||||
|
@ -611,15 +611,15 @@ void CHud::Draw()
|
|||||||
/*
|
/*
|
||||||
DrawClock
|
DrawClock
|
||||||
*/
|
*/
|
||||||
CFont::SetJustifyOff();
|
CFont::SetJustifyOff();
|
||||||
CFont::SetCentreOff();
|
CFont::SetCentreOff();
|
||||||
CFont::SetBackgroundOff();
|
CFont::SetBackgroundOff();
|
||||||
CFont::SetScale(SCREEN_SCALE_X(0.8f), SCREEN_SCALE_Y(1.35f));
|
CFont::SetScale(SCREEN_SCALE_X(0.8f), SCREEN_SCALE_Y(1.35f));
|
||||||
CFont::SetBackGroundOnlyTextOff();
|
CFont::SetBackGroundOnlyTextOff();
|
||||||
CFont::SetPropOff();
|
CFont::SetPropOff();
|
||||||
CFont::SetFontStyle(FONT_HEADING);
|
CFont::SetFontStyle(FONT_HEADING);
|
||||||
CFont::SetRightJustifyOn();
|
CFont::SetRightJustifyOn();
|
||||||
CFont::SetRightJustifyWrap(0.0);
|
CFont::SetRightJustifyWrap(0.0f);
|
||||||
|
|
||||||
sprintf(sTemp, "%02d:%02d", CClock::GetHours(), CClock::GetMinutes());
|
sprintf(sTemp, "%02d:%02d", CClock::GetHours(), CClock::GetMinutes());
|
||||||
AsciiToUnicode(sTemp, sPrint);
|
AsciiToUnicode(sTemp, sPrint);
|
||||||
@ -702,21 +702,21 @@ void CHud::Draw()
|
|||||||
AsciiToUnicode(CUserDisplay::OnscnTimer.m_sEntries[0].m_bCounterBuffer, sTimer);
|
AsciiToUnicode(CUserDisplay::OnscnTimer.m_sEntries[0].m_bCounterBuffer, sTimer);
|
||||||
CFont::SetPropOn();
|
CFont::SetPropOn();
|
||||||
|
|
||||||
CFont::SetBackgroundOff();
|
CFont::SetBackgroundOff();
|
||||||
CFont::SetScale(SCREEN_SCALE_X(0.8f), SCREEN_SCALE_Y(1.35f));
|
CFont::SetScale(SCREEN_SCALE_X(0.8f), SCREEN_SCALE_Y(1.35f));
|
||||||
CFont::SetCentreOff();
|
CFont::SetCentreOff();
|
||||||
CFont::SetRightJustifyOn();
|
CFont::SetRightJustifyOn();
|
||||||
CFont::SetRightJustifyWrap(0.0f);
|
CFont::SetRightJustifyWrap(0.0f);
|
||||||
CFont::SetFontStyle(FONT_HEADING);
|
CFont::SetFontStyle(FONT_HEADING);
|
||||||
CFont::SetColor(CRGBA(244, 20, 20, 255));
|
CFont::SetColor(CRGBA(244, 20, 20, 255));
|
||||||
CFont::SetWrapx(SCREEN_SCALE_X(640.0f));
|
CFont::SetWrapx(SCREEN_SCALE_X(640.0f));
|
||||||
CFont::SetPropOff();
|
CFont::SetPropOff();
|
||||||
CFont::SetBackGroundOnlyTextOn();
|
CFont::SetBackGroundOnlyTextOn();
|
||||||
|
|
||||||
CFont::SetColor(CRGBA(0, 0, 0, 255));
|
CFont::SetColor(CRGBA(0, 0, 0, 255));
|
||||||
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y(2.0f), sTimer);
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y(2.0f), sTimer);
|
||||||
|
|
||||||
CFont::SetColor(CRGBA(0, 106, 164, 255));
|
CFont::SetColor(CRGBA(0, 106, 164, 255));
|
||||||
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET), SCREEN_SCALE_Y(132.0f), sTimer);
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET), SCREEN_SCALE_Y(132.0f), sTimer);
|
||||||
} else {
|
} else {
|
||||||
int counter = atoi(CUserDisplay::OnscnTimer.m_sEntries[0].m_bCounterBuffer);
|
int counter = atoi(CUserDisplay::OnscnTimer.m_sEntries[0].m_bCounterBuffer);
|
||||||
@ -728,7 +728,7 @@ void CHud::Draw()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (CUserDisplay::OnscnTimer.m_sEntries[0].m_aCounterText[0]) {
|
if (CUserDisplay::OnscnTimer.m_sEntries[0].m_aCounterText[0]) {
|
||||||
CFont::SetPropOn();
|
CFont::SetPropOn();
|
||||||
CFont::SetScale(SCREEN_SCALE_X(0.8f), SCREEN_SCALE_Y(1.35f));
|
CFont::SetScale(SCREEN_SCALE_X(0.8f), SCREEN_SCALE_Y(1.35f));
|
||||||
CFont::SetColor(CRGBA(0, 0, 0, 255));
|
CFont::SetColor(CRGBA(0, 0, 0, 255));
|
||||||
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(61.0f) + SCREEN_SCALE_Y(2.0f), SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y(2.0f), TheText.Get(CUserDisplay::OnscnTimer.m_sEntries[0].m_aCounterText));
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(61.0f) + SCREEN_SCALE_Y(2.0f), SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y(2.0f), TheText.Get(CUserDisplay::OnscnTimer.m_sEntries[0].m_aCounterText));
|
||||||
@ -773,7 +773,7 @@ void CHud::Draw()
|
|||||||
fStep = 2.0f;
|
fStep = 2.0f;
|
||||||
PagerXOffset += fStep * CTimer::GetTimeStep();
|
PagerXOffset += fStep * CTimer::GetTimeStep();
|
||||||
if (PagerXOffset > 150.0f) {
|
if (PagerXOffset > 150.0f) {
|
||||||
PagerXOffset = 150.0;
|
PagerXOffset = 150.0f;
|
||||||
PagerOn = 0;
|
PagerOn = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -934,13 +934,13 @@ void CHud::Draw()
|
|||||||
BigMessageInUse[0] += CTimer::GetTimeStep();
|
BigMessageInUse[0] += CTimer::GetTimeStep();
|
||||||
|
|
||||||
if (BigMessageInUse[0] >= 120.0f) {
|
if (BigMessageInUse[0] >= 120.0f) {
|
||||||
BigMessageInUse[0] = 120.0;
|
BigMessageInUse[0] = 120.0f;
|
||||||
BigMessageAlpha[0] -= (CTimer::GetTimeStepInMilliseconds() * 0.3f);
|
BigMessageAlpha[0] -= (CTimer::GetTimeStepInMilliseconds() * 0.3f);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BigMessageAlpha[0] <= 0.0f) {
|
if (BigMessageAlpha[0] <= 0.0f) {
|
||||||
m_BigMessage[0][0] = 0;
|
m_BigMessage[0][0] = 0;
|
||||||
BigMessageAlpha[0] = 0.0;
|
BigMessageAlpha[0] = 0.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -977,7 +977,7 @@ void CHud::Draw()
|
|||||||
BigMessageAlpha[2] += (CTimer::GetTimeStepInSeconds() * 255.0f);
|
BigMessageAlpha[2] += (CTimer::GetTimeStepInSeconds() * 255.0f);
|
||||||
|
|
||||||
if (BigMessageAlpha[2] > 255.0f)
|
if (BigMessageAlpha[2] > 255.0f)
|
||||||
BigMessageAlpha[2] = 255.0;
|
BigMessageAlpha[2] = 255.0f;
|
||||||
|
|
||||||
CFont::SetBackgroundOff();
|
CFont::SetBackgroundOff();
|
||||||
|
|
||||||
@ -997,12 +997,12 @@ void CHud::Draw()
|
|||||||
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f), SCREEN_SCALE_FROM_BOTTOM(82.0f), m_BigMessage[2]);
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f), SCREEN_SCALE_FROM_BOTTOM(82.0f), m_BigMessage[2]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
BigMessageAlpha[2] = 0.0;
|
BigMessageAlpha[2] = 0.0f;
|
||||||
BigMessageInUse[2] = 1.0;
|
BigMessageInUse[2] = 1.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
BigMessageInUse[2] = 0.0;
|
BigMessageInUse[2] = 0.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1231,12 +1231,12 @@ void CHud::DrawAfterFade()
|
|||||||
BigMessageInUse[1] += CTimer::GetTimeStep();
|
BigMessageInUse[1] += CTimer::GetTimeStep();
|
||||||
|
|
||||||
if (BigMessageInUse[1] >= 120.0f) {
|
if (BigMessageInUse[1] >= 120.0f) {
|
||||||
BigMessageInUse[1] = 120.0;
|
BigMessageInUse[1] = 120.0f;
|
||||||
BigMessageAlpha[1] -= (CTimer::GetTimeStepInMilliseconds() * 0.3f);
|
BigMessageAlpha[1] -= (CTimer::GetTimeStepInMilliseconds() * 0.3f);
|
||||||
}
|
}
|
||||||
if (BigMessageAlpha[1] <= 0) {
|
if (BigMessageAlpha[1] <= 0) {
|
||||||
m_BigMessage[1][0] = 0;
|
m_BigMessage[1][0] = 0;
|
||||||
BigMessageAlpha[1] = 0.0;
|
BigMessageAlpha[1] = 0.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -115,47 +115,47 @@ void CBulletTrace::Update(void)
|
|||||||
|
|
||||||
WRAPPER void CBrightLights::RegisterOne(CVector pos, CVector up, CVector right, CVector fwd, uint8 type, uint8 unk1, uint8 unk2, uint8 unk3) { EAXJMP(0x51A410); }
|
WRAPPER void CBrightLights::RegisterOne(CVector pos, CVector up, CVector right, CVector fwd, uint8 type, uint8 unk1, uint8 unk2, uint8 unk3) { EAXJMP(0x51A410); }
|
||||||
|
|
||||||
RpAtomic *
|
RpAtomic *
|
||||||
MarkerAtomicCB(RpAtomic *atomic, void *data)
|
MarkerAtomicCB(RpAtomic *atomic, void *data)
|
||||||
{
|
{
|
||||||
*(RpAtomic**)data = atomic;
|
*(RpAtomic**)data = atomic;
|
||||||
return atomic;
|
return atomic;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
C3dMarker::AddMarker(uint32 identifier, uint16 type, float fSize, uint8 r, uint8 g, uint8 b, uint8 a, uint16 pulsePeriod, float pulseFraction, int16 rotateRate)
|
C3dMarker::AddMarker(uint32 identifier, uint16 type, float fSize, uint8 r, uint8 g, uint8 b, uint8 a, uint16 pulsePeriod, float pulseFraction, int16 rotateRate)
|
||||||
{
|
{
|
||||||
m_nIdentifier = identifier;
|
m_nIdentifier = identifier;
|
||||||
|
|
||||||
m_Matrix.SetUnity();
|
m_Matrix.SetUnity();
|
||||||
|
|
||||||
RpAtomic *origAtomic;
|
RpAtomic *origAtomic;
|
||||||
origAtomic = nil;
|
origAtomic = nil;
|
||||||
RpClumpForAllAtomics(C3dMarkers::m_pRpClumpArray[type], MarkerAtomicCB, &origAtomic);
|
RpClumpForAllAtomics(C3dMarkers::m_pRpClumpArray[type], MarkerAtomicCB, &origAtomic);
|
||||||
|
|
||||||
RpAtomic *atomic = RpAtomicClone(origAtomic);
|
RpAtomic *atomic = RpAtomicClone(origAtomic);
|
||||||
RwFrame *frame = RwFrameCreate();
|
RwFrame *frame = RwFrameCreate();
|
||||||
RpAtomicSetFrame(atomic, frame);
|
RpAtomicSetFrame(atomic, frame);
|
||||||
CVisibilityPlugins::SetAtomicRenderCallback(atomic, nil);
|
CVisibilityPlugins::SetAtomicRenderCallback(atomic, nil);
|
||||||
|
|
||||||
RpGeometry *geometry = RpAtomicGetGeometry(atomic);
|
RpGeometry *geometry = RpAtomicGetGeometry(atomic);
|
||||||
RpGeometrySetFlags(geometry, RpGeometryGetFlags(geometry) | rpGEOMETRYMODULATEMATERIALCOLOR);
|
RpGeometrySetFlags(geometry, RpGeometryGetFlags(geometry) | rpGEOMETRYMODULATEMATERIALCOLOR);
|
||||||
|
|
||||||
m_pAtomic = atomic;
|
m_pAtomic = atomic;
|
||||||
m_Matrix.Attach(RwFrameGetMatrix(RpAtomicGetFrame(m_pAtomic)));
|
m_Matrix.Attach(RwFrameGetMatrix(RpAtomicGetFrame(m_pAtomic)));
|
||||||
m_pMaterial = RpGeometryGetMaterial(geometry, 0);
|
m_pMaterial = RpGeometryGetMaterial(geometry, 0);
|
||||||
m_fSize = fSize;
|
m_fSize = fSize;
|
||||||
m_fStdSize = m_fSize;
|
m_fStdSize = m_fSize;
|
||||||
m_Color.red = r;
|
m_Color.red = r;
|
||||||
m_Color.green = g;
|
m_Color.green = g;
|
||||||
m_Color.blue = b;
|
m_Color.blue = b;
|
||||||
m_Color.alpha = a;
|
m_Color.alpha = a;
|
||||||
m_nPulsePeriod = pulsePeriod;
|
m_nPulsePeriod = pulsePeriod;
|
||||||
m_fPulseFraction = pulseFraction;
|
m_fPulseFraction = pulseFraction;
|
||||||
m_nRotateRate = rotateRate;
|
m_nRotateRate = rotateRate;
|
||||||
m_nStartTime = CTimer::GetTimeInMilliseconds();
|
m_nStartTime = CTimer::GetTimeInMilliseconds();
|
||||||
m_nType = type;
|
m_nType = type;
|
||||||
return m_pAtomic != nil;
|
return m_pAtomic != nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -163,238 +163,238 @@ C3dMarker::DeleteMarkerObject()
|
|||||||
{
|
{
|
||||||
RwFrame *frame;
|
RwFrame *frame;
|
||||||
|
|
||||||
m_nIdentifier = 0;
|
m_nIdentifier = 0;
|
||||||
m_nStartTime = 0;
|
m_nStartTime = 0;
|
||||||
m_bIsUsed = false;
|
m_bIsUsed = false;
|
||||||
m_nType = MARKERTYPE_INVALID;
|
m_nType = MARKERTYPE_INVALID;
|
||||||
|
|
||||||
frame = RpAtomicGetFrame(m_pAtomic);
|
frame = RpAtomicGetFrame(m_pAtomic);
|
||||||
RpAtomicDestroy(m_pAtomic);
|
RpAtomicDestroy(m_pAtomic);
|
||||||
RwFrameDestroy(frame);
|
RwFrameDestroy(frame);
|
||||||
m_pAtomic = nil;
|
m_pAtomic = nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
C3dMarker::Render()
|
C3dMarker::Render()
|
||||||
{
|
{
|
||||||
if (m_pAtomic == nil) return;
|
if (m_pAtomic == nil) return;
|
||||||
|
|
||||||
RwRGBA *color = RpMaterialGetColor(m_pMaterial);
|
RwRGBA *color = RpMaterialGetColor(m_pMaterial);
|
||||||
*color = m_Color;
|
*color = m_Color;
|
||||||
|
|
||||||
m_Matrix.UpdateRW();
|
m_Matrix.UpdateRW();
|
||||||
|
|
||||||
CMatrix matrix;
|
CMatrix matrix;
|
||||||
matrix.Attach(m_Matrix.m_attachment);
|
matrix.Attach(m_Matrix.m_attachment);
|
||||||
matrix.Scale(m_fSize);
|
matrix.Scale(m_fSize);
|
||||||
matrix.UpdateRW();
|
matrix.UpdateRW();
|
||||||
|
|
||||||
RwFrameUpdateObjects(RpAtomicGetFrame(m_pAtomic));
|
RwFrameUpdateObjects(RpAtomicGetFrame(m_pAtomic));
|
||||||
SetBrightMarkerColours(m_fBrightness);
|
SetBrightMarkerColours(m_fBrightness);
|
||||||
if (m_nType != MARKERTYPE_ARROW)
|
if (m_nType != MARKERTYPE_ARROW)
|
||||||
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE);
|
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE);
|
||||||
RpAtomicRender(m_pAtomic);
|
RpAtomicRender(m_pAtomic);
|
||||||
if (m_nType != MARKERTYPE_ARROW)
|
if (m_nType != MARKERTYPE_ARROW)
|
||||||
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)TRUE);
|
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)TRUE);
|
||||||
ReSetAmbientAndDirectionalColours();
|
ReSetAmbientAndDirectionalColours();
|
||||||
}
|
}
|
||||||
|
|
||||||
C3dMarker(&C3dMarkers::m_aMarkerArray)[NUM3DMARKERS] = *(C3dMarker(*)[NUM3DMARKERS])*(uintptr*)0x72D408;
|
C3dMarker(&C3dMarkers::m_aMarkerArray)[NUM3DMARKERS] = *(C3dMarker(*)[NUM3DMARKERS])*(uintptr*)0x72D408;
|
||||||
int32 &C3dMarkers::NumActiveMarkers = *(int32*)0x8F2A08;
|
int32 &C3dMarkers::NumActiveMarkers = *(int32*)0x8F2A08;
|
||||||
RpClump* (&C3dMarkers::m_pRpClumpArray)[NUMMARKERTYPES] = *(RpClump*(*)[NUMMARKERTYPES])*(uintptr*)0x8E2888;
|
RpClump* (&C3dMarkers::m_pRpClumpArray)[NUMMARKERTYPES] = *(RpClump*(*)[NUMMARKERTYPES])*(uintptr*)0x8E2888;
|
||||||
|
|
||||||
void
|
void
|
||||||
C3dMarkers::Init()
|
C3dMarkers::Init()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < NUM3DMARKERS; i++) {
|
for (int i = 0; i < NUM3DMARKERS; i++) {
|
||||||
m_aMarkerArray[i].m_pAtomic = nil;
|
m_aMarkerArray[i].m_pAtomic = nil;
|
||||||
m_aMarkerArray[i].m_nType = MARKERTYPE_INVALID;
|
m_aMarkerArray[i].m_nType = MARKERTYPE_INVALID;
|
||||||
m_aMarkerArray[i].m_bIsUsed = false;
|
m_aMarkerArray[i].m_bIsUsed = false;
|
||||||
m_aMarkerArray[i].m_nIdentifier = 0;
|
m_aMarkerArray[i].m_nIdentifier = 0;
|
||||||
m_aMarkerArray[i].m_Color.red = 255;
|
m_aMarkerArray[i].m_Color.red = 255;
|
||||||
m_aMarkerArray[i].m_Color.green = 255;
|
m_aMarkerArray[i].m_Color.green = 255;
|
||||||
m_aMarkerArray[i].m_Color.blue = 255;
|
m_aMarkerArray[i].m_Color.blue = 255;
|
||||||
m_aMarkerArray[i].m_Color.alpha = 255;
|
m_aMarkerArray[i].m_Color.alpha = 255;
|
||||||
m_aMarkerArray[i].m_nPulsePeriod = 1024;
|
m_aMarkerArray[i].m_nPulsePeriod = 1024;
|
||||||
m_aMarkerArray[i].m_nRotateRate = 5;
|
m_aMarkerArray[i].m_nRotateRate = 5;
|
||||||
m_aMarkerArray[i].m_nStartTime = 0;
|
m_aMarkerArray[i].m_nStartTime = 0;
|
||||||
m_aMarkerArray[i].m_fPulseFraction = 0.25f;
|
m_aMarkerArray[i].m_fPulseFraction = 0.25f;
|
||||||
m_aMarkerArray[i].m_fStdSize = 1.0f;
|
m_aMarkerArray[i].m_fStdSize = 1.0f;
|
||||||
m_aMarkerArray[i].m_fSize = 1.0f;
|
m_aMarkerArray[i].m_fSize = 1.0f;
|
||||||
m_aMarkerArray[i].m_fBrightness = 1.0f;
|
m_aMarkerArray[i].m_fBrightness = 1.0f;
|
||||||
m_aMarkerArray[i].m_fCameraRange = 0.0f;
|
m_aMarkerArray[i].m_fCameraRange = 0.0f;
|
||||||
}
|
}
|
||||||
NumActiveMarkers = 0;
|
NumActiveMarkers = 0;
|
||||||
int txdSlot = CTxdStore::FindTxdSlot("particle");
|
int txdSlot = CTxdStore::FindTxdSlot("particle");
|
||||||
CTxdStore::PushCurrentTxd();
|
CTxdStore::PushCurrentTxd();
|
||||||
CTxdStore::SetCurrentTxd(txdSlot);
|
CTxdStore::SetCurrentTxd(txdSlot);
|
||||||
CFileMgr::ChangeDir("\\");
|
CFileMgr::ChangeDir("\\");
|
||||||
m_pRpClumpArray[MARKERTYPE_ARROW] = CFileLoader::LoadAtomicFile2Return("models/generic/arrow.dff");
|
m_pRpClumpArray[MARKERTYPE_ARROW] = CFileLoader::LoadAtomicFile2Return("models/generic/arrow.dff");
|
||||||
m_pRpClumpArray[MARKERTYPE_CYLINDER] = CFileLoader::LoadAtomicFile2Return("models/generic/zonecylb.dff");
|
m_pRpClumpArray[MARKERTYPE_CYLINDER] = CFileLoader::LoadAtomicFile2Return("models/generic/zonecylb.dff");
|
||||||
CTxdStore::PopCurrentTxd();
|
CTxdStore::PopCurrentTxd();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
C3dMarkers::Shutdown()
|
C3dMarkers::Shutdown()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < NUM3DMARKERS; i++) {
|
for (int i = 0; i < NUM3DMARKERS; i++) {
|
||||||
if (m_aMarkerArray[i].m_pAtomic != nil)
|
if (m_aMarkerArray[i].m_pAtomic != nil)
|
||||||
m_aMarkerArray[i].DeleteMarkerObject();
|
m_aMarkerArray[i].DeleteMarkerObject();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < NUMMARKERTYPES; i++) {
|
for (int i = 0; i < NUMMARKERTYPES; i++) {
|
||||||
if (m_pRpClumpArray[i] != nil)
|
if (m_pRpClumpArray[i] != nil)
|
||||||
RpClumpDestroy(m_pRpClumpArray[i]);
|
RpClumpDestroy(m_pRpClumpArray[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
C3dMarkers::Render()
|
C3dMarkers::Render()
|
||||||
{
|
{
|
||||||
NumActiveMarkers = 0;
|
NumActiveMarkers = 0;
|
||||||
ActivateDirectional();
|
ActivateDirectional();
|
||||||
for (int i = 0; i < NUM3DMARKERS; i++) {
|
for (int i = 0; i < NUM3DMARKERS; i++) {
|
||||||
if (m_aMarkerArray[i].m_bIsUsed) {
|
if (m_aMarkerArray[i].m_bIsUsed) {
|
||||||
if (m_aMarkerArray[i].m_fCameraRange < 120.0f)
|
if (m_aMarkerArray[i].m_fCameraRange < 120.0f)
|
||||||
m_aMarkerArray[i].Render();
|
m_aMarkerArray[i].Render();
|
||||||
NumActiveMarkers++;
|
NumActiveMarkers++;
|
||||||
m_aMarkerArray[i].m_bIsUsed = false;
|
m_aMarkerArray[i].m_bIsUsed = false;
|
||||||
} else if (m_aMarkerArray[i].m_pAtomic != nil) {
|
} else if (m_aMarkerArray[i].m_pAtomic != nil) {
|
||||||
m_aMarkerArray[i].DeleteMarkerObject();
|
m_aMarkerArray[i].DeleteMarkerObject();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
C3dMarker *
|
C3dMarker *
|
||||||
C3dMarkers::PlaceMarker(uint32 identifier, uint16 type, CVector &pos, float size, uint8 r, uint8 g, uint8 b, uint8 a, uint16 pulsePeriod, float pulseFraction, int16 rotateRate)
|
C3dMarkers::PlaceMarker(uint32 identifier, uint16 type, CVector &pos, float size, uint8 r, uint8 g, uint8 b, uint8 a, uint16 pulsePeriod, float pulseFraction, int16 rotateRate)
|
||||||
{
|
{
|
||||||
C3dMarker *pMarker;
|
C3dMarker *pMarker;
|
||||||
|
|
||||||
pMarker = nil;
|
pMarker = nil;
|
||||||
float dist = Sqrt((pos.x - FindPlayerCentreOfWorld(0).x) * (pos.x - FindPlayerCentreOfWorld(0).x) + (pos.y - FindPlayerCentreOfWorld(0).y) * (pos.y - FindPlayerCentreOfWorld(0).y));
|
float dist = Sqrt((pos.x - FindPlayerCentreOfWorld(0).x) * (pos.x - FindPlayerCentreOfWorld(0).x) + (pos.y - FindPlayerCentreOfWorld(0).y) * (pos.y - FindPlayerCentreOfWorld(0).y));
|
||||||
|
|
||||||
if (type != MARKERTYPE_ARROW && type != MARKERTYPE_CYLINDER) return nil;
|
if (type != MARKERTYPE_ARROW && type != MARKERTYPE_CYLINDER) return nil;
|
||||||
|
|
||||||
for (int i = 0; i < NUM3DMARKERS; i++) {
|
for (int i = 0; i < NUM3DMARKERS; i++) {
|
||||||
if (!m_aMarkerArray[i].m_bIsUsed && m_aMarkerArray[i].m_nIdentifier == identifier) {
|
if (!m_aMarkerArray[i].m_bIsUsed && m_aMarkerArray[i].m_nIdentifier == identifier) {
|
||||||
pMarker = &m_aMarkerArray[i];
|
pMarker = &m_aMarkerArray[i];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pMarker == nil) {
|
if (pMarker == nil) {
|
||||||
for (int i = 0; i < NUM3DMARKERS; i++) {
|
for (int i = 0; i < NUM3DMARKERS; i++) {
|
||||||
if (m_aMarkerArray[i].m_nType == MARKERTYPE_INVALID) {
|
if (m_aMarkerArray[i].m_nType == MARKERTYPE_INVALID) {
|
||||||
pMarker = &m_aMarkerArray[i];
|
pMarker = &m_aMarkerArray[i];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pMarker == nil && type == MARKERTYPE_ARROW) {
|
if (pMarker == nil && type == MARKERTYPE_ARROW) {
|
||||||
for (int i = 0; i < NUM3DMARKERS; i++) {
|
for (int i = 0; i < NUM3DMARKERS; i++) {
|
||||||
if (dist < m_aMarkerArray[i].m_fCameraRange && m_aMarkerArray[i].m_nType == MARKERTYPE_ARROW && (pMarker == nil || m_aMarkerArray[i].m_fCameraRange > pMarker->m_fCameraRange)) {
|
if (dist < m_aMarkerArray[i].m_fCameraRange && m_aMarkerArray[i].m_nType == MARKERTYPE_ARROW && (pMarker == nil || m_aMarkerArray[i].m_fCameraRange > pMarker->m_fCameraRange)) {
|
||||||
pMarker = &m_aMarkerArray[i];
|
pMarker = &m_aMarkerArray[i];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pMarker != nil)
|
if (pMarker != nil)
|
||||||
pMarker->m_nType = MARKERTYPE_INVALID;
|
pMarker->m_nType = MARKERTYPE_INVALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pMarker == nil) return pMarker;
|
if (pMarker == nil) return pMarker;
|
||||||
|
|
||||||
pMarker->m_fCameraRange = dist;
|
pMarker->m_fCameraRange = dist;
|
||||||
if (pMarker->m_nIdentifier == identifier && pMarker->m_nType == type) {
|
if (pMarker->m_nIdentifier == identifier && pMarker->m_nType == type) {
|
||||||
if (type == MARKERTYPE_ARROW) {
|
if (type == MARKERTYPE_ARROW) {
|
||||||
if (dist < 25.0f) {
|
if (dist < 25.0f) {
|
||||||
if (dist > 5.0f)
|
if (dist > 5.0f)
|
||||||
pMarker->m_fStdSize = size - (25.0f - dist) * (0.3f * size) / 20.0f;
|
pMarker->m_fStdSize = size - (25.0f - dist) * (0.3f * size) / 20.0f;
|
||||||
else
|
else
|
||||||
pMarker->m_fStdSize = size - 0.3f * size;
|
pMarker->m_fStdSize = size - 0.3f * size;
|
||||||
} else {
|
} else {
|
||||||
pMarker->m_fStdSize = size;
|
pMarker->m_fStdSize = size;
|
||||||
}
|
}
|
||||||
} else if (type == MARKERTYPE_CYLINDER) {
|
} else if (type == MARKERTYPE_CYLINDER) {
|
||||||
if (dist < size + 12.0f) {
|
if (dist < size + 12.0f) {
|
||||||
if (dist > size + 1.0f)
|
if (dist > size + 1.0f)
|
||||||
pMarker->m_Color.alpha = (1.0f - (size + 12.0f - dist) * 0.7f / 11.0f) * (float)a;
|
pMarker->m_Color.alpha = (1.0f - (size + 12.0f - dist) * 0.7f / 11.0f) * (float)a;
|
||||||
else
|
else
|
||||||
pMarker->m_Color.alpha = (float)a * 0.3f;
|
pMarker->m_Color.alpha = (float)a * 0.3f;
|
||||||
} else {
|
} else {
|
||||||
pMarker->m_Color.alpha = a;
|
pMarker->m_Color.alpha = a;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
float someSin = Sin(TWOPI * (float)((pMarker->m_nPulsePeriod - 1) & (CTimer::GetTimeInMilliseconds() - pMarker->m_nStartTime)) / (float)pMarker->m_nPulsePeriod);
|
float someSin = Sin(TWOPI * (float)((pMarker->m_nPulsePeriod - 1) & (CTimer::GetTimeInMilliseconds() - pMarker->m_nStartTime)) / (float)pMarker->m_nPulsePeriod);
|
||||||
pMarker->m_fSize = pMarker->m_fStdSize - pulseFraction * pMarker->m_fStdSize * someSin;
|
pMarker->m_fSize = pMarker->m_fStdSize - pulseFraction * pMarker->m_fStdSize * someSin;
|
||||||
|
|
||||||
if (type == MARKERTYPE_ARROW) {
|
if (type == MARKERTYPE_ARROW) {
|
||||||
pos.z += 0.25f * pMarker->m_fStdSize * someSin;
|
pos.z += 0.25f * pMarker->m_fStdSize * someSin;
|
||||||
} else if (type == MARKERTYPE_0) {
|
} else if (type == MARKERTYPE_0) {
|
||||||
if (someSin > 0.0f)
|
if (someSin > 0.0f)
|
||||||
pMarker->m_Color.alpha = (float)a * 0.7f * someSin + a;
|
pMarker->m_Color.alpha = (float)a * 0.7f * someSin + a;
|
||||||
else
|
else
|
||||||
pMarker->m_Color.alpha = (float)a * 0.4f * someSin + a;
|
pMarker->m_Color.alpha = (float)a * 0.4f * someSin + a;
|
||||||
}
|
}
|
||||||
if (pMarker->m_nRotateRate) {
|
if (pMarker->m_nRotateRate) {
|
||||||
RwV3d pos = pMarker->m_Matrix.m_matrix.pos;
|
RwV3d pos = pMarker->m_Matrix.m_matrix.pos;
|
||||||
pMarker->m_Matrix.RotateZ(DEGTORAD(pMarker->m_nRotateRate * CTimer::GetTimeStep()));
|
pMarker->m_Matrix.RotateZ(DEGTORAD(pMarker->m_nRotateRate * CTimer::GetTimeStep()));
|
||||||
pMarker->m_Matrix.GetPosition() = pos;
|
pMarker->m_Matrix.GetPosition() = pos;
|
||||||
}
|
}
|
||||||
if (type == MARKERTYPE_ARROW)
|
if (type == MARKERTYPE_ARROW)
|
||||||
pMarker->m_Matrix.GetPosition() = pos;
|
pMarker->m_Matrix.GetPosition() = pos;
|
||||||
pMarker->m_bIsUsed = true;
|
pMarker->m_bIsUsed = true;
|
||||||
return pMarker;
|
return pMarker;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pMarker->m_nIdentifier != 0)
|
if (pMarker->m_nIdentifier != 0)
|
||||||
pMarker->DeleteMarkerObject();
|
pMarker->DeleteMarkerObject();
|
||||||
|
|
||||||
pMarker->AddMarker(identifier, type, size, r, g, b, a, pulsePeriod, pulseFraction, rotateRate);
|
pMarker->AddMarker(identifier, type, size, r, g, b, a, pulsePeriod, pulseFraction, rotateRate);
|
||||||
if (type == MARKERTYPE_CYLINDER || type == MARKERTYPE_0 || type == MARKERTYPE_2) {
|
if (type == MARKERTYPE_CYLINDER || type == MARKERTYPE_0 || type == MARKERTYPE_2) {
|
||||||
float z = CWorld::FindGroundZFor3DCoord(pos.x, pos.y, pos.z + 1.0f, nil);
|
float z = CWorld::FindGroundZFor3DCoord(pos.x, pos.y, pos.z + 1.0f, nil);
|
||||||
if (z != 0.0f)
|
if (z != 0.0f)
|
||||||
pos.z = z - 0.05f * size;
|
pos.z = z - 0.05f * size;
|
||||||
}
|
}
|
||||||
pMarker->m_Matrix.SetTranslate(pos.x, pos.y, pos.z);
|
pMarker->m_Matrix.SetTranslate(pos.x, pos.y, pos.z);
|
||||||
if (type == MARKERTYPE_2) {
|
if (type == MARKERTYPE_2) {
|
||||||
pMarker->m_Matrix.RotateX(PI);
|
pMarker->m_Matrix.RotateX(PI);
|
||||||
pMarker->m_Matrix.GetPosition() = pos;
|
pMarker->m_Matrix.GetPosition() = pos;
|
||||||
}
|
}
|
||||||
pMarker->m_Matrix.UpdateRW();
|
pMarker->m_Matrix.UpdateRW();
|
||||||
if (type == MARKERTYPE_ARROW) {
|
if (type == MARKERTYPE_ARROW) {
|
||||||
if (dist < 25.0f) {
|
if (dist < 25.0f) {
|
||||||
if (dist > 5.0f)
|
if (dist > 5.0f)
|
||||||
pMarker->m_fStdSize = size - (25.0f - dist) * (0.3f * size) / 20.0f;
|
pMarker->m_fStdSize = size - (25.0f - dist) * (0.3f * size) / 20.0f;
|
||||||
else
|
else
|
||||||
pMarker->m_fStdSize = size - 0.3f * size;
|
pMarker->m_fStdSize = size - 0.3f * size;
|
||||||
} else {
|
} else {
|
||||||
pMarker->m_fStdSize = size;
|
pMarker->m_fStdSize = size;
|
||||||
}
|
}
|
||||||
} else if (type == MARKERTYPE_CYLINDER) {
|
} else if (type == MARKERTYPE_CYLINDER) {
|
||||||
if (dist < size + 12.0f) {
|
if (dist < size + 12.0f) {
|
||||||
if (dist > size + 1.0f)
|
if (dist > size + 1.0f)
|
||||||
pMarker->m_Color.alpha = (1.0f - (size + 12.0f - dist) * 0.7f / 11.0f) * (float)a;
|
pMarker->m_Color.alpha = (1.0f - (size + 12.0f - dist) * 0.7f / 11.0f) * (float)a;
|
||||||
else
|
else
|
||||||
pMarker->m_Color.alpha = (float)a * 0.3f;
|
pMarker->m_Color.alpha = (float)a * 0.3f;
|
||||||
} else {
|
} else {
|
||||||
pMarker->m_Color.alpha = a;
|
pMarker->m_Color.alpha = a;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pMarker->m_bIsUsed = true;
|
pMarker->m_bIsUsed = true;
|
||||||
return pMarker;
|
return pMarker;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
C3dMarkers::PlaceMarkerSet(uint32 id, uint16 type, CVector &pos, float size, uint8 r, uint8 g, uint8 b, uint8 a, uint16 pulsePeriod, float pulseFraction, int16 rotateRate)
|
C3dMarkers::PlaceMarkerSet(uint32 id, uint16 type, CVector &pos, float size, uint8 r, uint8 g, uint8 b, uint8 a, uint16 pulsePeriod, float pulseFraction, int16 rotateRate)
|
||||||
{
|
{
|
||||||
PlaceMarker(id, type, pos, size, r, g, b, a, pulsePeriod, pulseFraction, 1);
|
PlaceMarker(id, type, pos, size, r, g, b, a, pulsePeriod, pulseFraction, 1);
|
||||||
PlaceMarker(id, type, pos, size * 0.93f, r, g, b, a, pulsePeriod, pulseFraction, 2);
|
PlaceMarker(id, type, pos, size * 0.93f, r, g, b, a, pulsePeriod, pulseFraction, 2);
|
||||||
PlaceMarker(id, type, pos, size * 0.86f, r, g, b, a, pulsePeriod, pulseFraction, -1);
|
PlaceMarker(id, type, pos, size * 0.86f, r, g, b, a, pulsePeriod, pulseFraction, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
C3dMarkers::Update()
|
C3dMarkers::Update()
|
||||||
{
|
{
|
||||||
@ -402,151 +402,151 @@ C3dMarkers::Update()
|
|||||||
|
|
||||||
#define MONEY_MESSAGE_LIFETIME_MS 2000
|
#define MONEY_MESSAGE_LIFETIME_MS 2000
|
||||||
|
|
||||||
CMoneyMessage CMoneyMessages::aMoneyMessages[NUMMONEYMESSAGES];
|
CMoneyMessage CMoneyMessages::aMoneyMessages[NUMMONEYMESSAGES];
|
||||||
|
|
||||||
void
|
void
|
||||||
CMoneyMessage::Render()
|
CMoneyMessage::Render()
|
||||||
{
|
{
|
||||||
const float MAX_SCALE = 4.0f;
|
const float MAX_SCALE = 4.0f;
|
||||||
uint32 nLifeTime = CTimer::GetTimeInMilliseconds() - m_nTimeRegistered;
|
uint32 nLifeTime = CTimer::GetTimeInMilliseconds() - m_nTimeRegistered;
|
||||||
if (nLifeTime >= MONEY_MESSAGE_LIFETIME_MS) m_nTimeRegistered = 0;
|
if (nLifeTime >= MONEY_MESSAGE_LIFETIME_MS) m_nTimeRegistered = 0;
|
||||||
else {
|
else {
|
||||||
float fLifeTime = (float)nLifeTime / MONEY_MESSAGE_LIFETIME_MS;
|
float fLifeTime = (float)nLifeTime / MONEY_MESSAGE_LIFETIME_MS;
|
||||||
RwV3d vecOut;
|
RwV3d vecOut;
|
||||||
float fDistX, fDistY;
|
float fDistX, fDistY;
|
||||||
if (CSprite::CalcScreenCoors(m_vecPosition + CVector(0.0f, 0.0f, fLifeTime), &vecOut, &fDistX, &fDistY, true)) {
|
if (CSprite::CalcScreenCoors(m_vecPosition + CVector(0.0f, 0.0f, fLifeTime), &vecOut, &fDistX, &fDistY, true)) {
|
||||||
fDistX *= (0.7 * fLifeTime + 2.0) * m_fSize;
|
fDistX *= (0.7 * fLifeTime + 2.0) * m_fSize;
|
||||||
fDistY *= (0.7 * fLifeTime + 2.0) * m_fSize;
|
fDistY *= (0.7 * fLifeTime + 2.0) * m_fSize;
|
||||||
CFont::SetPropOn();
|
CFont::SetPropOn();
|
||||||
CFont::SetBackgroundOff();
|
CFont::SetBackgroundOff();
|
||||||
|
|
||||||
float fScaleY = fDistY / 100.0f;
|
float fScaleY = fDistY / 100.0f;
|
||||||
if (fScaleY > MAX_SCALE) fScaleY = MAX_SCALE;
|
if (fScaleY > MAX_SCALE) fScaleY = MAX_SCALE;
|
||||||
|
|
||||||
float fScaleX = fDistX / 100.0f;
|
float fScaleX = fDistX / 100.0f;
|
||||||
if (fScaleX > MAX_SCALE) fScaleX = MAX_SCALE;
|
if (fScaleX > MAX_SCALE) fScaleX = MAX_SCALE;
|
||||||
|
|
||||||
CFont::SetScale(fScaleX, fScaleY); // maybe use SCREEN_SCALE_X and SCREEN_SCALE_Y here?
|
CFont::SetScale(fScaleX, fScaleY); // maybe use SCREEN_SCALE_X and SCREEN_SCALE_Y here?
|
||||||
CFont::SetCentreOn();
|
CFont::SetCentreOn();
|
||||||
CFont::SetCentreSize(SCREEN_WIDTH);
|
CFont::SetCentreSize(SCREEN_WIDTH);
|
||||||
CFont::SetJustifyOff();
|
CFont::SetJustifyOff();
|
||||||
CFont::SetColor(CRGBA(m_Colour.r, m_Colour.g, m_Colour.b, (255.0f - 255.0f * fLifeTime) * m_fOpacity));
|
CFont::SetColor(CRGBA(m_Colour.r, m_Colour.g, m_Colour.b, (255.0f - 255.0f * fLifeTime) * m_fOpacity));
|
||||||
CFont::SetBackGroundOnlyTextOff();
|
CFont::SetBackGroundOnlyTextOff();
|
||||||
CFont::SetFontStyle(FONT_BANK);
|
CFont::SetFontStyle(FONT_BANK);
|
||||||
CFont::PrintString(vecOut.x, vecOut.y, m_aText);
|
CFont::PrintString(vecOut.x, vecOut.y, m_aText);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CMoneyMessages::Init()
|
CMoneyMessages::Init()
|
||||||
{
|
{
|
||||||
for (int32 i = 0; i < NUMMONEYMESSAGES; i++)
|
for (int32 i = 0; i < NUMMONEYMESSAGES; i++)
|
||||||
aMoneyMessages[i].m_nTimeRegistered = 0;
|
aMoneyMessages[i].m_nTimeRegistered = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CMoneyMessages::Render()
|
CMoneyMessages::Render()
|
||||||
{
|
{
|
||||||
for (int32 i = 0; i < NUMMONEYMESSAGES; i++) {
|
for (int32 i = 0; i < NUMMONEYMESSAGES; i++) {
|
||||||
if (aMoneyMessages[i].m_nTimeRegistered != 0)
|
if (aMoneyMessages[i].m_nTimeRegistered != 0)
|
||||||
aMoneyMessages[i].Render();
|
aMoneyMessages[i].Render();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CMoneyMessages::RegisterOne(CVector vecPos, const char *pText, uint8 bRed, uint8 bGreen, uint8 bBlue, float fSize, float fOpacity)
|
CMoneyMessages::RegisterOne(CVector vecPos, const char *pText, uint8 bRed, uint8 bGreen, uint8 bBlue, float fSize, float fOpacity)
|
||||||
{
|
{
|
||||||
uint32 nIndex = 0;
|
uint32 nIndex = 0;
|
||||||
while (aMoneyMessages[nIndex].m_nTimeRegistered != 0) {
|
while (aMoneyMessages[nIndex].m_nTimeRegistered != 0) {
|
||||||
if (++nIndex >= NUMMONEYMESSAGES) return;
|
if (++nIndex >= NUMMONEYMESSAGES) return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add data of this money message to the array
|
// Add data of this money message to the array
|
||||||
AsciiToUnicode(pText, aMoneyMessages[nIndex].m_aText);
|
AsciiToUnicode(pText, aMoneyMessages[nIndex].m_aText);
|
||||||
|
|
||||||
aMoneyMessages[nIndex].m_nTimeRegistered = CTimer::GetTimeInMilliseconds();
|
aMoneyMessages[nIndex].m_nTimeRegistered = CTimer::GetTimeInMilliseconds();
|
||||||
aMoneyMessages[nIndex].m_vecPosition = vecPos;
|
aMoneyMessages[nIndex].m_vecPosition = vecPos;
|
||||||
aMoneyMessages[nIndex].m_Colour.red = bRed;
|
aMoneyMessages[nIndex].m_Colour.red = bRed;
|
||||||
aMoneyMessages[nIndex].m_Colour.green = bGreen;
|
aMoneyMessages[nIndex].m_Colour.green = bGreen;
|
||||||
aMoneyMessages[nIndex].m_Colour.blue = bBlue;
|
aMoneyMessages[nIndex].m_Colour.blue = bBlue;
|
||||||
aMoneyMessages[nIndex].m_fSize = fSize;
|
aMoneyMessages[nIndex].m_fSize = fSize;
|
||||||
aMoneyMessages[nIndex].m_fOpacity = fOpacity;
|
aMoneyMessages[nIndex].m_fOpacity = fOpacity;
|
||||||
}
|
}
|
||||||
|
|
||||||
CRGBA FoamColour(255, 255, 255, 255);
|
CRGBA FoamColour(255, 255, 255, 255);
|
||||||
unsigned int CSpecialParticleStuff::BoatFromStart;
|
unsigned int CSpecialParticleStuff::BoatFromStart;
|
||||||
|
|
||||||
void
|
void
|
||||||
CSpecialParticleStuff::CreateFoamAroundObject(CMatrix* pMatrix, float innerFw, float innerRg, float innerUp, int32 particles)
|
CSpecialParticleStuff::CreateFoamAroundObject(CMatrix* pMatrix, float innerFw, float innerRg, float innerUp, int32 particles)
|
||||||
{
|
{
|
||||||
float outerFw = innerFw + 5.0f;
|
float outerFw = innerFw + 5.0f;
|
||||||
float outerRg = innerRg + 5.0f;
|
float outerRg = innerRg + 5.0f;
|
||||||
float outerUp = innerUp + 5.0f;
|
float outerUp = innerUp + 5.0f;
|
||||||
for (int attempts = 0; particles > 0 && attempts < 1000; attempts++) {
|
for (int attempts = 0; particles > 0 && attempts < 1000; attempts++) {
|
||||||
CVector pos;
|
CVector pos;
|
||||||
int rnd = CGeneral::GetRandomNumber();
|
int rnd = CGeneral::GetRandomNumber();
|
||||||
pos.x = (int8)(rnd - 128) * innerFw / 110.0f;
|
pos.x = (int8)(rnd - 128) * innerFw / 110.0f;
|
||||||
pos.y = (int8)((rnd >> 8) - 128) * innerFw / 110.0f;
|
pos.y = (int8)((rnd >> 8) - 128) * innerFw / 110.0f;
|
||||||
pos.z = 0.0f;
|
pos.z = 0.0f;
|
||||||
if (DotProduct2D(pos, TheCamera.GetForward()) >= 0)
|
if (DotProduct2D(pos, TheCamera.GetForward()) >= 0)
|
||||||
continue;
|
continue;
|
||||||
// was there any point in adding it here?
|
// was there any point in adding it here?
|
||||||
pos += pMatrix->GetPosition();
|
pos += pMatrix->GetPosition();
|
||||||
pos.z = 2.0f;
|
pos.z = 2.0f;
|
||||||
float fw = Abs(DotProduct(pMatrix->GetForward(), pos - pMatrix->GetPosition()));
|
float fw = Abs(DotProduct(pMatrix->GetForward(), pos - pMatrix->GetPosition()));
|
||||||
if (fw >= outerFw)
|
if (fw >= outerFw)
|
||||||
continue;
|
continue;
|
||||||
float rg = Abs(DotProduct(pMatrix->GetRight(), pos - pMatrix->GetPosition()));
|
float rg = Abs(DotProduct(pMatrix->GetRight(), pos - pMatrix->GetPosition()));
|
||||||
if (rg >= outerRg)
|
if (rg >= outerRg)
|
||||||
continue;
|
continue;
|
||||||
float up = Abs(DotProduct(pMatrix->GetUp(), pos - pMatrix->GetPosition()));
|
float up = Abs(DotProduct(pMatrix->GetUp(), pos - pMatrix->GetPosition()));
|
||||||
if (up >= outerUp)
|
if (up >= outerUp)
|
||||||
continue;
|
continue;
|
||||||
if (fw > innerFw || rg > innerRg || up > innerUp) {
|
if (fw > innerFw || rg > innerRg || up > innerUp) {
|
||||||
CParticle::AddParticle(PARTICLE_STEAM2, pos, CVector(0.0f, 0.0f, 0.0f), nil, 4.0f, FoamColour, 1, 0, 0, 0);
|
CParticle::AddParticle(PARTICLE_STEAM2, pos, CVector(0.0f, 0.0f, 0.0f), nil, 4.0f, FoamColour, 1, 0, 0, 0);
|
||||||
particles--;
|
particles--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CSpecialParticleStuff::StartBoatFoamAnimation()
|
CSpecialParticleStuff::StartBoatFoamAnimation()
|
||||||
{
|
{
|
||||||
BoatFromStart = CTimer::GetTimeInMilliseconds();
|
BoatFromStart = CTimer::GetTimeInMilliseconds();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CSpecialParticleStuff::UpdateBoatFoamAnimation(CMatrix* pMatrix)
|
CSpecialParticleStuff::UpdateBoatFoamAnimation(CMatrix* pMatrix)
|
||||||
{
|
{
|
||||||
static int32 FrameInAnimation = 0;
|
static int32 FrameInAnimation = 0;
|
||||||
static float X, Y, Z, dX, dY, dZ;
|
static float X, Y, Z, dX, dY, dZ;
|
||||||
CreateFoamAroundObject(pMatrix, 107.0f, 24.1f, 30.5f, 2);
|
CreateFoamAroundObject(pMatrix, 107.0f, 24.1f, 30.5f, 2);
|
||||||
uint32 prev = CTimer::GetPreviousTimeInMilliseconds();
|
uint32 prev = CTimer::GetPreviousTimeInMilliseconds();
|
||||||
uint32 cur = CTimer::GetTimeInMilliseconds();
|
uint32 cur = CTimer::GetTimeInMilliseconds();
|
||||||
if (FrameInAnimation != 0) {
|
if (FrameInAnimation != 0) {
|
||||||
X += dX;
|
X += dX;
|
||||||
Y += dY;
|
Y += dY;
|
||||||
Z += dZ;
|
Z += dZ;
|
||||||
CVector pos = *pMatrix * CVector(X, Y, Z);
|
CVector pos = *pMatrix * CVector(X, Y, Z);
|
||||||
CParticle::AddParticle(PARTICLE_STEAM_NY, pos, CVector(0.0f, 0.0f, 0.0f),
|
CParticle::AddParticle(PARTICLE_STEAM_NY, pos, CVector(0.0f, 0.0f, 0.0f),
|
||||||
nil, FrameInAnimation * 0.5f + 2.0f, FoamColour, 1, 0, 0, 0);
|
nil, FrameInAnimation * 0.5f + 2.0f, FoamColour, 1, 0, 0, 0);
|
||||||
if (++FrameInAnimation > 15)
|
if (++FrameInAnimation > 15)
|
||||||
FrameInAnimation = 0;
|
FrameInAnimation = 0;
|
||||||
}
|
}
|
||||||
if ((cur & 0x3FF) < (prev & 0x3FF)) {
|
if ((cur & 0x3FF) < (prev & 0x3FF)) {
|
||||||
FrameInAnimation = 1;
|
FrameInAnimation = 1;
|
||||||
int rnd = CGeneral::GetRandomNumber();
|
int rnd = CGeneral::GetRandomNumber();
|
||||||
X = (int8)(rnd - 128) * 0.2f;
|
X = (int8)(rnd - 128) * 0.2f;
|
||||||
Y = (int8)((rnd >> 8) - 128) * 0.2f;
|
Y = (int8)((rnd >> 8) - 128) * 0.2f;
|
||||||
Z = 10.0f;
|
Z = 10.0f;
|
||||||
rnd = CGeneral::GetRandomNumber();
|
rnd = CGeneral::GetRandomNumber();
|
||||||
dX = (int8)(rnd - 128) * 0.02f;
|
dX = (int8)(rnd - 128) * 0.02f;
|
||||||
dY = (int8)((rnd >> 8) - 128) * 0.02f;
|
dY = (int8)((rnd >> 8) - 128) * 0.02f;
|
||||||
dZ = 2.0f;
|
dZ = 2.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
STARTPATCHES
|
STARTPATCHES
|
||||||
InjectHook(0x518DE0, &CBulletTraces::Init, PATCH_JUMP);
|
InjectHook(0x518DE0, &CBulletTraces::Init, PATCH_JUMP);
|
||||||
InjectHook(0x518E90, &CBulletTraces::AddTrace, PATCH_JUMP);
|
InjectHook(0x518E90, &CBulletTraces::AddTrace, PATCH_JUMP);
|
||||||
|
@ -584,7 +584,7 @@ void _psPrintCpuInfo()
|
|||||||
RwBool
|
RwBool
|
||||||
psInitialise(void)
|
psInitialise(void)
|
||||||
{
|
{
|
||||||
PsGlobal.lastMousePos.x = PsGlobal.lastMousePos.y = 0.0;
|
PsGlobal.lastMousePos.x = PsGlobal.lastMousePos.y = 0.0f;
|
||||||
|
|
||||||
RsGlobal.ps = &PsGlobal;
|
RsGlobal.ps = &PsGlobal;
|
||||||
|
|
||||||
@ -3066,4 +3066,4 @@ STARTPATCHES
|
|||||||
InjectHook(0x583DC0, _InputTranslateShiftKeyUpDown, PATCH_JUMP);
|
InjectHook(0x583DC0, _InputTranslateShiftKeyUpDown, PATCH_JUMP);
|
||||||
InjectHook(0x583E50, _InputTranslateShiftKey, PATCH_JUMP);
|
InjectHook(0x583E50, _InputTranslateShiftKey, PATCH_JUMP);
|
||||||
InjectHook(0x583EE0, _InputIsExtended, PATCH_JUMP);
|
InjectHook(0x583EE0, _InputIsExtended, PATCH_JUMP);
|
||||||
ENDPATCHES
|
ENDPATCHES
|
||||||
|
Loading…
Reference in New Issue
Block a user