aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock/resources.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sherlock/resources.cpp')
-rw-r--r--engines/sherlock/resources.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/engines/sherlock/resources.cpp b/engines/sherlock/resources.cpp
index 2e6a0c2d7c..64991ebd9f 100644
--- a/engines/sherlock/resources.cpp
+++ b/engines/sherlock/resources.cpp
@@ -496,4 +496,32 @@ int ImageFrame::sDrawYSize(int scaleVal) const {
return result;
}
+int ImageFrame::sDrawXOffset(int scaleVal) const {
+ int width = _offset.x;
+ int scale = scaleVal == 0 ? 1 : scaleVal;
+
+ if (scaleVal >= 256)
+ --width;
+
+ int result = width * 256 / scale;
+ if (scaleVal >= 256)
+ ++result;
+
+ return result;
+}
+
+int ImageFrame::sDrawYOffset(int scaleVal) const {
+ int height = _offset.y;
+ 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