From 0d99a362e9323da21081da4719359ead62ce45d4 Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Mon, 9 Apr 2007 14:00:23 +0000 Subject: Some fixes for the Gob3 demos svn-id: r26435 --- engines/gob/driver_vga.cpp | 4 ++-- engines/gob/inter_v1.cpp | 2 +- engines/gob/inter_v2.cpp | 12 ++++++++---- 3 files changed, 11 insertions(+), 7 deletions(-) (limited to 'engines/gob') diff --git a/engines/gob/driver_vga.cpp b/engines/gob/driver_vga.cpp index 759136180e..4923387ef8 100644 --- a/engines/gob/driver_vga.cpp +++ b/engines/gob/driver_vga.cpp @@ -105,8 +105,8 @@ void VGAVideoDriver::drawSprite(SurfaceDesc *source, SurfaceDesc *dest, (y >= dest->getHeight()) || (y < 0)) return; - int16 width = (right - left) + 1; - int16 height = (bottom - top) + 1; + int16 width = MIN((right - left) + 1, (int) dest->getWidth()); + int16 height = MIN((bottom - top) + 1, (int) dest->getHeight()); byte *srcPos = source->getVidMem() + (top * source->getWidth()) + left; byte *destPos = dest->getVidMem() + (y * dest->getWidth()) + x; diff --git a/engines/gob/inter_v1.cpp b/engines/gob/inter_v1.cpp index d213b601e4..052aef0e25 100644 --- a/engines/gob/inter_v1.cpp +++ b/engines/gob/inter_v1.cpp @@ -1775,7 +1775,7 @@ bool Inter_v1::o1_return(OpFuncParams ¶ms) { _break = true; _vm->_global->_inter_execPtr = 0; - return false; + return true; } bool Inter_v1::o1_renewTimeInVars(OpFuncParams ¶ms) { 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(); -- cgit v1.2.3