]> git.lizzy.rs Git - irrlicht.git/blobdiff - source/Irrlicht/CGUIFont.cpp
Fix: Listbox was sometimes sending EGET_LISTBOX_SELECTED_AGAIN instead of EGET_LISTBO...
[irrlicht.git] / source / Irrlicht / CGUIFont.cpp
index 0fa829815bc667b88cbb3614e0b3631b1bb5c113..b7b6ed754f8b5fd256e3efc2aa0396b02d711f45 100644 (file)
@@ -3,12 +3,10 @@
 // For conditions of distribution and use, see copyright notice in irrlicht.h\r
 \r
 #include "CGUIFont.h"\r
-#ifdef _IRR_COMPILE_WITH_GUI_\r
 \r
 #include "os.h"\r
 #include "coreutil.h"\r
 #include "IGUIEnvironment.h"\r
-#include "IXMLReader.h"\r
 #include "IReadFile.h"\r
 #include "IVideoDriver.h"\r
 #include "IGUISpriteBank.h"\r
@@ -63,6 +61,7 @@ CGUIFont::~CGUIFont()
 }\r
 \r
 \r
+#if 0\r
 //! loads a font file from xml\r
 bool CGUIFont::load(io::IXMLReader* xml, const io::path& directory)\r
 {\r
@@ -165,7 +164,7 @@ bool CGUIFont::load(io::IXMLReader* xml, const io::path& directory)
                                }\r
                                rectangle.LowerRightCorner.Y = val;\r
 \r
-                               CharacterMap.insert(ch,Areas.size());\r
+                               CharacterMap.emplace(ch, Areas.size());\r
 \r
                                // make frame\r
                                f.rectNumber = SpriteBank->getPositions().size();\r
@@ -195,6 +194,7 @@ bool CGUIFont::load(io::IXMLReader* xml, const io::path& directory)
 \r
        return true;\r
 }\r
+#endif\r
 \r
 \r
 void CGUIFont::setMaxHeight()\r
@@ -373,7 +373,7 @@ void CGUIFont::readPositions(video::IImage* image, s32& lowerRightPositions)
                                Areas.push_back(a);\r
                                // map letter to character\r
                                wchar_t ch = (wchar_t)(lowerRightPositions + 32);\r
-                               CharacterMap.set(ch, lowerRightPositions);\r
+                               CharacterMap[ch] = lowerRightPositions;\r
 \r
                                ++lowerRightPositions;\r
                        }\r
@@ -434,9 +434,9 @@ u32 CGUIFont::getSpriteNoFromChar(const wchar_t *c) const
 \r
 s32 CGUIFont::getAreaFromCharacter(const wchar_t c) const\r
 {\r
-       core::map<wchar_t, s32>::Node* n = CharacterMap.find(c);\r
-       if (n)\r
-               return n->getValue();\r
+       auto n = CharacterMap.find(c);\r
+       if (n != CharacterMap.end())\r
+               return n->second;\r
        else\r
                return WrongCharacter;\r
 }\r
@@ -593,6 +593,3 @@ IGUISpriteBank* CGUIFont::getSpriteBank() const
 \r
 } // end namespace gui\r
 } // end namespace irr\r
-\r
-#endif // _IRR_COMPILE_WITH_GUI_\r
-\r