ps4 support final

This commit is contained in:
NaN
2026-08-04 01:31:55 -04:00
parent d06e2e5eba
commit aca9560079
2 changed files with 23 additions and 2 deletions
@@ -203,6 +203,14 @@ void AILCALL MilesMixerCB(HDIGDRIVER dig)
void SoundEngine::init(Options *pOptions)
{
app.DebugPrintf("---SoundEngine::init\n");
#ifdef _WINDOWS64
HMODULE ntdll = GetModuleHandleA("ntdll.dll");
if (ntdll != NULL && GetProcAddress(ntdll, "wine_get_version") != NULL)
{
app.DebugPrintf("---SoundEngine::init - Miles disabled under Wine\n");
return;
}
#endif
#ifdef __DISABLE_MILES__
return;
#endif
@@ -402,6 +410,7 @@ void SoundEngine::SetStreamingSounds(int iOverworldMin, int iOverWorldMax, int i
// AP - moved to a separate function so it can be called from the mixer callback on Vita
void SoundEngine::updateMiles()
{
if (m_hDriver == 0) return;
#ifdef __PSVITA__
//CD - We must check for Background Music [BGM] at any point
//If it's playing disable our audio, otherwise enable
@@ -630,6 +639,7 @@ static S32 running = AIL_ms_count();
void SoundEngine::tick(shared_ptr<Mob> *players, float a)
{
ConsoleSoundEngine::tick();
if (m_hDriver == 0) return;
#ifdef __DISABLE_MILES__
return;
#endif
@@ -710,7 +720,13 @@ void SoundEngine::tick(shared_ptr<Mob> *players, float a)
SoundEngine::SoundEngine()
{
random = new Random();
m_hBank=0;
m_hDriver=0;
m_hStream=0;
m_MasterMusicVolume=1.0f;
m_MasterEffectsVolume=1.0f;
m_bSystemMusicPlaying=false;
m_openStreamThread=NULL;
m_StreamState=eMusicStreamState_Idle;
m_iMusicDelay=0;
m_validListenerCount=0;
@@ -759,6 +775,7 @@ void SoundEngine::GetSoundName(char *szSoundName,int iSound)
/////////////////////////////////////////////
void SoundEngine::play(int iSound, float x, float y, float z, float volume, float pitch)
{
if (m_hDriver == 0) return;
U8 szSoundName[256];
if(iSound==-1)
@@ -818,6 +835,7 @@ void SoundEngine::play(int iSound, float x, float y, float z, float volume, floa
/////////////////////////////////////////////
void SoundEngine::playUI(int iSound, float volume, float pitch)
{
if (m_hDriver == 0) return;
U8 szSoundName[256];
wstring name;
// we have some game sounds played as UI sounds...
@@ -1134,6 +1152,7 @@ int SoundEngine::OpenStreamThreadProc( void* lpParameter )
return 0;
#endif
SoundEngine *soundEngine = (SoundEngine *)lpParameter;
if (soundEngine->m_hDriver == 0) return 0;
soundEngine->m_hStream = AIL_open_stream(soundEngine->m_hDriver,soundEngine->m_szStreamName,0);
if(soundEngine->m_hStream==0)
@@ -1150,6 +1169,7 @@ int SoundEngine::OpenStreamThreadProc( void* lpParameter )
/////////////////////////////////////////////
void SoundEngine::playMusicTick()
{
if (m_hDriver == 0) return;
// AP - vita will update the music during the mixer callback
#ifndef __PSVITA__
playMusicUpdate();
@@ -1159,6 +1179,7 @@ void SoundEngine::playMusicTick()
// AP - moved to a separate function so it can be called from the mixer callback on Vita
void SoundEngine::playMusicUpdate()
{
if (m_hDriver == 0) return;
//return;
static bool firstCall = true;
static float fMusicVol = 0.0f;