Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3142


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

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

Location:
code/branches/pch/src
Files:
1 added
4 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}
  • code/branches/pch/src/orxonox/overlays/console/InGameConsole.h

    r2896 r3142  
    6161        static void closeConsole();
    6262
    63         static Ogre::UTFString convert2UTF(const std::string& text);
    64 
    6563    private: // functions
    6664        InGameConsole(const InGameConsole& other);
  • code/branches/pch/src/orxonox/overlays/hud/ChatOverlay.cc

    r3110 r3142  
    3131#include <OgreTextAreaOverlayElement.h>
    3232
     33#include "util/UTFStringConversions.h"
    3334#include "core/CoreIncludes.h"
    3435#include "core/ConfigValueIncludes.h"
     
    3940#include "PlayerManager.h"
    4041#include "objects/infos/PlayerInfo.h"
    41 #include "overlays/console/InGameConsole.h"
    4242#include "tools/Timer.h"
    4343
     
    8686        }
    8787
    88         this->messages_.push_back(InGameConsole::convert2UTF(text));
     88        this->messages_.push_back(multi_cast<Ogre::UTFString>(text));
    8989        COUT(0) << "Chat: " << text << std::endl;
    9090
  • code/branches/pch/src/util/MultiTypeValue.h

    r3084 r3142  
    194194        saveAndIncrease( this->value_.z, mem );
    195195        saveAndIncrease( this->value_.w, mem );
    196     }template <> inline uint8_t MT_Value<Ogre::Quaternion>::getSize() const
     196    }
     197    template <> inline uint8_t MT_Value<Ogre::Quaternion>::getSize() const
    197198    {
    198199        return 4*returnSize(this->value_.x);
Note: See TracChangeset for help on using the changeset viewer.