aboutsummaryrefslogtreecommitdiff
path: root/engines/lab/engine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/lab/engine.cpp')
-rw-r--r--engines/lab/engine.cpp369
1 files changed, 153 insertions, 216 deletions
diff --git a/engines/lab/engine.cpp b/engines/lab/engine.cpp
index 95dcc71923..6ba405380e 100644
--- a/engines/lab/engine.cpp
+++ b/engines/lab/engine.cpp
@@ -28,12 +28,16 @@
*
*/
-#include "lab/lab.h"
+#include "common/config-manager.h"
+
+#include "gui/message.h"
+#include "lab/lab.h"
#include "lab/anim.h"
#include "lab/dispman.h"
#include "lab/eventman.h"
#include "lab/image.h"
+#include "lab/interface.h"
#include "lab/intro.h"
#include "lab/labsets.h"
#include "lab/music.h"
@@ -44,9 +48,6 @@
namespace Lab {
-#define CRUMBSWIDTH 24
-#define CRUMBSHEIGHT 24
-
enum SpecialLock {
kLockCombination = 100,
kLockTiles = 101,
@@ -99,6 +100,40 @@ static char initColors[] = { '\x00', '\x00', '\x00', '\x30',
'\x24', '\x24', '\x2c', '\x2c',
'\x2c', '\x08', '\x08', '\x08' };
+void LabEngine::handleTrialWarning() {
+ // Check if this is the Wyrmkeep trial
+ Common::File roomFile;
+ bool knownVersion = true;
+ bool roomFileOpened = roomFile.open("rooms/48");
+
+ if (!roomFileOpened)
+ knownVersion = false;
+ else if (roomFile.size() != 892)
+ knownVersion = false;
+ else {
+ roomFile.seek(352);
+ byte checkByte = roomFile.readByte();
+ if (checkByte == 0x00) {
+ // Full Windows version
+ }
+ else if (checkByte == 0x80) {
+ // Wyrmkeep trial version
+ _extraGameFeatures = GF_WINDOWS_TRIAL;
+
+ GUI::MessageDialog trialMessage("This is a trial Windows version of the game. To play the full version, you will need to use the original interpreter and purchase a key from Wyrmkeep");
+ trialMessage.runModal();
+ }
+ else {
+ knownVersion = false;
+ }
+
+ roomFile.close();
+ }
+
+ if (!knownVersion)
+ error("Unknown Windows version found, please report this version to the ScummVM team");
+}
+
uint16 LabEngine::getQuarters() {
return _inventory[kItemQuarter]._quantity;
}
@@ -140,21 +175,28 @@ void LabEngine::freeScreens() {
delete _invImages[imgIdx];
_invImages[imgIdx] = nullptr;
}
+
+ // We can't use freeButtonList() here, because some buttons are shared
+ // between the two lists.
+ for (ButtonList::iterator buttonIter = _moveButtonList.begin(); buttonIter != _moveButtonList.end(); ++buttonIter) {
+ delete *buttonIter;
+ }
+ _moveButtonList.clear();
+
+ for (ButtonList::iterator buttonIter = _invButtonList.begin(); buttonIter != _invButtonList.end(); ++buttonIter) {
+ delete *buttonIter;
+ }
+ _invButtonList.clear();
}
void LabEngine::perFlipButton(uint16 buttonId) {
for (ButtonList::iterator button = _moveButtonList.begin(); button != _moveButtonList.end(); ++button) {
Button *topButton = *button;
if (topButton->_buttonId == buttonId) {
- Image *tmpImage = topButton->_image;
- topButton->_image = topButton->_altImage;
- topButton->_altImage = tmpImage;
+ SWAP<Image *>(topButton->_image, topButton->_altImage);
- if (!_alternate) {
- _event->mouseHide();
+ if (!_alternate)
topButton->_image->drawImage(topButton->_x, topButton->_y);
- _event->mouseShow();
- }
break;
}
@@ -169,68 +211,51 @@ void LabEngine::eatMessages() {
} while (msg && !shouldQuit());
}
-bool LabEngine::doCloseUp(const CloseData *closePtr) {
- if (!closePtr)
- return false;
-
- int luteRight;
- Common::Rect textRect;
+void LabEngine::handleMonitorCloseup() {
+ if (!_closeDataPtr)
+ return;
- if (getPlatform() != Common::kPlatformWindows) {
- textRect.left = 0;
- textRect.right = 319;
- textRect.top = 0;
- textRect.bottom = 165;
- luteRight = 124;
- } else {
- textRect.left = 2;
- textRect.right = 317;
- textRect.top = 2;
- textRect.bottom = 165;
- luteRight = 128;
- }
+ Common::Rect textRect(2, 2, 317, 165);
+ bool isInteractive = false;
- switch (closePtr->_closeUpType) {
+ switch (_closeDataPtr->_closeUpType) {
case kMonitorMuseum:
case kMonitorLibrary:
case kMonitorWindow:
- doMonitor(closePtr->_graphicName, closePtr->_message, false, textRect);
break;
case kMonitorGramophone:
textRect.right = 171;
- doMonitor(closePtr->_graphicName, closePtr->_message, false, textRect);
break;
case kMonitorUnicycle:
textRect.left = 100;
- doMonitor(closePtr->_graphicName, closePtr->_message, false, textRect);
break;
case kMonitorStatue:
textRect.left = 117;
- doMonitor(closePtr->_graphicName, closePtr->_message, false, textRect);
break;
case kMonitorTalisman:
textRect.right = 184;
- doMonitor(closePtr->_graphicName, closePtr->_message, false, textRect);
break;
case kMonitorLute:
- textRect.right = luteRight;
- doMonitor(closePtr->_graphicName, closePtr->_message, false, textRect);
+ textRect.right = 128;
break;
case kMonitorClock:
textRect.right = 206;
- doMonitor(closePtr->_graphicName, closePtr->_message, false, textRect);
break;
case kMonitorTerminal:
- doMonitor(closePtr->_graphicName, closePtr->_message, true, textRect);
+ isInteractive = true;
break;
default:
- return false;
+ return;
}
+ doMonitor(_closeDataPtr->_graphicName, _closeDataPtr->_message, isInteractive, textRect);
+
_curFileName = " ";
_graphics->drawPanel();
- return true;
+ _closeDataPtr = nullptr;
+ _interface->mayShowCrumbIndicator();
+ _graphics->screenUpdate();
}
Common::String LabEngine::getInvName(uint16 curInv) {
@@ -241,7 +266,7 @@ Common::String LabEngine::getInvName(uint16 curInv) {
return "P:Mines/120";
if ((curInv == kItemBelt) && _conditions->in(kCondBeltGlowing))
- return "P:Future/kCondBeltGlowing";
+ return "P:Future/BeltGlow";
if (curInv == kItemWestPaper) {
_curFileName = _inventory[curInv]._bitmapName;
@@ -261,25 +286,19 @@ Common::String LabEngine::getInvName(uint16 curInv) {
}
void LabEngine::interfaceOff() {
- if (!_interfaceOff) {
- _event->attachButtonList(nullptr);
- _event->mouseHide();
- _interfaceOff = true;
- }
+ _interface->attachButtonList(nullptr);
+ _event->mouseHide();
}
void LabEngine::interfaceOn() {
- if (_interfaceOff) {
- _interfaceOff = false;
- _event->mouseShow();
- }
-
if (_graphics->_longWinInFront)
- _event->attachButtonList(nullptr);
+ _interface->attachButtonList(nullptr);
else if (_alternate)
- _event->attachButtonList(&_invButtonList);
+ _interface->attachButtonList(&_invButtonList);
else
- _event->attachButtonList(&_moveButtonList);
+ _interface->attachButtonList(&_moveButtonList);
+
+ _event->mouseShow();
}
bool LabEngine::doUse(uint16 curInv) {
@@ -290,7 +309,7 @@ bool LabEngine::doUse(uint16 curInv) {
_anim->stopDiff();
_curFileName = " ";
_closeDataPtr = nullptr;
- doMap(_roomNum);
+ doMap();
_graphics->setPalette(initColors, 8);
_graphics->drawMessage("", false);
_graphics->drawPanel();
@@ -378,12 +397,6 @@ void LabEngine::decIncInv(uint16 *curInv, bool decreaseFl) {
}
void LabEngine::mainGameLoop() {
- uint16 actionMode = 4;
- uint16 curInv = kItemMap;
-
- bool forceDraw = false;
- bool gotMessage = true;
-
_graphics->setPalette(initColors, 8);
_closeDataPtr = nullptr;
@@ -405,8 +418,20 @@ void LabEngine::mainGameLoop() {
_graphics->_longWinInFront = false;
_graphics->drawPanel();
+ uint16 actionMode = 4;
perFlipButton(actionMode);
+ // Load saved slot from the launcher, if requested
+ if (ConfMan.hasKey("save_slot")) {
+ loadGame(ConfMan.getInt("save_slot"));
+
+ // Since the intro hasn't been shown, init the background music here
+ _music->resetMusic(false);
+ }
+
+ uint16 curInv = kItemMap;
+ bool forceDraw = false;
+ bool gotMessage = true;
// Set up initial picture.
while (1) {
_event->processInput();
@@ -418,14 +443,7 @@ void LabEngine::mainGameLoop() {
break;
}
- _music->resumeBackMusic();
-
- // Sees what kind of close up we're in and does the appropriate stuff, if any.
- if (doCloseUp(_closeDataPtr)) {
- _closeDataPtr = nullptr;
- mayShowCrumbIndicator();
- _graphics->screenUpdate();
- }
+ handleMonitorCloseup();
// Sets the current picture properly on the screen
if (_mainDisplay)
@@ -463,7 +481,7 @@ void LabEngine::mainGameLoop() {
drawRoomMessage(curInv, _closeDataPtr);
forceDraw = false;
- mayShowCrumbIndicator();
+ _interface->mayShowCrumbIndicator();
_graphics->screenUpdate();
if (!_followingCrumbs)
@@ -478,7 +496,7 @@ void LabEngine::mainGameLoop() {
}
// Make sure we check the music at least after every message
- updateMusicAndEvents();
+ updateEvents();
interfaceOn();
IntuiMessage *curMsg = _event->getMsg();
if (shouldQuit()) {
@@ -489,8 +507,7 @@ void LabEngine::mainGameLoop() {
if (!curMsg) {
// Does music load and next animation frame when you've run out of messages
gotMessage = false;
- _music->checkRoomMusic();
- updateMusicAndEvents();
+ updateEvents();
_anim->diffNextFrame();
if (_followingCrumbs) {
@@ -498,14 +515,14 @@ void LabEngine::mainGameLoop() {
if (code == kButtonForward || code == kButtonLeft || code == kButtonRight) {
gotMessage = true;
- mayShowCrumbIndicator();
+ _interface->mayShowCrumbIndicator();
_graphics->screenUpdate();
if (!processEvent(kMessageButtonUp, code, 0, _event->updateAndGetMousePos(), curInv, curMsg, forceDraw, code, actionMode))
break;
}
}
- mayShowCrumbIndicator();
+ _interface->mayShowCrumbIndicator();
_graphics->screenUpdate();
} else {
gotMessage = true;
@@ -521,7 +538,7 @@ void LabEngine::showLab2Teaser() {
_graphics->readPict("P:End/L2In.1");
for (int i = 0; i < 120; i++) {
- updateMusicAndEvents();
+ updateEvents();
waitTOF();
}
@@ -529,7 +546,7 @@ void LabEngine::showLab2Teaser() {
_graphics->readPict("P:End/Lost");
while (!_event->getMsg() && !shouldQuit()) {
- updateMusicAndEvents();
+ updateEvents();
_anim->diffNextFrame();
waitTOF();
}
@@ -537,6 +554,10 @@ void LabEngine::showLab2Teaser() {
bool LabEngine::processEvent(MessageClass tmpClass, uint16 code, uint16 qualifier, Common::Point tmpPos,
uint16 &curInv, IntuiMessage *curMsg, bool &forceDraw, uint16 buttonId, uint16 &actionMode) {
+
+ if (shouldQuit())
+ return false;
+
MessageClass msgClass = tmpClass;
Common::Point curPos = tmpPos;
uint16 oldDirection = 0;
@@ -550,9 +571,6 @@ bool LabEngine::processEvent(MessageClass tmpClass, uint16 code, uint16 qualifie
_anim->_doBlack = false;
- if (shouldQuit())
- return false;
-
if (_graphics->_longWinInFront) {
if (msgClass == kMessageRawKey || leftButtonClick || rightButtonClick) {
_graphics->_longWinInFront = false;
@@ -578,7 +596,7 @@ bool LabEngine::processEvent(MessageClass tmpClass, uint16 code, uint16 qualifie
else
performAction(actionMode, curPos, curInv);
- mayShowCrumbIndicator();
+ _interface->mayShowCrumbIndicator();
_graphics->screenUpdate();
} else if (rightButtonClick) {
eatMessages();
@@ -598,7 +616,7 @@ bool LabEngine::processEvent(MessageClass tmpClass, uint16 code, uint16 qualifie
_graphics->drawPanel();
drawRoomMessage(curInv, _closeDataPtr);
- mayShowCrumbIndicator();
+ _interface->mayShowCrumbIndicator();
_graphics->screenUpdate();
}
@@ -608,10 +626,10 @@ bool LabEngine::processEvent(MessageClass tmpClass, uint16 code, uint16 qualifie
bool LabEngine::processKey(IntuiMessage *curMsg, uint32 msgClass, uint16 &qualifier, Common::Point &curPos, uint16 &curInv, bool &forceDraw, uint16 code) {
if ((getPlatform() == Common::kPlatformWindows) && (code == Common::KEYCODE_b)) {
// Start bread crumbs
- _breadCrumbs[0]._roomNum = 0;
+ _breadCrumbs[0]._crumbRoomNum = 0;
_numCrumbs = 0;
_droppingCrumbs = true;
- mayShowCrumbIndicator();
+ _interface->mayShowCrumbIndicator();
_graphics->screenUpdate();
} else if (getPlatform() == Common::kPlatformWindows && (code == Common::KEYCODE_f || code == Common::KEYCODE_r)) {
// Follow bread crumbs
@@ -636,11 +654,10 @@ bool LabEngine::processKey(IntuiMessage *curMsg, uint32 msgClass, uint16 &qualif
_graphics->screenUpdate();
}
} else {
- _breadCrumbs[0]._roomNum = 0;
+ _breadCrumbs[0]._crumbRoomNum = 0;
_droppingCrumbs = false;
- // Need to hide indicator!!!!
- mayShowCrumbIndicatorOff();
+ _interface->mayShowCrumbIndicatorOff();
_graphics->screenUpdate();
}
}
@@ -652,7 +669,7 @@ bool LabEngine::processKey(IntuiMessage *curMsg, uint32 msgClass, uint16 &qualif
while (1) {
// Make sure we check the music at least after every message
- updateMusicAndEvents();
+ updateEvents();
curMsg = _event->getMsg();
if (shouldQuit())
@@ -660,7 +677,7 @@ bool LabEngine::processKey(IntuiMessage *curMsg, uint32 msgClass, uint16 &qualif
if (!curMsg) {
// Does music load and next animation frame when you've run out of messages
- updateMusicAndEvents();
+ updateEvents();
_anim->diffNextFrame();
} else if (curMsg->_msgClass == kMessageRawKey) {
if ((curMsg->_code == Common::KEYCODE_y) || (curMsg->_code == Common::KEYCODE_q)) {
@@ -692,9 +709,6 @@ bool LabEngine::processKey(IntuiMessage *curMsg, uint32 msgClass, uint16 &qualif
}
void LabEngine::processMainButton(uint16 &curInv, uint16 &lastInv, uint16 &oldDirection, bool &forceDraw, uint16 buttonId, uint16 &actionMode) {
- uint16 newDir;
- uint16 oldRoomNum;
-
switch (buttonId) {
case kButtonPickup:
case kButtonUse:
@@ -706,7 +720,7 @@ void LabEngine::processMainButton(uint16 &curInv, uint16 &lastInv, uint16 &oldDi
_anim->_doBlack = true;
_closeDataPtr = nullptr;
- mayShowCrumbIndicator();
+ _interface->mayShowCrumbIndicator();
} else {
uint16 oldActionMode = actionMode;
actionMode = buttonId;
@@ -737,11 +751,11 @@ void LabEngine::processMainButton(uint16 &curInv, uint16 &lastInv, uint16 &oldDi
_graphics->drawPanel();
drawRoomMessage(curInv, _closeDataPtr);
- mayShowCrumbIndicator();
+ _interface->mayShowCrumbIndicator();
break;
case kButtonLeft:
- case kButtonRight:
+ case kButtonRight: {
_closeDataPtr = nullptr;
if (buttonId == kButtonLeft)
drawStaticMessage(kTextTurnLeft);
@@ -751,17 +765,18 @@ void LabEngine::processMainButton(uint16 &curInv, uint16 &lastInv, uint16 &oldDi
_curFileName = " ";
oldDirection = _direction;
- newDir = processArrow(_direction, buttonId - 6);
+ uint16 newDir = processArrow(_direction, buttonId - 6);
doTurn(_direction, newDir);
_anim->_doBlack = true;
_direction = newDir;
forceDraw = true;
- mayShowCrumbIndicator();
+ _interface->mayShowCrumbIndicator();
+ }
break;
- case kButtonForward:
+ case kButtonForward: {
_closeDataPtr = nullptr;
- oldRoomNum = _roomNum;
+ int oldRoomNum = _roomNum;
if (doGoForward()) {
if (oldRoomNum == _roomNum)
@@ -795,13 +810,13 @@ void LabEngine::processMainButton(uint16 &curInv, uint16 &lastInv, uint16 &oldDi
_followingCrumbs = false;
_droppingCrumbs = false;
_numCrumbs = 0;
- _breadCrumbs[0]._roomNum = 0;
+ _breadCrumbs[0]._crumbRoomNum = 0;
} else {
bool intersect = false;
for (int idx = 0; idx < _numCrumbs; idx++) {
- if (_breadCrumbs[idx]._roomNum == _roomNum) {
+ if (_breadCrumbs[idx]._crumbRoomNum == _roomNum) {
_numCrumbs = idx + 1;
- _breadCrumbs[_numCrumbs]._roomNum = 0;
+ _breadCrumbs[_numCrumbs]._crumbRoomNum = 0;
intersect = true;
}
}
@@ -812,19 +827,20 @@ void LabEngine::processMainButton(uint16 &curInv, uint16 &lastInv, uint16 &oldDi
memcpy(&_breadCrumbs[0], &_breadCrumbs[1], _numCrumbs * sizeof _breadCrumbs[0]);
}
- _breadCrumbs[_numCrumbs]._roomNum = _roomNum;
- _breadCrumbs[_numCrumbs++]._direction = _direction;
+ _breadCrumbs[_numCrumbs]._crumbRoomNum = _roomNum;
+ _breadCrumbs[_numCrumbs++]._crumbDirection = _direction;
}
}
}
- mayShowCrumbIndicator();
+ _interface->mayShowCrumbIndicator();
+ }
break;
case kButtonMap:
doUse(kItemMap);
- mayShowCrumbIndicator();
+ _interface->mayShowCrumbIndicator();
break;
}
@@ -832,8 +848,6 @@ void LabEngine::processMainButton(uint16 &curInv, uint16 &lastInv, uint16 &oldDi
}
void LabEngine::processAltButton(uint16 &curInv, uint16 &lastInv, uint16 buttonId, uint16 &actionMode) {
- bool saveRestoreSuccessful = true;
-
_anim->_doBlack = true;
switch (buttonId) {
@@ -849,12 +863,12 @@ void LabEngine::processAltButton(uint16 &curInv, uint16 &lastInv, uint16 buttonI
drawRoomMessage(curInv, _closeDataPtr);
break;
- case kButtonSaveLoad:
+ case kButtonSaveLoad: {
interfaceOff();
_anim->stopDiff();
_curFileName = " ";
- saveRestoreSuccessful = saveRestoreGame();
+ bool saveRestoreSuccessful = saveRestoreGame();
_closeDataPtr = nullptr;
_mainDisplay = true;
@@ -868,6 +882,7 @@ void LabEngine::processAltButton(uint16 &curInv, uint16 &lastInv, uint16 buttonI
_graphics->setPalette(initColors, 8);
_system->delayMillis(1000);
}
+ }
break;
case kButtonUseItem:
@@ -912,10 +927,10 @@ void LabEngine::processAltButton(uint16 &curInv, uint16 &lastInv, uint16 buttonI
break;
case kButtonBreadCrumbs:
- _breadCrumbs[0]._roomNum = 0;
+ _breadCrumbs[0]._crumbRoomNum = 0;
_numCrumbs = 0;
_droppingCrumbs = true;
- mayShowCrumbIndicator();
+ _interface->mayShowCrumbIndicator();
break;
case kButtonFollowCrumbs:
@@ -937,11 +952,10 @@ void LabEngine::processAltButton(uint16 &curInv, uint16 &lastInv, uint16 buttonI
_graphics->drawPanel();
drawRoomMessage(curInv, _closeDataPtr);
} else {
- _breadCrumbs[0]._roomNum = 0;
+ _breadCrumbs[0]._crumbRoomNum = 0;
_droppingCrumbs = false;
- // Need to hide indicator!!!!
- mayShowCrumbIndicatorOff();
+ _interface->mayShowCrumbIndicatorOff();
}
}
break;
@@ -994,8 +1008,8 @@ void LabEngine::performAction(uint16 actionMode, Common::Point curPos, uint16 &c
_closeDataPtr = tmpClosePtr;
} else if (curPos.y < (_utils->vgaScaleY(149) + _utils->svgaCord(2)))
drawStaticMessage(kTextNothing);
- }
- break;
+ }
+ break;
case 5:
if (_conditions->in(curInv)) {
@@ -1013,6 +1027,9 @@ void LabEngine::performAction(uint16 actionMode, Common::Point curPos, uint16 &c
}
void LabEngine::go() {
+ if (getPlatform() == Common::kPlatformWindows)
+ handleTrialWarning();
+
_isHiRes = ((getFeatures() & GF_LOWRES) == 0);
_graphics->setUpScreens();
@@ -1024,13 +1041,18 @@ void LabEngine::go() {
_msgFont = _resource->getFont("F:AvanteG.12");
else
_msgFont = _resource->getFont("F:Map.fon");
- _event->mouseHide();
- Intro *intro = new Intro(this);
- intro->play();
- delete intro;
+ // If the user has requested to load a game from the launcher, skip the intro
+ if (!ConfMan.hasKey("save_slot")) {
+ _event->mouseHide();
+ _introPlaying = true;
+ Intro *intro = new Intro(this);
+ intro->play();
+ delete intro;
+ _introPlaying = false;
+ _event->mouseShow();
+ }
- _event->mouseShow();
mainGameLoop();
_graphics->freeFont(&_msgFont);
@@ -1058,12 +1080,12 @@ MainButton LabEngine::followCrumbs() {
}
if (!_isCrumbTurning)
- _breadCrumbs[_numCrumbs--]._roomNum = 0;
+ _breadCrumbs[_numCrumbs--]._crumbRoomNum = 0;
// Is the current crumb this room? If not, logic error.
- if (_roomNum != _breadCrumbs[_numCrumbs]._roomNum) {
+ if (_roomNum != _breadCrumbs[_numCrumbs]._crumbRoomNum) {
_numCrumbs = 0;
- _breadCrumbs[0]._roomNum = 0;
+ _breadCrumbs[0]._crumbRoomNum = 0;
_droppingCrumbs = false;
_followingCrumbs = false;
return kButtonNone;
@@ -1071,11 +1093,11 @@ MainButton LabEngine::followCrumbs() {
Direction exitDir;
// which direction is last crumb
- if (_breadCrumbs[_numCrumbs]._direction == kDirectionEast)
+ if (_breadCrumbs[_numCrumbs]._crumbDirection == kDirectionEast)
exitDir = kDirectionWest;
- else if (_breadCrumbs[_numCrumbs]._direction == kDirectionWest)
+ else if (_breadCrumbs[_numCrumbs]._crumbDirection == kDirectionWest)
exitDir = kDirectionEast;
- else if (_breadCrumbs[_numCrumbs]._direction == kDirectionNorth)
+ else if (_breadCrumbs[_numCrumbs]._crumbDirection == kDirectionNorth)
exitDir = kDirectionSouth;
else
exitDir = kDirectionNorth;
@@ -1084,7 +1106,7 @@ MainButton LabEngine::followCrumbs() {
if (_numCrumbs == 0) {
_isCrumbTurning = false;
- _breadCrumbs[0]._roomNum = 0;
+ _breadCrumbs[0]._crumbRoomNum = 0;
_droppingCrumbs = false;
_followingCrumbs = false;
} else {
@@ -1098,89 +1120,4 @@ MainButton LabEngine::followCrumbs() {
return moveDir;
}
-
-void LabEngine::mayShowCrumb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, 0, 0, 0, 0, 0, 3, 2, 3, 0, 0, 4, 7, 4, 0, 0, 0, 0, 4, 7, 4,
- 4, 7, 4, 0, 0, 0, 0, 0, 3, 2, 2, 2, 3, 4, 4, 7, 4, 0, 0, 0, 0, 4, 7, 4,
- 4, 7, 7, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 7, 7, 4, 0, 0, 0, 0, 4, 7, 4,
- 0, 4, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 4, 0, 0, 0, 0, 0, 4, 7, 4,
- 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 0, 0, 0, 0, 0, 4, 7, 4,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 3, 0, 0, 0, 0, 4, 7, 4,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 3, 0, 0, 0, 0, 4, 7, 4,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 2, 2, 3, 0, 0, 4, 4, 7, 4,
- 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 7, 7, 4,
- 0, 0, 4, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 4, 0,
- 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0
- };
-
- if (getPlatform() != Common::kPlatformWindows)
- return;
-
- if (_droppingCrumbs && _mainDisplay) {
- static byte *imgData = new byte[CRUMBSWIDTH * CRUMBSHEIGHT];
- memcpy(imgData, dropCrumbsImageData, CRUMBSWIDTH * CRUMBSHEIGHT);
- static Image dropCrumbsImage(CRUMBSWIDTH, CRUMBSHEIGHT, imgData, this);
-
- _event->mouseHide();
- dropCrumbsImage.drawMaskImage(612,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, 4, 8, 4, 0, 0, 0, 0, 4, 8, 4,
- 4, 8, 4, 0, 0, 0, 0, 0, 0, 3, 8, 3, 0, 0, 4, 8, 4, 0, 0, 0, 0, 4, 8, 4,
- 4, 8, 4, 0, 0, 0, 0, 0, 3, 8, 8, 8, 3, 4, 4, 8, 4, 0, 0, 0, 0, 4, 8, 4,
- 4, 8, 8, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 4, 0, 0, 0, 0, 4, 8, 4,
- 0, 4, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 4, 0, 0, 0, 0, 0, 4, 8, 4,
- 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 0, 0, 0, 0, 0, 4, 8, 4,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 8, 3, 0, 0, 0, 0, 4, 8, 4,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 8, 3, 0, 0, 0, 0, 4, 8, 4,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 8, 8, 8, 3, 0, 0, 4, 4, 8, 4,
- 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 4,
- 0, 0, 4, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 4, 0,
- 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0
- };
-
- if (getPlatform() != Common::kPlatformWindows)
- return;
-
- if (_mainDisplay) {
- static byte *imgData = new byte[CRUMBSWIDTH * CRUMBSHEIGHT];
- memcpy(imgData, dropCrumbsOffImageData, CRUMBSWIDTH * CRUMBSHEIGHT);
- static Image dropCrumbsOffImage(CRUMBSWIDTH, CRUMBSHEIGHT, imgData, this);
-
- _event->mouseHide();
- dropCrumbsOffImage.drawMaskImage(612, 4);
- _event->mouseShow();
- }
-}
-
} // End of namespace Lab