| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776 |
- #include <OgreRenderWindow.h>
- #include "common/QGearsApplication.h"
- #include "core/ConfigCmdManager.h"
- #include "core/ConfigVarManager.h"
- #include "core/Console.h"
- #include "core/DebugDraw.h"
- #include "core/Logger.h"
- #include "core/ScriptManager.h"
- #include "core/Timer.h"
- #include "core/Utilites.h"
- #include <OgreFontManager.h>
- template<>Console *Ogre::Singleton<Console>::msSingleton = nullptr;
- ConfigVar cv_console_notification("console_notification", "Draw console strings even when console is hided", "false");
- Console::Console():
- m_ToVisible(false),
- m_Visible(false),
- m_Height(0),
- m_MaxOutputLine(128),
- m_DisplayLine(0),
- m_InputLine(""),
- m_CursorPosition(0),
- m_CursorBlinkTime(0),
- m_HistoryLine(-1),
- m_HistorySize(32),
- m_AutoCompletitionLine(0)
- {
- Ogre::FontPtr font = Ogre::FontManager::getSingleton().getByName("CourierNew");
- if(font.isNull() == false)
- {
- m_LetterWidth = static_cast<int>(font->getGlyphAspectRatio('_') * 16);
- }
- else
- {
- LOG_ERROR("Console::frameStarted: Font for console not found.");
- }
- // calculate width and height of console depending on size of application
- Ogre::RenderTarget *render_target(QGears::Application::getSingleton().getRenderWindow());
- m_ConsoleWidth = render_target->getWidth();
- m_ConsoleHeight = static_cast<int>(render_target->getHeight() / 2.5f);
- m_LineWidth = (m_ConsoleWidth - 20) / 8;
- LOG_TRIVIAL("Created console width " + Ogre::StringConverter::toString(m_ConsoleWidth) + ", height " + Ogre::StringConverter::toString(m_ConsoleHeight));
- // add as frame and log listner
- Ogre::LogManager::getSingleton().getDefaultLog()->addListener(this);
- }
- Console::~Console()
- {
- // remove as listner
- Ogre::LogManager::getSingleton().getDefaultLog()->removeListener(this);
- }
- void
- Console::Input(const QGears::Event& event)
- {
- if(m_Visible != true)
- {
- // add console
- if (event.type == QGears::ET_KEY_PRESS && event.param1 == OIS::KC_GRAVE)
- {
- SetToVisible();
- }
- return;
- }
- // input command
- else if (event.type == QGears::ET_KEY_PRESS && event.param1 == OIS::KC_RETURN && m_InputLine.size())
- {
- if(m_AutoCompletition.size() > 0)
- {
- m_InputLine += m_AutoCompletition[m_AutoCompletitionLine];
- }
- AddTextToOutput(m_InputLine);
- AddInputToHistory();
- // backslashed text are console commands, otherwise - script commands
- if('\\' == m_InputLine[0] || '/' == m_InputLine[0])
- {
- if(m_InputLine.size() > 1)
- {
- // remove backslash
- m_InputLine.erase(0, 1);
- ExecuteCommand(m_InputLine);
- }
- }
- else
- {
- ExecuteScript();
- }
- m_InputLine.clear();
- m_CursorPosition = 0;
- ResetAutoCompletion();
- }
- else if (event.type == QGears::ET_KEY_PRESS && event.param1 == OIS::KC_TAB)
- {
- CompleteInput();
- }
- // remove console
- else if (event.type == QGears::ET_KEY_PRESS && event.param1 == OIS::KC_GRAVE)
- {
- SetToHide();
- }
- // history up
- else if ((event.type == QGears::ET_KEY_PRESS || event.type == QGears::ET_KEY_REPEAT) && event.param1 == OIS::KC_UP)
- {
- if(m_HistoryLine < (int)m_History.size() - 1)
- {
- ++m_HistoryLine;
- SetInputLineFromHistory();
- }
- }
- // history down
- else if ((event.type == QGears::ET_KEY_PRESS || event.type == QGears::ET_KEY_REPEAT) && event.param1 == OIS::KC_DOWN)
- {
- if(m_HistoryLine > 0)
- {
- --m_HistoryLine;
- SetInputLineFromHistory();
- }
- }
- // scroll display to previous row
- else if (event.type == QGears::ET_MOUSE_SCROLL && event.param1 > 0)
- {
- if(m_DisplayLine > 0)
- {
- m_DisplayLine -= 1;
- }
- }
- // scroll display to next row
- else if (event.type == QGears::ET_MOUSE_SCROLL && event.param1 < 0)
- {
- if(m_DisplayLine < m_OutputLine.size())
- {
- m_DisplayLine += 1;
- }
- }
- // scroll display to previous row
- else if ((event.type == QGears::ET_KEY_PRESS || event.type == QGears::ET_KEY_REPEAT) && event.param1 == OIS::KC_PGUP)
- {
- if(m_DisplayLine > 0)
- {
- m_DisplayLine -= 1;
- }
- }
- // scroll display to next row
- else if ((event.type == QGears::ET_KEY_PRESS || event.type == QGears::ET_KEY_REPEAT) && event.param1 == OIS::KC_PGDOWN)
- {
- if(m_DisplayLine < m_OutputLine.size())
- {
- m_DisplayLine += 1;
- }
- }
- // delete character after cursor
- else if ((event.type == QGears::ET_KEY_PRESS || event.type == QGears::ET_KEY_REPEAT) && event.param1 == OIS::KC_DELETE)
- {
- if(m_AutoCompletition.size() > 0)
- {
- ResetAutoCompletion();
- }
- else
- {
- if(m_InputLine.size() > 0 && m_CursorPosition < m_InputLine.size())
- {
- m_InputLine.erase(m_CursorPosition, 1);
- }
- }
- }
- // delete character before cursor
- else if ((event.type == QGears::ET_KEY_PRESS || event.type == QGears::ET_KEY_REPEAT) && event.param1 == OIS::KC_BACK)
- {
- if(m_AutoCompletition.size() > 0)
- {
- ResetAutoCompletion();
- }
- else
- {
- if(m_CursorPosition > 0)
- {
- m_InputLine.erase(m_CursorPosition - 1, 1);
- --m_CursorPosition;
- }
- }
- }
- // move cursor to left
- else if ((event.type == QGears::ET_KEY_PRESS || event.type == QGears::ET_KEY_REPEAT) && event.param1 == OIS::KC_LEFT)
- {
- if(m_AutoCompletition.size() > 0)
- {
- m_InputLine += m_AutoCompletition[m_AutoCompletitionLine];
- ResetAutoCompletion();
- }
- if(m_CursorPosition > 0)
- {
- --m_CursorPosition;
- }
- }
- // move cursor to right
- else if ((event.type == QGears::ET_KEY_PRESS || event.type == QGears::ET_KEY_REPEAT) && event.param1 == OIS::KC_RIGHT)
- {
- if(m_AutoCompletition.size() > 0)
- {
- m_InputLine += m_AutoCompletition[m_AutoCompletitionLine];
- ResetAutoCompletion();
- }
- if(m_CursorPosition < m_InputLine.size())
- {
- ++m_CursorPosition;
- }
- }
- else if (event.type == QGears::ET_KEY_PRESS && event.param1 == OIS::KC_ESCAPE)
- {
- m_InputLine.clear();
- m_CursorPosition = 0;
- ResetAutoCompletion();
- }
- // move cursor to start of string
- else if (event.type == QGears::ET_KEY_PRESS && event.param1 == OIS::KC_HOME)
- {
- m_CursorPosition = 0;
- if(m_AutoCompletition.size() > 0)
- {
- m_InputLine += m_AutoCompletition[m_AutoCompletitionLine];
- ResetAutoCompletion();
- }
- }
- // move cursor to end of string
- else if (event.type == QGears::ET_KEY_PRESS && event.param1 == OIS::KC_END)
- {
- if(m_AutoCompletition.size() > 0)
- {
- m_InputLine += m_AutoCompletition[m_AutoCompletitionLine];
- ResetAutoCompletion();
- }
- m_CursorPosition = m_InputLine.size();
- }
- // input ascii character
- else if ((event.type == QGears::ET_KEY_PRESS || event.type == QGears::ET_KEY_REPEAT) && m_InputLine.size() < m_LineWidth)
- {
- char legalchars[] = "ABCDEFGHIJKLMNOPQRSTUVWXUZabcdefghijklmnopqrstuvwxyz1234567890~!@#$%^&*()-_=+?{[]}|\\;:'\"<>,./? ";
- char txt = static_cast<char>(event.param2);
- for(unsigned int c = 0; c < sizeof(legalchars ) - 1; ++c)
- {
- if(legalchars[c] == txt)
- {
- std::string::iterator i = m_InputLine.begin() + m_CursorPosition;
- m_InputLine.insert(i, txt);
- ++m_CursorPosition;
- ResetAutoCompletion();
- break;
- }
- }
- }
- }
- void
- Console::Update()
- {
- float delta_time = Timer::getSingleton().GetSystemTimeDelta();
- if(m_ToVisible == true && m_Height < m_ConsoleHeight)
- {
- // TODO: Convert this to a constant.
- m_Height += delta_time * 1500;
- if(m_Height >= m_ConsoleHeight)
- {
- m_Height = static_cast<float>(m_ConsoleHeight);
- }
- }
- else if(m_ToVisible == false && m_Height > 0)
- {
- m_Height -= delta_time * 1500;
- if(m_Height <= 0)
- {
- m_Height = 0;
- m_Visible = false;
- }
- }
- if(m_Visible == true)
- {
- UpdateDraw();
- }
- else if(cv_console_notification.GetB() == true)
- {
- UpdateNotification();
- }
- }
- void
- Console::UpdateDraw()
- {
- float delta_time = Timer::getSingleton().GetSystemTimeDelta();
- DEBUG_DRAW.SetTextAlignment(DEBUG_DRAW.LEFT);
- DEBUG_DRAW.SetScreenSpace(true);
- DEBUG_DRAW.SetColour(Ogre::ColourValue(0.05f, 0.06f, 0.2f, 0.95f));
- DEBUG_DRAW.SetZ(-0.5f);
- DEBUG_DRAW.Quad(0.0f, 0.0f, static_cast<float>(m_ConsoleWidth), 0.0f, static_cast<float>(m_ConsoleWidth), m_Height, 0.0f, m_Height);
- DEBUG_DRAW.SetColour(Ogre::ColourValue(0.18f, 0.22f, 0.74f, 0.95f));
- DEBUG_DRAW.SetZ(-0.6f);
- DEBUG_DRAW.Line(0.0f, m_Height, static_cast<float>(m_ConsoleWidth), m_Height);
- int row = 1;
- int rows = (m_ConsoleHeight - 30) / 16;
- int y = static_cast<int>(-m_ConsoleHeight + m_Height);
- int empty = rows - m_DisplayLine;
- if(empty > 0)
- {
- y += empty * 16;
- }
- std::list<OutputLine>::iterator i;
- for(i = m_OutputLine.begin(); i != m_OutputLine.end(); ++i, ++row)
- {
- if(row > (int)m_DisplayLine - rows && row <= (int)m_DisplayLine)
- {
- DEBUG_DRAW.SetColour((*i).colour);
- DEBUG_DRAW.Text(5.0f, static_cast<float>(y), (*i).text);
- y += 16;
- }
- }
- if(m_DisplayLine != m_OutputLine.size())
- {
- Ogre::String temp = "";
- for(unsigned int i = 0; i < m_LineWidth; ++i)
- {
- temp += "^";
- }
- DEBUG_DRAW.SetColour(Ogre::ColourValue(1.0f, 0.0f, 0.0f, 1.0f));
- DEBUG_DRAW.Text(5.0f, static_cast<float>(y), temp);
- }
- m_CursorBlinkTime += delta_time;
- if((((int)(m_CursorBlinkTime * 1000)) >> 8) & 1)
- {
- DEBUG_DRAW.SetColour(Ogre::ColourValue(0.88f, 0.88f, 0.88f, 1));
- DEBUG_DRAW.Text(static_cast<float>(12 + m_CursorPosition * m_LetterWidth), static_cast<float>(-19 + m_Height), "_");
- }
- if(m_AutoCompletition.size() > 0)
- {
- DEBUG_DRAW.SetColour(Ogre::ColourValue(1, 1, 1, 1));
- DEBUG_DRAW.Text(12, -20 + m_Height, m_InputLine);
- DEBUG_DRAW.SetColour(Ogre::ColourValue(0, 1, 0, 1));
- DEBUG_DRAW.Text(static_cast<float>(12 + (m_InputLine.size() * m_LetterWidth)), static_cast<float>(-20 + m_Height), m_AutoCompletition[m_AutoCompletitionLine]);
- }
- else
- {
- DEBUG_DRAW.SetColour(Ogre::ColourValue(1, 1, 1, 1));
- DEBUG_DRAW.Text(12, -20 + m_Height, m_InputLine);
- }
- DEBUG_DRAW.SetZ(0);
- }
- void
- Console::UpdateNotification()
- {
- DEBUG_DRAW.SetTextAlignment(DEBUG_DRAW.LEFT);
- DEBUG_DRAW.SetScreenSpace(true);
- DEBUG_DRAW.SetZ(-0.6f);
- std::list< OutputLine >::reverse_iterator i;
- int y = (m_OutputLine.size() > 10) ? 160 : m_OutputLine.size() * 16;
- int line = 0;
- float max_time = 3.0f;
- for(i = m_OutputLine.rbegin(); i != m_OutputLine.rend() && line < 10; ++i)
- {
- float time = Timer::getSingleton().GetSystemTimeTotal() - (*i).time;
- if(time < max_time)
- {
- Ogre::ColourValue colour = (*i).colour;
- colour.a = (max_time - time) / max_time;
- DEBUG_DRAW.SetColour(colour);
- DEBUG_DRAW.Text(5.0f, static_cast<float>(y), (*i).text);
- y -= 16;
- ++line;
- }
- }
- }
- void
- Console::OnResize()
- {
- // calculate width and height of console depending on size of application
- Ogre::RenderTarget *render_target(QGears::Application::getSingleton().getRenderWindow());
- m_ConsoleWidth = render_target->getWidth();
- m_ConsoleHeight = static_cast<int>(render_target->getHeight() / 2.5f);
- m_LineWidth = (m_ConsoleWidth - 20) / 8;
- LOG_TRIVIAL("Resized console width to " + Ogre::StringConverter::toString(m_ConsoleWidth) + ", height to " + Ogre::StringConverter::toString(m_ConsoleHeight));
- // update height of already opened console
- m_Height = (m_Height > m_ConsoleHeight) ? m_ConsoleHeight : m_Height;
- }
- void
- Console::SetToVisible()
- {
- m_ToVisible = true;
- m_Visible = true;
- }
- void
- Console::SetToHide()
- {
- m_ToVisible = false;
- }
- bool
- Console::IsVisible() const
- {
- return m_Visible;
- }
- void
- Console::AddTextToOutput(const Ogre::String& text, const Ogre::ColourValue& colour)
- {
- // go through line and add it to output correctly
- const char* str = text.c_str();
- Ogre::String output_line;
- unsigned int string_size = 0;
- bool indent = false;
- unsigned int c = 0;
- for(; c < text.size(); ++c)
- {
- // add space at start of string if we want indent
- if(string_size == 0 && indent == true)
- {
- output_line.push_back(' ');
- ++string_size;
- }
- if(str[c] != '\n')
- {
- output_line.push_back(str[c]);
- ++string_size;
- }
- if(str[c] == '\n' || string_size >= m_LineWidth || c >= text.size() - 1)
- {
- // if string is larger than output size than add indent
- indent = (string_size >= m_LineWidth) ? true : false;
- if(m_OutputLine.size() >= m_MaxOutputLine)
- {
- m_OutputLine.pop_front();
- }
- if(m_OutputLine.size() == m_DisplayLine)
- {
- ++m_DisplayLine;
- }
- OutputLine line;
- line.text = output_line;
- line.colour = colour;
- line.time = Timer::getSingleton().GetSystemTimeTotal();
- m_OutputLine.push_back(line);
- output_line.clear();
- string_size = 0;
- }
- }
- // add one more string if text ended with \n
- if(text.size() == 0 || str[text.size() - 1] == '\n')
- {
- if(m_OutputLine.size() >= m_MaxOutputLine)
- {
- m_OutputLine.pop_front();
- }
- if(m_OutputLine.size() == m_DisplayLine)
- {
- ++m_DisplayLine;
- }
- OutputLine line;
- line.text = "";
- line.colour = colour;
- line.time = Timer::getSingleton().GetSystemTimeTotal();
- m_OutputLine.push_back(line);
- }
- }
- void
- Console::ExecuteCommand(const Ogre::String& command)
- {
- bool handled = false;
- Ogre::StringVector params = StringTokenise(command);
- // is it cvar
- ConfigVar* cvar = ConfigVarManager::getSingleton().Find(params[0]);
- if(cvar != nullptr)
- {
- handled = true;
- if(params.size() > 1)
- {
- cvar->SetS(params[1]);
- AddTextToOutput(params[0] + " changed to \"" + params[1] + "\".\n");
- }
- else
- {
- AddTextToOutput(params[0] + " = \"" + cvar->GetS() + "\".\n" +
- " default:\"" + cvar->GetDefaultValue() + "\".\n" +
- " description: " + cvar->GetDescription() + ".\n" );
- }
- }
- if(handled == false)
- {
- // handle command
- ConfigCmd* cmd = ConfigCmdManager::getSingleton().Find(params[0]);
- if(cmd != nullptr)
- {
- cmd->GetHandler()(params);
- return;
- }
- else
- {
- AddTextToOutput("Can't find command \"" + params[0] + "\".\n");
- }
- }
- }
- void
- Console::ExecuteScript()
- {
- ScriptManager::getSingleton().RunString(m_InputLine);
- }
- void
- Console::CompleteInput()
- {
- bool add_slash = false;
- if(m_AutoCompletition.size() == 0)
- {
- // remove backslash
- if(m_InputLine.size() > 0 && ('\\' == m_InputLine[0] || '/' == m_InputLine[0]))
- {
- m_InputLine.erase(0, 1);
- }
- size_t input_size = m_InputLine.size();
- Ogre::StringVector params = StringTokenise(m_InputLine);
- if(params.size() == 0)
- {
- // add cvars
- int num_vars = ConfigVarManager::getSingleton().GetConfigVarNumber();
- for(int i = 0; i < num_vars; ++i)
- {
- m_AutoCompletition.push_back(ConfigVarManager::getSingleton().GetConfigVar(i)->GetName());
- }
- // add commands
- int num_cmds = ConfigCmdManager::getSingleton().GetConfigCmdNumber();
- for(int i = 0; i < num_cmds; ++i)
- {
- m_AutoCompletition.push_back(ConfigCmdManager::getSingleton().GetConfigCmd(i)->GetName());
- }
- add_slash = true;
- }
- else if(params.size() == 1)
- {
- m_InputLine = params[0];
- // add cvars
- int num_vars = ConfigVarManager::getSingleton().GetConfigVarNumber();
- for(int i = 0; i < num_vars; ++i)
- {
- Ogre::String name = ConfigVarManager::getSingleton().GetConfigVar(i)->GetName();
- unsigned int pos = name.find(m_InputLine);
- if(pos == 0)
- {
- add_slash = true;
- if(input_size != name.size())
- {
- Ogre::String part = name.substr(input_size, name.size() - input_size);
- m_AutoCompletition.push_back(part);
- }
- }
- }
- // add commands
- int num_cmds = ConfigCmdManager::getSingleton().GetConfigCmdNumber();
- for(int i = 0; i < num_cmds; ++i)
- {
- Ogre::String name = ConfigCmdManager::getSingleton().GetConfigCmd(i)->GetName();
- int pos = name.find(m_InputLine);
- if(pos == 0)
- {
- add_slash = true;
- if(name != params[0])
- {
- Ogre::String part = name.substr(input_size, name.size() - input_size);
- m_AutoCompletition.push_back(part);
- }
- else if(ConfigCmdManager::getSingleton().GetConfigCmd(i)->GetCompletion() != nullptr)
- {
- m_InputLine += " ";
- ConfigCmdManager::getSingleton().GetConfigCmd(i)->GetCompletion()(m_AutoCompletition);
- }
- }
- }
- }
- else if(params.size() > 1)
- {
- Ogre::String all_params = params[1];
- for(size_t i = 2; i < params.size(); ++i)
- {
- all_params += " " + params[i];
- }
- // add commands arguments
- ConfigCmd* cmd = ConfigCmdManager::getSingleton().Find(params[0]);
- if(cmd != nullptr)
- {
- add_slash = true;
- if(cmd->GetCompletion() != nullptr)
- {
- Ogre::StringVector full_complete;
- cmd->GetCompletion()(full_complete);
- if(full_complete.size() > 0)
- {
- std::sort(full_complete.begin(), full_complete.end());
- for(size_t i = 0 ; i < full_complete.size(); ++i)
- {
- int pos = full_complete[i].find(all_params);
- if(pos == 0 && all_params != full_complete[i])
- {
- Ogre::String part = full_complete[i].substr(all_params.size(), full_complete[i].size() - all_params.size());
- m_AutoCompletition.push_back(part);
- }
- }
- }
- }
- }
- m_InputLine = params[0] + " " + all_params;
- }
- // if we found at least one match
- if(add_slash == true)
- {
- m_InputLine = "/" + m_InputLine;
- }
- m_CursorPosition = m_InputLine.size();
- // sort list
- std::sort(m_AutoCompletition.begin(), m_AutoCompletition.end());
- m_AutoCompletitionLine = 0;
- for(size_t i = 0; i < m_AutoCompletition.size(); ++i)
- {
- AddTextToOutput(" " + m_InputLine + m_AutoCompletition[i]);
- }
- if(m_AutoCompletition.size() > 0)
- {
- AddTextToOutput("\n");
- }
- }
- else
- {
- if(m_AutoCompletitionLine < m_AutoCompletition.size() - 1)
- {
- ++m_AutoCompletitionLine;
- }
- else
- {
- m_AutoCompletitionLine = 0;
- }
- }
- }
- void
- Console::ResetAutoCompletion()
- {
- m_AutoCompletition.clear();
- m_AutoCompletitionLine = 0;
- }
- void
- Console::AddInputToHistory()
- {
- if(m_History.size() >= m_HistorySize)
- {
- m_History.pop_back();
- }
- m_History.push_front(m_InputLine);
- m_HistoryLine = -1;
- }
- void
- Console::SetInputLineFromHistory()
- {
- ResetAutoCompletion();
- std::list<Ogre::String>::iterator i = m_History.begin();
- for(int count = 0; i != m_History.end(); ++i, ++count)
- {
- if(count == m_HistoryLine)
- {
- m_InputLine = (*i);
- m_CursorPosition = m_InputLine.size();
- break;
- }
- }
- }
- void
- Console::messageLogged(const Ogre::String& message, Ogre::LogMessageLevel lml, bool maskDebug, const Ogre::String& logName, bool& skipThisMessage)
- {
- Ogre::ColourValue colour = Ogre::ColourValue::White;
- switch((int)lml)
- {
- case 2: colour = Ogre::ColourValue(1, 1, 0, 1); break;
- case 3: colour = Ogre::ColourValue(1, 0, 0, 1); break;
- }
- AddTextToOutput(message, colour);
- }
|