Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6135


Ignore:
Timestamp:
Nov 24, 2009, 2:17:38 AM (14 years ago)
Author:
landauf
Message:

replaced UTFStringConversions.h by DisplayStringConversions.h which does basically the same but only if OGRE_UNICODE_SUPPORT is true.

this allows us to build orxonox with the latest release of mingw and this also fixes the broken fonts.

Location:
code/branches/presentation2/src
Files:
3 edited
1 moved

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/libraries/util/DisplayStringConversions.h

    r6133 r6135  
    3333*/
    3434
    35 #ifndef _UTFStringConversions_H__
    36 #define _UTFStringConversions_H__
     35#ifndef _DisplayStringConversions_H__
     36#define _DisplayStringConversions_H__
    3737
    3838#include "UtilPrereqs.h"
    39 #include <OgreUTFString.h>
     39#include <OgreOverlayElement.h>
    4040
    41 namespace orxonox
    42 {
    43     template <>
    44     struct ConverterExplicit<std::string, Ogre::UTFString>
     41#if OGRE_UNICODE_SUPPORT
     42    #include <OgreUTFString.h>
     43
     44    namespace orxonox
    4545    {
    46         //! Converts an std::string into an Ogre::UTFString
    47         inline static bool convert(Ogre::UTFString* output, const std::string& input)
     46        template <>
     47        struct ConverterExplicit<std::string, Ogre::DisplayString>
    4848        {
    49             Ogre::UTFString::code_point cp;
    50             for (unsigned int i = 0; i < input.size(); ++i)
     49            //! Converts an std::string into an Ogre::UTFString
     50            inline static bool convert(Ogre::DisplayString* output, const std::string& input)
    5151            {
    52               cp = input[i];
    53               cp &= 0xFF;
    54               output->append(1, cp);
     52                Ogre::UTFString::code_point cp;
     53                for (unsigned int i = 0; i < input.size(); ++i)
     54                {
     55                  cp = input[i];
     56                  cp &= 0xFF;
     57                  output->append(1, cp);
     58                }
     59                return true;
    5560            }
    56             return true;
    57         }
    58     };
    59 }
     61        };
     62    }
     63#else
     64    namespace orxonox
     65    {
     66        template <>
     67        struct ConverterExplicit<std::string, Ogre::DisplayString>
     68        {
     69            //! Converts an std::string into an Ogre::String
     70            inline static bool convert(Ogre::DisplayString* output, const std::string& input)
     71            {
     72                *output = input;
     73                return true;
     74            }
     75        };
     76    }
     77#endif
    6078
    61 #endif /* _UTFStringConversions_H__ */
     79#endif /* _DisplayStringConversions_H__ */
  • code/branches/presentation2/src/modules/overlays/hud/ChatOverlay.cc

    r5929 r6135  
    3333
    3434#include "util/Convert.h"
    35 #include "util/UTFStringConversions.h"
     35#include "util/DisplayStringConversions.h"
    3636#include "core/CoreIncludes.h"
    3737#include "core/ConfigValueIncludes.h"
     
    8686        }
    8787
    88         this->messages_.push_back(multi_cast<Ogre::UTFString>(text));
     88        this->messages_.push_back(multi_cast<Ogre::DisplayString>(text));
    8989        COUT(0) << "Chat: " << text << std::endl;
    9090
     
    110110        this->text_->setCaption("");
    111111
    112         for (std::list<Ogre::UTFString>::reverse_iterator it = this->messages_.rbegin(); it != this->messages_.rend(); ++it)
     112        for (std::list<Ogre::DisplayString>::reverse_iterator it = this->messages_.rbegin(); it != this->messages_.rend(); ++it)
    113113        {
    114114            this->text_->setCaption(this->text_->getCaption() + "\n" + (*it));
  • code/branches/presentation2/src/modules/overlays/hud/ChatOverlay.h

    r5929 r6135  
    3333
    3434#include <list>
    35 #include <OgreUTFString.h>
     35#include <OgreOverlayElement.h>
    3636
    3737#include "network/ChatListener.h"
     
    5151            virtual void incomingChat(const std::string& message, unsigned int senderID);
    5252
    53             std::list<Ogre::UTFString> messages_;
     53            std::list<Ogre::DisplayString> messages_;
    5454
    5555        private:
  • code/branches/presentation2/src/orxonox/overlays/InGameConsole.cc

    r6129 r6135  
    4444#include "util/Convert.h"
    4545#include "util/Math.h"
    46 #include "util/UTFStringConversions.h"
     46#include "util/DisplayStringConversions.h"
    4747#include "core/CoreIncludes.h"
    4848#include "core/ConfigValueIncludes.h"
     
    477477                {
    478478                    ++linesUsed;
    479                     this->consoleOverlayTextAreas_[index]->setCaption(multi_cast<Ogre::UTFString>(output.substr(0, this->maxCharsPerLine_)));
     479                    this->consoleOverlayTextAreas_[index]->setCaption(multi_cast<Ogre::DisplayString>(output.substr(0, this->maxCharsPerLine_)));
    480480                    output.erase(0, this->maxCharsPerLine_);
    481481                    output.insert(0, 1, ' ');
     
    484484                    this->colourLine(level, index);
    485485                }
    486                 this->consoleOverlayTextAreas_[index]->setCaption(multi_cast<Ogre::UTFString>(output));
     486                this->consoleOverlayTextAreas_[index]->setCaption(multi_cast<Ogre::DisplayString>(output));
    487487                this->displayedText_ = output;
    488488                this->numLinesShifted_ = linesUsed;
     
    502502                  this->inputWindowStart_ = 0;
    503503                this->displayedText_ = output;
    504                 this->consoleOverlayTextAreas_[index]->setCaption(multi_cast<Ogre::UTFString>(output));
     504                this->consoleOverlayTextAreas_[index]->setCaption(multi_cast<Ogre::DisplayString>(output));
    505505            }
    506506        }
Note: See TracChangeset for help on using the changeset viewer.