aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sherlock/inventory.cpp19
-rw-r--r--engines/sherlock/inventory.h1
-rw-r--r--engines/sherlock/objects.cpp2
-rw-r--r--engines/sherlock/scalpel/scalpel.cpp18
-rw-r--r--engines/sherlock/scene.cpp38
-rw-r--r--engines/sherlock/screen.cpp19
-rw-r--r--engines/sherlock/screen.h3
-rw-r--r--engines/sherlock/user_interface.cpp34
8 files changed, 77 insertions, 57 deletions
diff --git a/engines/sherlock/inventory.cpp b/engines/sherlock/inventory.cpp
index 75ee364123..8eb7ecc1a1 100644
--- a/engines/sherlock/inventory.cpp
+++ b/engines/sherlock/inventory.cpp
@@ -30,6 +30,7 @@ Inventory::Inventory(SherlockEngine *vm) : Common::Array<InventoryItem>(), _vm(v
_invGraphicsLoaded = false;
_invIndex = 0;
_holdings = 0;
+ _oldFlag = 0;
}
Inventory::~Inventory() {
@@ -120,8 +121,24 @@ void Inventory::putInv(int slamit) {
// TODO
}
+/**
+ * Put the game into inventory mode and open the interface window.
+ * The flag parameter specifies the mode:
+ * 0 = plain inventory mode
+ * 2 = use inventory mode
+ * 3 = give inventory mode
+ * 128 = Draw window in the back buffer, but don't display it
+ */
void Inventory::invent(int flag) {
- // TODO
+ Screen &screen = *_vm->_screen;
+ _oldFlag = 7;
+ loadInv();
+
+ if (flag == 128) {
+ screen._backBuffer = &screen._backBuffer2;
+ }
+
+
}
void Inventory::invCommands(bool slamIt) {
diff --git a/engines/sherlock/inventory.h b/engines/sherlock/inventory.h
index 0fa8eb0824..1db91292a5 100644
--- a/engines/sherlock/inventory.h
+++ b/engines/sherlock/inventory.h
@@ -50,6 +50,7 @@ public:
int _invIndex;
int _holdings;
void freeGraphics();
+ int _oldFlag;
public:
Inventory(SherlockEngine *vm);
~Inventory();
diff --git a/engines/sherlock/objects.cpp b/engines/sherlock/objects.cpp
index 39a9cf8014..d5d24e72af 100644
--- a/engines/sherlock/objects.cpp
+++ b/engines/sherlock/objects.cpp
@@ -656,7 +656,7 @@ bool Object::checkEndOfSequence() {
if (seq == 99) {
--_frameNumber;
- screen._backBuffer.transBlitFrom(_imageFrame->_frame, _position);
+ screen._backBuffer1.transBlitFrom(_imageFrame->_frame, _position);
screen._backBuffer2.transBlitFrom(_imageFrame->_frame, _position);
_type = INVALID;
} else {
diff --git a/engines/sherlock/scalpel/scalpel.cpp b/engines/sherlock/scalpel/scalpel.cpp
index 3ec971895a..db59434f85 100644
--- a/engines/sherlock/scalpel/scalpel.cpp
+++ b/engines/sherlock/scalpel/scalpel.cpp
@@ -99,23 +99,23 @@ bool ScalpelEngine::showCityCutscene() {
if (finished) {
ImageFile titleImages("title2.vgs", true);
- _screen->_backBuffer.blitFrom(*_screen);
+ _screen->_backBuffer1.blitFrom(*_screen);
_screen->_backBuffer2.blitFrom(*_screen);
// London, England
- _screen->_backBuffer.transBlitFrom(titleImages[0], Common::Point(10, 11));
+ _screen->_backBuffer1.transBlitFrom(titleImages[0], Common::Point(10, 11));
_screen->randomTransition();
finished = _events->delay(1000, true);
// November, 1888
if (finished) {
- _screen->_backBuffer.transBlitFrom(titleImages[1], Common::Point(101, 102));
+ _screen->_backBuffer1.transBlitFrom(titleImages[1], Common::Point(101, 102));
_screen->randomTransition();
finished = _events->delay(5000, true);
}
// Transition out the title
- _screen->_backBuffer.blitFrom(_screen->_backBuffer2);
+ _screen->_backBuffer1.blitFrom(_screen->_backBuffer2);
_screen->randomTransition();
}
@@ -124,21 +124,21 @@ bool ScalpelEngine::showCityCutscene() {
if (finished) {
ImageFile titleImages("title.vgs", true);
- _screen->_backBuffer.blitFrom(*_screen);
+ _screen->_backBuffer1.blitFrom(*_screen);
_screen->_backBuffer2.blitFrom(*_screen);
// The Lost Files of
- _screen->_backBuffer.transBlitFrom(titleImages[0], Common::Point(75, 6));
+ _screen->_backBuffer1.transBlitFrom(titleImages[0], Common::Point(75, 6));
// Sherlock Holmes
- _screen->_backBuffer.transBlitFrom(titleImages[1], Common::Point(34, 21));
+ _screen->_backBuffer1.transBlitFrom(titleImages[1], Common::Point(34, 21));
// copyright
- _screen->_backBuffer.transBlitFrom(titleImages[2], Common::Point(4, 190));
+ _screen->_backBuffer1.transBlitFrom(titleImages[2], Common::Point(4, 190));
_screen->verticalTransition();
finished = _events->delay(4000, true);
if (finished) {
- _screen->_backBuffer.blitFrom(_screen->_backBuffer2);
+ _screen->_backBuffer1.blitFrom(_screen->_backBuffer2);
_screen->randomTransition();
finished = _events->delay(2000);
}
diff --git a/engines/sherlock/scene.cpp b/engines/sherlock/scene.cpp
index 97f7350ea9..c3afc4a0d4 100644
--- a/engines/sherlock/scene.cpp
+++ b/engines/sherlock/scene.cpp
@@ -378,13 +378,13 @@ bool Scene::loadScene(const Common::String &filename) {
Common::SeekableReadStream *bgStream = !_lzwMode ? rrmStream :
decompressLZ(*rrmStream, SHERLOCK_SCREEN_WIDTH * SHERLOCK_SCENE_HEIGHT);
- bgStream->read(screen._backBuffer.getPixels(), SHERLOCK_SCREEN_WIDTH * SHERLOCK_SCENE_HEIGHT);
+ bgStream->read(screen._backBuffer1.getPixels(), SHERLOCK_SCREEN_WIDTH * SHERLOCK_SCENE_HEIGHT);
if (_lzwMode)
delete bgStream;
- // Set the palette
- screen._backBuffer2.blitFrom(screen._backBuffer);
+ // Backup the image and set the palette
+ screen._backBuffer2.blitFrom(screen._backBuffer1);
screen.setPalette(screen._cMap);
delete rrmStream;
@@ -658,7 +658,7 @@ void Scene::transitionToScene() {
if (screen._fadeStyle)
screen.randomTransition();
else
- screen.blitFrom(screen._backBuffer);
+ screen.blitFrom(screen._backBuffer1);
if (cAnimNum != -1) {
CAnim &c = _cAnim[cAnimNum];
@@ -696,7 +696,7 @@ int Scene::toggleObject(const Common::String &name) {
void Scene::updateBackground() {
People &people = *_vm->_people;
Screen &screen = *_vm->_screen;
- Surface surface = screen._backBuffer.getSubArea(
+ Surface surface = screen._backBuffer1.getSubArea(
Common::Rect(0, 0, SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCENE_HEIGHT));
Sprite &player = people[AL];
@@ -1055,7 +1055,7 @@ void Scene::doBgAnim() {
Sound &sound = *_vm->_sound;
Talk &talk = *_vm->_talk;
UserInterface &ui = *_vm->_ui;
- Surface surface = screen._backBuffer.getSubArea(Common::Rect(0, 0,
+ Surface surface = screen._backBuffer1.getSubArea(Common::Rect(0, 0,
SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCENE_HEIGHT));
int cursorId = events.getCursor();
Common::Point mousePos = events.mousePos();
@@ -1126,7 +1126,7 @@ void Scene::doBgAnim() {
if (people[AL]._type == CHARACTER)
screen.restoreBackground(bounds);
else if (people[AL]._type == REMOVE)
- screen._backBuffer.blitFrom(screen._backBuffer2, pt, bounds);
+ screen._backBuffer1.blitFrom(screen._backBuffer2, pt, bounds);
for (uint idx = 0; idx < _bgShapes.size(); ++idx) {
Object &o = _bgShapes[idx];
@@ -1145,7 +1145,7 @@ void Scene::doBgAnim() {
Object &o = _bgShapes[idx];
if (o._type == NO_SHAPE && ((o._flags & 1) == 0)) {
// Restore screen area
- screen._backBuffer.blitFrom(screen._backBuffer2, o._position,
+ screen._backBuffer1.blitFrom(screen._backBuffer2, o._position,
Common::Rect(o._position.x, o._position.y,
o._position.x + o._noShapeSize.x, o._position.y + o._noShapeSize.y));
@@ -1191,14 +1191,14 @@ void Scene::doBgAnim() {
for (uint idx = 0; idx < _bgShapes.size(); ++idx) {
Object &o = _bgShapes[idx];
if (o._type == ACTIVE_BG_SHAPE && o._misc == BEHIND)
- screen._backBuffer.transBlitFrom(o._imageFrame->_frame, o._position, o._flags & 2);
+ screen._backBuffer1.transBlitFrom(o._imageFrame->_frame, o._position, o._flags & 2);
}
// Draw all canimations which are behind the person
for (uint idx = 0; idx < _canimShapes.size(); ++idx) {
Object &o = _canimShapes[idx];
if (o._type == ACTIVE_BG_SHAPE && o._misc == BEHIND) {
- screen._backBuffer.transBlitFrom(o._imageFrame->_frame, o._position, o._flags & 2);
+ screen._backBuffer1.transBlitFrom(o._imageFrame->_frame, o._position, o._flags & 2);
}
}
@@ -1206,14 +1206,14 @@ void Scene::doBgAnim() {
for (uint idx = 0; idx < _bgShapes.size(); ++idx) {
Object &o = _bgShapes[idx];
if (o._type == ACTIVE_BG_SHAPE && o._misc == NORMAL_BEHIND)
- screen._backBuffer.transBlitFrom(o._imageFrame->_frame, o._position, o._flags & 2);
+ screen._backBuffer1.transBlitFrom(o._imageFrame->_frame, o._position, o._flags & 2);
}
// Draw all canimations which are NORMAL and behind the person
for (uint idx = 0; idx < _canimShapes.size(); ++idx) {
Object &o = _canimShapes[idx];
if (o._type == ACTIVE_BG_SHAPE && o._misc == NORMAL_BEHIND) {
- screen._backBuffer.transBlitFrom(o._imageFrame->_frame, o._position, o._flags & 2);
+ screen._backBuffer1.transBlitFrom(o._imageFrame->_frame, o._position, o._flags & 2);
}
}
@@ -1226,7 +1226,7 @@ void Scene::doBgAnim() {
bool flipped = people[AL]._frameNumber == WALK_LEFT || people[AL]._frameNumber == STOP_LEFT ||
people[AL]._frameNumber == WALK_UPLEFT || people[AL]._frameNumber == STOP_UPLEFT ||
people[AL]._frameNumber == WALK_DOWNRIGHT || people[AL]._frameNumber == STOP_DOWNRIGHT;
- screen._backBuffer.transBlitFrom(people[AL]._imageFrame->_frame,
+ screen._backBuffer1.transBlitFrom(people[AL]._imageFrame->_frame,
Common::Point(tempX, people[AL]._position.y / 100 - people[AL]._imageFrame->_frame.h), flipped);
}
@@ -1234,14 +1234,14 @@ void Scene::doBgAnim() {
for (uint idx = 0; idx < _bgShapes.size(); ++idx) {
Object &o = _bgShapes[idx];
if ((o._type == ACTIVE_BG_SHAPE || o._type == STATIC_BG_SHAPE) && o._misc == NORMAL_FORWARD)
- screen._backBuffer.transBlitFrom(o._imageFrame->_frame, o._position, o._flags & 2);
+ screen._backBuffer1.transBlitFrom(o._imageFrame->_frame, o._position, o._flags & 2);
}
// Draw all static and active canimations that are NORMAL and are in front of the person
for (uint idx = 0; idx < _canimShapes.size(); ++idx) {
Object &o = _canimShapes[idx];
if ((o._type == ACTIVE_BG_SHAPE || o._type == STATIC_BG_SHAPE) && o._misc == NORMAL_BEHIND) {
- screen._backBuffer.transBlitFrom(o._imageFrame->_frame, o._position, o._flags & 2);
+ screen._backBuffer1.transBlitFrom(o._imageFrame->_frame, o._position, o._flags & 2);
}
}
@@ -1249,19 +1249,19 @@ void Scene::doBgAnim() {
for (uint idx = 0; idx < _bgShapes.size(); ++idx) {
Object &o = _bgShapes[idx];
if ((o._type == ACTIVE_BG_SHAPE || o._type == STATIC_BG_SHAPE) && o._misc == FORWARD)
- screen._backBuffer.transBlitFrom(o._imageFrame->_frame, o._position, o._flags & 2);
+ screen._backBuffer1.transBlitFrom(o._imageFrame->_frame, o._position, o._flags & 2);
}
// Draw any active portrait
if (people._portraitLoaded && people._portrait._type == ACTIVE_BG_SHAPE)
- screen._backBuffer.transBlitFrom(people._portrait._imageFrame->_frame,
+ screen._backBuffer1.transBlitFrom(people._portrait._imageFrame->_frame,
people._portrait._position, people._portrait._flags & 2);
// Draw all static and active canimations that are in front of the person
for (uint idx = 0; idx < _canimShapes.size(); ++idx) {
Object &o = _canimShapes[idx];
if ((o._type == ACTIVE_BG_SHAPE || o._type == STATIC_BG_SHAPE) && o._misc == FORWARD) {
- screen._backBuffer.transBlitFrom(o._imageFrame->_frame, o._position, o._flags & 2);
+ screen._backBuffer1.transBlitFrom(o._imageFrame->_frame, o._position, o._flags & 2);
}
}
@@ -1269,7 +1269,7 @@ void Scene::doBgAnim() {
for (uint idx = 0; idx < _bgShapes.size(); ++idx) {
Object &o = _bgShapes[idx];
if (o._type == NO_SHAPE && (o._flags & 1) == 0)
- screen._backBuffer.transBlitFrom(o._imageFrame->_frame, o._position, o._flags & 2);
+ screen._backBuffer1.transBlitFrom(o._imageFrame->_frame, o._position, o._flags & 2);
}
// Bring the newly built picture to the screen
diff --git a/engines/sherlock/screen.cpp b/engines/sherlock/screen.cpp
index def20612b7..f1562e2468 100644
--- a/engines/sherlock/screen.cpp
+++ b/engines/sherlock/screen.cpp
@@ -29,8 +29,9 @@
namespace Sherlock {
Screen::Screen(SherlockEngine *vm) : Surface(SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCREEN_HEIGHT), _vm(vm),
- _backBuffer(SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCREEN_HEIGHT),
- _backBuffer2(SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCREEN_HEIGHT) {
+ _backBuffer1(SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCREEN_HEIGHT),
+ _backBuffer2(SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCREEN_HEIGHT),
+ _backBuffer(&_backBuffer1) {
_transitionSeed = 1;
_fadeStyle = false;
_font = nullptr;
@@ -201,7 +202,7 @@ void Screen::randomTransition() {
int offset = _transitionSeed & 65535;
if (offset < (SHERLOCK_SCREEN_WIDTH * SHERLOCK_SCREEN_HEIGHT))
- *((byte *)getPixels() + offset) = *((const byte *)_backBuffer.getPixels() + offset);
+ *((byte *)getPixels() + offset) = *((const byte *)_backBuffer->getPixels() + offset);
if (idx != 0 && (idx % 100) == 0) {
// Ensure there's a full screen dirty rect for the next frame update
@@ -214,7 +215,7 @@ void Screen::randomTransition() {
}
// Make sure everything has been transferred
- blitFrom(_backBuffer);
+ blitFrom(_backBuffer1);
}
/**
@@ -232,7 +233,7 @@ void Screen::verticalTransition() {
_vm->getRandomNumber(3) + 1;
if (temp) {
- blitFrom(_backBuffer, Common::Point(xp, table[xp]),
+ blitFrom(_backBuffer1, Common::Point(xp, table[xp]),
Common::Rect(xp, table[xp], xp + 1, table[xp] + temp));
table[xp] += temp;
}
@@ -251,7 +252,7 @@ void Screen::restoreBackground(const Common::Rect &r) {
tempRect.clip(Common::Rect(0, 0, SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCENE_HEIGHT));
if (tempRect.isValidRect())
- _backBuffer.blitFrom(_backBuffer2, Common::Point(tempRect.left, tempRect.top), tempRect);
+ _backBuffer1.blitFrom(_backBuffer2, Common::Point(tempRect.left, tempRect.top), tempRect);
}
}
@@ -271,7 +272,7 @@ void Screen::slamRect(const Common::Rect &r) {
tempRect.clip(Common::Rect(0, 0, SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCREEN_HEIGHT));
if (tempRect.isValidRect())
- blitFrom(_backBuffer, Common::Point(tempRect.left, tempRect.top), tempRect);
+ blitFrom(*_backBuffer, Common::Point(tempRect.left, tempRect.top), tempRect);
}
}
@@ -394,7 +395,7 @@ void Screen::writeString(const Common::String &str, const Common::Point &pt, int
else {
assert(*c > ' ' && *c <= '~');
ImageFrame &frame = (*_font)[*c - 33];
- _backBuffer.transBlitFrom(frame, charPos, false, color);
+ _backBuffer->transBlitFrom(frame, charPos, false, color);
charPos.x += frame._frame.w + 1;
}
}
@@ -404,7 +405,7 @@ void Screen::writeString(const Common::String &str, const Common::Point &pt, int
* Fills an area on the back buffer, and then copies it to the screen
*/
void Screen::vgaBar(const Common::Rect &r, int color) {
- _backBuffer.fillRect(r, color);
+ _backBuffer->fillRect(r, color);
slamRect(r);
}
diff --git a/engines/sherlock/screen.h b/engines/sherlock/screen.h
index 3ac40263c0..7d07cfa062 100644
--- a/engines/sherlock/screen.h
+++ b/engines/sherlock/screen.h
@@ -69,7 +69,8 @@ private:
protected:
virtual void addDirtyRect(const Common::Rect &r);
public:
- Surface _backBuffer, _backBuffer2;
+ Surface _backBuffer1, _backBuffer2;
+ Surface *_backBuffer;
bool _fadeStyle;
byte _cMap[PALETTE_SIZE];
byte _sMap[PALETTE_SIZE];
diff --git a/engines/sherlock/user_interface.cpp b/engines/sherlock/user_interface.cpp
index 9710c3a74a..dbc9108212 100644
--- a/engines/sherlock/user_interface.cpp
+++ b/engines/sherlock/user_interface.cpp
@@ -105,7 +105,7 @@ void UserInterface::drawInterface() {
Screen &screen = *_vm->_screen;
screen._backBuffer2.fillRect(0, INFO_LINE, SHERLOCK_SCREEN_WIDTH, INFO_LINE + 10, INFO_BLACK);
- screen._backBuffer.transBlitFrom((*_controlPanel)[0], Common::Point(0, CONTROLS_Y));
+ screen._backBuffer1.transBlitFrom((*_controlPanel)[0], Common::Point(0, CONTROLS_Y));
screen._backBuffer2.transBlitFrom((*_controlPanel)[0], Common::Point(0, CONTROLS_Y));
}
@@ -376,7 +376,7 @@ void UserInterface::depressButton(int num) {
Common::Point pt(MENU_POINTS[num][0], MENU_POINTS[num][1]);
Graphics::Surface &s = (*_controls)[num]._frame;
- screen._backBuffer.transBlitFrom(s, pt);
+ screen._backBuffer1.transBlitFrom(s, pt);
screen.slamArea(pt.x, pt.y, pt.x + s.w, pt.y + s.h);
}
@@ -389,7 +389,7 @@ void UserInterface::restoreButton(int num) {
Common::Point pt(MENU_POINTS[num][0], MENU_POINTS[num][1]);
Graphics::Surface &frame = (*_controls)[num]._frame;
- screen._backBuffer.blitFrom(screen._backBuffer2, pt,
+ screen._backBuffer1.blitFrom(screen._backBuffer2, pt,
Common::Rect(pt.x, pt.y, pt.x + 90, pt.y + 19));
screen.slamArea(pt.x, pt.y, pt.x + frame.w, pt.y + frame.h);
@@ -443,7 +443,7 @@ void UserInterface::toggleButton(int num) {
Graphics::Surface &s = (*_controls)[num]._frame;
Common::Point pt(MENU_POINTS[num][0], MENU_POINTS[num][1]);
- screen._backBuffer.transBlitFrom(s, pt);
+ screen._backBuffer1.transBlitFrom(s, pt);
screen.slamArea(pt.x, pt.y, pt.x + s.w, pt.y + s.h);
}
} else {
@@ -1199,7 +1199,7 @@ void UserInterface::printObjectDesc(const Common::String &str, bool firstTime) {
return;
}
- Surface &bb = screen._backBuffer;
+ Surface &bb = *screen._backBuffer;
if (firstTime) {
// Only draw the border on the first call
_infoFlag = true;
@@ -1286,10 +1286,10 @@ void UserInterface::printObjectDesc(const Common::String &str, bool firstTime) {
Surface tempSurface(SHERLOCK_SCREEN_WIDTH,
(SHERLOCK_SCREEN_HEIGHT - CONTROLS_Y));
Common::Rect r(0, CONTROLS_Y, SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCREEN_HEIGHT);
- tempSurface.blitFrom(screen._backBuffer, Common::Point(0, 0), r);
+ tempSurface.blitFrom(screen._backBuffer1, Common::Point(0, 0), r);
// Remove drawn window with original user interface
- screen._backBuffer.blitFrom(screen._backBuffer2,
+ screen._backBuffer1.blitFrom(screen._backBuffer2,
Common::Point(0, CONTROLS_Y), r);
// Display the window gradually on-screen
@@ -1318,7 +1318,7 @@ void UserInterface::makeButton(const Common::Rect &bounds, int textX,
const Common::String &str) {
Screen &screen = *_vm->_screen;
- Surface &bb = screen._backBuffer;
+ Surface &bb = *screen._backBuffer;
bb.fillRect(Common::Rect(bounds.left, bounds.top, bounds.right, bounds.top + 1), BUTTON_TOP);
bb.fillRect(Common::Rect(bounds.left, bounds.top, bounds.left + 1, bounds.bottom), BUTTON_TOP);
bb.fillRect(Common::Rect(bounds.right - 1, bounds.top, bounds.right, bounds.bottom), BUTTON_BOTTOM);
@@ -1343,7 +1343,7 @@ void UserInterface::summonWindow(const Surface &bgSurface) {
// Gradually slide up the display of the window
for (int idx = 1; idx <= bgSurface.h; idx += 2) {
- screen._backBuffer.blitFrom(bgSurface, Common::Point(0, SHERLOCK_SCREEN_HEIGHT - idx),
+ screen._backBuffer->blitFrom(bgSurface, Common::Point(0, SHERLOCK_SCREEN_HEIGHT - idx),
Common::Rect(0, 0, bgSurface.w, idx));
screen.slamRect(Common::Rect(0, SHERLOCK_SCREEN_HEIGHT - idx,
SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCREEN_HEIGHT));
@@ -1352,7 +1352,7 @@ void UserInterface::summonWindow(const Surface &bgSurface) {
}
// Final display of the entire window
- screen._backBuffer.blitFrom(bgSurface, Common::Point(0, CONTROLS_Y),
+ screen._backBuffer->blitFrom(bgSurface, Common::Point(0, CONTROLS_Y),
Common::Rect(0, 0, bgSurface.w, bgSurface.h));
screen.slamArea(0, CONTROLS_Y, bgSurface.w, bgSurface.h);
@@ -1374,13 +1374,13 @@ void UserInterface::banishWindow(bool flag) {
if (_windowStyle) {
for (int idx = 2; idx < (SHERLOCK_SCREEN_HEIGHT - CONTROLS_Y); idx += 2) {
// Shift the window down by 2 lines
- byte *pSrc = (byte *)screen._backBuffer.getBasePtr(0, CONTROLS_Y + idx - 2);
- byte *pSrcEnd = (byte *)screen._backBuffer.getBasePtr(0, SHERLOCK_SCREEN_HEIGHT - 2);
- byte *pDest = (byte *)screen._backBuffer.getBasePtr(0, SHERLOCK_SCREEN_HEIGHT);
+ byte *pSrc = (byte *)screen._backBuffer1.getBasePtr(0, CONTROLS_Y + idx - 2);
+ byte *pSrcEnd = (byte *)screen._backBuffer1.getBasePtr(0, SHERLOCK_SCREEN_HEIGHT - 2);
+ byte *pDest = (byte *)screen._backBuffer1.getBasePtr(0, SHERLOCK_SCREEN_HEIGHT);
Common::copy_backward(pSrc, pSrcEnd, pDest);
// Restore lines from the ui in the secondary back buffer
- screen._backBuffer.blitFrom(screen._backBuffer2,
+ screen._backBuffer1.blitFrom(screen._backBuffer2,
Common::Point(0, CONTROLS_Y),
Common::Rect(0, CONTROLS_Y, SHERLOCK_SCREEN_WIDTH, CONTROLS_Y + idx));
@@ -1390,14 +1390,14 @@ void UserInterface::banishWindow(bool flag) {
}
// Restore final two old lines
- screen._backBuffer.blitFrom(screen._backBuffer2,
+ screen._backBuffer1.blitFrom(screen._backBuffer2,
Common::Point(0, SHERLOCK_SCREEN_HEIGHT - 2),
Common::Rect(0, SHERLOCK_SCREEN_HEIGHT - 2,
SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCREEN_HEIGHT));
screen.slamArea(0, SHERLOCK_SCREEN_HEIGHT - 2, SHERLOCK_SCREEN_WIDTH, 2);
} else {
// Restore old area to completely erase window
- screen._backBuffer.blitFrom(screen._backBuffer2,
+ screen._backBuffer1.blitFrom(screen._backBuffer2,
Common::Point(0, CONTROLS_Y),
Common::Rect(0, CONTROLS_Y, SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCREEN_HEIGHT));
screen.slamRect(Common::Rect(0, CONTROLS_Y, SHERLOCK_SCREEN_WIDTH,
@@ -1408,7 +1408,7 @@ void UserInterface::banishWindow(bool flag) {
for (int idx = 1; idx < (SHERLOCK_SCREEN_HEIGHT - CONTROLS_Y1); idx += 2) {
byte *pSrc = (byte *)screen._backBuffer2.getBasePtr(0, CONTROLS_Y1);
byte *pSrcEnd = (byte *)screen._backBuffer2.getBasePtr(0, CONTROLS_Y1 + idx);
- byte *pDest = (byte *)screen._backBuffer.getBasePtr(0, SHERLOCK_SCREEN_HEIGHT - idx);
+ byte *pDest = (byte *)screen._backBuffer1.getBasePtr(0, SHERLOCK_SCREEN_HEIGHT - idx);
Common::copy(pSrc, pSrcEnd, pDest);
screen.slamArea(0, SHERLOCK_SCREEN_HEIGHT - idx, SHERLOCK_SCREEN_WIDTH,