aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEugene Sandulenko2019-06-17 21:38:45 +0200
committerEugene Sandulenko2019-09-03 17:16:47 +0200
commit38f11eef396e2faaa432ac3ad917b053f7ac0ef5 (patch)
tree7d93b153b9a101660f21c27961d6aca1df643305 /engines
parent166239f78a20deb27974b870e80ce1867b9b1b97 (diff)
downloadscummvm-rg350-38f11eef396e2faaa432ac3ad917b053f7ac0ef5.tar.gz
scummvm-rg350-38f11eef396e2faaa432ac3ad917b053f7ac0ef5.tar.bz2
scummvm-rg350-38f11eef396e2faaa432ac3ad917b053f7ac0ef5.zip
HDB: Do not blit whole screen
Diffstat (limited to 'engines')
-rw-r--r--engines/hdb/draw-manager.cpp28
-rw-r--r--engines/hdb/hdb.cpp2
2 files changed, 28 insertions, 2 deletions
diff --git a/engines/hdb/draw-manager.cpp b/engines/hdb/draw-manager.cpp
index 5320581cec..5130557d18 100644
--- a/engines/hdb/draw-manager.cpp
+++ b/engines/hdb/draw-manager.cpp
@@ -271,10 +271,24 @@ Graphics::Surface Picture::load(Common::SeekableReadStream *stream) {
void Picture::draw(int x, int y) {
g_hdb->_drawMan->_globalSurface.transBlitFrom(_surface, Common::Point(x, y));
+
+ Common::Rect clip(_surface.getBounds());
+ clip.moveTo(x, y);
+ clip.clip(g_hdb->_drawMan->_globalSurface.getBounds());
+ if (!clip.isEmpty()) {
+ g_system->copyRectToScreen(g_hdb->_drawMan->_globalSurface.getBasePtr(x, y), g_hdb->_drawMan->_globalSurface.pitch, x, y, clip.width(), clip.height());
+ }
}
void Picture::drawMasked(int x, int y) {
g_hdb->_drawMan->_globalSurface.transBlitFrom(_surface, Common::Point(x, y), 0xf81f);
+
+ Common::Rect clip(_surface.getBounds());
+ clip.moveTo(x, y);
+ clip.clip(g_hdb->_drawMan->_globalSurface.getBounds());
+ if (!clip.isEmpty()) {
+ g_system->copyRectToScreen(g_hdb->_drawMan->_globalSurface.getBasePtr(x, y), g_hdb->_drawMan->_globalSurface.pitch, x, y, clip.width(), clip.height());
+ }
}
Tile::~Tile() {
@@ -303,10 +317,24 @@ Graphics::Surface Tile::load(Common::SeekableReadStream *stream) {
void Tile::draw(int x, int y) {
g_hdb->_drawMan->_globalSurface.transBlitFrom(_surface, Common::Point(x, y));
+
+ Common::Rect clip(_surface.getBounds());
+ clip.moveTo(x, y);
+ clip.clip(g_hdb->_drawMan->_globalSurface.getBounds());
+ if (!clip.isEmpty()) {
+ g_system->copyRectToScreen(g_hdb->_drawMan->_globalSurface.getBasePtr(x, y), g_hdb->_drawMan->_globalSurface.pitch, x, y, clip.width(), clip.height());
+ }
}
void Tile::drawMasked(int x, int y) {
g_hdb->_drawMan->_globalSurface.transBlitFrom(_surface, Common::Point(x, y), 0xf81f);
+
+ Common::Rect clip(_surface.getBounds());
+ clip.moveTo(x, y);
+ clip.clip(g_hdb->_drawMan->_globalSurface.getBounds());
+ if (!clip.isEmpty()) {
+ g_system->copyRectToScreen(g_hdb->_drawMan->_globalSurface.getBasePtr(x, y), g_hdb->_drawMan->_globalSurface.pitch, x, y, clip.width(), clip.height());
+ }
}
}
diff --git a/engines/hdb/hdb.cpp b/engines/hdb/hdb.cpp
index c0fd7bee57..1b86838417 100644
--- a/engines/hdb/hdb.cpp
+++ b/engines/hdb/hdb.cpp
@@ -188,8 +188,6 @@ Common::Error HDBGame::run() {
}
}
- Graphics::ManagedSurface backBuffer = _drawMan->_globalSurface;
- g_system->copyRectToScreen(backBuffer.getBasePtr(0, 0), backBuffer.pitch, 0, 0, backBuffer.w, backBuffer.h);
g_system->updateScreen();
g_system->delayMillis(10);
}