aboutsummaryrefslogtreecommitdiff
path: root/queen/structs.h
diff options
context:
space:
mode:
authorDavid Eriksson2003-10-16 19:40:29 +0000
committerDavid Eriksson2003-10-16 19:40:29 +0000
commit7f6c294a1e74c34717b2153a436ffe19781b8fad (patch)
treeb00363995e90de0eee20084869b0ca43d19bd78a /queen/structs.h
parent5e36a5cac8571bc2e1c790df3bd0d190141946e9 (diff)
downloadscummvm-rg350-7f6c294a1e74c34717b2153a436ffe19781b8fad.tar.gz
scummvm-rg350-7f6c294a1e74c34717b2153a436ffe19781b8fad.tar.bz2
scummvm-rg350-7f6c294a1e74c34717b2153a436ffe19781b8fad.zip
Play all intro cutaways (some better than others... :-)
svn-id: r10833
Diffstat (limited to 'queen/structs.h')
-rw-r--r--queen/structs.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/queen/structs.h b/queen/structs.h
index 90c1a62dfe..1d0234d14f 100644
--- a/queen/structs.h
+++ b/queen/structs.h
@@ -74,10 +74,14 @@ struct Area {
uint16 calcScale(int16 y) const {
uint16 dy = box.y2 - box.y1;
int16 ds = (int16)(topScaleFactor - bottomScaleFactor);
- uint16 scale = ((((y - box.y1) * 100) / dy) * ds) / 100 + bottomScaleFactor;
- if (scale == 0) {
+ uint16 scale = 0;
+
+ if (dy) // Prevent division-by-zero
+ scale = ((((y - box.y1) * 100) / dy) * ds) / 100 + bottomScaleFactor;
+
+ if (scale == 0)
scale = 100;
- }
+
return scale;
}