mirror of
https://github.com/GTAmodding/re3.git
synced 2024-11-25 10:33:45 +00:00
Fixes from master
This commit is contained in:
parent
a04a84e00b
commit
a16fcd8d6a
6 changed files with 80 additions and 57 deletions
|
@ -5321,7 +5321,7 @@ cAudioManager::SetupPedComments(cPedParams ¶ms, uint16 sound)
|
||||||
else
|
else
|
||||||
Vol = PED_COMMENT_VOLUME_BEHIND_WALL;
|
Vol = PED_COMMENT_VOLUME_BEHIND_WALL;
|
||||||
m_sQueueSample.m_nVolume = ComputeVolume(Vol, maxDist, m_sQueueSample.m_fDistance);
|
m_sQueueSample.m_nVolume = ComputeVolume(Vol, maxDist, m_sQueueSample.m_fDistance);
|
||||||
pedComment.m_nProcess = 10;
|
pedComment.m_nLoadingTimeout = 10;
|
||||||
if (m_sQueueSample.m_nVolume > 0) {
|
if (m_sQueueSample.m_nVolume > 0) {
|
||||||
pedComment.m_nEntityIndex = m_sQueueSample.m_nEntityIndex;
|
pedComment.m_nEntityIndex = m_sQueueSample.m_nEntityIndex;
|
||||||
pedComment.m_vecPos = m_sQueueSample.m_vecPos;
|
pedComment.m_vecPos = m_sQueueSample.m_vecPos;
|
||||||
|
@ -7909,7 +7909,7 @@ cAudioManager::DebugPlayPedComment(int32 sound)
|
||||||
tPedComment pedComment;
|
tPedComment pedComment;
|
||||||
|
|
||||||
pedComment.m_nSampleIndex = sound;
|
pedComment.m_nSampleIndex = sound;
|
||||||
pedComment.m_nProcess = 10;
|
pedComment.m_nLoadingTimeout = 10;
|
||||||
pedComment.m_nEntityIndex = 0;
|
pedComment.m_nEntityIndex = 0;
|
||||||
pedComment.m_fDistance = 0.0f;
|
pedComment.m_fDistance = 0.0f;
|
||||||
pedComment.m_nVolume = 99;
|
pedComment.m_nVolume = 99;
|
||||||
|
@ -7982,12 +7982,12 @@ cPedComments::Process()
|
||||||
for(int i = 0; i < ARRAY_SIZE(prevSamples); i++) {
|
for(int i = 0; i < ARRAY_SIZE(prevSamples); i++) {
|
||||||
if(m_aPedCommentQueue[m_nActiveQueue][m_aPedCommentOrderList[m_nActiveQueue][0]].m_nSampleIndex ==
|
if(m_aPedCommentQueue[m_nActiveQueue][m_aPedCommentOrderList[m_nActiveQueue][0]].m_nSampleIndex ==
|
||||||
prevSamples[(counter + 1 + i) % ARRAY_SIZE(prevSamples)]) {
|
prevSamples[(counter + 1 + i) % ARRAY_SIZE(prevSamples)]) {
|
||||||
m_aPedCommentQueue[m_nActiveQueue][m_aPedCommentOrderList[m_nActiveQueue][0]].m_nProcess = -1;
|
m_aPedCommentQueue[m_nActiveQueue][m_aPedCommentOrderList[m_nActiveQueue][0]].m_nLoadingTimeout = -1;
|
||||||
goto PedCommentAlreadyAdded;
|
goto PedCommentAlreadyAdded;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if defined(GTA_PS2) || defined(FIX_BUGS)
|
#if defined(GTA_PS2) || defined(FIX_BUGS)
|
||||||
bool8 IsLoadedResult;
|
uint8 IsLoadedResult;
|
||||||
sampleIndex = m_aPedCommentQueue[m_nActiveQueue][m_aPedCommentOrderList[m_nActiveQueue][0]].m_nSampleIndex;
|
sampleIndex = m_aPedCommentQueue[m_nActiveQueue][m_aPedCommentOrderList[m_nActiveQueue][0]].m_nSampleIndex;
|
||||||
if (sampleIndex >= PLAYER_COMMENTS_START && sampleIndex <= PLAYER_COMMENTS_END) {
|
if (sampleIndex >= PLAYER_COMMENTS_START && sampleIndex <= PLAYER_COMMENTS_END) {
|
||||||
IsLoadedResult = SampleManager.IsMissionAudioLoaded(MISSION_AUDIO_PLAYER_COMMENT, sampleIndex);
|
IsLoadedResult = SampleManager.IsMissionAudioLoaded(MISSION_AUDIO_PLAYER_COMMENT, sampleIndex);
|
||||||
|
@ -7996,11 +7996,11 @@ cPedComments::Process()
|
||||||
IsLoadedResult = SampleManager.IsPedCommentLoaded(sampleIndex);
|
IsLoadedResult = SampleManager.IsPedCommentLoaded(sampleIndex);
|
||||||
bIsPlayerComment = FALSE;
|
bIsPlayerComment = FALSE;
|
||||||
}
|
}
|
||||||
switch(IsLoadedResult) { // yes, this was a switch
|
switch(IsLoadedResult) {
|
||||||
#else
|
#else
|
||||||
switch(SampleManager.IsPedCommentLoaded(sampleIndex)) { // yes, this was a switch
|
switch(SampleManager.IsPedCommentLoaded(sampleIndex)) {
|
||||||
#endif
|
#endif
|
||||||
case FALSE:
|
case LOADING_STATUS_NOT_LOADED:
|
||||||
#if defined(GTA_PC) && !defined(FIX_BUGS)
|
#if defined(GTA_PC) && !defined(FIX_BUGS)
|
||||||
if(!m_bDelay)
|
if(!m_bDelay)
|
||||||
#endif
|
#endif
|
||||||
|
@ -8011,7 +8011,7 @@ cPedComments::Process()
|
||||||
#endif
|
#endif
|
||||||
SampleManager.LoadPedComment(sampleIndex);
|
SampleManager.LoadPedComment(sampleIndex);
|
||||||
break;
|
break;
|
||||||
case TRUE:
|
case LOADING_STATUS_LOADED:
|
||||||
AudioManager.m_sQueueSample.m_nEntityIndex = m_aPedCommentQueue[m_nActiveQueue][m_aPedCommentOrderList[m_nActiveQueue][0]].m_nEntityIndex;
|
AudioManager.m_sQueueSample.m_nEntityIndex = m_aPedCommentQueue[m_nActiveQueue][m_aPedCommentOrderList[m_nActiveQueue][0]].m_nEntityIndex;
|
||||||
AudioManager.m_sQueueSample.m_nCounter = 0;
|
AudioManager.m_sQueueSample.m_nCounter = 0;
|
||||||
AudioManager.m_sQueueSample.m_nSampleIndex = sampleIndex;
|
AudioManager.m_sQueueSample.m_nSampleIndex = sampleIndex;
|
||||||
|
@ -8065,7 +8065,7 @@ cPedComments::Process()
|
||||||
if (CTimer::GetIsSlowMotionActive())
|
if (CTimer::GetIsSlowMotionActive())
|
||||||
AudioManager.m_sQueueSample.m_nFrequency >>= 1;
|
AudioManager.m_sQueueSample.m_nFrequency >>= 1;
|
||||||
#endif
|
#endif
|
||||||
m_aPedCommentQueue[m_nActiveQueue][m_aPedCommentOrderList[m_nActiveQueue][0]].m_nProcess = -1;
|
m_aPedCommentQueue[m_nActiveQueue][m_aPedCommentOrderList[m_nActiveQueue][0]].m_nLoadingTimeout = -1;
|
||||||
prevSamples[counter++] = sampleIndex;
|
prevSamples[counter++] = sampleIndex;
|
||||||
if(counter == 10) counter = 0;
|
if(counter == 10) counter = 0;
|
||||||
AudioManager.AddSampleToRequestedQueue();
|
AudioManager.AddSampleToRequestedQueue();
|
||||||
|
@ -8074,8 +8074,8 @@ cPedComments::Process()
|
||||||
m_bDelay = TRUE;
|
m_bDelay = TRUE;
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
default:
|
case LOADING_STATUS_LOADING: break;
|
||||||
break;
|
default: break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8089,8 +8089,8 @@ PedCommentAlreadyAdded:
|
||||||
m_nActiveQueue = 0;
|
m_nActiveQueue = 0;
|
||||||
}
|
}
|
||||||
for (uint8 i = 0; i < m_nPedCommentCount[queue]; i++) {
|
for (uint8 i = 0; i < m_nPedCommentCount[queue]; i++) {
|
||||||
if (m_aPedCommentQueue[queue][m_aPedCommentOrderList[queue][i]].m_nProcess > 0) {
|
if (m_aPedCommentQueue[queue][m_aPedCommentOrderList[queue][i]].m_nLoadingTimeout > 0) {
|
||||||
m_aPedCommentQueue[queue][m_aPedCommentOrderList[queue][i]].m_nProcess--;
|
m_aPedCommentQueue[queue][m_aPedCommentOrderList[queue][i]].m_nLoadingTimeout--;
|
||||||
Add(&m_aPedCommentQueue[queue][m_aPedCommentOrderList[queue][i]]);
|
Add(&m_aPedCommentQueue[queue][m_aPedCommentOrderList[queue][i]]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10116,7 +10116,7 @@ cAudioManager::ProcessMissionAudioSlot(uint8 slot)
|
||||||
m_nMissionAudioLoadingStatus[slot] = LOADING_STATUS_LOADED;
|
m_nMissionAudioLoadingStatus[slot] = LOADING_STATUS_LOADED;
|
||||||
nFramesUntilFailedLoad[slot] = 0;
|
nFramesUntilFailedLoad[slot] = 0;
|
||||||
break;
|
break;
|
||||||
case LOADING_STATUS_FAILED:
|
case LOADING_STATUS_LOADING:
|
||||||
if (++nFramesUntilFailedLoad[slot] >= 120) {
|
if (++nFramesUntilFailedLoad[slot] >= 120) {
|
||||||
nFramesForPretendPlaying[slot] = 0;
|
nFramesForPretendPlaying[slot] = 0;
|
||||||
g_bMissionAudioLoadFailed[slot] = TRUE;
|
g_bMissionAudioLoadFailed[slot] = TRUE;
|
||||||
|
|
|
@ -88,7 +88,7 @@ public:
|
||||||
CVector m_vecPos;
|
CVector m_vecPos;
|
||||||
float m_fDistance;
|
float m_fDistance;
|
||||||
uint8 m_nVolume;
|
uint8 m_nVolume;
|
||||||
int8 m_nProcess;
|
int8 m_nLoadingTimeout; // how many iterations we gonna wait until dropping the sample if it's still not loaded (only useful on PS2)
|
||||||
#if defined(EXTERNAL_3D_SOUND) && defined(FIX_BUGS)
|
#if defined(EXTERNAL_3D_SOUND) && defined(FIX_BUGS)
|
||||||
uint8 m_nEmittingVolume;
|
uint8 m_nEmittingVolume;
|
||||||
#endif
|
#endif
|
||||||
|
@ -112,7 +112,7 @@ public:
|
||||||
{
|
{
|
||||||
for (int i = 0; i < NUM_PED_COMMENTS_SLOTS; i++)
|
for (int i = 0; i < NUM_PED_COMMENTS_SLOTS; i++)
|
||||||
for (int j = 0; j < NUM_SOUND_QUEUES; j++) {
|
for (int j = 0; j < NUM_SOUND_QUEUES; j++) {
|
||||||
m_aPedCommentQueue[j][i].m_nProcess = -1;
|
m_aPedCommentQueue[j][i].m_nLoadingTimeout = -1;
|
||||||
m_aPedCommentOrderList[j][i] = NUM_PED_COMMENTS_SLOTS;
|
m_aPedCommentOrderList[j][i] = NUM_PED_COMMENTS_SLOTS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -218,7 +218,7 @@ enum {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
enum PLAY_STATUS { PLAY_STATUS_STOPPED = 0, PLAY_STATUS_PLAYING, PLAY_STATUS_FINISHED };
|
enum PLAY_STATUS { PLAY_STATUS_STOPPED = 0, PLAY_STATUS_PLAYING, PLAY_STATUS_FINISHED };
|
||||||
enum LOADING_STATUS { LOADING_STATUS_NOT_LOADED = 0, LOADING_STATUS_LOADED, LOADING_STATUS_FAILED };
|
enum LOADING_STATUS { LOADING_STATUS_NOT_LOADED = 0, LOADING_STATUS_LOADED, LOADING_STATUS_LOADING };
|
||||||
|
|
||||||
class cAudioManager
|
class cAudioManager
|
||||||
{
|
{
|
||||||
|
|
|
@ -203,14 +203,14 @@ public:
|
||||||
|
|
||||||
bool8 LoadSampleBank (uint8 nBank);
|
bool8 LoadSampleBank (uint8 nBank);
|
||||||
void UnloadSampleBank (uint8 nBank);
|
void UnloadSampleBank (uint8 nBank);
|
||||||
bool8 IsSampleBankLoaded(uint8 nBank);
|
int8 IsSampleBankLoaded(uint8 nBank);
|
||||||
|
|
||||||
#if defined (GTA_PS2) || defined (FIX_BUGS)
|
#if defined (GTA_PS2) || defined (FIX_BUGS)
|
||||||
bool8 IsMissionAudioLoaded(uint8 nSlot, uint32 nSample);
|
uint8 IsMissionAudioLoaded(uint8 nSlot, uint32 nSample);
|
||||||
bool8 LoadMissionAudio (uint8 nSlot, uint32 nSample);
|
bool8 LoadMissionAudio (uint8 nSlot, uint32 nSample);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool8 IsPedCommentLoaded(uint32 nComment);
|
uint8 IsPedCommentLoaded(uint32 nComment);
|
||||||
bool8 LoadPedComment (uint32 nComment);
|
bool8 LoadPedComment (uint32 nComment);
|
||||||
int32 GetBankContainingSound(uint32 offset);
|
int32 GetBankContainingSound(uint32 offset);
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ char SampleBankDataFilename[] = "AUDIO\\SFX.RAW";
|
||||||
|
|
||||||
FILE *fpSampleDescHandle;
|
FILE *fpSampleDescHandle;
|
||||||
FILE *fpSampleDataHandle;
|
FILE *fpSampleDataHandle;
|
||||||
bool8 bSampleBankLoaded [MAX_SFX_BANKS];
|
int8 gBankLoaded [MAX_SFX_BANKS];
|
||||||
int32 nSampleBankDiscStartOffset [MAX_SFX_BANKS];
|
int32 nSampleBankDiscStartOffset [MAX_SFX_BANKS];
|
||||||
int32 nSampleBankSize [MAX_SFX_BANKS];
|
int32 nSampleBankSize [MAX_SFX_BANKS];
|
||||||
int32 nSampleBankMemoryStartAddress[MAX_SFX_BANKS];
|
int32 nSampleBankMemoryStartAddress[MAX_SFX_BANKS];
|
||||||
|
@ -964,7 +964,7 @@ cSampleManager::Initialise(void)
|
||||||
|
|
||||||
for ( int32 i = 0; i < MAX_SFX_BANKS; i++ )
|
for ( int32 i = 0; i < MAX_SFX_BANKS; i++ )
|
||||||
{
|
{
|
||||||
bSampleBankLoaded[i] = FALSE;
|
gBankLoaded[i] = LOADING_STATUS_NOT_LOADED;
|
||||||
nSampleBankDiscStartOffset[i] = 0;
|
nSampleBankDiscStartOffset[i] = 0;
|
||||||
nSampleBankSize[i] = 0;
|
nSampleBankSize[i] = 0;
|
||||||
nSampleBankMemoryStartAddress[i] = 0;
|
nSampleBankMemoryStartAddress[i] = 0;
|
||||||
|
@ -1595,7 +1595,7 @@ cSampleManager::LoadSampleBank(uint8 nBank)
|
||||||
if ( fread((void *)nSampleBankMemoryStartAddress[nBank], 1, nSampleBankSize[nBank],fpSampleDataHandle) != nSampleBankSize[nBank] )
|
if ( fread((void *)nSampleBankMemoryStartAddress[nBank], 1, nSampleBankSize[nBank],fpSampleDataHandle) != nSampleBankSize[nBank] )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
bSampleBankLoaded[nBank] = TRUE;
|
gBankLoaded[nBank] = LOADING_STATUS_LOADED;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -1603,22 +1603,22 @@ cSampleManager::LoadSampleBank(uint8 nBank)
|
||||||
void
|
void
|
||||||
cSampleManager::UnloadSampleBank(uint8 nBank)
|
cSampleManager::UnloadSampleBank(uint8 nBank)
|
||||||
{
|
{
|
||||||
bSampleBankLoaded[nBank] = FALSE;
|
gBankLoaded[nBank] = LOADING_STATUS_NOT_LOADED;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool8
|
int8
|
||||||
cSampleManager::IsSampleBankLoaded(uint8 nBank)
|
cSampleManager::IsSampleBankLoaded(uint8 nBank)
|
||||||
{
|
{
|
||||||
return bSampleBankLoaded[nBank];
|
return gBankLoaded[nBank];
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FIX_BUGS
|
#ifdef FIX_BUGS
|
||||||
bool8
|
uint8
|
||||||
cSampleManager::IsMissionAudioLoaded(uint8 nSlot, uint32 nSample)
|
cSampleManager::IsMissionAudioLoaded(uint8 nSlot, uint32 nSample)
|
||||||
{
|
{
|
||||||
ASSERT(nSlot == MISSION_AUDIO_PLAYER_COMMENT); // only MISSION_AUDIO_PLAYER_COMMENT is supported on PC
|
ASSERT(nSlot == MISSION_AUDIO_PLAYER_COMMENT); // only MISSION_AUDIO_PLAYER_COMMENT is supported on PC
|
||||||
|
|
||||||
return nSample == gPlayerTalkSfx;
|
return nSample == gPlayerTalkSfx ? LOADING_STATUS_LOADED : LOADING_STATUS_NOT_LOADED;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool8
|
bool8
|
||||||
|
@ -1639,7 +1639,7 @@ cSampleManager::LoadMissionAudio(uint8 nSlot, uint32 nSample)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool8
|
uint8
|
||||||
cSampleManager::IsPedCommentLoaded(uint32 nComment)
|
cSampleManager::IsPedCommentLoaded(uint32 nComment)
|
||||||
{
|
{
|
||||||
int8 slot;
|
int8 slot;
|
||||||
|
@ -1652,10 +1652,10 @@ cSampleManager::IsPedCommentLoaded(uint32 nComment)
|
||||||
slot += ARRAY_SIZE(nPedSlotSfx);
|
slot += ARRAY_SIZE(nPedSlotSfx);
|
||||||
#endif
|
#endif
|
||||||
if ( nComment == nPedSlotSfx[slot] )
|
if ( nComment == nPedSlotSfx[slot] )
|
||||||
return TRUE;
|
return LOADING_STATUS_LOADED;
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return LOADING_STATUS_NOT_LOADED;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32
|
int32
|
||||||
|
@ -1873,12 +1873,23 @@ cSampleManager::InitialiseChannel(uint32 nChannel, uint32 nSfx, uint8 nBank)
|
||||||
#endif
|
#endif
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( !IsPedCommentLoaded(nSfx) )
|
int32 i;
|
||||||
|
for ( i = 0; i < _TODOCONST(3); i++ )
|
||||||
|
{
|
||||||
|
int32 slot = nCurrentPedSlot - i - 1;
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
if (slot < 0)
|
||||||
|
slot += ARRAY_SIZE(nPedSlotSfx);
|
||||||
|
#endif
|
||||||
|
if ( nSfx == nPedSlotSfx[slot] )
|
||||||
|
{
|
||||||
|
addr = nPedSlotSfxAddr[slot];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i == _TODOCONST(3))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
int32 slot = _GetPedCommentSlot(nSfx);
|
|
||||||
|
|
||||||
addr = nPedSlotSfxAddr[slot];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef EXTERNAL_3D_SOUND
|
#ifdef EXTERNAL_3D_SOUND
|
||||||
|
|
|
@ -148,20 +148,20 @@ cSampleManager::UnloadSampleBank(uint8 nBank)
|
||||||
ASSERT( nBank < MAX_SFX_BANKS );
|
ASSERT( nBank < MAX_SFX_BANKS );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool8
|
int8
|
||||||
cSampleManager::IsSampleBankLoaded(uint8 nBank)
|
cSampleManager::IsSampleBankLoaded(uint8 nBank)
|
||||||
{
|
{
|
||||||
ASSERT( nBank < MAX_SFX_BANKS );
|
ASSERT( nBank < MAX_SFX_BANKS );
|
||||||
|
|
||||||
return FALSE;
|
return LOADING_STATUS_NOT_LOADED;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool8
|
uint8
|
||||||
cSampleManager::IsMissionAudioLoaded(uint8 nSlot, uint32 nSample)
|
cSampleManager::IsMissionAudioLoaded(uint8 nSlot, uint32 nSample)
|
||||||
{
|
{
|
||||||
ASSERT(nSlot < MISSION_AUDIO_COUNT);
|
ASSERT(nSlot < MISSION_AUDIO_COUNT);
|
||||||
|
|
||||||
return FALSE;
|
return LOADING_STATUS_NOT_LOADED;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool8
|
bool8
|
||||||
|
@ -172,12 +172,12 @@ cSampleManager::LoadMissionAudio(uint8 nSlot, uint32 nSample)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool8
|
uint8
|
||||||
cSampleManager::IsPedCommentLoaded(uint32 nComment)
|
cSampleManager::IsPedCommentLoaded(uint32 nComment)
|
||||||
{
|
{
|
||||||
ASSERT( nComment < TOTAL_AUDIO_SAMPLES );
|
ASSERT( nComment < TOTAL_AUDIO_SAMPLES );
|
||||||
|
|
||||||
return FALSE;
|
return LOADING_STATUS_NOT_LOADED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -92,7 +92,7 @@ OggOpusFile *fpSampleDataHandle;
|
||||||
#else
|
#else
|
||||||
FILE *fpSampleDataHandle;
|
FILE *fpSampleDataHandle;
|
||||||
#endif
|
#endif
|
||||||
bool8 bSampleBankLoaded [MAX_SFX_BANKS];
|
int8 gBankLoaded [MAX_SFX_BANKS];
|
||||||
int32 nSampleBankDiscStartOffset [MAX_SFX_BANKS];
|
int32 nSampleBankDiscStartOffset [MAX_SFX_BANKS];
|
||||||
int32 nSampleBankSize [MAX_SFX_BANKS];
|
int32 nSampleBankSize [MAX_SFX_BANKS];
|
||||||
uintptr nSampleBankMemoryStartAddress[MAX_SFX_BANKS];
|
uintptr nSampleBankMemoryStartAddress[MAX_SFX_BANKS];
|
||||||
|
@ -812,7 +812,7 @@ cSampleManager::Initialise(void)
|
||||||
|
|
||||||
for ( int32 i = 0; i < MAX_SFX_BANKS; i++ )
|
for ( int32 i = 0; i < MAX_SFX_BANKS; i++ )
|
||||||
{
|
{
|
||||||
bSampleBankLoaded[i] = FALSE;
|
gBankLoaded[i] = LOADING_STATUS_NOT_LOADED;
|
||||||
nSampleBankDiscStartOffset[i] = 0;
|
nSampleBankDiscStartOffset[i] = 0;
|
||||||
nSampleBankSize[i] = 0;
|
nSampleBankSize[i] = 0;
|
||||||
nSampleBankMemoryStartAddress[i] = 0;
|
nSampleBankMemoryStartAddress[i] = 0;
|
||||||
|
@ -1250,7 +1250,7 @@ cSampleManager::LoadSampleBank(uint8 nBank)
|
||||||
if ( fread((void *)nSampleBankMemoryStartAddress[nBank], 1, nSampleBankSize[nBank], fpSampleDataHandle) != nSampleBankSize[nBank] )
|
if ( fread((void *)nSampleBankMemoryStartAddress[nBank], 1, nSampleBankSize[nBank], fpSampleDataHandle) != nSampleBankSize[nBank] )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
#endif
|
#endif
|
||||||
bSampleBankLoaded[nBank] = TRUE;
|
gBankLoaded[nBank] = LOADING_STATUS_LOADED;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -1260,24 +1260,24 @@ cSampleManager::UnloadSampleBank(uint8 nBank)
|
||||||
{
|
{
|
||||||
ASSERT( nBank < MAX_SFX_BANKS);
|
ASSERT( nBank < MAX_SFX_BANKS);
|
||||||
|
|
||||||
bSampleBankLoaded[nBank] = FALSE;
|
gBankLoaded[nBank] = LOADING_STATUS_NOT_LOADED;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool8
|
int8
|
||||||
cSampleManager::IsSampleBankLoaded(uint8 nBank)
|
cSampleManager::IsSampleBankLoaded(uint8 nBank)
|
||||||
{
|
{
|
||||||
ASSERT( nBank < MAX_SFX_BANKS);
|
ASSERT( nBank < MAX_SFX_BANKS);
|
||||||
|
|
||||||
return bSampleBankLoaded[nBank];
|
return gBankLoaded[nBank];
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FIX_BUGS
|
#ifdef FIX_BUGS
|
||||||
bool8
|
uint8
|
||||||
cSampleManager::IsMissionAudioLoaded(uint8 nSlot, uint32 nSample)
|
cSampleManager::IsMissionAudioLoaded(uint8 nSlot, uint32 nSample)
|
||||||
{
|
{
|
||||||
ASSERT(nSlot == MISSION_AUDIO_PLAYER_COMMENT); // only MISSION_AUDIO_PLAYER_COMMENT is supported on PC
|
ASSERT(nSlot == MISSION_AUDIO_PLAYER_COMMENT); // only MISSION_AUDIO_PLAYER_COMMENT is supported on PC
|
||||||
|
|
||||||
return nSample == gPlayerTalkSfx;
|
return nSample == gPlayerTalkSfx ? LOADING_STATUS_LOADED : LOADING_STATUS_NOT_LOADED;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool8
|
bool8
|
||||||
|
@ -1298,7 +1298,7 @@ cSampleManager::LoadMissionAudio(uint8 nSlot, uint32 nSample)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool8
|
uint8
|
||||||
cSampleManager::IsPedCommentLoaded(uint32 nComment)
|
cSampleManager::IsPedCommentLoaded(uint32 nComment)
|
||||||
{
|
{
|
||||||
ASSERT( nComment < TOTAL_AUDIO_SAMPLES );
|
ASSERT( nComment < TOTAL_AUDIO_SAMPLES );
|
||||||
|
@ -1313,10 +1313,10 @@ cSampleManager::IsPedCommentLoaded(uint32 nComment)
|
||||||
uint8 slot = nCurrentPedSlot - i - 1;
|
uint8 slot = nCurrentPedSlot - i - 1;
|
||||||
#endif
|
#endif
|
||||||
if ( nComment == nPedSlotSfx[slot] )
|
if ( nComment == nPedSlotSfx[slot] )
|
||||||
return TRUE;
|
return LOADING_STATUS_LOADED;
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return LOADING_STATUS_NOT_LOADED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1543,11 +1543,23 @@ cSampleManager::InitialiseChannel(uint32 nChannel, uint32 nSfx, uint8 nBank)
|
||||||
#endif
|
#endif
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( !IsPedCommentLoaded(nSfx) )
|
int32 i;
|
||||||
|
for ( i = 0; i < _TODOCONST(3); i++ )
|
||||||
|
{
|
||||||
|
int32 slot = nCurrentPedSlot - i - 1;
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
if (slot < 0)
|
||||||
|
slot += ARRAY_SIZE(nPedSlotSfx);
|
||||||
|
#endif
|
||||||
|
if ( nSfx == nPedSlotSfx[slot] )
|
||||||
|
{
|
||||||
|
addr = (nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] + PED_BLOCKSIZE * slot);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i == _TODOCONST(3))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
int32 slot = _GetPedCommentSlot(nSfx);
|
|
||||||
addr = (nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] + PED_BLOCKSIZE * slot);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( GetChannelUsedFlag(nChannel) )
|
if ( GetChannelUsedFlag(nChannel) )
|
||||||
|
|
Loading…
Reference in a new issue