add pause shortcut
This commit is contained in:
@@ -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();
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user