void Gfx::drawGfxObject(GfxObj *obj, Graphics::Surface &surf) { if (!obj->isVisible()) { return; } Common::Rect rect; byte *data; obj->getRect(obj->frame, rect); int x = obj->x; int y = obj->y; if (_overlayMode) { x += _scrollPosX; y += _scrollPosY; } rect.translate(x, y); data = obj->getData(obj->frame); // WORKAROUND: During the end credits, game scripts try to show a // non-existing frame. We change it to an existing one here. if (obj->frame == 14 && obj->getNum() == 9 && !strcmp(obj->getName(), "Dinor")) obj->frame = 8; if (obj->getSize(obj->frame) == obj->getRawSize(obj->frame)) { blt(rect, data, &surf, obj->layer, obj->scale, obj->transparentKey); } else { unpackBlt(rect, data, obj->getRawSize(obj->frame), &surf, obj->layer, obj->scale, obj->transparentKey); } }
void Gfx::drawGfxObject(GfxObj *obj, Graphics::Surface &surf) { if (!obj->isVisible()) { return; } Common::Rect rect; byte *data; obj->getRect(obj->frame, rect); int x = obj->x; int y = obj->y; if (_overlayMode) { x += _scrollPosX; y += _scrollPosY; } rect.translate(x, y); data = obj->getData(obj->frame); if (obj->getSize(obj->frame) == obj->getRawSize(obj->frame)) { blt(rect, data, &surf, obj->layer, obj->scale, obj->transparentKey); } else { unpackBlt(rect, data, obj->getRawSize(obj->frame), &surf, obj->layer, obj->scale, obj->transparentKey); } }