1 Commits
3D ... dev

Author SHA1 Message Date
0d84cc7470 add pause shortcut 2026-01-04 13:26:23 +01:00
2 changed files with 8 additions and 2 deletions

View File

@@ -21,6 +21,8 @@ class DebugWorldState : public DisplayState {
std::vector<std::unique_ptr<client::Client>> m_FakeClients; std::vector<std::unique_ptr<client::Client>> m_FakeClients;
std::shared_ptr<server::FakeSocket> m_ServerSocket; std::shared_ptr<server::FakeSocket> m_ServerSocket;
unsigned int m_PlaySpeed = 1;
public: public:
DebugWorldState(Display& a_Display); DebugWorldState(Display& a_Display);
~DebugWorldState(); ~DebugWorldState();

View File

@@ -75,8 +75,8 @@ DebugWorldState::DebugWorldState(Display& a_Display) : DisplayState(a_Display) {
} }
void DebugWorldState::Update(float a_Delta) { void DebugWorldState::Update(float a_Delta) {
m_Server->Update(a_Delta); m_Server->Update(a_Delta * m_PlaySpeed);
m_Client->Update(a_Delta); m_Client->Update(a_Delta * m_PlaySpeed);
if (m_ClientState) if (m_ClientState)
m_Renderer.Render(m_ClientState->GetCurrentLerp()); m_Renderer.Render(m_ClientState->GetCurrentLerp());
} }
@@ -102,6 +102,10 @@ void DebugWorldState::OnKeyDown(SDL_Keycode a_Key) {
m_Client->Update(SECONDS); m_Client->Update(SECONDS);
break; break;
case SDLK_P:
m_PlaySpeed = 1 - m_PlaySpeed;
break;
default: default:
break; break;
} }