aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorSven Hesse2007-04-09 14:00:23 +0000
committerSven Hesse2007-04-09 14:00:23 +0000
commit0d99a362e9323da21081da4719359ead62ce45d4 (patch)
tree37c8d26115eb3415fbec8624841dc517ceaaf09d /engines
parent871e83d0705fc3a18a3cb4e7db1e77ee6481422f (diff)
downloadscummvm-rg350-0d99a362e9323da21081da4719359ead62ce45d4.tar.gz
scummvm-rg350-0d99a362e9323da21081da4719359ead62ce45d4.tar.bz2
scummvm-rg350-0d99a362e9323da21081da4719359ead62ce45d4.zip
Some fixes for the Gob3 demos
svn-id: r26435
Diffstat (limited to 'engines')
-rw-r--r--engines/gob/driver_vga.cpp4
-rw-r--r--engines/gob/inter_v1.cpp2
-rw-r--r--engines/gob/inter_v2.cpp12
3 files changed, 11 insertions, 7 deletions
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 &params) {
_break = true;
_vm->_global->_inter_execPtr = 0;
- return false;
+ return true;
}
bool Inter_v1::o1_renewTimeInVars(OpFuncParams &params) {
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();