Changeset 6135 for code/branches/presentation2/src
- Timestamp:
- Nov 24, 2009, 2:17:38 AM (15 years ago)
- Location:
- code/branches/presentation2/src
- Files:
-
- 3 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2/src/libraries/util/DisplayStringConversions.h
r6133 r6135 33 33 */ 34 34 35 #ifndef _ UTFStringConversions_H__36 #define _ UTFStringConversions_H__35 #ifndef _DisplayStringConversions_H__ 36 #define _DisplayStringConversions_H__ 37 37 38 38 #include "UtilPrereqs.h" 39 #include <Ogre UTFString.h>39 #include <OgreOverlayElement.h> 40 40 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 45 45 { 46 //! Converts an std::string into an Ogre::UTFString47 inline static bool convert(Ogre::UTFString* output, const std::string& input)46 template <> 47 struct ConverterExplicit<std::string, Ogre::DisplayString> 48 48 { 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) 51 51 { 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; 55 60 } 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 60 78 61 #endif /* _ UTFStringConversions_H__ */79 #endif /* _DisplayStringConversions_H__ */ -
code/branches/presentation2/src/modules/overlays/hud/ChatOverlay.cc
r5929 r6135 33 33 34 34 #include "util/Convert.h" 35 #include "util/ UTFStringConversions.h"35 #include "util/DisplayStringConversions.h" 36 36 #include "core/CoreIncludes.h" 37 37 #include "core/ConfigValueIncludes.h" … … 86 86 } 87 87 88 this->messages_.push_back(multi_cast<Ogre:: UTFString>(text));88 this->messages_.push_back(multi_cast<Ogre::DisplayString>(text)); 89 89 COUT(0) << "Chat: " << text << std::endl; 90 90 … … 110 110 this->text_->setCaption(""); 111 111 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) 113 113 { 114 114 this->text_->setCaption(this->text_->getCaption() + "\n" + (*it)); -
code/branches/presentation2/src/modules/overlays/hud/ChatOverlay.h
r5929 r6135 33 33 34 34 #include <list> 35 #include <Ogre UTFString.h>35 #include <OgreOverlayElement.h> 36 36 37 37 #include "network/ChatListener.h" … … 51 51 virtual void incomingChat(const std::string& message, unsigned int senderID); 52 52 53 std::list<Ogre:: UTFString> messages_;53 std::list<Ogre::DisplayString> messages_; 54 54 55 55 private: -
code/branches/presentation2/src/orxonox/overlays/InGameConsole.cc
r6129 r6135 44 44 #include "util/Convert.h" 45 45 #include "util/Math.h" 46 #include "util/ UTFStringConversions.h"46 #include "util/DisplayStringConversions.h" 47 47 #include "core/CoreIncludes.h" 48 48 #include "core/ConfigValueIncludes.h" … … 477 477 { 478 478 ++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_))); 480 480 output.erase(0, this->maxCharsPerLine_); 481 481 output.insert(0, 1, ' '); … … 484 484 this->colourLine(level, index); 485 485 } 486 this->consoleOverlayTextAreas_[index]->setCaption(multi_cast<Ogre:: UTFString>(output));486 this->consoleOverlayTextAreas_[index]->setCaption(multi_cast<Ogre::DisplayString>(output)); 487 487 this->displayedText_ = output; 488 488 this->numLinesShifted_ = linesUsed; … … 502 502 this->inputWindowStart_ = 0; 503 503 this->displayedText_ = output; 504 this->consoleOverlayTextAreas_[index]->setCaption(multi_cast<Ogre:: UTFString>(output));504 this->consoleOverlayTextAreas_[index]->setCaption(multi_cast<Ogre::DisplayString>(output)); 505 505 } 506 506 }
Note: See TracChangeset
for help on using the changeset viewer.