diff options
author | Nipun Garg | 2019-06-18 00:36:01 +0530 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-03 17:16:46 +0200 |
commit | 147a4e84e7835ff6120477c5d70a8b9ab9a6f3ee (patch) | |
tree | 62924e33b9f0cf7d064564fae4d38adfd1e224ae /engines | |
parent | c946e1be1a4ebe8de4078fa3d6955287955adc76 (diff) | |
download | scummvm-rg350-147a4e84e7835ff6120477c5d70a8b9ab9a6f3ee.tar.gz scummvm-rg350-147a4e84e7835ff6120477c5d70a8b9ab9a6f3ee.tar.bz2 scummvm-rg350-147a4e84e7835ff6120477c5d70a8b9ab9a6f3ee.zip |
HDB: Add Tile::drawMasked for masked Blitting
Diffstat (limited to 'engines')
-rw-r--r-- | engines/hdb/draw-manager.cpp | 13 | ||||
-rw-r--r-- | engines/hdb/draw-manager.h | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/engines/hdb/draw-manager.cpp b/engines/hdb/draw-manager.cpp index 2dc49971d1..72ab4419c1 100644 --- a/engines/hdb/draw-manager.cpp +++ b/engines/hdb/draw-manager.cpp @@ -330,4 +330,17 @@ void Tile::draw(int x, int y) { // g_system->copyRectToScreen(_surface.getBasePtr(0, 0), _surface.pitch, x, y, _surface.w, _surface.h); } +void Tile::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)); + if (!clip.isEmpty()) { + g_hdb->_drawMan->_globalSurface.copyRectToSurface(_surface.getBasePtr(0, 0), _surface.pitch, x, y, clip.width(), clip.height()); + } + // g_system->copyRectToScreen(_surface.getBasePtr(0, 0), _surface.pitch, x, y, _surface.w, _surface.h); +} + } diff --git a/engines/hdb/draw-manager.h b/engines/hdb/draw-manager.h index cb4f8182ba..f5d6f5e808 100644 --- a/engines/hdb/draw-manager.h +++ b/engines/hdb/draw-manager.h @@ -121,6 +121,7 @@ public: Graphics::Surface load(Common::SeekableReadStream *stream); void draw(int x, int y); + void drawMasked(int x, int y); uint32 _flags; |