Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0d84cc7470 |
@@ -21,6 +21,8 @@ class DebugWorldState : public DisplayState {
|
||||
std::vector<std::unique_ptr<client::Client>> m_FakeClients;
|
||||
std::shared_ptr<server::FakeSocket> m_ServerSocket;
|
||||
|
||||
unsigned int m_PlaySpeed = 1;
|
||||
|
||||
public:
|
||||
DebugWorldState(Display& a_Display);
|
||||
~DebugWorldState();
|
||||
|
||||
@@ -75,8 +75,8 @@ DebugWorldState::DebugWorldState(Display& a_Display) : DisplayState(a_Display) {
|
||||
}
|
||||
|
||||
void DebugWorldState::Update(float a_Delta) {
|
||||
m_Server->Update(a_Delta);
|
||||
m_Client->Update(a_Delta);
|
||||
m_Server->Update(a_Delta * m_PlaySpeed);
|
||||
m_Client->Update(a_Delta * m_PlaySpeed);
|
||||
if (m_ClientState)
|
||||
m_Renderer.Render(m_ClientState->GetCurrentLerp());
|
||||
}
|
||||
@@ -102,6 +102,10 @@ void DebugWorldState::OnKeyDown(SDL_Keycode a_Key) {
|
||||
m_Client->Update(SECONDS);
|
||||
break;
|
||||
|
||||
case SDLK_P:
|
||||
m_PlaySpeed = 1 - m_PlaySpeed;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user