mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-02 15:38:59 +00:00
Moved the LSL1VGA workaround inside the font class
svn-id: r44705
This commit is contained in:
parent
0b47085da0
commit
1342d04821
@ -35,6 +35,11 @@ SciGuiFont::SciGuiFont(ResourceManager *resMan, GuiResourceId resourceId)
|
||||
: _resourceId(resourceId) {
|
||||
assert(resourceId != -1);
|
||||
|
||||
// Workaround: lsl1sci mixes its own internal fonts with the global
|
||||
// SCI ones, so we translate them here, by removing their extra bits
|
||||
if (!resMan->testResource(ResourceId(kResourceTypeFont, resourceId)))
|
||||
resourceId = resourceId & 0x7ff;
|
||||
|
||||
Resource *fontResource = resMan->findResource(ResourceId(kResourceTypeFont, resourceId), false);
|
||||
if (!fontResource) {
|
||||
error("font resource %d not found", resourceId);
|
||||
|
@ -111,14 +111,10 @@ SciGuiFont *SciGuiGfx::GetFont() {
|
||||
}
|
||||
|
||||
void SciGuiGfx::SetFont(GuiResourceId fontId) {
|
||||
// Workaround: lsl1sci mixes its own internal fonts with the global
|
||||
// SCI ones, so we translate them here, by removing their extra bits
|
||||
GuiResourceId actualFontId = (_s->_gameName == "lsl1sci") ? fontId & 0x7ff : fontId;
|
||||
|
||||
if ((_font == NULL) || (_font->getResourceId() != fontId))
|
||||
_font = new SciGuiFont(_s->resMan, actualFontId);
|
||||
_font = new SciGuiFont(_s->resMan, fontId);
|
||||
|
||||
_curPort->fontId = actualFontId;
|
||||
_curPort->fontId = _font->getResourceId();
|
||||
_curPort->fontHeight = _font->getHeight();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user