Changeset 1169 for code/branches
- Timestamp:
- Apr 24, 2008, 2:49:54 PM (17 years ago)
- Location:
- code/branches/console/src/orxonox/console
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/console/src/orxonox/console/InGameConsole.cc
r1144 r1169 109 109 scrollTimer = 0; 110 110 cursor = 0; 111 111 112 // create overlay and elements 112 113 om = &Ogre::OverlayManager::getSingleton(); … … 244 245 */ 245 246 void InGameConsole::print(std::string s){ 246 if(cursor>BLINK) consoleOverlayTextAreas[0]->setCaption(">" + s);247 else consoleOverlayTextAreas[0]->setCaption(">" + s+ "_");247 if(cursor>BLINK) consoleOverlayTextAreas[0]->setCaption(">" + convert2UTF(s)); 248 else consoleOverlayTextAreas[0]->setCaption(">" + convert2UTF(s) + "_"); 248 249 } 249 250 … … 252 253 */ 253 254 void InGameConsole::newline(){ 254 255 255 std::string line; 256 256 for(int i = LINES-1; i>=1; i--){ … … 259 259 int l = line.length(); 260 260 if(!line.empty() && line.substr(l-1) == "_") line.erase(l-1); 261 consoleOverlayTextAreas[i]->setCaption( line);261 consoleOverlayTextAreas[i]->setCaption(convert2UTF(line)); 262 262 } 263 263 consoleOverlayTextAreas[0]->setCaption(">"); 264 264 } 265 266 Ogre::UTFString InGameConsole::convert2UTF(std::string s){ 267 Ogre::UTFString utf; 268 int i; 269 Ogre::UTFString::code_point cp; 270 for (i=0; i<(int)s.size(); ++i){ 271 cp = s[i]; 272 cp &= 0xFF; 273 utf.append(1, cp); 274 } 275 return utf; 276 } 265 277 } -
code/branches/console/src/orxonox/console/InGameConsole.h
r1143 r1169 62 62 void print(std::string s); 63 63 void newline(); 64 Ogre::UTFString convert2UTF(std::string s); 64 65 65 66 int windowW;
Note: See TracChangeset
for help on using the changeset viewer.