aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Göffringmann2003-12-20 15:26:44 +0000
committerRobert Göffringmann2003-12-20 15:26:44 +0000
commitf533de72e48fa909240ecf3c0fffa5bfd895753b (patch)
tree170e50ade3494dceb804ff6854ac5af93ebf9595
parentc2b9debd31af640970b9ab89c86d9637d6be5147 (diff)
downloadscummvm-rg350-f533de72e48fa909240ecf3c0fffa5bfd895753b.tar.gz
scummvm-rg350-f533de72e48fa909240ecf3c0fffa5bfd895753b.tar.bz2
scummvm-rg350-f533de72e48fa909240ecf3c0fffa5bfd895753b.zip
sprites should now be rendered correctly.
svn-id: r11784
-rw-r--r--sword1/screen.cpp10
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;