diff options
author | Max Horn | 2004-09-24 23:21:15 +0000 |
---|---|---|
committer | Max Horn | 2004-09-24 23:21:15 +0000 |
commit | 216aa7319313fbce26aa3dff7378b178f4723027 (patch) | |
tree | 6c2279f4a7645454767eeb899ec23a1e84dc5bc9 /scumm | |
parent | 6749efe84c65434bcbf54fa7130fb072a4e22fb0 (diff) | |
download | scummvm-rg350-216aa7319313fbce26aa3dff7378b178f4723027.tar.gz scummvm-rg350-216aa7319313fbce26aa3dff7378b178f4723027.tar.bz2 scummvm-rg350-216aa7319313fbce26aa3dff7378b178f4723027.zip |
Some clipping for updateDirtyScreen; Evil hack to fix an actor drawing glitch in V7_SMOOTH_SCROLLING_HACK mode (which, by the way, works pretty well now)
svn-id: r15259
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/gfx.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp index 5ee02201b1..31872e83e1 100644 --- a/scumm/gfx.cpp +++ b/scumm/gfx.cpp @@ -322,6 +322,14 @@ void ScummEngine::markRectAsDirty(VirtScreenNumber virt, int left, int right, in bottom = vs->h; if (virt == kMainVirtScreen && dirtybit) { +#ifdef V7_SMOOTH_SCROLLING_HACK + if (_version >= 7) { + // FIXME / HACK: This is a hack to fix an actor redraw glitch + // in V7_SMOOTH_SCROLLING_HACK mode. Right now I have no idea + // why this hack is needed, but for now it works well enough. + lp = left / 8 + _screenStartStrip - 1; + } else +#endif lp = left / 8 + _screenStartStrip; if (lp < 0) lp = 0; @@ -410,14 +418,19 @@ void Gdi::updateDirtyScreen(VirtScreen *vs) { int i; int w = 8; int start = 0; +#ifdef V7_SMOOTH_SCROLLING_HACK + const int numStrips = MIN(_vm->_screenStartStrip + _numStrips, _vm->_roomWidth / 8) - _vm->_screenStartStrip; +#else + const int numStrips = _numStrips; +#endif - for (i = 0; i < _numStrips; i++) { + for (i = 0; i < numStrips; i++) { if (vs->bdirty[i]) { const int top = vs->tdirty[i]; const int bottom = vs->bdirty[i]; vs->tdirty[i] = vs->h; vs->bdirty[i] = 0; - if (i != (_numStrips - 1) && vs->bdirty[i + 1] == bottom && vs->tdirty[i + 1] == top) { + if (i != (numStrips - 1) && vs->bdirty[i + 1] == bottom && vs->tdirty[i + 1] == top) { // Simple optimizations: if two or more neighbouring strips // form one bigger rectangle, coalesce them. w += 8; |