chore(refactor): god-object decomposition and mega-file splits

Split all mega-files by single-responsibility concern and
partially extracting AudioCoordinator and
OverlaySystem from the Renderer facade. No behavioral changes.

Splits:
- game_handler.cpp (5,247 LOC) → core + callbacks + packets (3 files)
- world_packets.cpp (4,453 LOC) → economy/entity/social/world (4 files)
- game_screen.cpp  (5,786 LOC) → core + frames + hud + minimap (4 files)
- m2_renderer.cpp  (3,343 LOC) → core + instance + particles + render (4 files)
- chat_panel.cpp   (3,140 LOC) → core + commands + utils (3 files)
- entity_spawner.cpp (2,750 LOC) → core + player + processing (3 files)

Extractions:
- AudioCoordinator: include/audio/ + src/audio/ (owned by Renderer)
- OverlaySystem: include/rendering/ + src/rendering/overlay_system.*

CMakeLists.txt: registered all 17 new translation units.
Related handler/callback files: minor include fixups post-split.
This commit is contained in:
Paul 2026-04-05 19:30:44 +03:00
parent 6dcc06697b
commit 34c0e3ca28
49 changed files with 29113 additions and 28109 deletions

View file

@ -51,7 +51,7 @@ bool AnimationCallbackHandler::updateCharge(float deltaTime) {
dir *= glm::inversesqrt(dirLenSq);
float yawDeg = glm::degrees(std::atan2(dir.x, dir.y));
renderer_.setCharacterYaw(yawDeg);
renderer_.emitChargeEffect(renderPos, dir);
if (auto* ac = renderer_.getAnimationController()) ac->emitChargeEffect(renderPos, dir);
}
// Sync to game handler
@ -69,8 +69,8 @@ bool AnimationCallbackHandler::updateCharge(float deltaTime) {
// Charge complete
if (t >= 1.0f) {
chargeActive_ = false;
renderer_.setCharging(false);
renderer_.stopChargeEffect();
if (auto* ac = renderer_.getAnimationController()) ac->setCharging(false);
if (auto* ac = renderer_.getAnimationController()) ac->stopChargeEffect();
renderer_.getCameraController()->setExternalFollow(false);
renderer_.getCameraController()->setExternalMoving(false);
@ -95,7 +95,7 @@ bool AnimationCallbackHandler::updateCharge(float deltaTime) {
}
}
gameHandler_.startAutoAttack(chargeTargetGuid_);
renderer_.triggerMeleeSwing();
if (auto* ac = renderer_.getAnimationController()) ac->triggerMeleeSwing();
}
// Send movement heartbeat so server knows our new position
@ -157,11 +157,11 @@ void AnimationCallbackHandler::setupCallbacks() {
// Disable player input, play charge animation
renderer_.getCameraController()->setExternalFollow(true);
renderer_.getCameraController()->clearMovementInputs();
renderer_.setCharging(true);
if (auto* ac = renderer_.getAnimationController()) ac->setCharging(true);
// Start charge visual effect (red haze + dust)
glm::vec3 chargeDir = glm::normalize(endRender - startRender);
renderer_.startChargeEffect(startRender, chargeDir);
if (auto* ac = renderer_.getAnimationController()) ac->startChargeEffect(startRender, chargeDir);
// Play charge whoosh sound (try multiple paths)
auto& audio = audio::AudioEngine::instance();