From c946e1be1a4ebe8de4078fa3d6955287955adc76 Mon Sep 17 00:00:00 2001 From: Nipun Garg Date: Tue, 18 Jun 2019 00:15:32 +0530 Subject: 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. --- engines/hdb/draw-manager.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'engines') 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()) { -- cgit v1.2.3