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
+15
View File
@@ -401,6 +401,17 @@ void UIMouseWheel(int nLen)
pkCmrCur->Wheel(nLen);
}
// 40250 CPythonApplication::WindowProcedure WM_ACTIVATEAPP (PythonApplicationProcedure.cpp:58): the sound
// is muted while the window is inactive.
void UIActivate(bool active)
{
if (!g_sound_manager) return;
if (active)
g_sound_manager->RestoreVolume();
else
g_sound_manager->SaveVolume();
}
// 40250 CPythonApplication::OnKeyDown/OnKeyUp (PythonApplicationEvent.cpp:130-146): ESC first goes
// to RunPressEscapeKey (the OnPressEscapeKey chain every dialog closes on), then to RunKeyDown.
void UIKey(int key, bool pressed)
@@ -757,6 +768,9 @@ bool Start(const char* stdlib_path, std::string* error)
g_game_singletons->pySystem.GetConfig()->width = ui_w;
g_game_singletons->pySystem.GetConfig()->height = ui_h;
}
// 40250 CPythonApplication::Create (PythonApplication.cpp:1186): no warning box when it fails.
if (!g_game_singletons->pySystem.IsNoSoundCard())
g_sound_manager->Create();
g_game_singletons->pySystem.GetDisplaySettings(); // 40250 CPythonApplication::Create (PythonApplication.cpp:1233)
g_flying_manager->SetMapManagerPtr(&g_game_singletons->pyBackground); // 40250 CPythonApplication ctor (PythonApplication.cpp:82)
return true;
@@ -1049,6 +1063,7 @@ void Stop()
g_race_manager.reset();
g_server_state_checker.reset();
g_flying_manager.reset();
g_sound_manager->Destroy(); // 40250 CPythonApplication::Destroy (PythonApplication.cpp:1442)
g_sound_manager.reset();
g_player.reset();
g_account_connector.reset();