aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/inter_v2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/gob/inter_v2.cpp')
-rw-r--r--engines/gob/inter_v2.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/engines/gob/inter_v2.cpp b/engines/gob/inter_v2.cpp
index 819ba6df11..222ce8ee2b 100644
--- a/engines/gob/inter_v2.cpp
+++ b/engines/gob/inter_v2.cpp
@@ -1409,10 +1409,14 @@ void Inter_v2::o2_scroll() {
int16 curX;
int16 curY;
- startX = _vm->_parse->parseValExpr();
- startY = _vm->_parse->parseValExpr();
- endX = _vm->_parse->parseValExpr();
- endY = _vm->_parse->parseValExpr();
+ startX = CLIP((int) _vm->_parse->parseValExpr(), 0,
+ _vm->_video->_surfWidth - 320);
+ startY = CLIP((int) _vm->_parse->parseValExpr(), 0,
+ _vm->_video->_surfHeight - 200);
+ endX = CLIP((int) _vm->_parse->parseValExpr(), 0,
+ _vm->_video->_surfWidth - 320);
+ endY = CLIP((int) _vm->_parse->parseValExpr(), 0,
+ _vm->_video->_surfHeight - 200);
stepX = _vm->_parse->parseValExpr();
stepY = _vm->_parse->parseValExpr();