Changeset 1214 for code/trunk/src/orxonox/console
- Timestamp:
- May 2, 2008, 9:23:30 PM (17 years ago)
- Location:
- code/trunk/src/orxonox/console
- Files:
-
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/console/InGameConsole.cc
r1145 r1214 68 68 void InGameConsole::listen(){ 69 69 if(!active) activate(); 70 print( this->ib_->get());70 print(convert2UTF(this->ib_->get())); 71 71 } 72 72 … … 84 84 newline(); 85 85 this->ib_->set(CommandExecutor::complete(this->ib_->get())); 86 print( this->ib_->get());86 print(convert2UTF(this->ib_->get())); 87 87 } 88 88 … … 109 109 scrollTimer = 0; 110 110 cursor = 0; 111 111 112 // create overlay and elements 112 113 om = &Ogre::OverlayManager::getSingleton(); … … 195 196 cursor += dt; 196 197 if(cursor >= 2*BLINK) cursor = 0; 197 print( this->ib_->get());198 print(convert2UTF(this->ib_->get())); 198 199 199 200 // this creates a flickering effect … … 243 244 @param s string to be printed 244 245 */ 245 void InGameConsole::print( std::string s){246 void InGameConsole::print(Ogre::UTFString s){ 246 247 if(cursor>BLINK) consoleOverlayTextAreas[0]->setCaption(">" + s); 247 248 else consoleOverlayTextAreas[0]->setCaption(">" + s + "_"); … … 252 253 */ 253 254 void InGameConsole::newline(){ 254 255 std::string line; 255 Ogre::UTFString line; 256 256 for(int i = LINES-1; i>=1; i--){ 257 257 line = consoleOverlayTextAreas[i-1]->getCaption(); … … 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/trunk/src/orxonox/console/InGameConsole.h
r1145 r1214 60 60 private: 61 61 void resize(); 62 void print( std::string s);62 void print(Ogre::UTFString 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.