(svn r14223) -Codechange: make GetSprite aware of the 4 different types of sprites: fonts, recolour, mapgen and normal sprites.

This commit is contained in:
rubidium
2008-09-02 15:20:38 +00:00
parent 2c58a87f4c
commit c358955127
19 changed files with 61 additions and 51 deletions

View File

@@ -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);