diff --git a/games/xmoto/Makefile b/games/xmoto/Makefile index 174a5cab4b4..3ba2dc84d8c 100644 --- a/games/xmoto/Makefile +++ b/games/xmoto/Makefile @@ -1,9 +1,9 @@ -# $OpenBSD: Makefile,v 1.35 2019/10/09 17:59:09 kirby Exp $ +# $OpenBSD: Makefile,v 1.36 2019/11/06 16:19:52 cwen Exp $ COMMENT = challenging 2D motocross platform game V = 0.5.11 -REVISION = 8 +REVISION = 9 DISTNAME = xmoto-${V}-src PKGNAME = xmoto-${V} CATEGORIES = games @@ -17,10 +17,9 @@ MASTER_SITES = https://download.tuxfamily.org/xmoto/xmoto/${V}/ # GPLv2 PERMIT_PACKAGE = Yes -WANTLIB += GL GLU SDL SDL_mixer SDL_net SDL_ttf X11 bz2 c curl iconv intl jpeg -WANTLIB += ${MODLUA_WANTLIB} m ode png pthread sqlite3 ${COMPILER_LIBCXX} xdg-basedir lzma xml2 z - -COMPILER = base-clang ports-gcc base-gcc +WANTLIB += ${COMPILER_LIBCXX} ${MODLUA_WANTLIB} GL GLU SDL SDL_mixer +WANTLIB += SDL_net SDL_ttf X11 bz2 c curl iconv intl jpeg lzma m ode +WANTLIB += png sqlite3 xdg-basedir xml2 z MODULES= lang/lua MODLUA_SA= Yes diff --git a/games/xmoto/patches/patch-src_VTexture_h b/games/xmoto/patches/patch-src_VTexture_h index bcb668ddaf8..554b9b127ef 100644 --- a/games/xmoto/patches/patch-src_VTexture_h +++ b/games/xmoto/patches/patch-src_VTexture_h @@ -1,4 +1,4 @@ -$OpenBSD: patch-src_VTexture_h,v 1.1 2019/10/09 17:59:09 kirby Exp $ +$OpenBSD: patch-src_VTexture_h,v 1.2 2019/11/06 16:19:52 cwen Exp $ Fix text rendering @@ -10,7 +10,7 @@ Index: src/VTexture.h void cleanUnregistredTextures(); - HashNamespace::hash_map, hashcmp_str> m_textureSizeCache; -+ HashNamespace::hash_map m_textureSizeCache; ++ HashNamespace::unordered_map m_textureSizeCache; std::vector m_textureSizeCacheKeys; std::vector m_textureSizeCacheValues; diff --git a/games/xmoto/patches/patch-src_drawlib_DrawLibOpenGL_cpp b/games/xmoto/patches/patch-src_drawlib_DrawLibOpenGL_cpp index 5726d44d2e8..1b02d6377fe 100644 --- a/games/xmoto/patches/patch-src_drawlib_DrawLibOpenGL_cpp +++ b/games/xmoto/patches/patch-src_drawlib_DrawLibOpenGL_cpp @@ -1,4 +1,4 @@ -$OpenBSD: patch-src_drawlib_DrawLibOpenGL_cpp,v 1.1 2019/10/09 17:59:09 kirby Exp $ +$OpenBSD: patch-src_drawlib_DrawLibOpenGL_cpp,v 1.2 2019/11/06 16:19:52 cwen Exp $ Fix text rendering @@ -10,30 +10,49 @@ Index: src/drawlib/DrawLibOpenGL.cpp /*kejo:why not just grrr create a copy contructor*/ GLFontGlyph(const std::string& i_value, - HashNamespace::hash_map, hashcmp_str>& i_glyphsLetters); -+ HashNamespace::hash_map& i_glyphsLetters); ++ HashNamespace::unordered_map& i_glyphsLetters); virtual ~GLFontGlyph(); std::string Value() const; -@@ -132,11 +132,11 @@ class GLFontManager : public FontManager { (public) +@@ -132,12 +132,10 @@ class GLFontManager : public FontManager { (public) private: std::vector m_glyphsKeys; std::vector m_glyphsValues; - HashNamespace::hash_map, hashcmp_str> m_glyphs; -+ HashNamespace::hash_map m_glyphs; - +- ++ HashNamespace::unordered_map m_glyphs; std::vector m_glyphsLettersKeys; std::vector m_glyphsLettersValues; - HashNamespace::hash_map, hashcmp_str> m_glyphsLetters; -+ HashNamespace::hash_map m_glyphsLetters; - +- ++ HashNamespace::unordered_map 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) { + +@@ -825,7 +823,7 @@ GLFontGlyph::GLFontGlyph(const std::string& i_value) { } GLFontGlyph::GLFontGlyph(const std::string& i_value, - HashNamespace::hash_map, hashcmp_str>& i_glyphsLetters) { -+ HashNamespace::hash_map& i_glyphsLetters) { ++ HashNamespace::unordered_map& 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 */ diff --git a/games/xmoto/patches/patch-src_include_xm_hashmap_h b/games/xmoto/patches/patch-src_include_xm_hashmap_h index ae058c121da..c6c0ff2259e 100644 --- a/games/xmoto/patches/patch-src_include_xm_hashmap_h +++ b/games/xmoto/patches/patch-src_include_xm_hashmap_h @@ -1,31 +1,44 @@ -$OpenBSD: patch-src_include_xm_hashmap_h,v 1.2 2019/10/09 17:59:09 kirby Exp $ +$OpenBSD: patch-src_include_xm_hashmap_h,v 1.3 2019/11/06 16:19:52 cwen Exp $ + +Related to patches for font display. + +unordered_map() was standardised in C++11, before that it was in TR1. +Using the C++11 version fixes the build with base-clang, while still +keeping the TR1 one is needed for building with base-gcc. Index: src/include/xm_hashmap.h --- src/include/xm_hashmap.h.orig +++ src/include/xm_hashmap.h -@@ -13,13 +13,18 @@ - #include +@@ -1,25 +1,12 @@ + #ifndef __XMHASHMAP_H__ + #define __XMHASHMAP_H__ + +-#ifdef __GNUC__ +-#if (__GNUC__ >= 3) +-#include +- namespace HashNamespace=__gnu_cxx; +-#else +-#include +-#define HashNamespace std +-#endif +-#else // #ifdef __GNUC__ +-#include ++#if __cplusplus >= 201103L ++#include namespace HashNamespace=std; - #endif +-#endif -struct hashcmp_str { - bool operator()(const char* s1, const char* s2) { - if(s1 == NULL || s2 == NULL) { - return false; -+ -+#ifdef _LIBCPP_VERSION -+namespace __gnu_cxx { -+ template<> struct hash -+ : public unary_function -+ { -+ size_t operator()(const std::string& s) const -+ { -+ return hash()(s.c_str()); - } +- } - return strcmp(s1, s2) == 0; - } -}; -+ }; -+} -+#endif // _LIBCPP_VERSION ++#else ++#include ++namespace HashNamespace=std::tr1; ++#endif /* __cplusplus >= 201103L */ - #endif \ No newline at end of file +-#endif ++#endif /* _XMHASHMAP_H__ */