mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-19 08:25:35 +00:00
GUI: Adds clear and cls alias for gui console debugger
This commit is contained in:
parent
0396a08b42
commit
f720fba1aa
@ -133,6 +133,18 @@ void ConsoleDialog::resetPrompt() {
|
||||
_prompt = PROMPT;
|
||||
}
|
||||
|
||||
void ConsoleDialog::clearBuffer() {
|
||||
// Reset the line buffer.
|
||||
memset(_buffer, ' ', kBufferSize);
|
||||
|
||||
// Along with a few key vars.
|
||||
_currentPos = 0;
|
||||
_scrollLine = _linesPerPage - 1;
|
||||
_firstLineInBuffer = 0;
|
||||
|
||||
updateScrollBuffer();
|
||||
}
|
||||
|
||||
void ConsoleDialog::slideUpAndClose() {
|
||||
if (_slideMode == kNoSlideMode) {
|
||||
_slideTime = g_system->getMillis();
|
||||
|
@ -165,6 +165,7 @@ public:
|
||||
|
||||
void setPrompt(Common::String prompt);
|
||||
void resetPrompt();
|
||||
void clearBuffer();
|
||||
|
||||
protected:
|
||||
inline char &buffer(int idx) {
|
||||
|
@ -73,6 +73,8 @@ Debugger::Debugger() {
|
||||
registerCmd("md5", WRAP_METHOD(Debugger, cmdMd5));
|
||||
registerCmd("md5mac", WRAP_METHOD(Debugger, cmdMd5Mac));
|
||||
#endif
|
||||
registerCmd("clear", WRAP_METHOD(Debugger, cmdClearLog));
|
||||
registerCmd("cls", WRAP_METHOD(Debugger, cmdClearLog)); // alias
|
||||
registerCmd("exec", WRAP_METHOD(Debugger, cmdExecFile));
|
||||
|
||||
registerCmd("debuglevel", WRAP_METHOD(Debugger, cmdDebugLevel));
|
||||
@ -808,6 +810,13 @@ bool Debugger::cmdDebugFlagEnable(int argc, const char **argv) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Debugger::cmdClearLog(int argc, const char **argv) {
|
||||
#ifndef USE_TEXT_CONSOLE_FOR_DEBUGGER
|
||||
_debuggerDialog->clearBuffer();
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Debugger::cmdExecFile(int argc, const char **argv) {
|
||||
if (argc <= 1) {
|
||||
debugPrintf("Expected to get the file with debug commands\n");
|
||||
|
@ -275,6 +275,7 @@ protected:
|
||||
bool cmdDebugFlagsList(int argc, const char **argv);
|
||||
bool cmdDebugFlagEnable(int argc, const char **argv);
|
||||
bool cmdDebugFlagDisable(int argc, const char **argv);
|
||||
bool cmdClearLog(int argc, const char **argv);
|
||||
bool cmdExecFile(int argc, const char **argv);
|
||||
|
||||
#ifndef USE_TEXT_CONSOLE_FOR_DEBUGGER
|
||||
|
Loading…
x
Reference in New Issue
Block a user