Changeset 3196 for code/trunk/src/orxonox/overlays/console
- Timestamp:
- Jun 20, 2009, 9:20:47 AM (16 years ago)
- Location:
- code/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/pch (added) merged: 3114-3118,3124-3125,3127-3131,3133,3138-3194
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/overlays/console/InGameConsole.cc
r3110 r3196 35 35 #include <OgreOverlayManager.h> 36 36 #include <OgreOverlayContainer.h> 37 #include <OgreBorderPanelOverlayElement.h> 38 #include <OgreTextAreaOverlayElement.h> 37 39 #include <OgreFontManager.h> 38 40 #include <OgreFont.h> … … 40 42 #include "util/Math.h" 41 43 #include "util/Convert.h" 42 #include "util/ Debug.h"44 #include "util/UTFStringConversions.h" 43 45 #include "core/Clock.h" 44 46 #include "core/CoreIncludes.h" … … 466 468 { 467 469 ++linesUsed; 468 this->consoleOverlayTextAreas_[index]->setCaption( convert2UTF(output.substr(0, this->maxCharsPerLine_)));470 this->consoleOverlayTextAreas_[index]->setCaption(multi_cast<Ogre::UTFString>(output.substr(0, this->maxCharsPerLine_))); 469 471 output.erase(0, this->maxCharsPerLine_); 470 472 output.insert(0, 1, ' '); … … 473 475 this->colourLine(level, index); 474 476 } 475 this->consoleOverlayTextAreas_[index]->setCaption( convert2UTF(output));477 this->consoleOverlayTextAreas_[index]->setCaption(multi_cast<Ogre::UTFString>(output)); 476 478 this->displayedText_ = output; 477 479 this->numLinesShifted_ = linesUsed; … … 491 493 this->inputWindowStart_ = 0; 492 494 this->displayedText_ = output; 493 this->consoleOverlayTextAreas_[index]->setCaption( convert2UTF(output));495 this->consoleOverlayTextAreas_[index]->setCaption(multi_cast<Ogre::UTFString>(output)); 494 496 } 495 497 } … … 606 608 InGameConsole::getInstance().deactivate(); 607 609 } 608 609 /**610 @brief Converts a string into an Ogre::UTFString.611 @param s The string to convert612 @return The converted string613 */614 /*static*/ Ogre::UTFString InGameConsole::convert2UTF(const std::string& text)615 {616 Ogre::UTFString utf;617 Ogre::UTFString::code_point cp;618 for (unsigned int i = 0; i < text.size(); ++i)619 {620 cp = text[i];621 cp &= 0xFF;622 utf.append(1, cp);623 }624 return utf;625 }626 610 } -
code/trunk/src/orxonox/overlays/console/InGameConsole.h
r2896 r3196 32 32 33 33 #include "OrxonoxPrereqs.h" 34 #include <OgrePrerequisites.h>35 #include <OgreBorderPanelOverlayElement.h>36 #include <OgreTextAreaOverlayElement.h>37 34 35 #include <string> 36 #include "util/OgreForwardRefs.h" 38 37 #include "core/Shell.h" 39 #include "core/OrxonoxClass.h" 40 #include "tools/WindowEventListener.h" 41 38 #include "interfaces/WindowEventListener.h" 42 39 43 40 namespace orxonox 44 41 { 45 class _OrxonoxExport InGameConsole : virtual public OrxonoxClass,public ShellListener, public WindowEventListener42 class _OrxonoxExport InGameConsole : public ShellListener, public WindowEventListener 46 43 { 47 44 public: // functions … … 60 57 static void openConsole(); 61 58 static void closeConsole(); 62 63 static Ogre::UTFString convert2UTF(const std::string& text);64 59 65 60 private: // functions
Note: See TracChangeset
for help on using the changeset viewer.