diff options
author | Max Horn | 2002-10-20 01:02:52 +0000 |
---|---|---|
committer | Max Horn | 2002-10-20 01:02:52 +0000 |
commit | b5f0fa4c8b637fa1efccfc419ff652b31a802708 (patch) | |
tree | 9e4a986e08c2bfb3e371694c51f9d5a78a4e7d83 | |
parent | dd7cfdb0de600f3079dcca28eb1f748b8ac03f9b (diff) | |
download | scummvm-rg350-b5f0fa4c8b637fa1efccfc419ff652b31a802708.tar.gz scummvm-rg350-b5f0fa4c8b637fa1efccfc419ff652b31a802708.tar.bz2 scummvm-rg350-b5f0fa4c8b637fa1efccfc419ff652b31a802708.zip |
cleanup; fix for room 88 in The Dig (Ender, I was right, only the place was another :-)
svn-id: r5191
-rw-r--r-- | scumm/gfx.cpp | 54 | ||||
-rw-r--r-- | scumm/gfx.h | 2 | ||||
-rw-r--r-- | scumm/scumm.h | 2 |
3 files changed, 30 insertions, 28 deletions
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp index fbeca666bf..46a7f8f96d 100644 --- a/scumm/gfx.cpp +++ b/scumm/gfx.cpp @@ -79,7 +79,7 @@ void Scumm::initScreens(int a, int b, int w, int h) } void Scumm::initVirtScreen(int slot, int number, int top, int width, int height, bool twobufs, - bool fourextra) + bool scrollable) { VirtScreen *vs = &virtscr[slot]; int size; @@ -100,7 +100,7 @@ void Scumm::initVirtScreen(int slot, int number, int top, int width, int height, vs->topline = top; vs->height = height; vs->alloctwobuffers = twobufs; - vs->scrollable = fourextra; + vs->scrollable = scrollable; vs->xstart = 0; size = vs->width * vs->height; vs->size = size; @@ -158,7 +158,7 @@ void Scumm::drawDirtyScreenParts() } else { vs = &virtscr[0]; - src = vs->screenPtr + _screenStartStrip * 8 + camera._cur.y - (_realHeight / 2); + src = vs->screenPtr + _screenStartStrip * 8 + _screenTop * _realWidth; _system->copy_rect(src, _realWidth, 0, vs->topline, _realWidth, vs->height); for (i = 0; i < NUM_STRIPS; i++) { @@ -184,9 +184,6 @@ void Scumm::updateDirtyScreen(int slot) void Gdi::updateDirtyScreen(VirtScreen *vs) { - int i; - int start, w, top, bottom; - if (vs->height == 0) return; @@ -194,29 +191,34 @@ void Gdi::updateDirtyScreen(VirtScreen *vs) if (vs->scrollable) _readOffs = vs->xstart; - w = 8; - start = 0; - - for (i = 0; i < NUM_STRIPS; i++) { - bottom = vs->bdirty[i]; + if (_vm->_features & GF_AFTER_V7 && (_vm->camera._cur.y != _vm->camera._last.y)) + drawStripToScreen(vs, 0, NUM_STRIPS << 3, 0, vs->height); + else { + int i; + int start, w, top, bottom; + + w = 8; + start = 0; - if (_vm->_features & GF_AFTER_V7 && (_vm->camera._cur.y != _vm->camera._last.y)) - drawStripToScreen(vs, start, w, 0, vs->height); - else if (bottom) { - top = vs->tdirty[i]; - vs->tdirty[i] = (byte)vs->height; - vs->bdirty[i] = 0; - if (i != (NUM_STRIPS-1) && vs->bdirty[i + 1] == (byte)bottom && vs->tdirty[i + 1] == (byte)top) { - w += 8; - continue; + for (i = 0; i < NUM_STRIPS; i++) { + bottom = vs->bdirty[i]; + + if (bottom) { + top = vs->tdirty[i]; + vs->tdirty[i] = (byte)vs->height; + vs->bdirty[i] = 0; + if (i != (NUM_STRIPS-1) && vs->bdirty[i + 1] == (byte)bottom && vs->tdirty[i + 1] == (byte)top) { + w += 8; + continue; + } + if (_vm->_features & GF_AFTER_V7) + drawStripToScreen(vs, start, w, 0, vs->height); + else + drawStripToScreen(vs, start, w, top, bottom); + w = 8; } - if (_vm->_features & GF_AFTER_V7) - drawStripToScreen(vs, start, w, 0, vs->height); - else - drawStripToScreen(vs, start, w, top, bottom); - w = 8; + start = i + 1; } - start = i + 1; } } diff --git a/scumm/gfx.h b/scumm/gfx.h index b1f605d193..25b9a206c9 100644 --- a/scumm/gfx.h +++ b/scumm/gfx.h @@ -58,7 +58,7 @@ struct VirtScreen { /* Virtual screen areas */ uint16 width, height; uint16 size; byte alloctwobuffers; - byte scrollable; + bool scrollable; uint16 xstart; uint16 tdirty[40]; uint16 bdirty[40]; diff --git a/scumm/scumm.h b/scumm/scumm.h index 85ae545d80..7464fecf56 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -774,7 +774,7 @@ public: void getGraphicsPerformance(); void initScreens(int a, int b, int w, int h); - void initVirtScreen(int slot, int number, int top, int width, int height, bool twobufs, bool fourextra); + void initVirtScreen(int slot, int number, int top, int width, int height, bool twobufs, bool scrollable); void initBGBuffers(int height); void initCycl(byte *ptr); // Color cycle |