aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEugene Sandulenko2019-06-17 21:19:33 +0200
committerEugene Sandulenko2019-09-03 17:16:46 +0200
commit166239f78a20deb27974b870e80ce1867b9b1b97 (patch)
tree349a33f7b9851f40cda43217cf288f13d4e42c1c /engines
parent7df02e4116a5ac5ba0397b3bca67369783ed467b (diff)
downloadscummvm-rg350-166239f78a20deb27974b870e80ce1867b9b1b97.tar.gz
scummvm-rg350-166239f78a20deb27974b870e80ce1867b9b1b97.tar.bz2
scummvm-rg350-166239f78a20deb27974b870e80ce1867b9b1b97.zip
HDB: Optimise blitting code
Diffstat (limited to 'engines')
-rw-r--r--engines/hdb/draw-manager.cpp42
1 files changed, 4 insertions, 38 deletions
diff --git a/engines/hdb/draw-manager.cpp b/engines/hdb/draw-manager.cpp
index 038b29c525..5320581cec 100644
--- a/engines/hdb/draw-manager.cpp
+++ b/engines/hdb/draw-manager.cpp
@@ -270,28 +270,11 @@ Graphics::Surface Picture::load(Common::SeekableReadStream *stream) {
}
void Picture::draw(int x, int y) {
- if (x == kScreenWidth || y == kScreenHeight) {
- return;
- }
- 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);
+ g_hdb->_drawMan->_globalSurface.transBlitFrom(_surface, Common::Point(x, y));
}
void Picture::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(tempSurf.getBasePtr(0, 0), tempSurf.pitch, x, y, tempSurf.w, tempSurf.h);
+ g_hdb->_drawMan->_globalSurface.transBlitFrom(_surface, Common::Point(x, y), 0xf81f);
}
Tile::~Tile() {
@@ -319,28 +302,11 @@ Graphics::Surface Tile::load(Common::SeekableReadStream *stream) {
}
void Tile::draw(int x, int y) {
- if (x == kScreenWidth || y == kScreenHeight) {
- return;
- }
- 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);
+ g_hdb->_drawMan->_globalSurface.transBlitFrom(_surface, Common::Point(x, y));
}
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);
+ g_hdb->_drawMan->_globalSurface.transBlitFrom(_surface, Common::Point(x, y), 0xf81f);
}
}