diff options
Diffstat (limited to 'sword1/screen.cpp')
-rw-r--r-- | sword1/screen.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/sword1/screen.cpp b/sword1/screen.cpp index 7d7f08a6eb..2386c760db 100644 --- a/sword1/screen.cpp +++ b/sword1/screen.cpp @@ -390,13 +390,9 @@ void SwordScreen::processImage(uint32 id) { void SwordScreen::verticalMask(uint16 x, uint16 y, uint16 bWidth, uint16 bHeight) { if (_roomDefTable[_currentScreen].totalLayers <= 1) return; - bWidth = (bWidth + (SCRNGRID_X - 1)) / SCRNGRID_X; - bHeight = (bHeight + (SCRNGRID_Y - 1)) / SCRNGRID_Y; - - if (x & (SCRNGRID_X - 1)) - bWidth++; - if (y & (SCRNGRID_Y - 1)) - bHeight++; + + bWidth = (bWidth + (x & (SCRNGRID_X - 1)) + (SCRNGRID_X - 1)) / SCRNGRID_X; + bHeight = (bHeight + (y & (SCRNGRID_Y - 1)) + (SCRNGRID_Y - 1)) / SCRNGRID_Y; x /= SCRNGRID_X; y /= SCRNGRID_Y; |