MilesLib: run the 40250 sound sources verbatim over an AIL software mixer

Copy SoundBase/SoundData/SoundInstance*/SoundManager*/Type from 40250 and
implement the AIL_* calls they make in MilesAil.cpp (2D pan, 3D distance and
listener pan, threaded stream decode, loop counts). The SDL host drains the
mixer. CSoundManager is created/updated/destroyed where 40250 does it and the
old AudioCommands bridge is removed. Port-map MilesLib 142/142 PORTED.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-09-30 12:07:37 +09:00
co-authored by Claude Opus 5.5
parent d509f0a8b4
commit 11991d4d1f
39 changed files with 4232 additions and 1053 deletions
+42 -23
View File
@@ -1,45 +1,64 @@
// Platform skeleton for MilesLib/SoundManagerStream.h (40250 MilesLib/SoundManagerStream.cpp), generated by platform_stub.py.
// Every MT_PLATFORM_STUB() body is unimplemented: replace it with the platform implementation.
#include "MilesLib/Stdafx.h"
#include "MilesLib/SoundManagerStream.h"
#include "../PlatformStub.h"
CSoundManagerStream::CSoundManagerStream()
{
MT_PLATFORM_STUB();
}
CSoundManagerStream::~CSoundManagerStream()
{
MT_PLATFORM_STUB();
{
}
auto CSoundManagerStream::Initialize() -> bool
bool CSoundManagerStream::Initialize()
{
MT_PLATFORM_STUB();
return mt_platform_stub_return<bool>();
CSoundBase::Initialize();
if (ms_DIGDriver)
return true;
ms_DIGDriver = AIL_open_digital_driver(44100, 16, 2, 0);
for (int i = 0; i < MUSIC_INSTANCE_MAX_NUM; ++i)
m_Instances[i].Initialize();
return true;
}
auto CSoundManagerStream::Destroy() -> void
{
MT_PLATFORM_STUB();
void CSoundManagerStream::Destroy()
{
for (int i=0; i<MUSIC_INSTANCE_MAX_NUM; ++i)
m_Instances[i].Stop();
CSoundBase::Destroy();
}
auto CSoundManagerStream::SetInstance(DWORD, const char *) -> bool
bool CSoundManagerStream::SetInstance(DWORD dwIndex, const char* filename)
{
MT_PLATFORM_STUB();
return mt_platform_stub_return<bool>();
if (!CheckInstanceIndex(dwIndex))
return false;
HSTREAM hStream = AIL_open_stream(ms_DIGDriver, filename, 0);
if (NULL == hStream)
return false;
m_Instances[dwIndex].SetStream(hStream);
return true;
}
auto CSoundManagerStream::GetInstance(DWORD) -> CSoundInstanceStream *
CSoundInstanceStream * CSoundManagerStream::GetInstance(DWORD dwIndex)
{
MT_PLATFORM_STUB();
return mt_platform_stub_return<CSoundInstanceStream *>();
if (!CheckInstanceIndex(dwIndex))
return NULL;
return &m_Instances[dwIndex];
}
auto CSoundManagerStream::CheckInstanceIndex(DWORD) -> bool
bool CSoundManagerStream::CheckInstanceIndex(DWORD dwIndex)
{
MT_PLATFORM_STUB();
return mt_platform_stub_return<bool>();
}
if (dwIndex >= DWORD(MUSIC_INSTANCE_MAX_NUM))
return false;
return true;
}