Skip to content

Commit

Permalink
DREAMWEB: Migrate object/inventory related functions out of stubs.
Browse files Browse the repository at this point in the history
  • Loading branch information
digitall committed Nov 30, 2012
1 parent 06cc3b0 commit 9dc4542
Show file tree
Hide file tree
Showing 2 changed files with 127 additions and 127 deletions.
127 changes: 127 additions & 0 deletions engines/dreamweb/object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1099,4 +1099,131 @@ void DreamWebEngine::pickupConts(uint8 from, uint8 containerEx) {
}
}

void DreamWebEngine::incRyanPage() {
commandOnlyCond(31, 222);

if (_mouseButton == _oldButton || !(_mouseButton & 1))
return;

_vars._ryanPage = (_mouseX - (kInventx + 167)) / 18;

delPointer();
fillRyan();
readMouse();
showPointer();
workToScreen();
delPointer();
}

void DreamWebEngine::emergencyPurge() {
while (true) {
if (_vars._exFramePos + 4000 < kExframeslen) {
// Not near frame end
if (_vars._exTextPos + 400 < kExtextlen)
return; // notneartextend
}

purgeAnItem();
}
}

void DreamWebEngine::purgeAnItem() {
const DynObject *extraObjects = _exData;

for (size_t i = 0; i < kNumexobjects; ++i) {
if (extraObjects[i].mapad[0] && extraObjects[i].objId[0] == 255 &&
extraObjects[i].initialLocation != _realLocation) {
deleteExObject(i);
return;
}
}

for (size_t i = 0; i < kNumexobjects; ++i) {
if (extraObjects[i].mapad[0] && extraObjects[i].objId[0] == 255) {
deleteExObject(i);
return;
}
}
}

void DreamWebEngine::dropError() {
_commandType = 255;
delPointer();
printMessage(76, 21, 56, 240, 240 & 1);
workToScreenM();
hangOnP(50);
showPanel();
showMan();
examIcon();
_commandType = 255;
workToScreenM();
}

void DreamWebEngine::cantDrop() {
_commandType = 255;
delPointer();
printMessage(76, 21, 24, 240, 240 & 1);
workToScreenM();
hangOnP(50);
showPanel();
showMan();
examIcon();
_commandType = 255;
workToScreenM();
}

void DreamWebEngine::examineInventory() {
commandOnlyCond(32, 249);

if (!(_mouseButton & 1))
return;

createPanel();
showPanel();
showMan();
showExit();
examIcon();
_pickUp = 0;
_invOpen = 2;
openInv();
workToScreenM();
}

void DreamWebEngine::openInv() {
_invOpen = 1;
printMessage(80, 58 - 10, 61, 240, (240 & 1));
fillRyan();
_commandType = 255;
}

void DreamWebEngine::pickupOb(uint8 command, uint8 pos) {
_lastInvPos = pos;
_objectType = kFreeObjectType;
_itemFrame = command;
_command = command;
//uint8 dummy;
//getAnyAd(&dummy, &dummy); // was in the original source, seems useless here
transferToEx(command);
}

void DreamWebEngine::initialInv() {
if (_realLocation != 24)
return;

pickupOb(11, 5);
pickupOb(12, 6);
pickupOb(13, 7);
pickupOb(14, 8);
pickupOb(18, 0);
pickupOb(19, 1);
pickupOb(20, 9);
pickupOb(16, 2);
_vars._watchMode = 1;
_vars._reelToHold = 0;
_vars._endOfHoldReel = 6;
_vars._watchSpeed = 1;
_vars._speedCount = 1;
switchRyanOff();
}

} // End of namespace DreamWeb
127 changes: 0 additions & 127 deletions engines/dreamweb/stubs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2213,36 +2213,6 @@ void DreamWebEngine::newGame() {
_getBack = 3;
}

void DreamWebEngine::pickupOb(uint8 command, uint8 pos) {
_lastInvPos = pos;
_objectType = kFreeObjectType;
_itemFrame = command;
_command = command;
//uint8 dummy;
//getAnyAd(&dummy, &dummy); // was in the original source, seems useless here
transferToEx(command);
}

void DreamWebEngine::initialInv() {
if (_realLocation != 24)
return;

pickupOb(11, 5);
pickupOb(12, 6);
pickupOb(13, 7);
pickupOb(14, 8);
pickupOb(18, 0);
pickupOb(19, 1);
pickupOb(20, 9);
pickupOb(16, 2);
_vars._watchMode = 1;
_vars._reelToHold = 0;
_vars._endOfHoldReel = 6;
_vars._watchSpeed = 1;
_vars._speedCount = 1;
switchRyanOff();
}

void DreamWebEngine::walkIntoRoom() {
if (_vars._location == 14 && _mapX == 22) {
_destination = 1;
Expand Down Expand Up @@ -2307,13 +2277,6 @@ void DreamWebEngine::makeMainScreen() {
_manIsOffScreen = 0;
}

void DreamWebEngine::openInv() {
_invOpen = 1;
printMessage(80, 58 - 10, 61, 240, (240 & 1));
fillRyan();
_commandType = 255;
}

void DreamWebEngine::obsThatDoThings() {
if (!compare(_command, _objectType, "MEMB"))
return; // notlouiscard
Expand Down Expand Up @@ -2433,23 +2396,6 @@ bool DreamWebEngine::isSetObOnMap(uint8 index) {
return (getSetAd(index)->mapad[0] == 0);
}

void DreamWebEngine::examineInventory() {
commandOnlyCond(32, 249);

if (!(_mouseButton & 1))
return;

createPanel();
showPanel();
showMan();
showExit();
examIcon();
_pickUp = 0;
_invOpen = 2;
openInv();
workToScreenM();
}

void DreamWebEngine::underTextLine() {
if (_foreignRelease)
multiGet(_textUnder, _textAddressX, _textAddressY - 3, kUnderTextSizeX_f, kUnderTextSizeY_f);
Expand Down Expand Up @@ -2644,32 +2590,6 @@ void DreamWebEngine::showGun() {
getRidOfTempText();
}

void DreamWebEngine::dropError() {
_commandType = 255;
delPointer();
printMessage(76, 21, 56, 240, 240 & 1);
workToScreenM();
hangOnP(50);
showPanel();
showMan();
examIcon();
_commandType = 255;
workToScreenM();
}

void DreamWebEngine::cantDrop() {
_commandType = 255;
delPointer();
printMessage(76, 21, 24, 240, 240 & 1);
workToScreenM();
hangOnP(50);
showPanel();
showMan();
examIcon();
_commandType = 255;
workToScreenM();
}

void DreamWebEngine::getBack1() {
if (_pickUp != 0) {
blank();
Expand Down Expand Up @@ -2987,51 +2907,4 @@ void DreamWebEngine::edensFlatReminders() {
_vars._progressPoints++; // got card
}

void DreamWebEngine::incRyanPage() {
commandOnlyCond(31, 222);

if (_mouseButton == _oldButton || !(_mouseButton & 1))
return;

_vars._ryanPage = (_mouseX - (kInventx + 167)) / 18;

delPointer();
fillRyan();
readMouse();
showPointer();
workToScreen();
delPointer();
}

void DreamWebEngine::emergencyPurge() {
while (true) {
if (_vars._exFramePos + 4000 < kExframeslen) {
// Not near frame end
if (_vars._exTextPos + 400 < kExtextlen)
return; // notneartextend
}

purgeAnItem();
}
}

void DreamWebEngine::purgeAnItem() {
const DynObject *extraObjects = _exData;

for (size_t i = 0; i < kNumexobjects; ++i) {
if (extraObjects[i].mapad[0] && extraObjects[i].objId[0] == 255 &&
extraObjects[i].initialLocation != _realLocation) {
deleteExObject(i);
return;
}
}

for (size_t i = 0; i < kNumexobjects; ++i) {
if (extraObjects[i].mapad[0] && extraObjects[i].objId[0] == 255) {
deleteExObject(i);
return;
}
}
}

} // End of namespace DreamWeb

0 comments on commit 9dc4542

Please sign in to comment.