Changed the internal storage of pixels in sf::Image (vector<Color> --> vector<Uint8>)
Changed the Glyph structure to allow using sprites to display glyphs git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1473 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
parent
dcdf39bf74
commit
6b23d15a14
10 changed files with 124 additions and 132 deletions
|
@ -36,9 +36,9 @@
|
|||
////////////////////////////////////////////////////////////
|
||||
typedef struct
|
||||
{
|
||||
int Advance; ///< Offset to move horizontically to the next character
|
||||
sfIntRect Rectangle; ///< Bounding rectangle of the glyph, in relative coordinates
|
||||
sfFloatRect TexCoords; ///< Texture coordinates of the glyph inside the bitmap font
|
||||
int Advance; ///< Offset to move horizontically to the next character
|
||||
sfIntRect Bounds; ///< Bounding rectangle of the glyph, in coordinates relative to the baseline
|
||||
sfIntRect SubRect; ///< Texture coordinates of the glyph inside the font's image
|
||||
} sfGlyph;
|
||||
|
||||
|
||||
|
|
|
@ -92,15 +92,15 @@ sfGlyph sfFont_GetGlyph(sfFont* font, sfUint32 codePoint, unsigned int character
|
|||
|
||||
sf::Glyph SFMLGlyph = font->This.GetGlyph(codePoint, characterSize, bold == sfTrue);
|
||||
|
||||
glyph.Advance = SFMLGlyph.Advance;
|
||||
glyph.Rectangle.Left = SFMLGlyph.Rectangle.Left;
|
||||
glyph.Rectangle.Top = SFMLGlyph.Rectangle.Top;
|
||||
glyph.Rectangle.Right = SFMLGlyph.Rectangle.Right;
|
||||
glyph.Rectangle.Bottom = SFMLGlyph.Rectangle.Bottom;
|
||||
glyph.TexCoords.Left = SFMLGlyph.TexCoords.Left;
|
||||
glyph.TexCoords.Top = SFMLGlyph.TexCoords.Top;
|
||||
glyph.TexCoords.Right = SFMLGlyph.TexCoords.Right;
|
||||
glyph.TexCoords.Bottom = SFMLGlyph.TexCoords.Bottom;
|
||||
glyph.Advance = SFMLGlyph.Advance;
|
||||
glyph.Bounds.Left = SFMLGlyph.Bounds.Left;
|
||||
glyph.Bounds.Top = SFMLGlyph.Bounds.Top;
|
||||
glyph.Bounds.Right = SFMLGlyph.Bounds.Right;
|
||||
glyph.Bounds.Bottom = SFMLGlyph.Bounds.Bottom;
|
||||
glyph.SubRect.Left = SFMLGlyph.SubRect.Left;
|
||||
glyph.SubRect.Top = SFMLGlyph.SubRect.Top;
|
||||
glyph.SubRect.Right = SFMLGlyph.SubRect.Right;
|
||||
glyph.SubRect.Bottom = SFMLGlyph.SubRect.Bottom;
|
||||
|
||||
return glyph;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue