sync line added in cooperate mode

This commit is contained in:
2025-12-22 17:13:35 +01:00
parent 18463774e9
commit a729dc089e
6 changed files with 217 additions and 32 deletions

View File

@ -0,0 +1,33 @@
#pragma once
#include <SDL3/SDL.h>
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:
SDL_FRect m_rect{};
SyncState m_state;
float m_flashTimer;
float m_time;
static constexpr float FLASH_DURATION = 0.15f;
SDL_Color GetBaseColor() const;
};