aboutsummaryrefslogtreecommitdiff
path: root/engines/dreamweb
diff options
context:
space:
mode:
authorMax Horn2011-12-18 13:04:45 +0100
committerWillem Jan Palenstijn2011-12-18 14:13:59 +0100
commit8c8666e811d1b68fec400f4100a02146e0e1235b (patch)
tree8d4ee466e24588b1ca3d67f66dc7ae736fcc3404 /engines/dreamweb
parentf0508dd05a2840a98f98d3a215b5a859d757e653 (diff)
downloadscummvm-rg350-8c8666e811d1b68fec400f4100a02146e0e1235b.tar.gz
scummvm-rg350-8c8666e811d1b68fec400f4100a02146e0e1235b.tar.bz2
scummvm-rg350-8c8666e811d1b68fec400f4100a02146e0e1235b.zip
DREAMWEB: Move backdrop.cpp and more to DreamBase; remove some dead code
Diffstat (limited to 'engines/dreamweb')
-rw-r--r--engines/dreamweb/backdrop.cpp78
-rw-r--r--engines/dreamweb/dreambase.h31
-rw-r--r--engines/dreamweb/dreamweb.cpp2
-rw-r--r--engines/dreamweb/monitor.cpp18
-rw-r--r--engines/dreamweb/stubs.cpp88
-rw-r--r--engines/dreamweb/stubs.h36
-rw-r--r--engines/dreamweb/use.cpp32
-rw-r--r--engines/dreamweb/vgafades.cpp4
8 files changed, 113 insertions, 176 deletions
diff --git a/engines/dreamweb/backdrop.cpp b/engines/dreamweb/backdrop.cpp
index 15a226a5ac..38ccb0296c 100644
--- a/engines/dreamweb/backdrop.cpp
+++ b/engines/dreamweb/backdrop.cpp
@@ -24,7 +24,7 @@
namespace DreamGen {
-void DreamGenContext::doBlocks() {
+void DreamBase::doBlocks() {
uint16 dstOffset = data.word(kMapady) * 320 + data.word(kMapadx);
uint16 mapOffset = kMap + data.byte(kMapy) * kMapwidth + data.byte(kMapx);
const uint8 *mapData = getSegment(data.word(kMapdata)).ptr(mapOffset, 0);
@@ -49,7 +49,6 @@ void DreamGenContext::doBlocks() {
dst += 320;
}
dst += 4;
- ax = 0x0dfdf;
memset(dst, 0xdf, 16);
dst += 320;
memset(dst, 0xdf, 16);
@@ -63,7 +62,7 @@ void DreamGenContext::doBlocks() {
}
}
-uint8 DreamGenContext::getXAd(const uint8 *setData, uint8 *result) {
+uint8 DreamBase::getXAd(const uint8 *setData, uint8 *result) {
uint8 v0 = setData[0];
uint8 v1 = setData[1];
uint8 v2 = setData[2];
@@ -78,7 +77,7 @@ uint8 DreamGenContext::getXAd(const uint8 *setData, uint8 *result) {
return 1;
}
-uint8 DreamGenContext::getYAd(const uint8 *setData, uint8 *result) {
+uint8 DreamBase::getYAd(const uint8 *setData, uint8 *result) {
uint8 v0 = setData[3];
uint8 v1 = setData[4];
if (v0 < data.byte(kMapy))
@@ -90,11 +89,7 @@ uint8 DreamGenContext::getYAd(const uint8 *setData, uint8 *result) {
return 1;
}
-void DreamGenContext::getMapAd() {
- ch = getMapAd((const uint8 *)es.ptr(si, 5));
-}
-
-uint8 DreamGenContext::getMapAd(const uint8 *setData) {
+uint8 DreamBase::getMapAd(const uint8 *setData) {
uint8 xad, yad;
if (getXAd(setData, &xad) == 0)
return 0;
@@ -105,14 +100,7 @@ uint8 DreamGenContext::getMapAd(const uint8 *setData) {
return 1;
}
-void DreamGenContext::calcFrFrame(uint16 frame) {
- uint8 width, height;
- calcFrFrame(frame, &width, &height);
- cl = width;
- ch = height;
-}
-
-void DreamGenContext::calcFrFrame(uint16 frameNum, uint8* width, uint8* height) {
+void DreamBase::calcFrFrame(uint16 frameNum, uint8* width, uint8* height) {
const Frame *frame = (const Frame *)getSegment(data.word(kFrsegment)).ptr(frameNum * sizeof(Frame), sizeof(Frame));
data.word(kSavesource) = data.word(kFramesad) + frame->ptr();
data.byte(kSavesize+0) = frame->width;
@@ -123,21 +111,34 @@ void DreamGenContext::calcFrFrame(uint16 frameNum, uint8* width, uint8* height)
*height = frame->height;
}
-void DreamGenContext::finalFrame() {
- uint16 x, y;
- finalFrame(&x, &y);
- di = x;
- bx = y;
-}
-
-void DreamGenContext::finalFrame(uint16 *x, uint16 *y) {
+void DreamBase::finalFrame(uint16 *x, uint16 *y) {
data.byte(kSavex) = (data.word(kObjectx) + data.word(kOffsetx)) & 0xff;
data.byte(kSavey) = (data.word(kObjecty) + data.word(kOffsety)) & 0xff;
*x = data.word(kObjectx);
*y = data.word(kObjecty);
}
-void DreamGenContext::showAllObs() {
+void DreamBase::makeBackOb(SetObject *objData) {
+ if (data.byte(kNewobs) == 0)
+ return;
+ uint8 priority = objData->priority;
+ uint8 type = objData->type;
+ Sprite *sprite = makeSprite(data.word(kObjectx), data.word(kObjecty), addr_backobject, data.word(kSetframes), 0);
+
+ uint16 objDataOffset = (uint8 *)objData - getSegment(data.word(kSetdat)).ptr(0, 0);
+ assert(objDataOffset % sizeof(SetObject) == 0);
+ assert(objDataOffset < 128 * sizeof(SetObject));
+ sprite->setObjData(objDataOffset);
+ if (priority == 255)
+ priority = 0;
+ sprite->priority = priority;
+ sprite->type = type;
+ sprite->b16 = 0;
+ sprite->delay = 0;
+ sprite->animFrame = 0;
+}
+
+void DreamBase::showAllObs() {
data.word(kListpos) = kSetlist;
memset(getSegment(data.word(kBuffers)).ptr(kSetlist, 0), 0xff, 128 * 5);
data.word(kFrsegment) = data.word(kSetframes);
@@ -153,7 +154,8 @@ void DreamGenContext::showAllObs() {
uint8 currentFrame = setEntry->frames[0];
if (currentFrame == 0xff)
continue;
- calcFrFrame(currentFrame);
+ uint8 width, height;
+ calcFrFrame(currentFrame, &width, &height);
uint16 x, y;
finalFrame(&x, &y);
setEntry->index = setEntry->frames[0];
@@ -174,17 +176,7 @@ void DreamGenContext::showAllObs() {
}
}
-void DreamGenContext::getDimension() {
- uint8 mapXstart, mapYstart;
- uint8 mapXsize, mapYsize;
- getDimension(&mapXstart, &mapYstart, &mapXsize, &mapYsize);
- cl = mapXstart;
- ch = mapYstart;
- dl = mapXsize;
- dh = mapYsize;
-}
-
-bool DreamGenContext::addAlong(const uint8 *mapFlags) {
+bool DreamBase::addAlong(const uint8 *mapFlags) {
for (size_t i = 0; i < 11; ++i) {
if (mapFlags[3 * i] != 0)
return true;
@@ -192,7 +184,7 @@ bool DreamGenContext::addAlong(const uint8 *mapFlags) {
return false;
}
-bool DreamGenContext::addLength(const uint8 *mapFlags) {
+bool DreamBase::addLength(const uint8 *mapFlags) {
for (size_t i = 0; i < 10; ++i) {
if (mapFlags[3 * 11 * i] != 0)
return true;
@@ -200,7 +192,7 @@ bool DreamGenContext::addLength(const uint8 *mapFlags) {
return false;
}
-void DreamGenContext::getDimension(uint8 *mapXstart, uint8 *mapYstart, uint8 *mapXsize, uint8 *mapYsize) {
+void DreamBase::getDimension(uint8 *mapXstart, uint8 *mapYstart, uint8 *mapXsize, uint8 *mapYsize) {
const uint8 *mapFlags = getSegment(data.word(kBuffers)).ptr(kMapflags, 0);
uint8 yStart = 0;
@@ -229,7 +221,7 @@ void DreamGenContext::getDimension(uint8 *mapXstart, uint8 *mapYstart, uint8 *ma
data.byte(kMapysize) = *mapYsize << 4;
}
-void DreamGenContext::calcMapAd() {
+void DreamBase::calcMapAd() {
uint8 mapXstart, mapYstart;
uint8 mapXsize, mapYsize;
getDimension(&mapXstart, &mapYstart, &mapXsize, &mapYsize);
@@ -237,7 +229,7 @@ void DreamGenContext::calcMapAd() {
data.word(kMapady) = data.word(kMapoffsety) - 8 * (mapYsize + 2 * mapYstart - 10);
}
-void DreamGenContext::showAllFree() {
+void DreamBase::showAllFree() {
data.word(kListpos) = kFreelist;
ObjPos *listPos = (ObjPos *)getSegment(data.word(kBuffers)).ptr(kFreelist, 80 * sizeof(ObjPos));
memset(listPos, 0xff, 80 * sizeof(ObjPos));
@@ -290,7 +282,7 @@ void DreamBase::drawFlags() {
}
}
-void DreamGenContext::showAllEx() {
+void DreamBase::showAllEx() {
data.word(kListpos) = kExlist;
memset(getSegment(data.word(kBuffers)).ptr(kExlist, 100 * 5), 0xff, 100 * 5);
diff --git a/engines/dreamweb/dreambase.h b/engines/dreamweb/dreambase.h
index 06936ca72d..6f78bcad07 100644
--- a/engines/dreamweb/dreambase.h
+++ b/engines/dreamweb/dreambase.h
@@ -57,12 +57,29 @@ protected:
char _saveNames[17*7];
char _saveNamesOld[17*7];
+ // from vgagrafx.cpp
+ uint8 _workspace[(0x1000 + 2) * 16];
+
public:
DreamBase(DreamWeb::DreamWebEngine *en);
public:
// from backdrop.cpp
+ void doBlocks();
+ uint8 getXAd(const uint8 *setData, uint8 *result);
+ uint8 getYAd(const uint8 *setData, uint8 *result);
+ uint8 getMapAd(const uint8 *setData);
+ void calcFrFrame(uint16 frame, uint8* width, uint8* height);
+ void finalFrame(uint16 *x, uint16 *y);
+ void makeBackOb(SetObject *objData);
+ void showAllObs();
+ bool addAlong(const uint8 *mapFlags);
+ bool addLength(const uint8 *mapFlags);
+ void getDimension(uint8 *mapXstart, uint8 *mapYstart, uint8 *mapXsize, uint8 *mapYsize);
+ void calcMapAd();
+ void showAllFree();
void drawFlags();
+ void showAllEx();
// from keypad.cpp
void getUnderMenu();
@@ -110,6 +127,9 @@ public:
const char *monPrint(const char *string);
void lockLightOn();
void lockLightOff();
+ void loadPersonal();
+ void loadNews();
+ void loadCart();
// from object.cpp
void obIcons();
@@ -392,11 +412,19 @@ public:
bool isRyanHolding(const char *id);
void clearBuffers();
void clearChanges();
+ void drawFloor();
+ uint16 findSetObject(const char *id);
+ void hangOnCurs(uint16 frameCount);
+ const uint8 *findObName(uint8 type, uint8 index);
+ void copyName(uint8 type, uint8 index, uint8 *dst);
// from use.cpp
void placeFreeObject(uint8 index);
void removeFreeObject(uint8 index);
void setupTimedUse(uint16 offset, uint16 countToTimed, uint16 timeCount, byte x, byte y);
+ void withWhat();
+ uint16 checkInside(uint16 command, uint16 type);
+ void showPuzText(uint16 command, uint16 count);
// from vgafades.cpp
uint8 *mainPalette();
@@ -411,6 +439,8 @@ public:
void fadeDOS();
void doFade();
void fadeCalculation();
+ void fadeupYellows();
+ void fadeupMonFirst();
void fadeScreenUp();
void fadeScreenUps();
void fadeScreenUpHalf();
@@ -423,7 +453,6 @@ public:
void dumpCurrent();
// from vgagrafx.cpp
- uint8 _workspace[(0x1000 + 2) * 16];
inline uint8 *workspace() { return _workspace; }
void clearWork();
diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp
index 0af3f00d5c..997f36438e 100644
--- a/engines/dreamweb/dreamweb.cpp
+++ b/engines/dreamweb/dreamweb.cpp
@@ -330,7 +330,7 @@ void DreamWebEngine::blit(const uint8 *src, int pitch, int x, int y, int w, int
}
void DreamWebEngine::printUnderMonitor() {
- uint8 *dst = _base._workspace + DreamGen::kScreenwidth * 43 + 76;
+ uint8 *dst = _base.workspace() + DreamGen::kScreenwidth * 43 + 76;
Graphics::Surface *s = _system->lockScreen();
if (!s)
diff --git a/engines/dreamweb/monitor.cpp b/engines/dreamweb/monitor.cpp
index 0b126ee250..9bac71a8e5 100644
--- a/engines/dreamweb/monitor.cpp
+++ b/engines/dreamweb/monitor.cpp
@@ -72,15 +72,11 @@ void DreamGenContext::useMon() {
data.word(kBufferout) = 0;
bool stop = false;
do {
- di = data.word(kMonadx);
- bx = data.word(kMonady);
- push(di);
- push(bx);
+ uint16 oldMonadx = data.word(kMonadx);
+ uint16 oldMonady = data.word(kMonady);
input();
- bx = pop();
- di = pop();
- data.word(kMonadx) = di;
- data.word(kMonady) = bx;
+ data.word(kMonadx) = oldMonadx;
+ data.word(kMonady) = oldMonady;
stop = execCommand();
if (quitRequested()) //TODO : Check why it crashes when put before the execcommand
break;
@@ -383,14 +379,14 @@ void DreamBase::printOuterMon() {
showFrame(tempGraphics(), 40, 164, 4, 0);
}
-void DreamGenContext::loadPersonal() {
+void DreamBase::loadPersonal() {
if (data.byte(kLocation) == 0 || data.byte(kLocation) == 42)
data.word(kTextfile1) = standardLoad("DREAMWEB.T01"); // monitor file 1
else
data.word(kTextfile1) = standardLoad("DREAMWEB.T02"); // monitor file 2
}
-void DreamGenContext::loadNews() {
+void DreamBase::loadNews() {
// textfile2 holds information accessible by anyone
if (data.byte(kNewsitem) == 0)
data.word(kTextfile2) = standardLoad("DREAMWEB.T10"); // monitor file 10
@@ -402,7 +398,7 @@ void DreamGenContext::loadNews() {
data.word(kTextfile2) = standardLoad("DREAMWEB.T13"); // monitor file 13
}
-void DreamGenContext::loadCart() {
+void DreamBase::loadCart() {
byte cartridgeId = 0;
uint16 objectIndex = findSetObject("INTF");
uint16 cartridgeIndex = checkInside(objectIndex, 1);
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 1c87a05dea..021b2bad84 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -785,11 +785,7 @@ void DreamBase::loadTempCharset(const char *fileName) {
engine->setTempCharset(standardLoadCPP(fileName));
}
-void DreamGenContext::hangOnCurs() {
- hangOnCurs(cx);
-}
-
-void DreamGenContext::hangOnCurs(uint16 frameCount) {
+void DreamBase::hangOnCurs(uint16 frameCount) {
for (uint16 i = 0; i < frameCount; ++i) {
printCurs();
vSync();
@@ -1035,26 +1031,6 @@ void DreamBase::lockMon() {
}
}
-void DreamGenContext::makeBackOb(SetObject *objData) {
- if (data.byte(kNewobs) == 0)
- return;
- uint8 priority = objData->priority;
- uint8 type = objData->type;
- Sprite *sprite = makeSprite(data.word(kObjectx), data.word(kObjecty), addr_backobject, data.word(kSetframes), 0);
-
- uint16 objDataOffset = (uint8 *)objData - getSegment(data.word(kSetdat)).ptr(0, 0);
- assert(objDataOffset % sizeof(SetObject) == 0);
- assert(objDataOffset < 128 * sizeof(SetObject));
- sprite->setObjData(objDataOffset);
- if (priority == 255)
- priority = 0;
- sprite->priority = priority;
- sprite->type = type;
- sprite->b16 = 0;
- sprite->delay = 0;
- sprite->animFrame = 0;
-}
-
uint16 DreamBase::allocateAndLoad(unsigned int size) {
// allocatemem adds 32 bytes, so it doesn't matter that size/16 rounds down
uint16 result = allocateMem(size / 16);
@@ -1252,7 +1228,7 @@ bool DreamGenContext::checkIfEx(uint8 x, uint8 y) {
return false;
}
-const uint8 *DreamGenContext::findObName(uint8 type, uint8 index) {
+const uint8 *DreamBase::findObName(uint8 type, uint8 index) {
if (type == 5) {
uint16 i = 64 * 2 * (index & 127);
uint16 offset = getSegment(data.word(kPeople)).word(kPersontxtdat + i) + kPersontext;
@@ -1272,7 +1248,7 @@ const uint8 *DreamGenContext::findObName(uint8 type, uint8 index) {
}
}
-void DreamGenContext::copyName(uint8 type, uint8 index, uint8 *dst) {
+void DreamBase::copyName(uint8 type, uint8 index, uint8 *dst) {
const uint8 *src = findObName(type, index);
size_t i;
for (i = 0; i < 28; ++i) {
@@ -1737,19 +1713,7 @@ bool DreamBase::compare(uint8 index, uint8 flag, const char id[4]) {
return objectMatches(getAnyAdDir(index, flag), id);
}
-void DreamGenContext::findSetObject() {
- char id[5];
- id[0] = al;
- id[1] = ah;
- id[2] = cl;
- id[3] = ch;
- id[4] = '\0';
- al = findSetObject(id);
- es = data.word(kSetdat);
- bx = al * 64;
-}
-
-uint16 DreamGenContext::findSetObject(const char *id) {
+uint16 DreamBase::findSetObject(const char *id) {
for (uint16 index = 0; index < 128; index++) {
if (objectMatches(getSetAd(index), id))
return index;
@@ -1799,22 +1763,6 @@ bool DreamBase::isRyanHolding(const char *id) {
return false;
}
-void DreamGenContext::checkInside() {
- cl = checkInside(al, ah);
- es = data.word(kExtras);
- bx = kExdata + cl * sizeof(DynObject);
-}
-
-uint16 DreamGenContext::checkInside(uint16 command, uint16 type) {
- for (uint16 index = 0; index < kNumexobjects; index++) {
- DynObject *object = getExAd(index);
- if (object->mapad[1] == command && object->mapad[0] == type)
- return index;
- }
-
- return kNumexobjects;
-}
-
bool DreamBase::isItDescribed(const ObjPos *pos) {
uint16 offset = getSegment(data.word(kSetdesc)).word(kSettextdat + pos->index * 2);
uint8 result = getSegment(data.word(kSetdesc)).byte(kSettext + offset);
@@ -2184,7 +2132,14 @@ void DreamGenContext::loadRoom() {
loadRoomsSample();
switchRyanOn();
drawFlags();
- getDimension();
+
+ uint8 mapXstart, mapYstart;
+ uint8 mapXsize, mapYsize;
+ getDimension(&mapXstart, &mapYstart, &mapXsize, &mapYsize);
+ cl = mapXstart;
+ ch = mapYstart;
+ dl = mapXsize;
+ dh = mapYsize;
}
void DreamGenContext::readSetData() {
@@ -2617,7 +2572,7 @@ void DreamBase::loadTempText(const char *fileName) {
data.word(kTextfile1) = standardLoad(fileName);
}
-void DreamGenContext::drawFloor() {
+void DreamBase::drawFloor() {
eraseOldObs();
drawFlags();
calcMapAd();
@@ -4173,23 +4128,6 @@ void DreamGenContext::newPlace() {
}
}
-void DreamGenContext::showPuzText() {
- showPuzText(al, cx);
-}
-
-void DreamGenContext::showPuzText(uint16 command, uint16 count) {
- createPanel();
- showPanel();
- showMan();
- showExit();
- obIcons();
- uint16 offset = kTextstart + getSegment(data.word(kPuzzletext)).word(command * 2);
- const uint8 *string = getSegment(data.word(kPuzzletext)).ptr(offset, 0);
- printDirect(string, 36, 104, 241, 241 & 1);
- workToScreenM();
- hangOnP(count);
-}
-
void DreamGenContext::monkSpeaking() {
// FIXME: This is the CD version only.
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index e6726b664a..b835a26ea1 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -26,8 +26,6 @@
void startup();
void startup1();
void saveLoad();
- void hangOnCurs(uint16 frameCount);
- void hangOnCurs();
void workToScreen();
void multiGet();
void multiGet(uint8 *dst, uint16 x, uint16 y, uint8 width, uint8 height) {
@@ -65,39 +63,21 @@
void width160();
void spriteUpdate();
void mainMan(Sprite *sprite);
- void makeBackOb(SetObject *objData);
void zoom();
void showRain();
void commandOnly();
void commandOnly(uint8 command) {
DreamBase::commandOnly(command);
}
- void doBlocks();
void checkIfPerson();
bool checkIfPerson(uint8 x, uint8 y);
void checkIfFree();
bool checkIfFree(uint8 x, uint8 y);
void checkIfEx();
bool checkIfEx(uint8 x, uint8 y);
- const uint8 *findObName(uint8 type, uint8 index);
- void copyName(uint8 type, uint8 index, uint8 *dst);
void commandWithOb();
void commandWithOb(uint8 command, uint8 type, uint8 index);
void updatePeople();
- bool addAlong(const uint8 *mapFlags);
- bool addLength(const uint8 *mapFlags);
- void getDimension();
- void getDimension(uint8 *mapXstart, uint8 *mapYstart, uint8 *mapXsize, uint8 *mapYsize);
- void getMapAd();
- void calcMapAd();
- uint8 getMapAd(const uint8 *setData);
- uint8 getXAd(const uint8 *setData, uint8 *result);
- uint8 getYAd(const uint8 *setData, uint8 *result);
- void calcFrFrame(uint16 frame);
- void calcFrFrame(uint16 frame, uint8* width, uint8* height);
- void finalFrame();
- void finalFrame(uint16 *x, uint16 *y);
- void showAllObs();
void blockNameText();
void walkToText();
void personNameText();
@@ -115,8 +95,6 @@
}
void setAllChanges();
void deleteTaken();
- void showAllFree();
- void showAllEx();
bool finishedWalkingCPP();
void finishedWalking();
void checkOne();
@@ -161,7 +139,6 @@
void findNextColon();
const uint8 *getObTextStartCPP();
void useText(const uint8 *string);
- void useText();
void examineObText();
void showCity();
uint16 getPersFrame(uint8 index);
@@ -172,8 +149,6 @@
void watchCount();
void loadRoom();
void readSetData();
- void fadeupYellows();
- void fadeupMonFirst();
void useMenu();
void useMon();
void makeCaps();
@@ -263,7 +238,6 @@
void checkFolderCoords();
void nextFolder();
void lastFolder();
- void drawFloor();
void mugger(ReelRoutine &routine);
void singleKey(uint8 key, uint16 x, uint16 y);
void loadSaveBox();
@@ -279,9 +253,6 @@
void saveGame();
void zoomOnOff();
void atmospheres();
- void loadPersonal();
- void loadNews();
- void loadCart();
void hangOne(uint16 delay);
void hangOne();
void bibleQuote();
@@ -362,8 +333,6 @@
void dropError();
void cantDrop();
void newPlace();
- void showPuzText(uint16 command, uint16 count);
- void showPuzText();
void monkSpeaking();
void rollEndCredits2();
void useButtonA();
@@ -379,8 +348,6 @@
void runEndSeq();
void lookAtCard();
bool execCommand();
- void findSetObject();
- uint16 findSetObject(const char *id);
void findExObject();
uint16 findExObject(const char *id);
void isRyanHolding();
@@ -391,15 +358,12 @@
void getOpenedSize();
byte getOpenedSizeCPP();
void openOb();
- void withWhat();
void notHeldError();
void useGun();
void identifyOb();
void showSlots();
void useCashCard();
void useStereo();
- void checkInside();
- uint16 checkInside(uint16 command, uint16 type);
void selectOb();
void findInvPos();
uint16 findInvPosCPP();
diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp
index 5a80a33bd5..5cb1f6b92c 100644
--- a/engines/dreamweb/use.cpp
+++ b/engines/dreamweb/use.cpp
@@ -163,10 +163,6 @@ void DreamGenContext::useRoutine() {
data.byte(kCommandtype) = 255;
}
-void DreamGenContext::useText() {
- useText(es.ptr(si, 0));
-}
-
void DreamGenContext::useText(const uint8 *string) {
createPanel();
showPanel();
@@ -1408,7 +1404,6 @@ void DreamGenContext::usePipe() {
putBackObStuff();
} else {
showPuzText(14, 300);
- showPuzText();
putBackObStuff();
}
}
@@ -1572,7 +1567,7 @@ void DreamGenContext::useAltar() {
}
}
-void DreamGenContext::withWhat() {
+void DreamBase::withWhat() {
uint8 commandLine[64] = "OBJECT NAME ONE ";
createPanel();
@@ -1590,7 +1585,7 @@ void DreamGenContext::withWhat() {
data.byte(kCommandtype) = 255;
readMouse();
showPointer();
- workToScreen();
+ workToScreenCPP();
delPointer();
data.byte(kInvopen) = 2;
}
@@ -1666,4 +1661,27 @@ void DreamGenContext::useStereo() {
}
}
+uint16 DreamBase::checkInside(uint16 command, uint16 type) {
+ for (uint16 index = 0; index < kNumexobjects; index++) {
+ DynObject *object = getExAd(index);
+ if (object->mapad[1] == command && object->mapad[0] == type)
+ return index;
+ }
+
+ return kNumexobjects;
+}
+
+void DreamBase::showPuzText(uint16 command, uint16 count) {
+ createPanel();
+ showPanel();
+ showMan();
+ showExit();
+ obIcons();
+ uint16 offset = kTextstart + getSegment(data.word(kPuzzletext)).word(command * 2);
+ const uint8 *string = getSegment(data.word(kPuzzletext)).ptr(offset, 0);
+ printDirect(string, 36, 104, 241, 241 & 1);
+ workToScreenM();
+ hangOnP(count);
+}
+
} // End of namespace DreamGen
diff --git a/engines/dreamweb/vgafades.cpp b/engines/dreamweb/vgafades.cpp
index 6766d56424..7518c226f4 100644
--- a/engines/dreamweb/vgafades.cpp
+++ b/engines/dreamweb/vgafades.cpp
@@ -114,7 +114,7 @@ void DreamBase::fadeCalculation() {
--data.byte(kFadecount);
}
-void DreamGenContext::fadeupYellows() {
+void DreamBase::fadeupYellows() {
palToEndPal();
memset(endPalette() + 231 * 3, 0, 8 * 3);
memset(endPalette() + 246 * 3, 0, 1 * 3);
@@ -125,7 +125,7 @@ void DreamGenContext::fadeupYellows() {
hangOn(128);
}
-void DreamGenContext::fadeupMonFirst() {
+void DreamBase::fadeupMonFirst() {
palToStartPal();
palToEndPal();
memset(startPalette() + 231 * 3, 0, 8 * 3);