diff options
author | Martin Kiewitz | 2010-08-14 06:05:54 +0000 |
---|---|---|
committer | Martin Kiewitz | 2010-08-14 06:05:54 +0000 |
commit | 512bf22af689a9fec0f1dc3a637f6f2e084b06a7 (patch) | |
tree | 0095b8e2700224b698d13f885d59d02da10eb0aa /engines/sci/graphics | |
parent | f252c0b67ef74da5376fcf3a08d514fb311c4316 (diff) | |
download | scummvm-rg350-512bf22af689a9fec0f1dc3a637f6f2e084b06a7.tar.gz scummvm-rg350-512bf22af689a9fec0f1dc3a637f6f2e084b06a7.tar.bz2 scummvm-rg350-512bf22af689a9fec0f1dc3a637f6f2e084b06a7.zip |
SCI: adding workaround for camelot during ending
fixes bug #3044734
also fixing heap corruption during the ending
svn-id: r52077
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r-- | engines/sci/graphics/paint16.cpp | 1 | ||||
-rw-r--r-- | engines/sci/graphics/ports.cpp | 7 | ||||
-rw-r--r-- | engines/sci/graphics/ports.h | 1 |
3 files changed, 9 insertions, 0 deletions
diff --git a/engines/sci/graphics/paint16.cpp b/engines/sci/graphics/paint16.cpp index 6e7da7c4dd..dbc738e2f7 100644 --- a/engines/sci/graphics/paint16.cpp +++ b/engines/sci/graphics/paint16.cpp @@ -417,6 +417,7 @@ void GfxPaint16::kernelGraphFrameBox(const Common::Rect &rect, int16 color) { } void GfxPaint16::kernelGraphDrawLine(Common::Point startPoint, Common::Point endPoint, int16 color, int16 priority, int16 control) { + _ports->clipLine(startPoint, endPoint); _ports->offsetLine(startPoint, endPoint); _screen->drawLine(startPoint.x, startPoint.y, endPoint.x, endPoint.y, color, priority, control); } diff --git a/engines/sci/graphics/ports.cpp b/engines/sci/graphics/ports.cpp index 32a9db5ae3..2d8bfde37d 100644 --- a/engines/sci/graphics/ports.cpp +++ b/engines/sci/graphics/ports.cpp @@ -566,6 +566,13 @@ void GfxPorts::offsetLine(Common::Point &start, Common::Point &end) { end.y += _curPort->top; } +void GfxPorts::clipLine(Common::Point &start, Common::Point &end) { + start.y = CLIP<int16>(start.y, _curPort->rect.top, _curPort->rect.bottom - 1); + start.x = CLIP<int16>(start.x, _curPort->rect.left, _curPort->rect.right - 1); + end.y = CLIP<int16>(end.y, _curPort->rect.top, _curPort->rect.bottom - 1); + end.x = CLIP<int16>(end.x, _curPort->rect.left, _curPort->rect.right - 1); +} + void GfxPorts::priorityBandsInit(int16 bandCount, int16 top, int16 bottom) { int16 y; int32 bandSize; diff --git a/engines/sci/graphics/ports.h b/engines/sci/graphics/ports.h index 42a0a5d4b4..453cb50986 100644 --- a/engines/sci/graphics/ports.h +++ b/engines/sci/graphics/ports.h @@ -83,6 +83,7 @@ public: void offsetRect(Common::Rect &r); void offsetLine(Common::Point &start, Common::Point &end); + void clipLine(Common::Point &start, Common::Point &end); void priorityBandsInit(int16 bandCount, int16 top, int16 bottom); void priorityBandsInit(byte *data); |