summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaurice <maurice.henke@protonmail.com>2021-07-07 19:11:06 +0200
committerMaurice <maurice.henke@protonmail.com>2021-07-07 19:11:06 +0200
commit729e31eff4daa933ed10542dad3f8765a4cdc989 (patch)
tree2efe70c06fdb2626c1b6c3a37c598c0d4c0c1f45
parent548d3b766094cb394c570da69c026d4366ccaa80 (diff)
Prevent last line from being cleared as it is used for debug info
-rw-r--r--source/display/console.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/display/console.cpp b/source/display/console.cpp
index 57655fc..411b524 100644
--- a/source/display/console.cpp
+++ b/source/display/console.cpp
@@ -216,8 +216,9 @@ namespace libtp::display
// Load the console as a local pointer to avoid loading it each loop
tp::jfw_system::SystemConsole* console = tp::jfw_system::systemConsole;
- // If count is 0 we want to clear all lines
- std::size_t linecount = sizeof( tp::jfw_system::SystemConsole::consoleLine ) / sizeof( tp::jfw_system::ConsoleLine );
+ // If count is 0 we want to clear all lines; -1 because last line is debug info
+ std::size_t linecount =
+ sizeof( tp::jfw_system::SystemConsole::consoleLine ) / sizeof( tp::jfw_system::ConsoleLine ) - 1;
if ( from > linecount )
{