[Scummvm-cvs-logs] scummvm master -> 1659e357c2aa3f051cb3baa20bbb0a4282948048

dreammaster dreammaster at scummvm.org
Sun Aug 23 00:13:02 CEST 2015


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
1659e357c2 SHERLOCK: RT: Cleanup of sDrawXOffset & sDrawYOffset


Commit: 1659e357c2aa3f051cb3baa20bbb0a4282948048
    https://github.com/scummvm/scummvm/commit/1659e357c2aa3f051cb3baa20bbb0a4282948048
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-08-22T18:12:31-04:00

Commit Message:
SHERLOCK: RT: Cleanup of sDrawXOffset & sDrawYOffset

Changed paths:
    engines/sherlock/image_file.cpp



diff --git a/engines/sherlock/image_file.cpp b/engines/sherlock/image_file.cpp
index 1ff0f4b..246b82f 100644
--- a/engines/sherlock/image_file.cpp
+++ b/engines/sherlock/image_file.cpp
@@ -220,31 +220,33 @@ int ImageFrame::sDrawYSize(int scaleVal) const {
 }
 
 int ImageFrame::sDrawXOffset(int scaleVal) const {
-	int width = _offset.x;
-	int scale = scaleVal == 0 ? 1 : scaleVal;
+	int xOffset = _offset.x;
+	if (!scaleVal)
+		++scaleVal;
 
-	if (scaleVal >= SCALE_THRESHOLD)
-		--width;
+	if (scaleVal >= SCALE_THRESHOLD && xOffset)
+		--xOffset;
 
-	int result = width * SCALE_THRESHOLD / scale;
+	xOffset = xOffset * SCALE_THRESHOLD / scaleVal;
 	if (scaleVal >= SCALE_THRESHOLD)
-		++result;
+		++xOffset;
 
-	return result;
+	return xOffset;
 }
 
 int ImageFrame::sDrawYOffset(int scaleVal) const {
-	int height = _offset.y;
-	int scale = scaleVal == 0 ? 1 : scaleVal;
+	int yOffset = _offset.y;
+	if (!scaleVal)
+		++scaleVal;
 
-	if (scaleVal >= SCALE_THRESHOLD)
-		--height;
+	if (scaleVal >= SCALE_THRESHOLD && yOffset)
+		--yOffset;
 
-	int result = height * SCALE_THRESHOLD / scale;
+	yOffset = yOffset * SCALE_THRESHOLD / scaleVal;
 	if (scaleVal >= SCALE_THRESHOLD)
-		++result;
+		++yOffset;
 
-	return result;
+	return yOffset;
 }
 
 // *******************************************************






More information about the Scummvm-git-logs mailing list