(svn r14223) -Codechange: make GetSprite aware of the 4 different types of sprites: fonts, recolour, mapgen and normal sprites.
This commit is contained in:
@@ -401,7 +401,7 @@ const Sprite *GetGlyph(FontSize size, WChar key)
|
||||
if (face == NULL || (key >= SCC_SPRITE_START && key <= SCC_SPRITE_END)) {
|
||||
SpriteID sprite = GetUnicodeGlyph(size, key);
|
||||
if (sprite == 0) sprite = GetUnicodeGlyph(size, '?');
|
||||
return GetSprite(sprite);
|
||||
return GetSprite(sprite, ST_FONT);
|
||||
}
|
||||
|
||||
/* Check for the glyph in our cache */
|
||||
@@ -470,7 +470,7 @@ uint GetGlyphWidth(FontSize size, WChar key)
|
||||
if (face == NULL || (key >= SCC_SPRITE_START && key <= SCC_SPRITE_END)) {
|
||||
SpriteID sprite = GetUnicodeGlyph(size, key);
|
||||
if (sprite == 0) sprite = GetUnicodeGlyph(size, '?');
|
||||
return SpriteExists(sprite) ? GetSprite(sprite)->width + (size != FS_NORMAL) : 0;
|
||||
return SpriteExists(sprite) ? GetSprite(sprite, ST_FONT)->width + (size != FS_NORMAL) : 0;
|
||||
}
|
||||
|
||||
glyph = GetGlyphPtr(size, key);
|
||||
|
Reference in New Issue
Block a user