Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 10, 2009, 10:49:04 PM (15 years ago)
Author:
rgrieder
Message:

Move std::string to Ogre::UTFString conversion to util.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/pch/src/orxonox/overlays/console/InGameConsole.cc

    r3110 r3142  
    4141#include "util/Convert.h"
    4242#include "util/Debug.h"
     43#include "util/UTFStringConversions.h"
    4344#include "core/Clock.h"
    4445#include "core/CoreIncludes.h"
     
    466467                {
    467468                    ++linesUsed;
    468                     this->consoleOverlayTextAreas_[index]->setCaption(convert2UTF(output.substr(0, this->maxCharsPerLine_)));
     469                    this->consoleOverlayTextAreas_[index]->setCaption(multi_cast<Ogre::UTFString>(output.substr(0, this->maxCharsPerLine_)));
    469470                    output.erase(0, this->maxCharsPerLine_);
    470471                    output.insert(0, 1, ' ');
     
    473474                    this->colourLine(level, index);
    474475                }
    475                 this->consoleOverlayTextAreas_[index]->setCaption(convert2UTF(output));
     476                this->consoleOverlayTextAreas_[index]->setCaption(multi_cast<Ogre::UTFString>(output));
    476477                this->displayedText_ = output;
    477478                this->numLinesShifted_ = linesUsed;
     
    491492                  this->inputWindowStart_ = 0;
    492493                this->displayedText_ = output;
    493                 this->consoleOverlayTextAreas_[index]->setCaption(convert2UTF(output));
     494                this->consoleOverlayTextAreas_[index]->setCaption(multi_cast<Ogre::UTFString>(output));
    494495            }
    495496        }
     
    606607        InGameConsole::getInstance().deactivate();
    607608    }
    608 
    609     /**
    610         @brief Converts a string into an Ogre::UTFString.
    611         @param s The string to convert
    612         @return The converted string
    613     */
    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     }
    626609}
Note: See TracChangeset for help on using the changeset viewer.