diff -ur ScummVM-cvs20021029/scummvm/scumm/gfx.cpp ScummVM-cvs20021029+hack/scummvm/scumm/gfx.cpp
old
|
new
|
|
1776 | 1776 | void Scumm::restoreBG(int left, int top, int right, int bottom) |
1777 | 1777 | { |
1778 | 1778 | VirtScreen *vs; |
1779 | | int topline, height, width, widthmod; |
1780 | | byte *backbuff, *bgbak, *mask; |
| 1779 | int topline, height, width; |
| 1780 | byte *backbuff, *bgbak; |
1781 | 1781 | |
1782 | 1782 | if (left == right || top == bottom) |
1783 | 1783 | return; |
… |
… |
|
1812 | 1812 | |
1813 | 1813 | backbuff = vs->screenPtr + height; |
1814 | 1814 | bgbak = getResourceAddress(rtBuffer, vs->number + 5) + height; |
1815 | | mask = getResourceAddress(rtBuffer, 9) + top * gdi._numStrips + (left >> 3) + _screenStartStrip; |
1816 | | if (vs->number == 0) { |
1817 | | // FIXME: hardcoded value |
1818 | | mask += vs->topline * 216; |
1819 | | } |
1820 | 1815 | |
1821 | 1816 | height = bottom - top; |
1822 | 1817 | width = right - left; |
1823 | | widthmod = (width >> 2) + 2; |
1824 | 1818 | |
1825 | 1819 | if (vs->alloctwobuffers && _currentRoom != 0 /*&& _vars[VAR_V5_DRAWFLAGS]&2 */ ) { |
1826 | 1820 | blit(backbuff, bgbak, width, height); |
1827 | 1821 | if (vs->number == 0 && charset._hasMask && height) { |
| 1822 | byte *mask; |
| 1823 | int mask_width = (width >> 3); |
| 1824 | |
| 1825 | if (width & 0x07) |
| 1826 | mask_width++; |
| 1827 | |
| 1828 | mask = getResourceAddress(rtBuffer, 9) + top * gdi._numStrips + (left >> 3) + _screenStartStrip; |
| 1829 | if (vs->number == 0) |
| 1830 | mask += vs->topline * gdi._numStrips; |
| 1831 | |
1828 | 1832 | do { |
1829 | | memset(mask, 0, widthmod); |
| 1833 | memset(mask, 0, mask_width); |
1830 | 1834 | mask += gdi._numStrips; |
1831 | 1835 | } while (--height); |
1832 | 1836 | } |