aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNipun Garg2019-06-18 00:15:32 +0530
committerEugene Sandulenko2019-09-03 17:16:46 +0200
commitc946e1be1a4ebe8de4078fa3d6955287955adc76 (patch)
tree335f6cb8782a148aa5c7be7b7232d1b6bbef677f
parente267210ec863a5e7c870e15eb4e72c71e72645f1 (diff)
downloadscummvm-rg350-c946e1be1a4ebe8de4078fa3d6955287955adc76.tar.gz
scummvm-rg350-c946e1be1a4ebe8de4078fa3d6955287955adc76.tar.bz2
scummvm-rg350-c946e1be1a4ebe8de4078fa3d6955287955adc76.zip
HDB: Implement workaround for edge blitting
copyRectToSurface expects that graphics won't touch the edge of the screen. Hence, when they do touch the edge, the draw call is ignored.
-rw-r--r--engines/hdb/draw-manager.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/engines/hdb/draw-manager.cpp b/engines/hdb/draw-manager.cpp
index e0a4e7c36c..2dc49971d1 100644
--- a/engines/hdb/draw-manager.cpp
+++ b/engines/hdb/draw-manager.cpp
@@ -270,6 +270,9 @@ Graphics::Surface Picture::load(Common::SeekableReadStream *stream) {
}
void Picture::draw(int x, int y) {
+ if (x == kScreenWidth || y == kScreenHeight) {
+ return;
+ }
Common::Rect clip(_surface.getBounds());
clip.clip(Common::Rect(0, 0, kScreenWidth - 1 - x, kScreenHeight - 1 - y));
if (!clip.isEmpty()) {
@@ -279,6 +282,9 @@ void Picture::draw(int x, int y) {
}
void Picture::drawMasked(int x, int y) {
+ if (x == kScreenWidth || y == kScreenHeight) {
+ return;
+ }
_surface.transBlitFrom(_surface, 0xf81f);
Common::Rect clip(_surface.getBounds());
clip.clip(Common::Rect(0, 0, kScreenWidth - 1 - x, kScreenHeight - 1 - y));
@@ -313,6 +319,9 @@ Graphics::Surface Tile::load(Common::SeekableReadStream *stream) {
}
void Tile::draw(int x, int y) {
+ if (x == kScreenWidth || y == kScreenHeight) {
+ return;
+ }
Common::Rect clip(_surface.getBounds());
clip.clip(Common::Rect(0, 0, kScreenWidth - 1 - x, kScreenHeight - 1 - y));
if (!clip.isEmpty()) {