aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNipun Garg2019-06-17 21:44:37 +0530
committerEugene Sandulenko2019-09-03 17:16:46 +0200
commit9df5622d1f05f74431f3654118ef3e77b48a707f (patch)
treecf7e69b8ff4326a881dc34241f7f2029d09785db
parentd1a3dd0847d946cc7100679706c79db61ced16cf (diff)
downloadscummvm-rg350-9df5622d1f05f74431f3654118ef3e77b48a707f.tar.gz
scummvm-rg350-9df5622d1f05f74431f3654118ef3e77b48a707f.tar.bz2
scummvm-rg350-9df5622d1f05f74431f3654118ef3e77b48a707f.zip
HDB: Add Picture::drawMasked for masked blitting
-rw-r--r--engines/hdb/draw-manager.cpp7
-rw-r--r--engines/hdb/draw-manager.h5
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