Moved the LSL1VGA workaround inside the font class
svn-id: r44705
This commit is contained in:
parent
0b47085da0
commit
1342d04821
2 changed files with 7 additions and 6 deletions
|
@ -35,6 +35,11 @@ SciGuiFont::SciGuiFont(ResourceManager *resMan, GuiResourceId resourceId)
|
||||||
: _resourceId(resourceId) {
|
: _resourceId(resourceId) {
|
||||||
assert(resourceId != -1);
|
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);
|
Resource *fontResource = resMan->findResource(ResourceId(kResourceTypeFont, resourceId), false);
|
||||||
if (!fontResource) {
|
if (!fontResource) {
|
||||||
error("font resource %d not found", resourceId);
|
error("font resource %d not found", resourceId);
|
||||||
|
|
|
@ -111,14 +111,10 @@ SciGuiFont *SciGuiGfx::GetFont() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SciGuiGfx::SetFont(GuiResourceId fontId) {
|
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))
|
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();
|
_curPort->fontHeight = _font->getHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue