Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1169


Ignore:
Timestamp:
Apr 24, 2008, 2:49:54 PM (16 years ago)
Author:
FelixSchulthess
Message:

cönsöle häs spêcíäl chärs. please update media also…

Location:
code/branches/console/src/orxonox/console
Files:
2 edited

Legend:

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

    r1144 r1169  
    109109        scrollTimer = 0;
    110110        cursor = 0;
     111
    111112        // create overlay and elements
    112113        om = &Ogre::OverlayManager::getSingleton();
     
    244245    */
    245246    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) + "_");
    248249    }
    249250
     
    252253    */
    253254    void InGameConsole::newline(){
    254 
    255255        std::string line;
    256256        for(int i = LINES-1; i>=1; i--){
     
    259259            int l = line.length();
    260260            if(!line.empty() && line.substr(l-1) == "_") line.erase(l-1);
    261             consoleOverlayTextAreas[i]->setCaption(line);
     261            consoleOverlayTextAreas[i]->setCaption(convert2UTF(line));
    262262        }
    263263        consoleOverlayTextAreas[0]->setCaption(">");
    264264    }
     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    }
    265277}
  • code/branches/console/src/orxonox/console/InGameConsole.h

    r1143 r1169  
    6262            void print(std::string s);
    6363            void newline();
     64            Ogre::UTFString convert2UTF(std::string s);
    6465
    6566            int windowW;
Note: See TracChangeset for help on using the changeset viewer.