pioneerspacesim/pioneer — pull request #1907 by johnbartholomew (2013-01-05 13:12:29+00:00)
Title: Fix alpha blended text

Since #1899, TextureFont has rendered with BLEND_ALPHA_PREMULT, because the texture itself stores (and has always stored) colours with pre-multiplied alpha. This is clear from the fact that the luminance value (in the RGB channels) is set to the same as the alpha value. That's true for the old RGBA storage, and the 2-channel luminance/alpha storage, and the 1-channel intensity storage (when a GL_INTENSITY texture is sampled, the stored value is replicated across the four canonical RGBA channels).

However, although the texture is in pre-multiplied alpha format, the vertex colours (used to control the overall text colour) are in non-pre-multiplied format. This patch fixes `TextureFont::RenderString` and `TextureFont::RenderMarkup` to convert the text colour to pre-multiplied format, so that text colours with alpha values less than 1 are rendered as expected.

Fixes #1904.