[Orxonox-commit 1417] r6135 - in code/branches/presentation2/src: libraries/util modules/overlays/hud orxonox/overlays
landauf at orxonox.net
landauf at orxonox.net
Tue Nov 24 02:17:38 CET 2009
Author: landauf
Date: 2009-11-24 02:17:38 +0100 (Tue, 24 Nov 2009)
New Revision: 6135
Added:
code/branches/presentation2/src/libraries/util/DisplayStringConversions.h
Removed:
code/branches/presentation2/src/libraries/util/UTFStringConversions.h
Modified:
code/branches/presentation2/src/modules/overlays/hud/ChatOverlay.cc
code/branches/presentation2/src/modules/overlays/hud/ChatOverlay.h
code/branches/presentation2/src/orxonox/overlays/InGameConsole.cc
Log:
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.
Copied: code/branches/presentation2/src/libraries/util/DisplayStringConversions.h (from rev 6133, code/branches/presentation2/src/libraries/util/UTFStringConversions.h)
===================================================================
--- code/branches/presentation2/src/libraries/util/DisplayStringConversions.h (rev 0)
+++ code/branches/presentation2/src/libraries/util/DisplayStringConversions.h 2009-11-24 01:17:38 UTC (rev 6135)
@@ -0,0 +1,79 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Fabian 'x3n' Landau
+ * Reto Grieder
+ * Co-authors:
+ * ...
+ */
+
+/**
+ at file
+ at brief
+ std::sring to Ogre::UTFString conversion functions
+*/
+
+#ifndef _DisplayStringConversions_H__
+#define _DisplayStringConversions_H__
+
+#include "UtilPrereqs.h"
+#include <OgreOverlayElement.h>
+
+#if OGRE_UNICODE_SUPPORT
+ #include <OgreUTFString.h>
+
+ namespace orxonox
+ {
+ template <>
+ struct ConverterExplicit<std::string, Ogre::DisplayString>
+ {
+ //! Converts an std::string into an Ogre::UTFString
+ inline static bool convert(Ogre::DisplayString* output, const std::string& input)
+ {
+ Ogre::UTFString::code_point cp;
+ for (unsigned int i = 0; i < input.size(); ++i)
+ {
+ cp = input[i];
+ cp &= 0xFF;
+ output->append(1, cp);
+ }
+ return true;
+ }
+ };
+ }
+#else
+ namespace orxonox
+ {
+ template <>
+ struct ConverterExplicit<std::string, Ogre::DisplayString>
+ {
+ //! Converts an std::string into an Ogre::String
+ inline static bool convert(Ogre::DisplayString* output, const std::string& input)
+ {
+ *output = input;
+ return true;
+ }
+ };
+ }
+#endif
+
+#endif /* _DisplayStringConversions_H__ */
Deleted: code/branches/presentation2/src/libraries/util/UTFStringConversions.h
===================================================================
--- code/branches/presentation2/src/libraries/util/UTFStringConversions.h 2009-11-24 00:06:50 UTC (rev 6134)
+++ code/branches/presentation2/src/libraries/util/UTFStringConversions.h 2009-11-24 01:17:38 UTC (rev 6135)
@@ -1,61 +0,0 @@
-/*
- * ORXONOX - the hottest 3D action shooter ever to exist
- * > www.orxonox.net <
- *
- *
- * License notice:
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * Author:
- * Fabian 'x3n' Landau
- * Reto Grieder
- * Co-authors:
- * ...
- */
-
-/**
- at file
- at brief
- std::sring to Ogre::UTFString conversion functions
-*/
-
-#ifndef _UTFStringConversions_H__
-#define _UTFStringConversions_H__
-
-#include "UtilPrereqs.h"
-#include <OgreUTFString.h>
-
-namespace orxonox
-{
- template <>
- struct ConverterExplicit<std::string, Ogre::UTFString>
- {
- //! Converts an std::string into an Ogre::UTFString
- inline static bool convert(Ogre::UTFString* output, const std::string& input)
- {
- Ogre::UTFString::code_point cp;
- for (unsigned int i = 0; i < input.size(); ++i)
- {
- cp = input[i];
- cp &= 0xFF;
- output->append(1, cp);
- }
- return true;
- }
- };
-}
-
-#endif /* _UTFStringConversions_H__ */
Modified: code/branches/presentation2/src/modules/overlays/hud/ChatOverlay.cc
===================================================================
--- code/branches/presentation2/src/modules/overlays/hud/ChatOverlay.cc 2009-11-24 00:06:50 UTC (rev 6134)
+++ code/branches/presentation2/src/modules/overlays/hud/ChatOverlay.cc 2009-11-24 01:17:38 UTC (rev 6135)
@@ -32,7 +32,7 @@
#include <OgreTextAreaOverlayElement.h>
#include "util/Convert.h"
-#include "util/UTFStringConversions.h"
+#include "util/DisplayStringConversions.h"
#include "core/CoreIncludes.h"
#include "core/ConfigValueIncludes.h"
#include "core/Executor.h"
@@ -85,7 +85,7 @@
text = message;
}
- this->messages_.push_back(multi_cast<Ogre::UTFString>(text));
+ this->messages_.push_back(multi_cast<Ogre::DisplayString>(text));
COUT(0) << "Chat: " << text << std::endl;
Timer* timer = new Timer();
@@ -109,7 +109,7 @@
{
this->text_->setCaption("");
- for (std::list<Ogre::UTFString>::reverse_iterator it = this->messages_.rbegin(); it != this->messages_.rend(); ++it)
+ for (std::list<Ogre::DisplayString>::reverse_iterator it = this->messages_.rbegin(); it != this->messages_.rend(); ++it)
{
this->text_->setCaption(this->text_->getCaption() + "\n" + (*it));
}
Modified: code/branches/presentation2/src/modules/overlays/hud/ChatOverlay.h
===================================================================
--- code/branches/presentation2/src/modules/overlays/hud/ChatOverlay.h 2009-11-24 00:06:50 UTC (rev 6134)
+++ code/branches/presentation2/src/modules/overlays/hud/ChatOverlay.h 2009-11-24 01:17:38 UTC (rev 6135)
@@ -32,7 +32,7 @@
#include "overlays/OverlaysPrereqs.h"
#include <list>
-#include <OgreUTFString.h>
+#include <OgreOverlayElement.h>
#include "network/ChatListener.h"
#include "overlays/OverlayText.h"
@@ -50,7 +50,7 @@
protected:
virtual void incomingChat(const std::string& message, unsigned int senderID);
- std::list<Ogre::UTFString> messages_;
+ std::list<Ogre::DisplayString> messages_;
private:
void updateOverlayText();
Modified: code/branches/presentation2/src/orxonox/overlays/InGameConsole.cc
===================================================================
--- code/branches/presentation2/src/orxonox/overlays/InGameConsole.cc 2009-11-24 00:06:50 UTC (rev 6134)
+++ code/branches/presentation2/src/orxonox/overlays/InGameConsole.cc 2009-11-24 01:17:38 UTC (rev 6135)
@@ -43,7 +43,7 @@
#include "util/Clock.h"
#include "util/Convert.h"
#include "util/Math.h"
-#include "util/UTFStringConversions.h"
+#include "util/DisplayStringConversions.h"
#include "core/CoreIncludes.h"
#include "core/ConfigValueIncludes.h"
#include "core/ConsoleCommand.h"
@@ -476,14 +476,14 @@
while (output.size() > this->maxCharsPerLine_)
{
++linesUsed;
- this->consoleOverlayTextAreas_[index]->setCaption(multi_cast<Ogre::UTFString>(output.substr(0, this->maxCharsPerLine_)));
+ this->consoleOverlayTextAreas_[index]->setCaption(multi_cast<Ogre::DisplayString>(output.substr(0, this->maxCharsPerLine_)));
output.erase(0, this->maxCharsPerLine_);
output.insert(0, 1, ' ');
if (linesUsed > numLinesShifted_ || alwaysShift)
this->shiftLines();
this->colourLine(level, index);
}
- this->consoleOverlayTextAreas_[index]->setCaption(multi_cast<Ogre::UTFString>(output));
+ this->consoleOverlayTextAreas_[index]->setCaption(multi_cast<Ogre::DisplayString>(output));
this->displayedText_ = output;
this->numLinesShifted_ = linesUsed;
}
@@ -501,7 +501,7 @@
else
this->inputWindowStart_ = 0;
this->displayedText_ = output;
- this->consoleOverlayTextAreas_[index]->setCaption(multi_cast<Ogre::UTFString>(output));
+ this->consoleOverlayTextAreas_[index]->setCaption(multi_cast<Ogre::DisplayString>(output));
}
}
}
More information about the Orxonox-commit
mailing list