diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/hdb/draw-manager.cpp | 28 | ||||
-rw-r--r-- | engines/hdb/hdb.cpp | 2 |
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); } |