diff options
author | Johannes Schickel | 2012-01-06 15:52:55 +0100 |
---|---|---|
committer | Johannes Schickel | 2012-01-06 15:52:55 +0100 |
commit | 243de5950f8405e5958687b8f733994ca60f0320 (patch) | |
tree | bebeac4777f8c529ae40895c04bbba1e749a9203 | |
parent | abbc87e180243d6918008f680330ded52c478b4c (diff) | |
download | scummvm-rg350-243de5950f8405e5958687b8f733994ca60f0320.tar.gz scummvm-rg350-243de5950f8405e5958687b8f733994ca60f0320.tar.bz2 scummvm-rg350-243de5950f8405e5958687b8f733994ca60f0320.zip |
GRAPHICS: Slight cleanup in BDF code.
-rw-r--r-- | graphics/fonts/bdf.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/graphics/fonts/bdf.cpp b/graphics/fonts/bdf.cpp index 2bc0582584..36d44554c7 100644 --- a/graphics/fonts/bdf.cpp +++ b/graphics/fonts/bdf.cpp @@ -482,6 +482,9 @@ BdfFont *BdfFont::loadFont(Common::SeekableReadStream &stream) { return new BdfFont(font, DisposeAfterUse::YES); } +#define BDF_FONTCACHE_TAG MKTAG('S', 'V', 'F', 'C') +#define BDF_FONTCACHE_VERSION 1 + bool BdfFont::cacheFontData(const BdfFont &font, const Common::String &filename) { Common::DumpFile cacheFile; if (!cacheFile.open(filename)) { @@ -491,8 +494,8 @@ bool BdfFont::cacheFontData(const BdfFont &font, const Common::String &filename) const BdfFontData &data = font._data; - cacheFile.writeUint32BE(MKTAG('S', 'V', 'F', 'C')); - cacheFile.writeUint32BE(1); + cacheFile.writeUint32BE(BDF_FONTCACHE_TAG); + cacheFile.writeUint32BE(BDF_FONTCACHE_VERSION); cacheFile.writeUint16BE(data.maxAdvance); cacheFile.writeByte(data.height); cacheFile.writeByte(data.defaultBox.width); @@ -541,11 +544,11 @@ bool BdfFont::cacheFontData(const BdfFont &font, const Common::String &filename) BdfFont *BdfFont::loadFromCache(Common::SeekableReadStream &stream) { const uint32 magic = stream.readUint32BE(); - if (magic != MKTAG('S', 'V', 'F', 'C')) + if (magic != BDF_FONTCACHE_TAG) return 0; const uint32 version = stream.readUint32BE(); - if (version != 1) + if (version != BDF_FONTCACHE_VERSION) return 0; BdfFontData data; |