#pragma once #include #include enum class SyncState { Idle, LeftReady, RightReady, Synced, ClearFlash }; class SyncLineRenderer { public: SyncLineRenderer(); void SetRect(const SDL_FRect& rect); void SetState(SyncState state); void TriggerClearFlash(); void Update(float deltaTime); void Render(SDL_Renderer* renderer); private: struct SyncParticle { float y; float speed; float alpha; }; SDL_FRect m_rect{}; SyncState m_state; float m_flashTimer; float m_time; float m_pulseTime{0.0f}; float m_spawnAcc{0.0f}; std::vector m_particles; static constexpr float FLASH_DURATION = 0.15f; static constexpr size_t MAX_PARTICLES = 64; void SpawnParticle(); void SpawnBurst(int count); SDL_Color GetBaseColor() const; };