Permalink
Browse files

SCI: Add support for text loading in Hoyle 3 Amiga

  • Loading branch information...
bluegr committed Aug 20, 2018
1 parent 2877c22 commit 5684273ee11d973b1f1ed3a3a51571bb5e3dcaaa
Showing with 14 additions and 1 deletion.
  1. +14 −1 engines/sci/engine/kernel.cpp
@@ -880,7 +880,20 @@ Common::String Kernel::lookupText(reg_t address, int index) {
if (address.getSegment())
return _segMan->getString(address);

Resource *textres = _resMan->findResource(ResourceId(kResourceTypeText, address.getOffset()), false);
ResourceId resourceId = ResourceId(kResourceTypeText, address.getOffset());
if (g_sci->getGameId() == GID_HOYLE3 && g_sci->getPlatform() == Common::kPlatformAmiga) {
// WORKAROUND: In the Amiga version of Hoyle 3, texts are stored as
// either text, font or palette types. Seems like the resource type
// bits are used as part of the resource numbers. This is the same
// as the workaround used in GfxFontFromResource()
resourceId = ResourceId(kResourceTypeText, address.getOffset() & 0x7FF);
if (!_resMan->testResource(resourceId))
resourceId = ResourceId(kResourceTypeFont, address.getOffset() & 0x7FF);
if (!_resMan->testResource(resourceId))
resourceId = ResourceId(kResourceTypePalette, address.getOffset() & 0x7FF);
}

Resource *textres = _resMan->findResource(resourceId, false);

if (!textres) {
error("text.%03d not found", address.getOffset());

0 comments on commit 5684273

Please sign in to comment.