On Wed, October 2, 2019 10:19, Solene Rapenne wrote:
> I wanted to play xmoto on current, but it has no fonts. I'm pretty sure
> it worked once. Any idea what's happening?
>
> Before being able to start it, it core dumped 3 times but I can't
> reproduce now (i did nothing except trying to run from egdb and now it
> starts correctly).  here is the core dump which does not appear to be of
> any use, and I can't even reproduce it.

[...]

Attached patch fixes it for me on amd64. Taken from FreeBSD.
Will try it on macppc and i386 soon.
Thanks for reporting!
Index: Makefile
===================================================================
RCS file: /cvs/ports/games/xmoto/Makefile,v
retrieving revision 1.34
diff -u -p -u -p -r1.34 Makefile
--- Makefile	12 Jul 2019 20:46:27 -0000	1.34
+++ Makefile	4 Oct 2019 16:38:27 -0000
@@ -3,7 +3,7 @@
 COMMENT =	challenging 2D motocross platform game
 
 V =	 	0.5.11
-REVISION =	7
+REVISION =	8
 DISTNAME =	xmoto-${V}-src
 PKGNAME =	xmoto-${V}
 CATEGORIES =	games
Index: patches/patch-src_VTexture_h
===================================================================
RCS file: patches/patch-src_VTexture_h
diff -N patches/patch-src_VTexture_h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_VTexture_h	4 Oct 2019 16:38:27 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Fix text rendering
+
+Index: src/VTexture.h
+--- src/VTexture.h.orig
++++ src/VTexture.h
+@@ -135,7 +135,7 @@ class TextureManager { (private)
+ 
+   void cleanUnregistredTextures();
+ 
+-  HashNamespace::hash_map<const char*, int*, HashNamespace::hash<const char*>, hashcmp_str> m_textureSizeCache;
++  HashNamespace::hash_map<std::string, int*> m_textureSizeCache;
+   std::vector<std::string> m_textureSizeCacheKeys;
+   std::vector<int*> m_textureSizeCacheValues;
+ 
Index: patches/patch-src_drawlib_DrawLibOpenGL_cpp
===================================================================
RCS file: patches/patch-src_drawlib_DrawLibOpenGL_cpp
diff -N patches/patch-src_drawlib_DrawLibOpenGL_cpp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_drawlib_DrawLibOpenGL_cpp	4 Oct 2019 16:38:27 -0000
@@ -0,0 +1,39 @@
+$OpenBSD$
+
+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::hash_map<std::string, GLFontGlyphLetter*>& i_glyphsLetters);
+   virtual ~GLFontGlyph();
+ 
+   std::string Value() const;
+@@ -132,11 +132,11 @@ 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::hash_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::hash_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 +825,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::hash_map<std::string, GLFontGlyphLetter*>& i_glyphsLetters) {
+   GLFontGlyph* v_glyph;
+   std::string  v_char;
+ 
Index: patches/patch-src_include_xm_hashmap_h
===================================================================
RCS file: /cvs/ports/games/xmoto/patches/patch-src_include_xm_hashmap_h,v
retrieving revision 1.1
diff -u -p -u -p -r1.1 patch-src_include_xm_hashmap_h
--- patches/patch-src_include_xm_hashmap_h	25 May 2017 11:03:31 -0000	1.1
+++ patches/patch-src_include_xm_hashmap_h	4 Oct 2019 16:38:27 -0000
@@ -1,14 +1,31 @@
-$OpenBSD: patch-src_include_xm_hashmap_h,v 1.1 2017/05/25 11:03:31 espie Exp $
+$OpenBSD$
 
 Index: src/include/xm_hashmap.h
 --- src/include/xm_hashmap.h.orig
 +++ src/include/xm_hashmap.h
-@@ -14,7 +14,7 @@
+@@ -13,13 +13,18 @@
+ #include <hash_map>
  namespace HashNamespace=std;
  #endif
- struct hashcmp_str {
+-struct hashcmp_str {
 -  bool operator()(const char* s1, const char* s2) {
-+  bool operator()(const char* s1, const char* s2) const {
-     if(s1 == NULL || s2 == NULL) {
-       return false;
+-    if(s1 == NULL || s2 == NULL) {
+-      return false;
++
++#ifdef _LIBCPP_VERSION
++namespace __gnu_cxx {
++  template<> struct hash<std::string>
++    : public unary_function<std::string, size_t>
++  {
++    size_t operator()(const std::string& s) const
++    {
++      return hash<const char*>()(s.c_str());
      }
+-    return strcmp(s1, s2) == 0;
+-  }
+-};
++  };
++}
++#endif // _LIBCPP_VERSION
+ 
+ #endif

Reply via email to