DIRECTOR: Rename FontInfo to FontMapEntry

This commit is contained in:
djsrv 2021-07-08 21:57:51 -04:00
parent 6cfed5099e
commit 6408f6023a
3 changed files with 13 additions and 13 deletions

View File

@ -57,14 +57,14 @@ struct FontXPlatformInfo {
};
typedef Common::HashMap<Common::String, FontXPlatformInfo *> FontXPlatformMap;
struct FontInfo {
struct FontMapEntry {
uint16 toFont;
bool remapChars;
FontSizeMap sizeMap;
FontInfo() : toFont(0), remapChars(false) {}
FontMapEntry() : toFont(0), remapChars(false) {}
};
typedef Common::HashMap<uint16, FontInfo *> FontMap;
typedef Common::HashMap<uint16, FontMapEntry *> FontMap;
class Cast {
public:

View File

@ -55,9 +55,9 @@ void Cast::loadFontMap(Common::SeekableReadStreamEndian &stream) {
}
// Map cast font ID to window manager font ID
FontInfo *info = new FontInfo;
info->toFont = _vm->_wm->_fontMan->registerFontName(font);
_fontMap[id] = info;
FontMapEntry *entry = new FontMapEntry;
entry->toFont = _vm->_wm->_fontMan->registerFontName(font);
_fontMap[id] = entry;
debugC(3, kDebugLoading, "Cast::loadFontMap: Mapping font %d (%s) to %d", id, font.c_str(), _fontMap[id]->toFont);
currentRawPosition = stream.pos();
@ -94,16 +94,16 @@ void Cast::loadFontMapV4(Common::SeekableReadStreamEndian &stream) {
uint16 id = stream.readUint16();
// Map cast font ID to window manager font ID
FontInfo *info = new FontInfo;
FontMapEntry *entry = new FontMapEntry;
if (platform == Common::kPlatformWindows && _fontXPlatformMap.contains(name)) {
FontXPlatformInfo *xinfo = _fontXPlatformMap[name];
info->toFont = _vm->_wm->_fontMan->registerFontName(xinfo->toFont);
info->remapChars = xinfo->remapChars;
info->sizeMap = xinfo->sizeMap;
entry->toFont = _vm->_wm->_fontMan->registerFontName(xinfo->toFont);
entry->remapChars = xinfo->remapChars;
entry->sizeMap = xinfo->sizeMap;
} else {
info->toFont = _vm->_wm->_fontMan->registerFontName(name);
entry->toFont = _vm->_wm->_fontMan->registerFontName(name);
}
_fontMap[id] = info;
_fontMap[id] = entry;
debugC(3, kDebugLoading, "Cast::loadFontMapV4: Mapping %s font %d (%s) to %d", getPlatformAbbrev(platform), id, name.c_str(), _fontMap[id]->toFont);
}

View File

@ -130,7 +130,7 @@ void FontStyle::read(Common::ReadStreamEndian &stream, Cast *cast) {
b = stream.readUint16();
if (cast->_fontMap.contains(originalFontId)) {
FontInfo *info = cast->_fontMap[originalFontId];
FontMapEntry *info = cast->_fontMap[originalFontId];
fontId = info->toFont;
if (info->sizeMap.contains(originalHeight)) {
height = info->sizeMap[height];