$OpenBSD: patch-src_drawlib_DrawLibOpenGL_cpp,v 1.2 2019/11/06 16:19:52 cwen Exp $

Fix text rendering

Index: src/drawlib/DrawLibOpenGL.cpp
--- src/drawlib/DrawLibOpenGL.cpp.orig
+++ src/drawlib/DrawLibOpenGL.cpp
@@ -80,7 +80,7 @@ class GLFontGlyph : public FontGlyph { (public)
   /* a glyph from other glyphs */
   /*kejo:why not just grrr create a copy contructor*/
   GLFontGlyph(const std::string& i_value,
-	      HashNamespace::hash_map<const char*, GLFontGlyphLetter*, HashNamespace::hash<const char*>, hashcmp_str>& i_glyphsLetters);
+              HashNamespace::unordered_map<std::string, GLFontGlyphLetter*>& i_glyphsLetters);
   virtual ~GLFontGlyph();
 
   std::string Value() const;
@@ -132,12 +132,10 @@ class GLFontManager : public FontManager { (public)
 private:
   std::vector<std::string> m_glyphsKeys;
   std::vector<GLFontGlyph*> m_glyphsValues;
-  HashNamespace::hash_map<const char*, GLFontGlyph*, HashNamespace::hash<const char*>, hashcmp_str> m_glyphs;
-
+  HashNamespace::unordered_map<std::string, GLFontGlyph*> m_glyphs;
   std::vector<std::string> m_glyphsLettersKeys;
   std::vector<GLFontGlyphLetter*> m_glyphsLettersValues;
-  HashNamespace::hash_map<const char*, GLFontGlyphLetter*, HashNamespace::hash<const char*>, hashcmp_str> m_glyphsLetters;
-
+  HashNamespace::unordered_map<std::string, GLFontGlyphLetter*> m_glyphsLetters;
   unsigned int getLonguestLineSize(const std::string& i_value, unsigned int i_start = 0, unsigned int i_nbLinesToRead = -1);
 };
 
@@ -825,7 +823,7 @@ GLFontGlyph::GLFontGlyph(const std::string& i_value) {
 }
 
 GLFontGlyph::GLFontGlyph(const std::string& i_value,
-			 HashNamespace::hash_map<const char*, GLFontGlyphLetter*, HashNamespace::hash<const char*>, hashcmp_str>& i_glyphsLetters) {
+                         HashNamespace::unordered_map<std::string, GLFontGlyphLetter*>& i_glyphsLetters) {
   GLFontGlyph* v_glyph;
   std::string  v_char;
 
@@ -850,7 +848,7 @@ GLFontGlyph::GLFontGlyph(const std::string& i_value,
       v_maxHeight = 0;
       v_curWidth  = 0;
     } else {
-      v_glyph = i_glyphsLetters[v_char.c_str()];
+      v_glyph = i_glyphsLetters[v_char];
       if(v_glyph != NULL) {
 	if(v_glyph->realHeight() > v_maxHeight)
 	  v_maxHeight = v_glyph->realHeight();
@@ -967,7 +965,7 @@ FontGlyph* GLFontManager::getGlyph(const std::string& 
   GLFontGlyph *v_glyph;
   GLFontGlyphLetter *v_glyphLetter;
 
-  v_glyph = m_glyphs[i_string.c_str()];
+  v_glyph = m_glyphs[i_string];
   if(v_glyph != NULL) return v_glyph;
 
   /* make sure that chars exists into the hashmap before continuing */
