Renaming audio enum entries to something more like original

This commit is contained in:
Sergeanur 2020-09-19 15:55:27 +03:00
parent 9c2e9fcf88
commit 7efc153dc9
10 changed files with 518 additions and 518 deletions

View file

@ -165,7 +165,7 @@ cAudioManager::SetUpLoopingCollisionSound(const cAudioCollision &col, uint8 coun
if(m_sQueueSample.m_nVolume) {
m_sQueueSample.m_nCounter = counter;
m_sQueueSample.m_vecPos = col.m_vecPosition;
m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
m_sQueueSample.m_bIs2D = false;
m_sQueueSample.m_nReleasingVolumeModificator = 7;
m_sQueueSample.m_nLoopCount = 0;
@ -306,7 +306,7 @@ cAudioManager::SetUpOneShotCollisionSound(const cAudioCollision &col)
m_sQueueSample.m_nCounter = counter++;
if(counter >= 255) counter = 28;
m_sQueueSample.m_vecPos = col.m_vecPosition;
m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
m_sQueueSample.m_bIs2D = false;
m_sQueueSample.m_nReleasingVolumeModificator = 11;
m_sQueueSample.m_nLoopCount = 1;

File diff suppressed because it is too large Load diff

View file

@ -86,7 +86,7 @@ cAudioManager::Terminate()
m_sAudioScriptObjectManager.m_nScriptObjectEntityTotal = 0;
PreTerminateGameSpecificShutdown();
for (uint32 i = 0; i < MAX_SAMPLEBANKS; i++) {
for (uint32 i = 0; i < MAX_SFX_BANKS; i++) {
if (SampleManager.IsSampleBankLoaded(i))
SampleManager.UnloadSampleBank(i);
}
@ -917,7 +917,7 @@ cAudioManager::ClearActiveSamples()
m_asActiveSamples[i].m_nEntityIndex = AEHANDLE_NONE;
m_asActiveSamples[i].m_nCounter = 0;
m_asActiveSamples[i].m_nSampleIndex = NO_SAMPLE;
m_asActiveSamples[i].m_nBankIndex = SAMPLEBANK_INVALID;
m_asActiveSamples[i].m_nBankIndex = INVALID_SFX_BANK;
m_asActiveSamples[i].m_bIs2D = false;
m_asActiveSamples[i].m_nReleasingVolumeModificator = 5;
m_asActiveSamples[i].m_nFrequency = 0;

View file

@ -26,12 +26,12 @@ cMusicManager::cMusicManager()
m_bIsInitialised = false;
m_bDisabled = false;
m_nMusicMode = MUSICMODE_DISABLED;
m_nCurrentStreamedSound = NO_STREAMED_SOUND;
m_nPreviousStreamedSound = NO_STREAMED_SOUND;
m_nCurrentStreamedSound = NO_TRACK;
m_nPreviousStreamedSound = NO_TRACK;
m_bFrontendTrackFinished = false;
m_bPlayInFrontend = false;
m_bSetNextStation = false;
m_nAnnouncement = NO_STREAMED_SOUND;
m_nAnnouncement = NO_TRACK;
m_bPreviousPlayerInCar = false;
m_bPlayerInCar = false;
m_bAnnouncementInProgress = false;
@ -224,7 +224,7 @@ cMusicManager::Initialise()
m_bRadioSetByScript = false;
m_nRadioStation = HEAD_RADIO;
m_nRadioPosition = -1;
m_nRadioInCar = NO_STREAMED_SOUND;
m_nRadioInCar = NO_TRACK;
gNumRetunePresses = 0;
gRetuneCounter = 0;
m_bIsInitialised = true;
@ -239,8 +239,8 @@ cMusicManager::Terminate()
if (SampleManager.IsStreamPlaying(0)) {
SampleManager.StopStreamedFile(0);
m_nCurrentStreamedSound = NO_STREAMED_SOUND;
m_nPreviousStreamedSound = NO_STREAMED_SOUND;
m_nCurrentStreamedSound = NO_TRACK;
m_nPreviousStreamedSound = NO_TRACK;
}
m_bIsInitialised = false;
}
@ -274,8 +274,8 @@ cMusicManager::ChangeMusicMode(uint8 mode)
}
SampleManager.StopStreamedFile(0);
}
m_nCurrentStreamedSound = NO_STREAMED_SOUND;
m_nPreviousStreamedSound = NO_STREAMED_SOUND;
m_nCurrentStreamedSound = NO_TRACK;
m_nPreviousStreamedSound = NO_TRACK;
m_bFrontendTrackFinished = false;
m_bPlayInFrontend = false;
m_bSetNextStation = false;
@ -301,14 +301,14 @@ cMusicManager::GetRadioInCar(void)
CVehicle *veh = FindPlayerVehicle();
if (veh != nil){
if (UsesPoliceRadio(veh)) {
if (m_nRadioInCar == NO_STREAMED_SOUND || (CReplay::IsPlayingBack() && AudioManager.m_nUserPause == 0))
if (m_nRadioInCar == NO_TRACK || (CReplay::IsPlayingBack() && AudioManager.m_nUserPause == 0))
return POLICE_RADIO;
return m_nRadioInCar;
} else return veh->m_nRadioStation;
}
}
if (m_nRadioInCar == NO_STREAMED_SOUND || (CReplay::IsPlayingBack() && AudioManager.m_nUserPause == 0))
if (m_nRadioInCar == NO_TRACK || (CReplay::IsPlayingBack() && AudioManager.m_nUserPause == 0))
return RADIO_OFF;
return m_nRadioInCar;
}
@ -347,7 +347,7 @@ cMusicManager::ResetMusicAfterReload()
m_bRadioSetByScript = false;
m_nRadioStation = 0;
m_nRadioPosition = -1;
m_nAnnouncement = NO_STREAMED_SOUND;
m_nAnnouncement = NO_TRACK;
m_bAnnouncementInProgress = false;
m_bSetNextStation = false;
gRetuneCounter = 0;
@ -384,7 +384,7 @@ cMusicManager::Service()
m_nLastTrackServiceTime = m_nTimer;
} else m_bDoTrackService = false;
if (m_nCurrentStreamedSound == NO_STREAMED_SOUND && SampleManager.IsStreamPlaying(0))
if (m_nCurrentStreamedSound == NO_TRACK && SampleManager.IsStreamPlaying(0))
SampleManager.StopStreamedFile(0);
else switch (m_nMusicMode) {
case MUSICMODE_FRONTEND: ServiceFrontEndMode(); break;
@ -410,8 +410,8 @@ cMusicManager::ServiceFrontEndMode()
default:
break;
}
m_nCurrentStreamedSound = NO_STREAMED_SOUND;
m_nPreviousStreamedSound = NO_STREAMED_SOUND;
m_nCurrentStreamedSound = NO_TRACK;
m_nPreviousStreamedSound = NO_TRACK;
}
} else if (bHasStarted) {
if (!SampleManager.IsStreamPlaying(0))
@ -516,7 +516,7 @@ cMusicManager::ServiceGameMode()
m_bPlayerInCar = false;
if (FindPlayerVehicle())
FindPlayerVehicle()->m_nRadioStation = m_nCurrentStreamedSound;
m_nCurrentStreamedSound = NO_STREAMED_SOUND;
m_nCurrentStreamedSound = NO_TRACK;
}
if (CTimer::GetIsSlowMotionActive()) {
if (TheCamera.pTargetEntity != nil) {
@ -585,7 +585,7 @@ cMusicManager::ServiceGameMode()
} else {
m_nCurrentStreamedSound = m_nRadioStation;
if (FindPlayerVehicle()->m_nRadioStation == m_nCurrentStreamedSound) {
m_nPreviousStreamedSound = NO_STREAMED_SOUND;
m_nPreviousStreamedSound = NO_TRACK;
SampleManager.SetStreamedVolumeAndPan(0, 63, 0, 0);
SampleManager.StopStreamedFile(0);
}
@ -608,19 +608,19 @@ cMusicManager::ServiceGameMode()
}
} else {
m_bPlayerInCar = false;
m_nCurrentStreamedSound = NO_STREAMED_SOUND;
m_nCurrentStreamedSound = NO_TRACK;
}
}
void
cMusicManager::StopFrontEndTrack()
{
if (IsInitialised() && !m_bDisabled && m_nMusicMode == MUSICMODE_FRONTEND && m_nCurrentStreamedSound != NO_STREAMED_SOUND) {
if (IsInitialised() && !m_bDisabled && m_nMusicMode == MUSICMODE_FRONTEND && m_nCurrentStreamedSound != NO_TRACK) {
m_aTracks[m_nCurrentStreamedSound].m_nPosition = SampleManager.GetStreamedFilePosition(0);
m_aTracks[m_nCurrentStreamedSound].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode();
SampleManager.StopStreamedFile(0);
m_nPreviousStreamedSound = NO_STREAMED_SOUND;
m_nCurrentStreamedSound = NO_STREAMED_SOUND;
m_nPreviousStreamedSound = NO_TRACK;
m_nCurrentStreamedSound = NO_TRACK;
}
}
@ -636,9 +636,9 @@ cMusicManager::PlayFrontEndTrack(uint8 track, uint8 bPlayInFrontend)
{
if (IsInitialised() && !m_bDisabled && track < TOTAL_STREAMED_SOUNDS) {
if (m_nMusicMode == MUSICMODE_GAME) {
if (m_nCurrentStreamedSound != NO_STREAMED_SOUND) {
if (m_nCurrentStreamedSound != NO_TRACK) {
if (m_bAnnouncementInProgress) {
m_nAnnouncement = NO_STREAMED_SOUND;
m_nAnnouncement = NO_TRACK;
m_bAnnouncementInProgress = false;
}
m_aTracks[m_nCurrentStreamedSound].m_nPosition = SampleManager.GetStreamedFilePosition(0);
@ -646,7 +646,7 @@ cMusicManager::PlayFrontEndTrack(uint8 track, uint8 bPlayInFrontend)
}
SampleManager.StopStreamedFile(0);
} else if (m_nMusicMode == MUSICMODE_FRONTEND) {
if (m_nCurrentStreamedSound != NO_STREAMED_SOUND) {
if (m_nCurrentStreamedSound != NO_TRACK) {
m_aTracks[m_nCurrentStreamedSound].m_nPosition = SampleManager.GetStreamedFilePosition(0);
m_aTracks[m_nCurrentStreamedSound].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode();
}
@ -691,7 +691,7 @@ cMusicManager::StopCutSceneMusic(void)
{
if (IsInitialised() && !m_bDisabled && m_nMusicMode == MUSICMODE_CUTSCENE) {
SampleManager.StopStreamedFile(0);
m_nCurrentStreamedSound = NO_STREAMED_SOUND;
m_nCurrentStreamedSound = NO_TRACK;
}
}
@ -733,7 +733,7 @@ cMusicManager::ServiceAmbience()
uint8 volume;
if (m_bAnnouncementInProgress) {
m_nAnnouncement = NO_STREAMED_SOUND;
m_nAnnouncement = NO_TRACK;
m_bAnnouncementInProgress = false;
}
if (m_nCurrentStreamedSound < STREAMED_SOUND_CITY_AMBIENT) {
@ -741,13 +741,13 @@ cMusicManager::ServiceAmbience()
m_aTracks[m_nCurrentStreamedSound].m_nPosition = SampleManager.GetStreamedFilePosition(0);
m_aTracks[m_nCurrentStreamedSound].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode();
SampleManager.StopStreamedFile(0);
m_nCurrentStreamedSound = NO_STREAMED_SOUND;
m_nCurrentStreamedSound = NO_TRACK;
return;
}
m_nCurrentStreamedSound = STREAMED_SOUND_CITY_AMBIENT;
}
if (CWorld::Players[CWorld::PlayerInFocus].m_WBState != WBSTATE_PLAYING && !SampleManager.IsStreamPlaying(0)) {
m_nCurrentStreamedSound = NO_STREAMED_SOUND;
m_nCurrentStreamedSound = NO_TRACK;
return;
}
@ -774,7 +774,7 @@ cMusicManager::ServiceAmbience()
SampleManager.SetStreamedVolumeAndPan(volume, 63, 1, 0);
m_bDontServiceAmbienceTrack = true;
} else
m_nCurrentStreamedSound = NO_STREAMED_SOUND;
m_nCurrentStreamedSound = NO_TRACK;
}
}
@ -813,7 +813,7 @@ cMusicManager::ServiceAnnouncement()
static int8 cCheck = 0;
if (m_bAnnouncementInProgress) {
if (!SampleManager.IsStreamPlaying(0)) {
m_nAnnouncement = NO_STREAMED_SOUND;
m_nAnnouncement = NO_TRACK;
m_bAnnouncementInProgress = false;
}
return true;
@ -823,7 +823,7 @@ cMusicManager::ServiceAnnouncement()
cCheck = 0;
int pos = SampleManager.GetStreamedFilePosition(0);
if (SampleManager.IsStreamPlaying(0)) {
if (m_nCurrentStreamedSound != NO_STREAMED_SOUND) {
if (m_nCurrentStreamedSound != NO_TRACK) {
m_aTracks[m_nCurrentStreamedSound].m_nPosition = pos;
m_aTracks[m_nCurrentStreamedSound].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode();
SampleManager.StopStreamedFile(0);

View file

@ -129,7 +129,7 @@ cAudioManager::DoPoliceRadioCrackle()
m_sQueueSample.m_nEntityIndex = m_nPoliceChannelEntity;
m_sQueueSample.m_nCounter = 0;
m_sQueueSample.m_nSampleIndex = SFX_POLICE_RADIO_CRACKLE;
m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
m_sQueueSample.m_bIs2D = true;
m_sQueueSample.m_nReleasingVolumeModificator = 10;
m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_POLICE_RADIO_CRACKLE);

View file

@ -224,7 +224,7 @@ enum eStreamedSounds
STREAMED_SOUND_MISSION_K1_B,
STREAMED_SOUND_MISSION_CAT1,
TOTAL_STREAMED_SOUNDS,
NO_STREAMED_SOUND,
NO_TRACK,
};
enum AudioEntityHandle {

View file

@ -16,83 +16,83 @@ struct tSample {
#ifdef GTA_PS2
#define PS2BANK(e) e
#else
#define PS2BANK(e) e = SAMPLEBANK_MAIN
#define PS2BANK(e) e = SFX_BANK_0
#endif // GTA_PS2
enum
{
SAMPLEBANK_MAIN,
SFX_BANK_0,
CAR_SAMPLEBANKS_OFFSET,
SAMPLEBANK_CAR_PACARD = CAR_SAMPLEBANKS_OFFSET,
SAMPLEBANK_CAR_PATHFINDER,
SAMPLEBANK_CAR_PORSCHE,
SAMPLEBANK_CAR_SPIDER,
SAMPLEBANK_CAR_MERC,
SAMPLEBANK_CAR_MACKTRUCK,
SAMPLEBANK_CAR_HOTROD,
SAMPLEBANK_CAR_COBRA,
SAMPLEBANK_CAR_NONE,
CAR_SFX_BANKS_OFFSET,
SFX_BANK_PACARD = CAR_SFX_BANKS_OFFSET,
SFX_BANK_PATHFINDER,
SFX_BANK_PORSCHE,
SFX_BANK_SPIDER,
SFX_BANK_MERC,
SFX_BANK_TRUCK,
SFX_BANK_HOTROD,
SFX_BANK_COBRA,
SFX_BANK_NONE,
PS2BANK(SAMPLEBANK_FRONTEND),
PS2BANK(SFX_BANK_FRONT_END_MENU),
PS2BANK(SAMPLEBANK_TRAIN),
PS2BANK(SFX_BANK_TRAIN),
PS2BANK(SAMPLEBANK_BUILDING_CLUB_1),
PS2BANK(SAMPLEBANK_BUILDING_CLUB_2),
PS2BANK(SAMPLEBANK_BUILDING_CLUB_3),
PS2BANK(SAMPLEBANK_BUILDING_CLUB_4),
PS2BANK(SAMPLEBANK_BUILDING_CLUB_5),
PS2BANK(SAMPLEBANK_BUILDING_CLUB_6),
PS2BANK(SAMPLEBANK_BUILDING_CLUB_7),
PS2BANK(SAMPLEBANK_BUILDING_CLUB_8),
PS2BANK(SAMPLEBANK_BUILDING_CLUB_9),
PS2BANK(SAMPLEBANK_BUILDING_CLUB_10),
PS2BANK(SAMPLEBANK_BUILDING_CLUB_11),
PS2BANK(SAMPLEBANK_BUILDING_CLUB_12),
PS2BANK(SAMPLEBANK_BUILDING_CLUB_RAGGA),
PS2BANK(SAMPLEBANK_BUILDING_STRIP_CLUB_1),
PS2BANK(SAMPLEBANK_BUILDING_STRIP_CLUB_2),
PS2BANK(SAMPLEBANK_BUILDING_WORKSHOP),
PS2BANK(SAMPLEBANK_BUILDING_PIANO_BAR),
PS2BANK(SAMPLEBANK_BUILDING_SAWMILL),
PS2BANK(SAMPLEBANK_BUILDING_DOG_FOOD_FACTORY),
PS2BANK(SAMPLEBANK_BUILDING_LAUNDERETTE),
PS2BANK(SAMPLEBANK_BUILDING_RESTAURANT_CHINATOWN),
PS2BANK(SAMPLEBANK_BUILDING_RESTAURANT_ITALY),
PS2BANK(SAMPLEBANK_BUILDING_RESTAURANT_GENERIC_1),
PS2BANK(SAMPLEBANK_BUILDING_RESTAURANT_GENERIC_2),
PS2BANK(SAMPLEBANK_BUILDING_AIRPORT),
PS2BANK(SAMPLEBANK_BUILDING_SHOP),
PS2BANK(SAMPLEBANK_BUILDING_CINEMA),
PS2BANK(SAMPLEBANK_BUILDING_DOCKS),
PS2BANK(SAMPLEBANK_BUILDING_HOME),
PS2BANK(SAMPLEBANK_BUILDING_PORN_1),
PS2BANK(SAMPLEBANK_BUILDING_PORN_2),
PS2BANK(SAMPLEBANK_BUILDING_PORN_3),
PS2BANK(SAMPLEBANK_BUILDING_POLICE_BALL),
PS2BANK(SAMPLEBANK_BUILDING_BANK_ALARM),
PS2BANK(SAMPLEBANK_BUILDING_RAVE_INDUSTRIAL),
PS2BANK(SAMPLEBANK_BUILDING_RAVE_COMMERCIAL),
PS2BANK(SAMPLEBANK_BUILDING_RAVE_SUBURBAN),
PS2BANK(SAMPLEBANK_BUILDING_RAVE_COMMERCIAL_2),
PS2BANK(SFX_BANK_BUILDING_CLUB_1),
PS2BANK(SFX_BANK_BUILDING_CLUB_2),
PS2BANK(SFX_BANK_BUILDING_CLUB_3),
PS2BANK(SFX_BANK_BUILDING_CLUB_4),
PS2BANK(SFX_BANK_BUILDING_CLUB_5),
PS2BANK(SFX_BANK_BUILDING_CLUB_6),
PS2BANK(SFX_BANK_BUILDING_CLUB_7),
PS2BANK(SFX_BANK_BUILDING_CLUB_8),
PS2BANK(SFX_BANK_BUILDING_CLUB_9),
PS2BANK(SFX_BANK_BUILDING_CLUB_10),
PS2BANK(SFX_BANK_BUILDING_CLUB_11),
PS2BANK(SFX_BANK_BUILDING_CLUB_12),
PS2BANK(SFX_BANK_BUILDING_CLUB_RAGGA),
PS2BANK(SFX_BANK_BUILDING_STRIP_CLUB_1),
PS2BANK(SFX_BANK_BUILDING_STRIP_CLUB_2),
PS2BANK(SFX_BANK_BUILDING_WORKSHOP),
PS2BANK(SFX_BANK_BUILDING_PIANO_BAR),
PS2BANK(SFX_BANK_BUILDING_SAWMILL),
PS2BANK(SFX_BANK_BUILDING_DOG_FOOD_FACTORY),
PS2BANK(SFX_BANK_BUILDING_LAUNDERETTE),
PS2BANK(SFX_BANK_BUILDING_RESTAURANT_CHINATOWN),
PS2BANK(SFX_BANK_BUILDING_RESTAURANT_ITALY),
PS2BANK(SFX_BANK_BUILDING_RESTAURANT_GENERIC_1),
PS2BANK(SFX_BANK_BUILDING_RESTAURANT_GENERIC_2),
PS2BANK(SFX_BANK_BUILDING_AIRPORT),
PS2BANK(SFX_BANK_BUILDING_SHOP),
PS2BANK(SFX_BANK_BUILDING_CINEMA),
PS2BANK(SFX_BANK_BUILDING_DOCKS),
PS2BANK(SFX_BANK_BUILDING_HOME),
PS2BANK(SFX_BANK_BUILDING_PORN_1),
PS2BANK(SFX_BANK_BUILDING_PORN_2),
PS2BANK(SFX_BANK_BUILDING_PORN_3),
PS2BANK(SFX_BANK_BUILDING_POLICE_BALL),
PS2BANK(SFX_BANK_BUILDING_BANK_ALARM),
PS2BANK(SFX_BANK_BUILDING_RAVE_INDUSTRIAL),
PS2BANK(SFX_BANK_BUILDING_RAVE_COMMERCIAL),
PS2BANK(SFX_BANK_BUILDING_RAVE_SUBURBAN),
PS2BANK(SFX_BANK_BUILDING_RAVE_COMMERCIAL_2),
PS2BANK(SAMPLEBANK_BUILDING_39),
PS2BANK(SAMPLEBANK_BUILDING_40),
PS2BANK(SAMPLEBANK_BUILDING_41),
PS2BANK(SAMPLEBANK_BUILDING_42),
PS2BANK(SAMPLEBANK_BUILDING_43),
PS2BANK(SAMPLEBANK_BUILDING_44),
PS2BANK(SAMPLEBANK_BUILDING_45),
PS2BANK(SAMPLEBANK_BUILDING_46),
PS2BANK(SAMPLEBANK_BUILDING_47),
PS2BANK(SFX_BANK_BUILDING_39),
PS2BANK(SFX_BANK_BUILDING_40),
PS2BANK(SFX_BANK_BUILDING_41),
PS2BANK(SFX_BANK_BUILDING_42),
PS2BANK(SFX_BANK_BUILDING_43),
PS2BANK(SFX_BANK_BUILDING_44),
PS2BANK(SFX_BANK_BUILDING_45),
PS2BANK(SFX_BANK_BUILDING_46),
PS2BANK(SFX_BANK_BUILDING_47),
PS2BANK(SAMPLEBANK_EXTRAS),
PS2BANK(SFX_BANK_GENERIC_EXTRA),
SAMPLEBANK_PED,
MAX_SAMPLEBANKS,
SAMPLEBANK_INVALID
SFX_BANK_PED_COMMENTS,
MAX_SFX_BANKS,
INVALID_SFX_BANK
};
#define MAX_PEDSFX 7
@ -216,7 +216,7 @@ public:
};
extern cSampleManager SampleManager;
extern uint32 BankStartOffset[MAX_SAMPLEBANKS];
extern uint32 BankStartOffset[MAX_SFX_BANKS];
#ifdef AUDIO_OPUS
static char StreamedNameTable[][25] = {

View file

@ -21,7 +21,7 @@
#pragma comment( lib, "mss32.lib" )
cSampleManager SampleManager;
uint32 BankStartOffset[MAX_SAMPLEBANKS];
uint32 BankStartOffset[MAX_SFX_BANKS];
///////////////////////////////////////////////////////////////
char SampleBankDescFilename[] = "AUDIO\\SFX.SDT";
@ -29,10 +29,10 @@ char SampleBankDataFilename[] = "AUDIO\\SFX.RAW";
FILE *fpSampleDescHandle;
FILE *fpSampleDataHandle;
bool bSampleBankLoaded [MAX_SAMPLEBANKS];
int32 nSampleBankDiscStartOffset [MAX_SAMPLEBANKS];
int32 nSampleBankSize [MAX_SAMPLEBANKS];
int32 nSampleBankMemoryStartAddress[MAX_SAMPLEBANKS];
bool bSampleBankLoaded [MAX_SFX_BANKS];
int32 nSampleBankDiscStartOffset [MAX_SFX_BANKS];
int32 nSampleBankSize [MAX_SFX_BANKS];
int32 nSampleBankMemoryStartAddress[MAX_SFX_BANKS];
int32 _nSampleDataEndOffset;
int32 nPedSlotSfx [MAX_PEDSFX];
@ -896,7 +896,7 @@ cSampleManager::Initialise(void)
_nSampleDataEndOffset = 0;
for ( int32 i = 0; i < MAX_SAMPLEBANKS; i++ )
for ( int32 i = 0; i < MAX_SFX_BANKS; i++ )
{
bSampleBankLoaded[i] = false;
nSampleBankDiscStartOffset[i] = 0;
@ -948,14 +948,14 @@ cSampleManager::Initialise(void)
return false;
}
nSampleBankMemoryStartAddress[SAMPLEBANK_MAIN] = (int32)AIL_mem_alloc_lock(nSampleBankSize[SAMPLEBANK_MAIN]);
if ( !nSampleBankMemoryStartAddress[SAMPLEBANK_MAIN] )
nSampleBankMemoryStartAddress[SFX_BANK_0] = (int32)AIL_mem_alloc_lock(nSampleBankSize[SFX_BANK_0]);
if ( !nSampleBankMemoryStartAddress[SFX_BANK_0] )
{
Terminate();
return false;
}
nSampleBankMemoryStartAddress[SAMPLEBANK_PED] = (int32)AIL_mem_alloc_lock(PED_BLOCKSIZE*MAX_PEDSFX);
nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] = (int32)AIL_mem_alloc_lock(PED_BLOCKSIZE*MAX_PEDSFX);
}
@ -1176,7 +1176,7 @@ cSampleManager::Initialise(void)
TRACE("bank");
LoadSampleBank(SAMPLEBANK_MAIN);
LoadSampleBank(SFX_BANK_0);
// mp3
TRACE("mp3");
@ -1271,16 +1271,16 @@ cSampleManager::Terminate(void)
_DeleteMP3Entries();
if ( nSampleBankMemoryStartAddress[SAMPLEBANK_MAIN] != 0 )
if ( nSampleBankMemoryStartAddress[SFX_BANK_0] != 0 )
{
AIL_mem_free_lock((void *)nSampleBankMemoryStartAddress[SAMPLEBANK_MAIN]);
nSampleBankMemoryStartAddress[SAMPLEBANK_MAIN] = 0;
AIL_mem_free_lock((void *)nSampleBankMemoryStartAddress[SFX_BANK_0]);
nSampleBankMemoryStartAddress[SFX_BANK_0] = 0;
}
if ( nSampleBankMemoryStartAddress[SAMPLEBANK_PED] != 0 )
if ( nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] != 0 )
{
AIL_mem_free_lock((void *)nSampleBankMemoryStartAddress[SAMPLEBANK_PED]);
nSampleBankMemoryStartAddress[SAMPLEBANK_PED] = 0;
AIL_mem_free_lock((void *)nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS]);
nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] = 0;
}
if ( DIG )
@ -1429,7 +1429,7 @@ cSampleManager::LoadSampleBank(uint8 nBank)
if ( MusicManager.IsInitialised()
&& MusicManager.GetMusicMode() == MUSICMODE_CUTSCENE
&& nBank != SAMPLEBANK_MAIN )
&& nBank != SFX_BANK_0 )
{
return false;
}
@ -1526,10 +1526,10 @@ cSampleManager::LoadPedComment(uint32 nComment)
if ( fseek(fpSampleDataHandle, m_aSamples[nComment].nOffset, SEEK_SET) != 0 )
return false;
if ( fread((void *)(nSampleBankMemoryStartAddress[SAMPLEBANK_PED] + PED_BLOCKSIZE*nCurrentPedSlot), 1, m_aSamples[nComment].nSize, fpSampleDataHandle) != m_aSamples[nComment].nSize )
if ( fread((void *)(nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] + PED_BLOCKSIZE*nCurrentPedSlot), 1, m_aSamples[nComment].nSize, fpSampleDataHandle) != m_aSamples[nComment].nSize )
return false;
nPedSlotSfxAddr[nCurrentPedSlot] = nSampleBankMemoryStartAddress[SAMPLEBANK_PED] + PED_BLOCKSIZE*nCurrentPedSlot;
nPedSlotSfxAddr[nCurrentPedSlot] = nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] + PED_BLOCKSIZE*nCurrentPedSlot;
nPedSlotSfx [nCurrentPedSlot] = nComment;
if ( ++nCurrentPedSlot >= MAX_PEDSFX )
@ -1541,13 +1541,13 @@ cSampleManager::LoadPedComment(uint32 nComment)
int32
cSampleManager::GetBankContainingSound(uint32 offset)
{
if ( offset >= BankStartOffset[SAMPLEBANK_PED] )
return SAMPLEBANK_PED;
if ( offset >= BankStartOffset[SFX_BANK_PED_COMMENTS] )
return SFX_BANK_PED_COMMENTS;
if ( offset >= BankStartOffset[SAMPLEBANK_MAIN] )
return SAMPLEBANK_MAIN;
if ( offset >= BankStartOffset[SFX_BANK_0] )
return SFX_BANK_0;
return SAMPLEBANK_INVALID;
return INVALID_SFX_BANK;
}
int32
@ -2289,7 +2289,7 @@ cSampleManager::IsStreamPlaying(uint8 nStream)
bool
cSampleManager::InitialiseSampleBanks(void)
{
int32 nBank = SAMPLEBANK_MAIN;
int32 nBank = SFX_BANK_0;
fpSampleDescHandle = fopen(SampleBankDescFilename, "rb");
if ( fpSampleDescHandle == NULL )
@ -2316,17 +2316,17 @@ cSampleManager::InitialiseSampleBanks(void)
for ( int32 i = 0; i < TOTAL_AUDIO_SAMPLES; i++ )
{
#ifdef FIX_BUGS
if (nBank >= MAX_SAMPLEBANKS) break;
if (nBank >= MAX_SFX_BANKS) break;
#endif
if ( BankStartOffset[nBank] == BankStartOffset[SAMPLEBANK_MAIN] + i )
if ( BankStartOffset[nBank] == BankStartOffset[SFX_BANK_0] + i )
{
nSampleBankDiscStartOffset[nBank] = m_aSamples[i].nOffset;
nBank++;
}
}
nSampleBankSize[SAMPLEBANK_MAIN] = nSampleBankDiscStartOffset[SAMPLEBANK_PED] - nSampleBankDiscStartOffset[SAMPLEBANK_MAIN];
nSampleBankSize[SAMPLEBANK_PED] = _nSampleDataEndOffset - nSampleBankDiscStartOffset[SAMPLEBANK_PED];
nSampleBankSize[SFX_BANK_0] = nSampleBankDiscStartOffset[SFX_BANK_PED_COMMENTS] - nSampleBankDiscStartOffset[SFX_BANK_0];
nSampleBankSize[SFX_BANK_PED_COMMENTS] = _nSampleDataEndOffset - nSampleBankDiscStartOffset[SFX_BANK_PED_COMMENTS];
return true;
}

View file

@ -6,7 +6,7 @@
cSampleManager SampleManager;
bool _bSampmanInitialised = false;
uint32 BankStartOffset[MAX_SAMPLEBANKS];
uint32 BankStartOffset[MAX_SFX_BANKS];
uint32 nNumMP3s;
cSampleManager::cSampleManager(void)
@ -131,20 +131,20 @@ cSampleManager::SetMonoMode(uint8 nMode)
bool
cSampleManager::LoadSampleBank(uint8 nBank)
{
ASSERT( nBank < MAX_SAMPLEBANKS );
ASSERT( nBank < MAX_SFX_BANKS );
return false;
}
void
cSampleManager::UnloadSampleBank(uint8 nBank)
{
ASSERT( nBank < MAX_SAMPLEBANKS );
ASSERT( nBank < MAX_SFX_BANKS );
}
bool
cSampleManager::IsSampleBankLoaded(uint8 nBank)
{
ASSERT( nBank < MAX_SAMPLEBANKS );
ASSERT( nBank < MAX_SFX_BANKS );
return false;
}
@ -174,7 +174,7 @@ cSampleManager::LoadPedComment(uint32 nComment)
int32
cSampleManager::GetBankContainingSound(uint32 offset)
{
return SAMPLEBANK_INVALID;
return INVALID_SFX_BANK;
}
int32

View file

@ -43,7 +43,7 @@
cSampleManager SampleManager;
bool _bSampmanInitialised = false;
uint32 BankStartOffset[MAX_SAMPLEBANKS];
uint32 BankStartOffset[MAX_SFX_BANKS];
int prevprovider=-1;
int curprovider=-1;
@ -77,10 +77,10 @@ OggOpusFile *fpSampleDataHandle;
#else
FILE *fpSampleDataHandle;
#endif
bool bSampleBankLoaded [MAX_SAMPLEBANKS];
int32 nSampleBankDiscStartOffset [MAX_SAMPLEBANKS];
int32 nSampleBankSize [MAX_SAMPLEBANKS];
uintptr nSampleBankMemoryStartAddress[MAX_SAMPLEBANKS];
bool bSampleBankLoaded [MAX_SFX_BANKS];
int32 nSampleBankDiscStartOffset [MAX_SFX_BANKS];
int32 nSampleBankSize [MAX_SFX_BANKS];
uintptr nSampleBankMemoryStartAddress[MAX_SFX_BANKS];
int32 _nSampleDataEndOffset;
int32 nPedSlotSfx [MAX_PEDSFX];
@ -541,7 +541,7 @@ cSampleManager::Initialise(void)
fpSampleDescHandle = NULL;
fpSampleDataHandle = NULL;
for ( int32 i = 0; i < MAX_SAMPLEBANKS; i++ )
for ( int32 i = 0; i < MAX_SFX_BANKS; i++ )
{
bSampleBankLoaded[i] = false;
nSampleBankDiscStartOffset[i] = 0;
@ -586,17 +586,17 @@ cSampleManager::Initialise(void)
return false;
}
nSampleBankMemoryStartAddress[SAMPLEBANK_MAIN] = (uintptr)malloc(nSampleBankSize[SAMPLEBANK_MAIN]);
ASSERT(nSampleBankMemoryStartAddress[SAMPLEBANK_MAIN] != 0);
nSampleBankMemoryStartAddress[SFX_BANK_0] = (uintptr)malloc(nSampleBankSize[SFX_BANK_0]);
ASSERT(nSampleBankMemoryStartAddress[SFX_BANK_0] != 0);
if ( nSampleBankMemoryStartAddress[SAMPLEBANK_MAIN] == 0 )
if ( nSampleBankMemoryStartAddress[SFX_BANK_0] == 0 )
{
Terminate();
return false;
}
nSampleBankMemoryStartAddress[SAMPLEBANK_PED] = (uintptr)malloc(PED_BLOCKSIZE*MAX_PEDSFX);
ASSERT(nSampleBankMemoryStartAddress[SAMPLEBANK_PED] != 0);
nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] = (uintptr)malloc(PED_BLOCKSIZE*MAX_PEDSFX);
ASSERT(nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] != 0);
}
@ -644,7 +644,7 @@ cSampleManager::Initialise(void)
#endif
}
LoadSampleBank(SAMPLEBANK_MAIN);
LoadSampleBank(SFX_BANK_0);
return true;
}
@ -666,16 +666,16 @@ cSampleManager::Terminate(void)
CStream::Terminate();
if ( nSampleBankMemoryStartAddress[SAMPLEBANK_MAIN] != 0 )
if ( nSampleBankMemoryStartAddress[SFX_BANK_0] != 0 )
{
free((void *)nSampleBankMemoryStartAddress[SAMPLEBANK_MAIN]);
nSampleBankMemoryStartAddress[SAMPLEBANK_MAIN] = 0;
free((void *)nSampleBankMemoryStartAddress[SFX_BANK_0]);
nSampleBankMemoryStartAddress[SFX_BANK_0] = 0;
}
if ( nSampleBankMemoryStartAddress[SAMPLEBANK_PED] != 0 )
if ( nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] != 0 )
{
free((void *)nSampleBankMemoryStartAddress[SAMPLEBANK_PED]);
nSampleBankMemoryStartAddress[SAMPLEBANK_PED] = 0;
free((void *)nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS]);
nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] = 0;
}
_bSampmanInitialised = false;
@ -751,14 +751,14 @@ cSampleManager::SetMonoMode(uint8 nMode)
bool
cSampleManager::LoadSampleBank(uint8 nBank)
{
ASSERT( nBank < MAX_SAMPLEBANKS );
ASSERT( nBank < MAX_SFX_BANKS );
if ( CTimer::GetIsCodePaused() )
return false;
if ( MusicManager.IsInitialised()
&& MusicManager.GetMusicMode() == MUSICMODE_CUTSCENE
&& nBank != SAMPLEBANK_MAIN )
&& nBank != SFX_BANK_0 )
{
return false;
}
@ -792,7 +792,7 @@ cSampleManager::LoadSampleBank(uint8 nBank)
void
cSampleManager::UnloadSampleBank(uint8 nBank)
{
ASSERT( nBank < MAX_SAMPLEBANKS );
ASSERT( nBank < MAX_SFX_BANKS );
bSampleBankLoaded[nBank] = false;
}
@ -800,7 +800,7 @@ cSampleManager::UnloadSampleBank(uint8 nBank)
bool
cSampleManager::IsSampleBankLoaded(uint8 nBank)
{
ASSERT( nBank < MAX_SAMPLEBANKS );
ASSERT( nBank < MAX_SFX_BANKS );
return bSampleBankLoaded[nBank];
}
@ -881,7 +881,7 @@ cSampleManager::LoadPedComment(uint32 nComment)
int samplesSize = m_aSamples[nComment].nSize / 2;
op_pcm_seek(fpSampleDataHandle, m_aSamples[nComment].nOffset / 2);
while (samplesSize > 0) {
int size = op_read(fpSampleDataHandle, (opus_int16 *)(nSampleBankMemoryStartAddress[SAMPLEBANK_PED] + PED_BLOCKSIZE * nCurrentPedSlot + samplesRead),
int size = op_read(fpSampleDataHandle, (opus_int16 *)(nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] + PED_BLOCKSIZE * nCurrentPedSlot + samplesRead),
samplesSize, NULL);
if (size <= 0) {
return false;
@ -893,7 +893,7 @@ cSampleManager::LoadPedComment(uint32 nComment)
if ( fseek(fpSampleDataHandle, m_aSamples[nComment].nOffset, SEEK_SET) != 0 )
return false;
if ( fread((void *)(nSampleBankMemoryStartAddress[SAMPLEBANK_PED] + PED_BLOCKSIZE*nCurrentPedSlot), 1, m_aSamples[nComment].nSize, fpSampleDataHandle) != m_aSamples[nComment].nSize )
if ( fread((void *)(nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] + PED_BLOCKSIZE*nCurrentPedSlot), 1, m_aSamples[nComment].nSize, fpSampleDataHandle) != m_aSamples[nComment].nSize )
return false;
#endif
@ -901,7 +901,7 @@ cSampleManager::LoadPedComment(uint32 nComment)
alBufferData(pedBuffers[nCurrentPedSlot],
AL_FORMAT_MONO16,
(void *)(nSampleBankMemoryStartAddress[SAMPLEBANK_PED] + PED_BLOCKSIZE*nCurrentPedSlot),
(void *)(nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] + PED_BLOCKSIZE*nCurrentPedSlot),
m_aSamples[nComment].nSize,
m_aSamples[nComment].nFrequency);
@ -914,13 +914,13 @@ cSampleManager::LoadPedComment(uint32 nComment)
int32
cSampleManager::GetBankContainingSound(uint32 offset)
{
if ( offset >= BankStartOffset[SAMPLEBANK_PED] )
return SAMPLEBANK_PED;
if ( offset >= BankStartOffset[SFX_BANK_PED_COMMENTS] )
return SFX_BANK_PED_COMMENTS;
if ( offset >= BankStartOffset[SAMPLEBANK_MAIN] )
return SAMPLEBANK_MAIN;
if ( offset >= BankStartOffset[SFX_BANK_0] )
return SFX_BANK_0;
return SAMPLEBANK_INVALID;
return INVALID_SFX_BANK;
}
int32
@ -1421,7 +1421,7 @@ cSampleManager::Service(void)
bool
cSampleManager::InitialiseSampleBanks(void)
{
int32 nBank = SAMPLEBANK_MAIN;
int32 nBank = SFX_BANK_0;
fpSampleDescHandle = fopen(SampleBankDescFilename, "rb");
if ( fpSampleDescHandle == NULL )
@ -1453,17 +1453,17 @@ cSampleManager::InitialiseSampleBanks(void)
for ( int32 i = 0; i < TOTAL_AUDIO_SAMPLES; i++ )
{
#ifdef FIX_BUGS
if (nBank >= MAX_SAMPLEBANKS) break;
if (nBank >= MAX_SFX_BANKS) break;
#endif
if ( BankStartOffset[nBank] == BankStartOffset[SAMPLEBANK_MAIN] + i )
if ( BankStartOffset[nBank] == BankStartOffset[SFX_BANK_0] + i )
{
nSampleBankDiscStartOffset[nBank] = m_aSamples[i].nOffset;
nBank++;
}
}
nSampleBankSize[SAMPLEBANK_MAIN] = nSampleBankDiscStartOffset[SAMPLEBANK_PED] - nSampleBankDiscStartOffset[SAMPLEBANK_MAIN];
nSampleBankSize[SAMPLEBANK_PED] = _nSampleDataEndOffset - nSampleBankDiscStartOffset[SAMPLEBANK_PED];
nSampleBankSize[SFX_BANK_0] = nSampleBankDiscStartOffset[SFX_BANK_PED_COMMENTS] - nSampleBankDiscStartOffset[SFX_BANK_0];
nSampleBankSize[SFX_BANK_PED_COMMENTS] = _nSampleDataEndOffset - nSampleBankDiscStartOffset[SFX_BANK_PED_COMMENTS];
return true;
}