diff options
author | lolbot-iichan | 2019-06-27 10:59:35 +0300 |
---|---|---|
committer | Filippos Karapetis | 2019-06-27 10:59:35 +0300 |
commit | fa4d310fb4d3ccdcf45b2f78e2a23126ec07f006 (patch) | |
tree | 5c442f2ddc433664ca99f3109bfa9a95710e05d5 /engines/wintermute/base/gfx/osystem | |
parent | 1f0f4c9642d55ecf95d4c5d6a4d947f0786ae2f5 (diff) | |
download | scummvm-rg350-fa4d310fb4d3ccdcf45b2f78e2a23126ec07f006.tar.gz scummvm-rg350-fa4d310fb4d3ccdcf45b2f78e2a23126ec07f006.tar.bz2 scummvm-rg350-fa4d310fb4d3ccdcf45b2f78e2a23126ec07f006.zip |
WINTERMUTE: Do not optimize out alpha blits on rotation
This fixes defect #10684: 1-pixel width sprite becomes a big rectangle
if rotation is applied.
Case was originally reproduced with FoxTail game for WME, then reduced
to testcase
https://github.com/tobiatesan/wme_testsuite/tree/master/time_test/packages
Diffstat (limited to 'engines/wintermute/base/gfx/osystem')
-rw-r--r-- | engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp | 3 | ||||
-rw-r--r-- | engines/wintermute/base/gfx/osystem/render_ticket.cpp | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp b/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp index 4e33702504..140988267f 100644 --- a/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp +++ b/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp @@ -452,7 +452,8 @@ bool BaseSurfaceOSystem::drawSprite(int x, int y, Rect32 *rect, Rect32 *newRect, // But no checking is in place for that yet. // Optimize by not doing alpha-blits if we lack alpha - if (_alphaType == Graphics::ALPHA_OPAQUE && !transform._alphaDisable) { + // If angle is not 0, then transparent regions are added near the corners + if (_alphaType == Graphics::ALPHA_OPAQUE && transform._angle == 0) { transform._alphaDisable = true; } diff --git a/engines/wintermute/base/gfx/osystem/render_ticket.cpp b/engines/wintermute/base/gfx/osystem/render_ticket.cpp index acc9530684..e092e3cf17 100644 --- a/engines/wintermute/base/gfx/osystem/render_ticket.cpp +++ b/engines/wintermute/base/gfx/osystem/render_ticket.cpp @@ -117,6 +117,8 @@ void RenderTicket::drawToSurface(Graphics::Surface *_targetSurface) const { if (_owner) { if (_transform._alphaDisable) { src.setAlphaMode(Graphics::ALPHA_OPAQUE); + } else if (_transform._angle) { + src.setAlphaMode(Graphics::ALPHA_FULL); } else { src.setAlphaMode(_owner->getAlphaType()); } @@ -149,6 +151,8 @@ void RenderTicket::drawToSurface(Graphics::Surface *_targetSurface, Common::Rect if (_owner) { if (_transform._alphaDisable) { src.setAlphaMode(Graphics::ALPHA_OPAQUE); + } else if (_transform._angle) { + src.setAlphaMode(Graphics::ALPHA_FULL); } else { src.setAlphaMode(_owner->getAlphaType()); } |