diff options
Diffstat (limited to 'engines/sherlock/resources.cpp')
-rw-r--r-- | engines/sherlock/resources.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/engines/sherlock/resources.cpp b/engines/sherlock/resources.cpp index 961286fcf4..f1c705b522 100644 --- a/engines/sherlock/resources.cpp +++ b/engines/sherlock/resources.cpp @@ -469,11 +469,31 @@ void ImageFile::decompressFrame(ImageFrame &frame, const byte *src) { /*----------------------------------------------------------------*/ int ImageFrame::sDrawXSize(int scaleVal) const { - error("TODO: sDrawXSize"); + int width = _width; + int scale = scaleVal == 0 ? 1 : scaleVal; + + if (scaleVal >= 256) + --width; + + int result = width * 256 / scale; + if (scaleVal >= 256) + ++result; + + return result; } int ImageFrame::sDrawYSize(int scaleVal) const { - error("TODO: sDrawYSize"); + int height = _height; + int scale = scaleVal == 0 ? 1 : scaleVal; + + if (scaleVal >= 256) + --height; + + int result = height * 256 / scale; + if (scaleVal >= 256) + ++result; + + return result; } } // End of namespace Sherlock |