summaryrefslogtreecommitdiffstats
path: root/src/audio
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-04-16 09:23:31 +0200
committeraap <aap@papnet.eu>2020-04-16 09:23:31 +0200
commit89b7085353f9ade38c2f2d4cac4aa9caf9db6a9d (patch)
treecbecbce7d638d7175ea4ee5c8b402c00564c017e /src/audio
parentMerge branch 'master' of github.com:gtamodding/re3 (diff)
parentMerge pull request #453 from Fire-Head/master (diff)
downloadre3-89b7085353f9ade38c2f2d4cac4aa9caf9db6a9d.tar
re3-89b7085353f9ade38c2f2d4cac4aa9caf9db6a9d.tar.gz
re3-89b7085353f9ade38c2f2d4cac4aa9caf9db6a9d.tar.bz2
re3-89b7085353f9ade38c2f2d4cac4aa9caf9db6a9d.tar.lz
re3-89b7085353f9ade38c2f2d4cac4aa9caf9db6a9d.tar.xz
re3-89b7085353f9ade38c2f2d4cac4aa9caf9db6a9d.tar.zst
re3-89b7085353f9ade38c2f2d4cac4aa9caf9db6a9d.zip
Diffstat (limited to 'src/audio')
-rw-r--r--src/audio/AudioManager.cpp3
-rw-r--r--src/audio/sampman.cpp98
-rw-r--r--src/audio/sampman.h4
3 files changed, 36 insertions, 69 deletions
diff --git a/src/audio/AudioManager.cpp b/src/audio/AudioManager.cpp
index f99891ec..8a9a81f9 100644
--- a/src/audio/AudioManager.cpp
+++ b/src/audio/AudioManager.cpp
@@ -9132,6 +9132,9 @@ cAudioManager::ProcessVehicleSirenOrAlarm(cVehicleParams *params)
CVehicle *veh = params->m_pVehicle;
if(veh->m_bSirenOrAlarm == 0 && veh->m_nAlarmState <= 0) return;
+#ifdef FIX_BUGS
+ if (params->m_pVehicle->m_status == STATUS_WRECKED) return;
+#endif
CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance);
m_sQueueSample.m_bVolume = ComputeVolume(80, 110.f, m_sQueueSample.m_fDistance);
if(m_sQueueSample.m_bVolume) {
diff --git a/src/audio/sampman.cpp b/src/audio/sampman.cpp
index 6edb6028..6dd744c3 100644
--- a/src/audio/sampman.cpp
+++ b/src/audio/sampman.cpp
@@ -17,9 +17,8 @@
#pragma comment( lib, "mss32.lib" )
-cSampleManager &SampleManager = *(cSampleManager *)0x7341E0;
-extern int32 (&BankStartOffset)[MAX_SAMPLEBANKS] = *(int32 (*)[MAX_SAMPLEBANKS])*(int *)0x6FAB70;
-
+cSampleManager SampleManager;
+int32 BankStartOffset[MAX_SAMPLEBANKS];
///////////////////////////////////////////////////////////////
char SampleBankDescFilename[] = "AUDIO\\SFX.SDT";
@@ -116,7 +115,7 @@ typedef struct provider_stuff
static int __cdecl comp(const provider_stuff*s1,const provider_stuff*s2)
{
- return(strcasecmp(s1->name, s2->name));
+ return( _stricmp(s1->name,s2->name) );
}
static void
@@ -435,21 +434,17 @@ _FindMP3s(void)
OutputDebugString("Resolving Link");
OutputDebugString(filepath);
- if ( f )
- fprintf(f, " - shortcut to \"%s\"", filepath);
+ if ( f ) fprintf(f, " - shortcut to \"%s\"", filepath);
}
else
{
- if ( f )
- fprintf(f, " - couldn't resolve shortcut");
+ if ( f ) fprintf(f, " - couldn't resolve shortcut");
}
bShortcut = true;
}
else
- {
bShortcut = false;
- }
}
mp3Stream[0] = AIL_open_stream(DIG, filepath, 0);
@@ -494,8 +489,7 @@ _FindMP3s(void)
_pMP3List->pLinkPath = NULL;
}
- if ( f )
- fprintf(f, " - OK\n");
+ if ( f ) fprintf(f, " - OK\n");
bInitFirstEntry = false;
}
@@ -505,8 +499,7 @@ _FindMP3s(void)
OutputDebugString(filepath);
- if ( f )
- fprintf(f, " - not an MP3 or supported MP3 type\n");
+ if ( f ) fprintf(f, " - not an MP3 or supported MP3 type\n");
bInitFirstEntry = true;
}
@@ -514,17 +507,7 @@ _FindMP3s(void)
while ( true )
{
if ( !FindNextFile(hFind, &fd) )
- {
- if ( f )
- {
- fprintf(f, "\nTOTAL SUPPORTED MP3s: %d\n", nNumMP3s);
- fclose(f);
- }
-
- FindClose(hFind);
-
- return;
- }
+ break;
if ( bInitFirstEntry )
{
@@ -533,8 +516,7 @@ _FindMP3s(void)
int32 filepathlen = strlen(filepath);
- if ( f )
- fprintf(f, "\"%s\"", fd.cFileName);
+ if ( f ) fprintf(f, "\"%s\"", fd.cFileName);
if ( filepathlen > 0 )
{
@@ -547,13 +529,11 @@ _FindMP3s(void)
OutputDebugString("Resolving Link");
OutputDebugString(filepath);
- if ( f )
- fprintf(f, " - shortcut to \"%s\"", filepath);
+ if ( f ) fprintf(f, " - shortcut to \"%s\"", filepath);
}
else
{
- if ( f )
- fprintf(f, " - couldn't resolve shortcut");
+ if ( f ) fprintf(f, " - couldn't resolve shortcut");
}
bShortcut = true;
@@ -564,8 +544,7 @@ _FindMP3s(void)
if ( filepathlen > MAX_PATH )
{
- if ( f )
- fprintf(f, " - Filename and path too long - %s - IGNORED)\n", filepath);
+ if ( f ) fprintf(f, " - Filename and path too long - %s - IGNORED)\n", filepath);
continue;
}
@@ -585,15 +564,7 @@ _FindMP3s(void)
_pMP3List = new tMP3Entry;
if ( _pMP3List == NULL)
- {
- if ( f )
- {
- fprintf(f, "\nTOTAL SUPPORTED MP3s: %d\n", nNumMP3s);
- fclose(f);
- }
- FindClose(hFind);
- return;
- }
+ break;
nNumMP3s = 1;
@@ -614,8 +585,7 @@ _FindMP3s(void)
pList = _pMP3List;
- if ( f )
- fprintf(f, " - OK\n");
+ if ( f ) fprintf(f, " - OK\n");
bInitFirstEntry = false;
}
@@ -624,8 +594,7 @@ _FindMP3s(void)
strcat(filepath, " - NOT A VALID MP3");
OutputDebugString(filepath);
- if ( f )
- fprintf(f, " - not an MP3 or supported MP3 type\n");
+ if ( f ) fprintf(f, " - not an MP3 or supported MP3 type\n");
}
}
}
@@ -638,8 +607,7 @@ _FindMP3s(void)
if ( filepathlen > 0 )
{
- if ( f )
- fprintf(f, "\"%s\"", fd.cFileName);
+ if ( f ) fprintf(f, "\"%s\"", fd.cFileName);
if ( filepathlen > 4 )
{
@@ -650,13 +618,11 @@ _FindMP3s(void)
OutputDebugString("Resolving Link");
OutputDebugString(filepath);
- if ( f )
- fprintf(f, " - shortcut to \"%s\"", filepath);
+ if ( f ) fprintf(f, " - shortcut to \"%s\"", filepath);
}
else
{
- if ( f )
- fprintf(f, " - couldn't resolve shortcut");
+ if ( f ) fprintf(f, " - couldn't resolve shortcut");
}
bShortcut = true;
@@ -679,16 +645,8 @@ _FindMP3s(void)
tMP3Entry *e = pList->pNext;
- if ( e == NULL)
- {
- if ( f )
- {
- fprintf(f, "\nTOTAL SUPPORTED MP3s: %d\n", nNumMP3s);
- fclose(f);
- }
- FindClose(hFind);
- return;
- }
+ if ( e == NULL )
+ break;
pList = pList->pNext;
@@ -710,20 +668,26 @@ _FindMP3s(void)
OutputDebugString(fd.cFileName);
- if ( f )
- fprintf(f, " - OK\n");
+ if ( f ) fprintf(f, " - OK\n");
}
else
{
strcat(filepath, " - NOT A VALID MP3");
OutputDebugString(filepath);
- if ( f )
- fprintf(f, " - not an MP3 or supported MP3 type\n");
+ if ( f ) fprintf(f, " - not an MP3 or supported MP3 type\n");
}
}
}
}
+
+ if ( f )
+ {
+ fprintf(f, "\nTOTAL SUPPORTED MP3s: %d\n", nNumMP3s);
+ fclose(f);
+ }
+
+ FindClose(hFind);
}
static void
@@ -2257,7 +2221,7 @@ cSampleManager::InitialiseSampleBanks(void)
for ( int32 i = 0; i < TOTAL_AUDIO_SAMPLES; i++ )
{
- if ( BankStartOffset[nBank] == BankStartOffset[0] + i )
+ if ( BankStartOffset[nBank] == BankStartOffset[SAMPLEBANK_MAIN] + i )
{
nSampleBankDiscStartOffset[nBank] = m_aSamples[i].nOffset;
nBank++;
diff --git a/src/audio/sampman.h b/src/audio/sampman.h
index 4b546911..4f3c3eeb 100644
--- a/src/audio/sampman.h
+++ b/src/audio/sampman.h
@@ -135,8 +135,8 @@ public:
bool InitialiseSampleBanks(void);
};
-extern cSampleManager &SampleManager;
-extern int32 (&BankStartOffset)[MAX_SAMPLEBANKS];
+extern cSampleManager SampleManager;
+extern int32 BankStartOffset[MAX_SAMPLEBANKS];
static char StreamedNameTable[][25]=
{