Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/sys/consoleinterface.cc')
-rw-r--r--src/sys/consoleinterface.cc26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/sys/consoleinterface.cc b/src/sys/consoleinterface.cc
index 438a8de..45f678d 100644
--- a/src/sys/consoleinterface.cc
+++ b/src/sys/consoleinterface.cc
@@ -34,20 +34,20 @@ void fallback_print(const std::string &text)
bool is_color_code = false;
int ansi_bold = 0;
int ansi_color = 39;
-
+
const char *c = text.c_str();
while (*c) {
-
+
if ((*c) == '\n') {
std::cout << std::endl;
-
+
} else if ((*c) == '^') {
-
+
is_color_code = true;
ansi_bold = 0;
ansi_color = 39;
-
- switch (*(c+1)) {
+
+ switch (*(c + 1)) {
case '0': // black
ansi_color = 0;
ansi_bold = 1;
@@ -75,7 +75,7 @@ void fallback_print(const std::string &text)
ansi_bold = 1;
ansi_color = 39;
break;
-
+
case 'N': // normal
ansi_bold = 0;
ansi_color = 39;
@@ -103,7 +103,7 @@ void fallback_print(const std::string &text)
default:
is_color_code = false;
}
-
+
if (is_color_code) {
if (con_ansicolor)
std::cout << "\033[" << ansi_bold << ";" << ansi_color << "m";
@@ -111,11 +111,11 @@ void fallback_print(const std::string &text)
} else {
std::cout << *c;
}
-
+
} else {
std::cout << *c;
}
-
+
c++;
}
}
@@ -126,7 +126,7 @@ int ConsoleBuffer::overflow(int c)
{
if (c == Traits::eof())
return Traits::not_eof(c);
-
+
if (c == '\n') {
if (ConsoleInterface::instance()) {
ConsoleInterface::instance()->event_text(con_buffer);
@@ -168,7 +168,7 @@ ConsoleInterface::ConsoleInterface()
std::cerr << "multiple sys::ConsoleInterface instances!" << std::endl;
sys::quit(2);
}
-
+
consoleinterface_rcon = false;
consoleinterface_instance = this;
consoleinterface_logsize = DEFAULT_LOGSIZE;
@@ -203,7 +203,7 @@ void ConsoleInterface::event_text(const std::string & text)
while (consoleinterface_log.size() >= consoleinterface_logsize) {
consoleinterface_log.pop_front();
}
-
+
consoleinterface_log.push_back(text);
print(text);
}