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
|
@ -193,17 +193,6 @@ public :
|
|||
|
||||
private :
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Structure storing a glyph together with its
|
||||
/// rectangle in the texture
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
struct GlyphInfo
|
||||
{
|
||||
Glyph GlyphDesc;
|
||||
IntRect TextureRect;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Structure defining a row of glyphs
|
||||
///
|
||||
|
@ -220,7 +209,7 @@ private :
|
|||
////////////////////////////////////////////////////////////
|
||||
// Types
|
||||
////////////////////////////////////////////////////////////
|
||||
typedef std::map<Uint32, GlyphInfo> GlyphTable; ///< Table mapping a codepoint to its glyph
|
||||
typedef std::map<Uint32, Glyph> GlyphTable; ///< Table mapping a codepoint to its glyph
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Structure defining a page if glyphs
|
||||
|
@ -252,7 +241,7 @@ private :
|
|||
/// \return The glyph corresponding to \a codePoint and \a characterSize
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
GlyphInfo LoadGlyph(Uint32 codePoint, unsigned int characterSize, bool bold) const;
|
||||
Glyph LoadGlyph(Uint32 codePoint, unsigned int characterSize, bool bold) const;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Find a suitable rectangle within the texture for a glyph
|
||||
|
|
|
@ -50,9 +50,9 @@ public :
|
|||
////////////////////////////////////////////////////////////
|
||||
// Member data
|
||||
////////////////////////////////////////////////////////////
|
||||
int Advance; ///< Offset to move horizontically to the next character
|
||||
IntRect Rectangle; ///< Bounding rectangle of the glyph, in coordinates relative to the baseline
|
||||
FloatRect TexCoords; ///< Texture coordinates of the glyph inside the font's image
|
||||
int Advance; ///< Offset to move horizontically to the next character
|
||||
IntRect Bounds; ///< Bounding rectangle of the glyph, in coordinates relative to the baseline
|
||||
IntRect SubRect; ///< Texture coordinates of the glyph inside the font's image
|
||||
};
|
||||
|
||||
} // namespace sf
|
||||
|
|
|
@ -127,11 +127,11 @@ public :
|
|||
////////////////////////////////////////////////////////////
|
||||
/// Create transparency mask from a specified colorkey
|
||||
///
|
||||
/// \param transparentColor : Color to become transparent
|
||||
/// \param alpha : Alpha value to assign to transparent pixels
|
||||
/// \param color : Color to become transparent
|
||||
/// \param alpha : Alpha value to assign to transparent pixels
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
void CreateMaskFromColor(const Color& transparentColor, Uint8 alpha = 0);
|
||||
void CreateMaskFromColor(const Color& color, Uint8 alpha = 0);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Copy pixels from another image onto this one.
|
||||
|
@ -178,7 +178,7 @@ public :
|
|||
/// \return Color of pixel (x, y)
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
const Color& GetPixel(unsigned int x, unsigned int y) const;
|
||||
Color GetPixel(unsigned int x, unsigned int y) const;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Get a read-only pointer to the array of pixels (RGBA 8 bits integers components)
|
||||
|
@ -338,7 +338,7 @@ private :
|
|||
////////////////////////////////////////////////////////////
|
||||
// Types
|
||||
////////////////////////////////////////////////////////////
|
||||
typedef std::vector<Color> ColorArray; ///< Array of colors
|
||||
typedef std::vector<Uint8> ColorArray; ///< Array of colors
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Member data
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue