mirror of
https://gitlab.com/GaryOderNichts/re3-wiiu.git
synced 2024-11-30 04:54:15 +01:00
some style and bug fixes, updated sfx enum, and implemented processVehicleEngine
This commit is contained in:
parent
223cd11835
commit
5b9e4c4780
@ -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
@ -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);
|
||||
}
|
||||
@ -934,7 +934,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;
|
||||
|
@ -371,6 +371,8 @@ public:
|
||||
void ProcessWeather(int32 id);
|
||||
bool ProcessWetRoadNoise(cVehicleParams *params);
|
||||
|
||||
void ProcessVehicleEngine1(cVehicleParams* params);
|
||||
|
||||
int32 RandomDisplacement(uint32 seed) const;
|
||||
void ReacquireDigitalHandle() const;
|
||||
void ReleaseDigitalHandle() const;
|
||||
|
@ -103,7 +103,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);
|
||||
|
@ -16,85 +16,101 @@ 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,
|
||||
#ifdef GTA_PS2
|
||||
SFX_BANK_GENERIC_EXTRA,
|
||||
SFX_BANK_PED_COMMENTS,
|
||||
SFX_BANK_FRONT_END_MENU,
|
||||
#else
|
||||
SFX_BANK_GENERIC_EXTRA = SFX_BANK_0,
|
||||
SFX_BANK_FRONT_END_MENU = 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,
|
||||
SFX_BANK_PED_COMMENTS,
|
||||
MAX_SFX_BANKS,
|
||||
INVALID_SFX_BANK,
|
||||
#endif
|
||||
|
||||
PS2BANK(SAMPLEBANK_FRONTEND),
|
||||
CAR_SFX_BANKS_OFFSET,
|
||||
SFX_BANK_PONTIAC = CAR_SFX_BANKS_OFFSET,
|
||||
SFX_BANK_PORSCHE,
|
||||
SFX_BANK_SPIDER,
|
||||
SFX_BANK_MERC,
|
||||
SFX_BANK_TRUCK,
|
||||
SFX_BANK_HOTROD,
|
||||
SFX_BANK_COBRA,
|
||||
SFX_BANK_PONTIAC_SLOW,
|
||||
SFX_BANK_CADILLAC,
|
||||
SFX_BANK_PATHFINDER,
|
||||
SFX_BANK_PACARD,
|
||||
SFX_BANK_GOLF_CART,
|
||||
SFX_BANK_CAR_CHAINSAW,
|
||||
SFX_BANK_RC,
|
||||
SFX_BANK_RC_HELI,
|
||||
SFX_BANK_CAR_UNUSED_4,
|
||||
|
||||
PS2BANK(SAMPLEBANK_TRAIN),
|
||||
// bikes
|
||||
SFX_BANK_VTWIN,
|
||||
SFX_BANK_MOPED,
|
||||
SFX_BANK_HONDA250,
|
||||
SFX_BANK_SPORTS_BIKE,
|
||||
SFX_BANK_BIKE_UNUSED_1,
|
||||
SFX_BANK_BIKE_UNUSED_2,
|
||||
SFX_BANK_BIKE_UNUSED_3,
|
||||
SFX_BANK_BIKE_UNUSED_4,
|
||||
SFX_BANK_BIKE_UNUSED_5,
|
||||
SFX_BANK_BIKE_UNUSED_6,
|
||||
|
||||
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),
|
||||
// heli
|
||||
SFX_BANK_HELI_APACHE,
|
||||
SFX_BANK_HELI_UNUSED_1,
|
||||
SFX_BANK_HELI_UNUSED_2,
|
||||
SFX_BANK_HELI_UNUSED_3,
|
||||
SFX_BANK_HELI_UNUSED_4,
|
||||
|
||||
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(SAMPLEBANK_EXTRAS),
|
||||
|
||||
SAMPLEBANK_PED,
|
||||
MAX_SAMPLEBANKS,
|
||||
SAMPLEBANK_INVALID
|
||||
// plane
|
||||
SFX_BANK_PLANE_SEAPLANE,
|
||||
SFX_BANK_PLANE_UNUSED_1,
|
||||
SFX_BANK_PLANE_UNUSED_2,
|
||||
SFX_BANK_PLANE_UNUSED_3,
|
||||
SFX_BANK_PLANE_UNUSED_4,
|
||||
PS2BANK(SFX_BANK_BUILDING_BANK_ALARM),
|
||||
PS2BANK(SFX_BANK_BUILDING_SNORING),
|
||||
PS2BANK(SFX_BANK_BUILDING_BAR_1),
|
||||
PS2BANK(SFX_BANK_BUILDING_BAR_2),
|
||||
PS2BANK(SFX_BANK_BUILDING_BAR_3),
|
||||
PS2BANK(SFX_BANK_BUILDING_BAR_4),
|
||||
PS2BANK(SFX_BANK_BUILDING_MALIBU_1),
|
||||
PS2BANK(SFX_BANK_BUILDING_MALIBU_2),
|
||||
PS2BANK(SFX_BANK_BUILDING_MALIBU_3),
|
||||
PS2BANK(SFX_BANK_BUILDING_STRIP_1),
|
||||
PS2BANK(SFX_BANK_BUILDING_STRIP_2),
|
||||
PS2BANK(SFX_BANK_BUILDING_STRIP_3),
|
||||
PS2BANK(SFX_BANK_BUILDING_CHURCH),
|
||||
PS2BANK(SFX_BANK_BUILDING_FAN_1),
|
||||
PS2BANK(SFX_BANK_BUILDING_FAN_2),
|
||||
PS2BANK(SFX_BANK_BUILDING_INSECT_1),
|
||||
PS2BANK(SFX_BANK_BUILDING_INSECT_2),
|
||||
PS2BANK(SFX_BANK_BUILDING_18),
|
||||
PS2BANK(SFX_BANK_BUILDING_19),
|
||||
PS2BANK(SFX_BANK_BUILDING_20),
|
||||
PS2BANK(SFX_BANK_BUILDING_21),
|
||||
PS2BANK(SFX_BANK_FOOTSTEPS_GRASS),
|
||||
PS2BANK(SFX_BANK_FOOTSTEPS_GRAVEL),
|
||||
PS2BANK(SFX_BANK_FOOTSTEPS_WOOD),
|
||||
PS2BANK(SFX_BANK_FOOTSTEPS_METAL),
|
||||
PS2BANK(SFX_BANK_FOOTSTEPS_WATER),
|
||||
PS2BANK(SFX_BANK_FOOTSTEPS_SAND),
|
||||
#ifdef GTA_PS2
|
||||
MAX_SFX_BANKS,
|
||||
INVALID_SFX_BANK
|
||||
#endif
|
||||
};
|
||||
|
||||
#define MAX_PEDSFX 7
|
||||
#define PED_BLOCKSIZE 79000
|
||||
|
||||
@ -226,7 +242,7 @@ public:
|
||||
};
|
||||
|
||||
extern cSampleManager SampleManager;
|
||||
extern uint32 BankStartOffset[MAX_SAMPLEBANKS];
|
||||
extern uint32 BankStartOffset[MAX_SFX_BANKS];
|
||||
|
||||
#ifdef AUDIO_OPUS
|
||||
static char StreamedNameTable[][25] = {
|
||||
|
@ -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];
|
||||
@ -1007,7 +1007,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;
|
||||
@ -1059,14 +1059,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);
|
||||
|
||||
}
|
||||
|
||||
@ -1287,7 +1287,7 @@ cSampleManager::Initialise(void)
|
||||
|
||||
TRACE("bank");
|
||||
|
||||
LoadSampleBank(SAMPLEBANK_MAIN);
|
||||
LoadSampleBank(SFX_BANK_0);
|
||||
|
||||
// mp3
|
||||
TRACE("mp3");
|
||||
@ -1382,16 +1382,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 )
|
||||
@ -1546,7 +1546,7 @@ cSampleManager::LoadSampleBank(uint8 nBank)
|
||||
|
||||
if ( MusicManager.IsInitialised()
|
||||
&& MusicManager.GetMusicMode() == MUSICMODE_CUTSCENE
|
||||
&& nBank != SAMPLEBANK_MAIN )
|
||||
&& nBank != SFX_BANK_0 )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -1643,10 +1643,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 )
|
||||
@ -1658,13 +1658,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
|
||||
@ -2410,7 +2410,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 )
|
||||
@ -2437,17 +2437,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;
|
||||
}
|
||||
|
@ -619,10 +619,10 @@ 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;
|
||||
@ -677,7 +677,7 @@ cSampleManager::Initialise(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
LoadSampleBank(SAMPLEBANK_MAIN);
|
||||
LoadSampleBank(SFX_BANK_0);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -699,10 +699,10 @@ 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 )
|
||||
@ -797,7 +797,7 @@ cSampleManager::LoadSampleBank(uint8 nBank)
|
||||
|
||||
if ( MusicManager.IsInitialised()
|
||||
&& MusicManager.GetMusicMode() == MUSICMODE_CUTSCENE
|
||||
&& nBank != SAMPLEBANK_MAIN )
|
||||
&& nBank != SFX_BANK_0 )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -956,8 +956,8 @@ cSampleManager::GetBankContainingSound(uint32 offset)
|
||||
if ( offset >= BankStartOffset[SAMPLEBANK_PED] )
|
||||
return SAMPLEBANK_PED;
|
||||
|
||||
if ( offset >= BankStartOffset[SAMPLEBANK_MAIN] )
|
||||
return SAMPLEBANK_MAIN;
|
||||
if ( offset >= BankStartOffset[SFX_BANK_0] )
|
||||
return SFX_BANK_0;
|
||||
|
||||
return SAMPLEBANK_INVALID;
|
||||
}
|
||||
@ -1460,7 +1460,7 @@ cSampleManager::Service(void)
|
||||
bool
|
||||
cSampleManager::InitialiseSampleBanks(void)
|
||||
{
|
||||
int32 nBank = SAMPLEBANK_MAIN;
|
||||
int32 nBank = SFX_BANK_0;
|
||||
|
||||
fpSampleDescHandle = fopen(SampleBankDescFilename, "rb");
|
||||
if ( fpSampleDescHandle == NULL )
|
||||
@ -1494,14 +1494,14 @@ cSampleManager::InitialiseSampleBanks(void)
|
||||
#ifdef FIX_BUGS
|
||||
if (nBank >= MAX_SAMPLEBANKS) 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[SFX_BANK_0] = nSampleBankDiscStartOffset[SAMPLEBANK_PED] - nSampleBankDiscStartOffset[SFX_BANK_0];
|
||||
nSampleBankSize[SAMPLEBANK_PED] = _nSampleDataEndOffset - nSampleBankDiscStartOffset[SAMPLEBANK_PED];
|
||||
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user