mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-09 15:41:15 +00:00
(svn r16604) -Codechange: Use FS_BEGIN for iterating over fonts.
This commit is contained in:
parent
4419366f94
commit
8aa51823fc
@ -631,14 +631,13 @@ static GlyphEntry **_glyph_ptr[FS_END];
|
|||||||
/** Clear the complete cache */
|
/** Clear the complete cache */
|
||||||
static void ResetGlyphCache()
|
static void ResetGlyphCache()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < FS_END; i++) {
|
for (FontSize i = FS_BEGIN; i < FS_END; i++) {
|
||||||
if (_glyph_ptr[i] == NULL) continue;
|
if (_glyph_ptr[i] == NULL) continue;
|
||||||
|
|
||||||
for (int j = 0; j < 256; j++) {
|
for (int j = 0; j < 256; j++) {
|
||||||
if (_glyph_ptr[i][j] == NULL) continue;
|
if (_glyph_ptr[i][j] == NULL) continue;
|
||||||
|
|
||||||
for (int k = 0; k < 256; k++) {
|
for (int k = 0; k < 256; k++) {
|
||||||
if (_glyph_ptr[i][j][k].sprite == NULL) continue;
|
|
||||||
free(_glyph_ptr[i][j][k].sprite);
|
free(_glyph_ptr[i][j][k].sprite);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -842,11 +841,11 @@ void SetUnicodeGlyph(FontSize size, uint32 key, SpriteID sprite)
|
|||||||
|
|
||||||
void InitializeUnicodeGlyphMap()
|
void InitializeUnicodeGlyphMap()
|
||||||
{
|
{
|
||||||
for (FontSize size = FS_NORMAL; size != FS_END; size++) {
|
for (FontSize size = FS_BEGIN; size != FS_END; size++) {
|
||||||
/* Clear out existing glyph map if it exists */
|
/* Clear out existing glyph map if it exists */
|
||||||
if (_unicode_glyph_map[size] != NULL) {
|
if (_unicode_glyph_map[size] != NULL) {
|
||||||
for (uint i = 0; i < 256; i++) {
|
for (uint i = 0; i < 256; i++) {
|
||||||
if (_unicode_glyph_map[size][i] != NULL) free(_unicode_glyph_map[size][i]);
|
free(_unicode_glyph_map[size][i]);
|
||||||
}
|
}
|
||||||
free(_unicode_glyph_map[size]);
|
free(_unicode_glyph_map[size]);
|
||||||
_unicode_glyph_map[size] = NULL;
|
_unicode_glyph_map[size] = NULL;
|
||||||
|
@ -148,10 +148,12 @@ struct Colour {
|
|||||||
|
|
||||||
/** Available font sizes */
|
/** Available font sizes */
|
||||||
enum FontSize {
|
enum FontSize {
|
||||||
FS_NORMAL,
|
FS_NORMAL, ///< Index of the normal font in the font tables.
|
||||||
FS_SMALL,
|
FS_SMALL, ///< Index of the small font in the font tables.
|
||||||
FS_LARGE,
|
FS_LARGE, ///< Index of the large font in the font tables.
|
||||||
FS_END,
|
FS_END,
|
||||||
|
|
||||||
|
FS_BEGIN = FS_NORMAL, ///< First font.
|
||||||
};
|
};
|
||||||
DECLARE_POSTFIX_INCREMENT(FontSize);
|
DECLARE_POSTFIX_INCREMENT(FontSize);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user