Ensure adaptive speed is reset before a (potential) restart.
Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
This commit is contained in:
parent
54403f74c6
commit
b65e67ed67
4 changed files with 12 additions and 4 deletions
|
@ -1018,7 +1018,7 @@ namespace sa2
|
|||
{
|
||||
if (ImGui::InputText("Prompt", myInputBuffer, IM_ARRAYSIZE(myInputBuffer), ImGuiInputTextFlags_EnterReturnsTrue))
|
||||
{
|
||||
debuggerCommand(myInputBuffer);
|
||||
debuggerCommand(frame, myInputBuffer);
|
||||
myInputBuffer[0] = 0;
|
||||
ImGui::SetKeyboardFocusHere(-1);
|
||||
}
|
||||
|
@ -1027,12 +1027,14 @@ namespace sa2
|
|||
ImGui::End();
|
||||
}
|
||||
|
||||
void ImGuiSettings::debuggerCommand(const char * s)
|
||||
void ImGuiSettings::debuggerCommand(SDLFrame * frame, const char * s)
|
||||
{
|
||||
for (; *s; ++s)
|
||||
{
|
||||
DebuggerInputConsoleChar(*s);
|
||||
}
|
||||
// this might trigger a GO
|
||||
frame->ResetSpeed();
|
||||
DebuggerProcessKey(VK_RETURN);
|
||||
myScrollConsole = true;
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ namespace sa2
|
|||
void drawDisassemblyTable();
|
||||
void drawConsole();
|
||||
|
||||
void debuggerCommand(const char * s);
|
||||
void debuggerCommand(SDLFrame * frame, const char * s);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -556,6 +556,11 @@ namespace sa2
|
|||
};
|
||||
}
|
||||
|
||||
void SDLFrame::ResetSpeed()
|
||||
{
|
||||
mySpeed.reset();
|
||||
}
|
||||
|
||||
void SDLFrame::ChangeMode(const AppMode_e mode)
|
||||
{
|
||||
if (mode != g_nAppMode)
|
||||
|
@ -576,7 +581,7 @@ namespace sa2
|
|||
break;
|
||||
}
|
||||
FrameRefreshStatus(DRAW_TITLE);
|
||||
mySpeed.reset();
|
||||
ResetSpeed();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@ namespace sa2
|
|||
void Execute(const DWORD uCycles);
|
||||
void ExecuteOneFrame(const size_t msNextFrame);
|
||||
void ChangeMode(const AppMode_e mode);
|
||||
void ResetSpeed();
|
||||
|
||||
virtual void UpdateTexture() = 0;
|
||||
virtual void RenderPresent() = 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue