refactor: decouple Application singleton by extracting core subsystems and updating interfaces

- Add `audio::AudioCoordinator` interface and implementation
- Modify `Application` to reduce singleton usage and move controller responsibilities:
  - application.hpp
  - application.cpp
- Update UI and audio headers/sources:
  - game_screen.hpp
  - game_screen.cpp
  - ui_manager.hpp
  - audio_coordinator.hpp
  - audio_coordinator.cpp
- Project config touched:
  - CMakeLists.txt
This commit is contained in:
Paul 2026-04-01 20:38:37 +03:00
parent 9b38e64f84
commit d43397163e
8 changed files with 179 additions and 3 deletions

View file

@ -31,6 +31,7 @@
#include "audio/footstep_manager.hpp"
#include "audio/activity_sound_manager.hpp"
#include "audio/audio_engine.hpp"
#include "audio/audio_coordinator.hpp"
#include "addons/addon_manager.hpp"
#include <imgui.h>
#include "pipeline/m2_loader.hpp"
@ -223,6 +224,11 @@ bool Application::initialize() {
renderer.get(), assetManager.get(), gameHandler.get(),
dbcLayout_.get(), entitySpawner_.get());
// Wire AppearanceComposer to UI components (Phase A singleton breaking)
if (uiManager) {
uiManager->setAppearanceComposer(appearanceComposer_.get());
}
// Ensure the main in-world CharacterRenderer can load textures immediately.
// Previously this was only wired during terrain initialization, which meant early spawns
// (before terrain load) would render with white fallback textures (notably hair).