1
0
Fork 0
mirror of https://github.com/halpz/re3.git synced 2024-12-26 18:15:27 +00:00

merged from upstream

This commit is contained in:
Roman Masanin 2020-10-02 04:03:17 +03:00
commit e5a48faf89
3 changed files with 45 additions and 49 deletions

View file

@ -236,19 +236,18 @@ public:
float GetReflectionsDistance(int32 idx) const { return m_afReflectionsDistances[idx]; } float GetReflectionsDistance(int32 idx) const { return m_afReflectionsDistances[idx]; }
int32 GetRandomNumber(int32 idx) const { return m_anRandomTable[idx]; } int32 GetRandomNumber(int32 idx) const { return m_anRandomTable[idx]; }
int32 GetRandomNumberInRange(int32 idx, int32 low, int32 high) const { return (m_anRandomTable[idx] % (high - low + 1)) + low; } int32 GetRandomNumberInRange(int32 idx, int32 low, int32 high) const { return (m_anRandomTable[idx] % (high - low + 1)) + low; }
bool IsMissionAudioSamplePlaying(uint8 slot) const;// { return m_sMissionAudio.m_nPlayStatus == 1; } bool IsMissionAudioSamplePlaying(uint8 slot) const; // { return m_sMissionAudio.m_nPlayStatus == 1; }
bool ShouldDuckMissionAudio(uint8 slot) const; bool ShouldDuckMissionAudio(uint8 slot) const;
// "Should" be in alphabetic order, except "getXTalkSfx" // "Should" be in alphabetic order, except "getXTalkSfx"
void AddDetailsToRequestedOrderList(uint8 sample); void AddDetailsToRequestedOrderList(uint8 sample); // done (inlined in vc)
void AddPlayerCarSample(uint8 emittingVolume, int32 freq, uint32 sample, uint8 bank, void AddPlayerCarSample(uint8 emittingVolume, int32 freq, uint32 sample, uint8 bank, uint8 counter, bool notLooping); // done
uint8 counter, bool notLooping); //done void AddReflectionsToRequestedQueue(); // done
void AddReflectionsToRequestedQueue(); void AddReleasingSounds(); // done
void AddReleasingSounds(); void AddSampleToRequestedQueue(); // done
void AddSampleToRequestedQueue(); void AgeCrimes(); // done (inlined in vc)
void AgeCrimes();
void CalculateDistance(bool &condition, float dist); //done void CalculateDistance(bool &condition, float dist); // done
bool CheckForAnAudioFileOnCD() const; bool CheckForAnAudioFileOnCD() const;
void ClearActiveSamples(); //done void ClearActiveSamples(); //done
void ClearMissionAudio(uint8 slot); //done void ClearMissionAudio(uint8 slot); //done
@ -260,7 +259,7 @@ public:
int32 CreateEntity(eAudioType type, void *entity); //done int32 CreateEntity(eAudioType type, void *entity); //done
void DestroyAllGameCreatedEntities(); void DestroyAllGameCreatedEntities();
void DestroyEntity(int32 id); void DestroyEntity(int32 id); //done (inlined in vc)
void DoPoliceRadioCrackle(); void DoPoliceRadioCrackle();
// functions returning talk sfx, // functions returning talk sfx,
@ -272,44 +271,42 @@ public:
char *Get3DProviderName(uint8 id) const; char *Get3DProviderName(uint8 id) const;
uint8 GetCDAudioDriveLetter() const; uint8 GetCDAudioDriveLetter() const;
int8 GetCurrent3DProviderIndex() const; int8 GetCurrent3DProviderIndex() const;
int8 AutoDetect3DProviders() const; int8 AutoDetect3DProviders() const; // done
float GetCollisionLoopingRatio(uint32 a, uint32 b, float c) const; // not used float GetCollisionLoopingRatio(uint32 a, uint32 b, float c) const; // not used
float GetCollisionOneShotRatio(int32 a, float b) const; float GetCollisionOneShotRatio(int32 a, float b) const;
float GetCollisionRatio(float a, float b, float c, float d) const; float GetCollisionRatio(float a, float b, float c, float d) const;
float GetDistanceSquared(const CVector &v) const; //done float GetDistanceSquared(const CVector &v) const; // done (inlined in vc)
int32 GetJumboTaxiFreq() const; int32 GetJumboTaxiFreq() const;
uint8 GetMissionAudioLoadingStatus(uint8 slot) const; uint8 GetMissionAudioLoadingStatus(uint8 slot) const; // done
int8 GetMissionScriptPoliceAudioPlayingStatus() const; int8 GetMissionScriptPoliceAudioPlayingStatus() const;
uint8 GetNum3DProvidersAvailable() const; uint8 GetNum3DProvidersAvailable() const; // done
int32 GetPedCommentSfx(CPed *ped, int32 sound); int32 GetPedCommentSfx(CPed *ped, int32 sound);
void GetPhrase(uint32 *phrase, uint32 *prevPhrase, uint32 sample, uint32 maxOffset) const; void GetPhrase(uint32 *phrase, uint32 *prevPhrase, uint32 sample, uint32 maxOffset) const;
float GetVehicleDriveWheelSkidValue(uint8 wheel, CAutomobile *automobile, float GetVehicleDriveWheelSkidValue(uint8 wheel, CAutomobile *automobile, cTransmission *transmission, float velocityChange);
cTransmission *transmission, float velocityChange); float GetVehicleNonDriveWheelSkidValue(uint8 wheel, CAutomobile *automobile, cTransmission *transmission, float velocityChange);
float GetVehicleNonDriveWheelSkidValue(uint8 wheel, CAutomobile *automobile,
cTransmission *transmission, float velocityChange);
bool HasAirBrakes(int32 model) const; //done bool HasAirBrakes(int32 model) const; // done
void Initialise(); void Initialise(); // done
void InitialisePoliceRadio(); void InitialisePoliceRadio();
void InitialisePoliceRadioZones(); void InitialisePoliceRadioZones();
void InterrogateAudioEntities(); void InterrogateAudioEntities();
bool IsAudioInitialised() const; bool IsAudioInitialised() const;
bool IsMissionAudioSampleFinished(uint8 slot); bool IsMissionAudioSampleFinished(uint8 slot);
bool IsMP3RadioChannelAvailable() const; bool IsMP3RadioChannelAvailable() const; // done
bool MissionScriptAudioUsesPoliceChannel(int32 soundMission) const; bool MissionScriptAudioUsesPoliceChannel(int32 soundMission) const;
void PlayLoadedMissionAudio(uint8 slot); void PlayLoadedMissionAudio(uint8 slot); // done
void PlayOneShot(int32 index, int16 sound, float vol); void PlayOneShot(int32 index, int16 sound, float vol); // done
void PlaySuspectLastSeen(float x, float y, float z); void PlaySuspectLastSeen(float x, float y, float z);
void PlayerJustGotInCar() const; //done void PlayerJustGotInCar() const; // done
void PlayerJustLeftCar() const; //done void PlayerJustLeftCar() const; // done
void PostInitialiseGameSpecificSetup(); void PostInitialiseGameSpecificSetup();
void PostTerminateGameSpecificShutdown(); //done void PostTerminateGameSpecificShutdown(); // done
void PreInitialiseGameSpecificSetup() const; //done void PreInitialiseGameSpecificSetup() const; // done
void PreloadMissionAudio(uint8 slot, Const char *name); void PreloadMissionAudio(uint8 slot, Const char *name); // done
void PreTerminateGameSpecificShutdown(); //done void PreTerminateGameSpecificShutdown(); // done
/// processX - main logic of adding new sounds /// processX - main logic of adding new sounds
void ProcessActiveQueues(); //done void ProcessActiveQueues(); //done
bool ProcessAirBrakes(cVehicleParams *params); bool ProcessAirBrakes(cVehicleParams *params);
@ -376,11 +373,10 @@ public:
void ProcessExtraSounds(); //done void ProcessExtraSounds(); //done
int32 RandomDisplacement(uint32 seed) const; int32 RandomDisplacement(uint32 seed) const;
void ReacquireDigitalHandle() const; void ReacquireDigitalHandle() const; // done
void ReleaseDigitalHandle() const; void ReleaseDigitalHandle() const; // done
void ReportCollision(CEntity *entity1, CEntity *entity2, uint8 surface1, uint8 surface2, void ReportCollision(CEntity *entity1, CEntity *entity2, uint8 surface1, uint8 surface2, float collisionPower, float intensity2); // done
float collisionPower, float intensity2); void ReportCrime(int32 crime, const CVector *pos); // done
void ReportCrime(int32 crime, const CVector *pos);
void ResetAudioLogicTimers(uint32 timer); void ResetAudioLogicTimers(uint32 timer);
void ResetPoliceRadio(); void ResetPoliceRadio();
void ResetTimers(uint32 time); void ResetTimers(uint32 time);
@ -395,7 +391,7 @@ public:
void SetEffectsFadeVol(uint8 volume) const; void SetEffectsFadeVol(uint8 volume) const;
void SetEffectsMasterVolume(uint8 volume) const; void SetEffectsMasterVolume(uint8 volume) const;
void SetMP3BoostVolume(uint8 volume) const; void SetMP3BoostVolume(uint8 volume) const;
void SetEntityStatus(int32 id, uint8 status); void SetEntityStatus(int32 id, uint8 status); //done
uint32 SetLoopingCollisionRequestedSfxFreqAndGetVol(const cAudioCollision &audioCollision); uint32 SetLoopingCollisionRequestedSfxFreqAndGetVol(const cAudioCollision &audioCollision);
void SetMissionAudioLocation(uint8 slot, float x, float y, float z); void SetMissionAudioLocation(uint8 slot, float x, float y, float z);
void SetMissionScriptPoliceAudio(int32 sfx) const; void SetMissionScriptPoliceAudio(int32 sfx) const;

View file

@ -725,7 +725,7 @@ cAudioManager::AgeCrimes()
{ {
for (uint8 i = 0; i < ARRAY_SIZE(m_sPoliceRadioQueue.crimes); i++) { for (uint8 i = 0; i < ARRAY_SIZE(m_sPoliceRadioQueue.crimes); i++) {
if (m_sPoliceRadioQueue.crimes[i].type != CRIME_NONE) { if (m_sPoliceRadioQueue.crimes[i].type != CRIME_NONE) {
if (++m_sPoliceRadioQueue.crimes[i].timer > 1500) m_sPoliceRadioQueue.crimes[i].type = CRIME_NONE; if (++m_sPoliceRadioQueue.crimes[i].timer > 1200) m_sPoliceRadioQueue.crimes[i].type = CRIME_NONE;
} }
} }
} }

View file

@ -2118,7 +2118,7 @@ int32 CRunningScript::CollectNextParameterWithoutIncreasingPC(uint32 ip)
case ARGUMENT_INT32: case ARGUMENT_INT32:
return CTheScripts::Read4BytesFromScript(pIp); return CTheScripts::Read4BytesFromScript(pIp);
case ARGUMENT_GLOBALVAR: case ARGUMENT_GLOBALVAR:
return *((int32*)&CTheScripts::ScriptSpace[CTheScripts::Read2BytesFromScript(pIp)]); return *((int32*)&CTheScripts::ScriptSpace[(uint16)CTheScripts::Read2BytesFromScript(pIp)]);
case ARGUMENT_LOCALVAR: case ARGUMENT_LOCALVAR:
return m_anLocalVariables[CTheScripts::Read2BytesFromScript(pIp)]; return m_anLocalVariables[CTheScripts::Read2BytesFromScript(pIp)];
case ARGUMENT_INT8: case ARGUMENT_INT8:
@ -2138,7 +2138,7 @@ void CRunningScript::StoreParameters(uint32* pIp, int16 number)
for (int16 i = 0; i < number; i++){ for (int16 i = 0; i < number; i++){
switch (CTheScripts::Read1ByteFromScript(pIp)) { switch (CTheScripts::Read1ByteFromScript(pIp)) {
case ARGUMENT_GLOBALVAR: case ARGUMENT_GLOBALVAR:
*(int32*)&CTheScripts::ScriptSpace[CTheScripts::Read2BytesFromScript(pIp)] = ScriptParams[i]; *(int32*)&CTheScripts::ScriptSpace[(uint16)CTheScripts::Read2BytesFromScript(pIp)] = ScriptParams[i];
break; break;
case ARGUMENT_LOCALVAR: case ARGUMENT_LOCALVAR:
m_anLocalVariables[CTheScripts::Read2BytesFromScript(pIp)] = ScriptParams[i]; m_anLocalVariables[CTheScripts::Read2BytesFromScript(pIp)] = ScriptParams[i];
@ -2155,7 +2155,7 @@ int32 *CRunningScript::GetPointerToScriptVariable(uint32* pIp, int16 type)
{ {
case ARGUMENT_GLOBALVAR: case ARGUMENT_GLOBALVAR:
script_assert(type == VAR_GLOBAL); script_assert(type == VAR_GLOBAL);
return (int32*)&CTheScripts::ScriptSpace[CTheScripts::Read2BytesFromScript(pIp)]; return (int32*)&CTheScripts::ScriptSpace[(uint16)CTheScripts::Read2BytesFromScript(pIp)];
case ARGUMENT_LOCALVAR: case ARGUMENT_LOCALVAR:
script_assert(type == VAR_LOCAL); script_assert(type == VAR_LOCAL);
return &m_anLocalVariables[CTheScripts::Read2BytesFromScript(pIp)]; return &m_anLocalVariables[CTheScripts::Read2BytesFromScript(pIp)];
@ -2472,7 +2472,7 @@ int8 CRunningScript::ProcessOneCommand()
{ {
int8 retval = -1; int8 retval = -1;
++CTheScripts::CommandsExecuted; ++CTheScripts::CommandsExecuted;
int32 command = CTheScripts::Read2BytesFromScript(&m_nIp); int32 command = (uint16)CTheScripts::Read2BytesFromScript(&m_nIp);
m_bNotFlag = (command & 0x8000); m_bNotFlag = (command & 0x8000);
command &= 0x7FFF; command &= 0x7FFF;
#ifdef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT #ifdef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
@ -3095,7 +3095,7 @@ int8 CRunningScript::ProcessCommands0To99(int32 command)
pNew->m_anLocalVariables[i] = CTheScripts::Read4BytesFromScript(&m_nIp); pNew->m_anLocalVariables[i] = CTheScripts::Read4BytesFromScript(&m_nIp);
break; break;
case ARGUMENT_GLOBALVAR: case ARGUMENT_GLOBALVAR:
pNew->m_anLocalVariables[i] = *(int32*)&CTheScripts::ScriptSpace[CTheScripts::Read2BytesFromScript(&m_nIp)]; pNew->m_anLocalVariables[i] = *(int32*)&CTheScripts::ScriptSpace[(uint16)CTheScripts::Read2BytesFromScript(&m_nIp)];
break; break;
case ARGUMENT_LOCALVAR: case ARGUMENT_LOCALVAR:
pNew->m_anLocalVariables[i] = m_anLocalVariables[CTheScripts::Read2BytesFromScript(&m_nIp)]; pNew->m_anLocalVariables[i] = m_anLocalVariables[CTheScripts::Read2BytesFromScript(&m_nIp)];
@ -4886,7 +4886,7 @@ int8 CRunningScript::ProcessCommands300To399(int32 command)
{ {
script_assert(CTheScripts::ScriptSpace[m_nIp] == ARGUMENT_GLOBALVAR); script_assert(CTheScripts::ScriptSpace[m_nIp] == ARGUMENT_GLOBALVAR);
m_nIp++; m_nIp++;
uint32 offset = CTheScripts::Read2BytesFromScript(&m_nIp); uint16 offset = CTheScripts::Read2BytesFromScript(&m_nIp);
CollectParameters(&m_nIp, 1); CollectParameters(&m_nIp, 1);
CUserDisplay::OnscnTimer.AddClock(offset, nil, ScriptParams[0] != 0); CUserDisplay::OnscnTimer.AddClock(offset, nil, ScriptParams[0] != 0);
return 0; return 0;
@ -4895,14 +4895,14 @@ int8 CRunningScript::ProcessCommands300To399(int32 command)
{ {
script_assert(CTheScripts::ScriptSpace[m_nIp] == ARGUMENT_GLOBALVAR); script_assert(CTheScripts::ScriptSpace[m_nIp] == ARGUMENT_GLOBALVAR);
m_nIp++; m_nIp++;
CUserDisplay::OnscnTimer.ClearClock(CTheScripts::Read2BytesFromScript(&m_nIp)); CUserDisplay::OnscnTimer.ClearClock((uint16)CTheScripts::Read2BytesFromScript(&m_nIp));
return 0; return 0;
} }
case COMMAND_DISPLAY_ONSCREEN_COUNTER: case COMMAND_DISPLAY_ONSCREEN_COUNTER:
{ {
script_assert(CTheScripts::ScriptSpace[m_nIp] == ARGUMENT_GLOBALVAR); script_assert(CTheScripts::ScriptSpace[m_nIp] == ARGUMENT_GLOBALVAR);
m_nIp++; m_nIp++;
int32 counter = CTheScripts::Read2BytesFromScript(&m_nIp); int16 counter = CTheScripts::Read2BytesFromScript(&m_nIp);
CollectParameters(&m_nIp, 1); CollectParameters(&m_nIp, 1);
CUserDisplay::OnscnTimer.AddCounter(counter, ScriptParams[0], nil, 0); CUserDisplay::OnscnTimer.AddCounter(counter, ScriptParams[0], nil, 0);
return 0; return 0;
@ -4911,7 +4911,7 @@ int8 CRunningScript::ProcessCommands300To399(int32 command)
{ {
script_assert(CTheScripts::ScriptSpace[m_nIp] == ARGUMENT_GLOBALVAR); script_assert(CTheScripts::ScriptSpace[m_nIp] == ARGUMENT_GLOBALVAR);
m_nIp++; m_nIp++;
CUserDisplay::OnscnTimer.ClearCounter(CTheScripts::Read2BytesFromScript(&m_nIp)); CUserDisplay::OnscnTimer.ClearCounter((uint16)CTheScripts::Read2BytesFromScript(&m_nIp));
return 0; return 0;
} }
case COMMAND_SET_ZONE_CAR_INFO: case COMMAND_SET_ZONE_CAR_INFO:
@ -5286,7 +5286,7 @@ int8 CRunningScript::ProcessCommands300To399(int32 command)
//case COMMAND_MOVE_CAMERA_ALONG_SPLINE: //case COMMAND_MOVE_CAMERA_ALONG_SPLINE:
//case COMMAND_GET_CAMERA_POSITION_ALONG_SPLINE: //case COMMAND_GET_CAMERA_POSITION_ALONG_SPLINE:
case COMMAND_DECLARE_MISSION_FLAG: case COMMAND_DECLARE_MISSION_FLAG:
CTheScripts::OnAMissionFlag = CTheScripts::Read2BytesFromScript(&++m_nIp); CTheScripts::OnAMissionFlag = (uint16)CTheScripts::Read2BytesFromScript(&++m_nIp);
return 0; return 0;
case COMMAND_DECLARE_MISSION_FLAG_FOR_CONTACT: case COMMAND_DECLARE_MISSION_FLAG_FOR_CONTACT:
return 0; return 0;
@ -10065,7 +10065,7 @@ int8 CRunningScript::ProcessCommands900To999(int32 command)
case COMMAND_DISPLAY_ONSCREEN_TIMER_WITH_STRING: case COMMAND_DISPLAY_ONSCREEN_TIMER_WITH_STRING:
{ {
script_assert(CTheScripts::ScriptSpace[m_nIp++] == ARGUMENT_GLOBALVAR); script_assert(CTheScripts::ScriptSpace[m_nIp++] == ARGUMENT_GLOBALVAR);
int16 var = CTheScripts::Read2BytesFromScript(&m_nIp); uint16 var = CTheScripts::Read2BytesFromScript(&m_nIp);
CollectParameters(&m_nIp, 1); CollectParameters(&m_nIp, 1);
wchar* text = TheText.Get((char*)&CTheScripts::ScriptSpace[m_nIp]); // ??? wchar* text = TheText.Get((char*)&CTheScripts::ScriptSpace[m_nIp]); // ???
strncpy(onscreen_str, (char*)&CTheScripts::ScriptSpace[m_nIp], KEY_LENGTH_IN_SCRIPT); strncpy(onscreen_str, (char*)&CTheScripts::ScriptSpace[m_nIp], KEY_LENGTH_IN_SCRIPT);
@ -10076,7 +10076,7 @@ int8 CRunningScript::ProcessCommands900To999(int32 command)
case COMMAND_DISPLAY_ONSCREEN_COUNTER_WITH_STRING: case COMMAND_DISPLAY_ONSCREEN_COUNTER_WITH_STRING:
{ {
script_assert(CTheScripts::ScriptSpace[m_nIp++] == ARGUMENT_GLOBALVAR); script_assert(CTheScripts::ScriptSpace[m_nIp++] == ARGUMENT_GLOBALVAR);
int16 var = CTheScripts::Read2BytesFromScript(&m_nIp); uint16 var = CTheScripts::Read2BytesFromScript(&m_nIp);
CollectParameters(&m_nIp, 1); CollectParameters(&m_nIp, 1);
wchar* text = TheText.Get((char*)&CTheScripts::ScriptSpace[m_nIp]); // ??? wchar* text = TheText.Get((char*)&CTheScripts::ScriptSpace[m_nIp]); // ???
strncpy(onscreen_str, (char*)&CTheScripts::ScriptSpace[m_nIp], KEY_LENGTH_IN_SCRIPT); strncpy(onscreen_str, (char*)&CTheScripts::ScriptSpace[m_nIp], KEY_LENGTH_IN_SCRIPT);
@ -12709,7 +12709,7 @@ int8 CRunningScript::ProcessCommands1200To1299(int32 command)
{ {
char onscreen_str[12]; char onscreen_str[12];
script_assert(CTheScripts::ScriptSpace[m_nIp++] == ARGUMENT_GLOBALVAR); script_assert(CTheScripts::ScriptSpace[m_nIp++] == ARGUMENT_GLOBALVAR);
int16 var = CTheScripts::Read2BytesFromScript(&m_nIp); uint16 var = CTheScripts::Read2BytesFromScript(&m_nIp);
CollectParameters(&m_nIp, 2); CollectParameters(&m_nIp, 2);
wchar* text = TheText.Get((char*)&CTheScripts::ScriptSpace[m_nIp]); // ??? wchar* text = TheText.Get((char*)&CTheScripts::ScriptSpace[m_nIp]); // ???
strncpy(onscreen_str, (char*)&CTheScripts::ScriptSpace[m_nIp], KEY_LENGTH_IN_SCRIPT); strncpy(onscreen_str, (char*)&CTheScripts::ScriptSpace[m_nIp], KEY_LENGTH_IN_SCRIPT);