From 08ea386197572ba00d22bc19aedf2ae96154a07e Mon Sep 17 00:00:00 2001 From: James Turner Date: Mon, 28 Mar 2016 22:54:24 +0100 Subject: [PATCH] Fix corrupt HUD fonts osg::texture2D changes GL_UNPACK_ROW_LENGTH, which fntLoadTXF is not prepared to deal with. Reset the value back to 0 before loading + caching TXF fonts on the PLIB side. --- src/GUI/gui.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/GUI/gui.cxx b/src/GUI/gui.cxx index b8a8f333a..733fb5cf9 100644 --- a/src/GUI/gui.cxx +++ b/src/GUI/gui.cxx @@ -79,6 +79,10 @@ public: puSetDefaultStyle ( PUSTYLE_SMALL_SHADED ); //PUSTYLE_DEFAULT puSetDefaultColourScheme (0.8, 0.8, 0.9, 1); + // OSG Texture2D sets this, which breaks PLIB fntLoadTXF + // force it back to zero so width passed to glTexImage2D is used + glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); + FGFontCache *fc = FGFontCache::instance(); fc->initializeFonts(); puFont *GuiFont -- 2.39.5