Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 24, 2009, 2:17:38 AM (15 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.

File:
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__ */
Note: See TracChangeset for help on using the changeset viewer.