AGS: Fix text rendering onto surfaces with a transparent pixel color #2798
This pull request resolves the outstanding problem with rendering TTF text onto surfaces in the AGS engine.. the problem being that with the surfaces having a designated transparent color, partially transparent pixels in the TTF glyphs were doing an alpha blend of the font color with the pink color AGS uses for transparency. Since this affects the core font code, I figure to make it a pull request for review first.
This change introduces a new virtual method on Graphics::Font called "setTransparentColor", and then overrides that in TTFFont. In the TTFFont glyph drawing code, if it's drawing a partially transparent pixel and detects the transparent color, it forces it to be transparent so it won't be blended.
I'd completely forgotten that Font already had a method version that takes in a ManagedSurface. Just internally it simply called the Surface version. So I did a minor rejigging so that the ManagedSurface drawChar version is a virtual method too now, and TTFFont overrides it to get access to the transparent color, if any.
At the same time, I finally got around to moving ManagedSurface's addDirtyRect to be public, and added a method to get access to a ManagedSurface's internal surface if a calling class really needs it. This let me get rid of the "friend class Font" that was previously required just so the Font class could get access to the surface and modify it to write the characters, and then call addDirtyRect itself. So it's all cleaner now.