diff options
author | Filippos Karapetis | 2009-10-06 17:13:57 +0000 |
---|---|---|
committer | Filippos Karapetis | 2009-10-06 17:13:57 +0000 |
commit | 1342d0482110ca26bffdf10bbc66eb377e22fd03 (patch) | |
tree | 80aeef2b4ed5c07f5cf60ba2732baed30df006fa /engines | |
parent | 0b47085da0d287ff14b9d0299bfe18cdf6dd469e (diff) | |
download | scummvm-rg350-1342d0482110ca26bffdf10bbc66eb377e22fd03.tar.gz scummvm-rg350-1342d0482110ca26bffdf10bbc66eb377e22fd03.tar.bz2 scummvm-rg350-1342d0482110ca26bffdf10bbc66eb377e22fd03.zip |
Moved the LSL1VGA workaround inside the font class
svn-id: r44705
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/gui/gui_font.cpp | 5 | ||||
-rw-r--r-- | engines/sci/gui/gui_gfx.cpp | 8 |
2 files changed, 7 insertions, 6 deletions
diff --git a/engines/sci/gui/gui_font.cpp b/engines/sci/gui/gui_font.cpp index 31bd0233cc..57e736613e 100644 --- a/engines/sci/gui/gui_font.cpp +++ b/engines/sci/gui/gui_font.cpp @@ -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); diff --git a/engines/sci/gui/gui_gfx.cpp b/engines/sci/gui/gui_gfx.cpp index 2e2d1b9cce..e6b2c85464 100644 --- a/engines/sci/gui/gui_gfx.cpp +++ b/engines/sci/gui/gui_gfx.cpp @@ -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(); } |