From 9df5622d1f05f74431f3654118ef3e77b48a707f Mon Sep 17 00:00:00 2001 From: Nipun Garg Date: Mon, 17 Jun 2019 21:44:37 +0530 Subject: HDB: Add Picture::drawMasked for masked blitting --- engines/hdb/draw-manager.cpp | 7 +++++++ engines/hdb/draw-manager.h | 5 +++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/engines/hdb/draw-manager.cpp b/engines/hdb/draw-manager.cpp index 72c8820cdf..e1cddda8be 100644 --- a/engines/hdb/draw-manager.cpp +++ b/engines/hdb/draw-manager.cpp @@ -273,6 +273,13 @@ void Picture::draw(int x, int y) { g_system->copyRectToScreen(_surface.getBasePtr(0, 0), _surface.pitch, x, y, _surface.w, _surface.h); } +void Picture::drawMasked(int x, int y) { + Graphics::ManagedSurface tempSurf; + tempSurf.create(_surface.w, _surface.h); + tempSurf.transBlitFrom(_surface, 0xf81f); + g_system->copyRectToScreen(tempSurf.getBasePtr(0, 0), tempSurf.pitch, x, y, tempSurf.w, tempSurf.h); +} + Tile::~Tile() { _surface.free(); } diff --git a/engines/hdb/draw-manager.h b/engines/hdb/draw-manager.h index 2789fbb099..f6909918ed 100644 --- a/engines/hdb/draw-manager.h +++ b/engines/hdb/draw-manager.h @@ -102,13 +102,14 @@ public: Graphics::Surface load(Common::SeekableReadStream *stream); void draw(int x, int y); + void drawMasked(int x, int y); private: uint _width, _height; char _name[64]; - Graphics::ManagedSurface _surface; + Graphics::Surface _surface; }; @@ -125,7 +126,7 @@ public: private: char _name[64]; - Graphics::ManagedSurface _surface; + Graphics::Surface _surface; }; } // End of Namespace HDB -- cgit v1.2.3